mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-31 07:57:47 +01:00
Refactor atom HUDs to track source of HUD gain/loss. (#32091)
* Refactor atom HUDs to track source of HUD gain/loss. * Retain shared images from different huds on removal. * Fix some ghost HUD toggles. * Add HUD sources to more hud add/remove calls. * Apply suggestions from CRUNCH review. Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Signed-off-by: Alan <alfalfascout@users.noreply.github.com> * Check if a user has a hud before removing it, autodoc. --------- Signed-off-by: Alan <alfalfascout@users.noreply.github.com> Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
@@ -331,13 +331,13 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/proc/show_me_the_hud(hud_index)
|
||||
var/datum/atom_hud/H = GLOB.huds[hud_index]
|
||||
H.add_hud_to(src)
|
||||
H.add_hud_to(src, "observer")
|
||||
data_hud_seen |= hud_index
|
||||
|
||||
// remove old huds
|
||||
/mob/dead/observer/proc/remove_the_hud(hud_index)
|
||||
var/datum/atom_hud/H = GLOB.huds[hud_index]
|
||||
H.remove_hud_from(src)
|
||||
H.remove_hud_from(src, "observer")
|
||||
data_hud_seen -= hud_index
|
||||
|
||||
/mob/dead/observer/verb/open_hud_panel()
|
||||
@@ -432,7 +432,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/datum/atom_hud/antag/chosen_hud = hud
|
||||
if(!istype(chosen_hud))
|
||||
continue
|
||||
chosen_hud.add_hud_to(src)
|
||||
chosen_hud.add_hud_to(src, "observer")
|
||||
|
||||
/**
|
||||
* Toggles off all HUDs for the ghost player.
|
||||
@@ -448,7 +448,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/datum/atom_hud/antag/chosen_hud = hud
|
||||
if(!istype(chosen_hud))
|
||||
continue
|
||||
chosen_hud.remove_hud_from(src)
|
||||
chosen_hud.remove_hud_from(src, "observer")
|
||||
|
||||
/mob/dead/observer/proc/toggle_rad_view()
|
||||
ghost_flags ^= GHOST_SEE_RADS
|
||||
|
||||
Reference in New Issue
Block a user