diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 8fd637b9df81..5daca490f47e 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -89,6 +89,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list( var/atom/movable/screen/holomap/holomap_container var/atom/movable/screen/progbar_container/use_timer + var/atom/movable/screen/vis_holder/vis_holder // subtypes can override this to force a specific UI style var/ui_style @@ -126,6 +127,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list( owner.overlay_fullscreen("see_through_darkness", /atom/movable/screen/fullscreen/see_through_darkness) holomap_container = new(null, src) + vis_holder = new(null, src) RegisterSignal(mymob, COMSIG_VIEWDATA_UPDATE, PROC_REF(on_viewdata_update)) @@ -159,6 +161,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list( QDEL_LIST(hotkeybuttons) throw_icon = null QDEL_LIST(infodisplay) + QDEL_NULL(vis_holder) healths = null stamina = null @@ -271,6 +274,9 @@ GLOBAL_LIST_INIT(available_ui_styles, list( if(holomap_container) screenmob.client.screen += holomap_container + if(vis_holder) + screenmob.client.screen += vis_holder + hud_version = display_hud_version update_gunpoint(screenmob) persistent_inventory_update(screenmob) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index f1c5127195f9..64645f246597 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -1025,3 +1025,7 @@ // We offset them by half the size on each axis to center them. // We need to account for this object being 32x32, so we subtract 32 from the initial 480 before dividing screen_loc = "CENTER:-224,CENTER:-224" + +/atom/movable/screen/vis_holder + icon = "" + invisibility = INVISIBILITY_MAXIMUM diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index dca4bdac9152..d27622580851 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -465,6 +465,11 @@ . += HAS_TRAIT(src, TRAIT_JOB_FIRST_ID_CARD) ? span_boldnotice("Hmm... yes, this ID was issued from Central Command!") : span_boldnotice("This ID was created in this sector, not by Central Command.") /obj/item/card/id/proc/show(mob/user) + set waitfor = FALSE + + var/atom/movable/screen/front_container = user.send_appearance(front_image) + var/atom/movable/screen/side_container = user.send_appearance(side_image) + var/list/content = list("" + content +="" content += "
") content += "Name: [registered_name]
" content += "Age: [registered_age]
" @@ -472,15 +477,17 @@ content += "Blood Type: [blood_type]
" content += "Fingerprint: [fingerprint]
" content += "DNA Hash: [dna_hash]
" + if(front_image && side_image) - content +="
Photo:
Photo:
" content = jointext(content, null) var/datum/browser/popup = new(user, "idcard", name, 660, 270) popup.set_content(content) popup.open() - return + sleep(1) // I don't know why but for some reason I need to re-send the entire UI to get it to display icons. Yes, I tried sleeping after sending the appearances. + popup.open() /obj/item/card/id/GetAccess() return access.Copy() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 13daac996daa..d1dafa252c85 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1608,3 +1608,27 @@ set name = "View Skills" mind?.print_levels(src) + +/// Makes a client temporarily aware of an appearance via and invisible vis contents object. +/mob/proc/send_appearance(mutable_appearance/appearance) + RETURN_TYPE(/atom/movable/screen) + if(!hud_used || isnull(appearance)) + return + + var/atom/movable/screen/container + if(isatom(container)) + container = appearance + else + container = new() + container.appearance = appearance + + hud_used.vis_holder.vis_contents += appearance + addtimer(CALLBACK(src, PROC_REF(remove_appearance), appearance), 5 SECONDS, TIMER_DELETE_ME) + + return container + +/mob/proc/remove_appearance(atom/movable/appearance) + if(!hud_used) + return + + hud_used.vis_holder.vis_contents -= appearance