More things use trait huds over raw hud management (#93084)

This commit is contained in:
MrMelbert
2025-10-02 14:36:40 -05:00
committed by GitHub
parent 3d0cdfeac0
commit 44acefa73f
47 changed files with 249 additions and 236 deletions
+9 -6
View File
@@ -340,15 +340,17 @@ ADMIN_VERB(combo_hud, R_ADMIN, "Toggle Combo HUD", "Toggles the Admin Combo HUD.
log_admin("[key_name(user)] toggled their admin combo HUD [user.combo_hud_enabled ? "ON" : "OFF"].")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Combo HUD", "[user.combo_hud_enabled ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
/// List of hud traits in the admin combo hud
#define ADMIN_HUDS list(TRAIT_SECURITY_HUD, TRAIT_MEDICAL_HUD, TRAIT_DIAGNOSTIC_HUD, TRAIT_BOT_PATH_HUD)
/client/proc/enable_combo_hud()
if (combo_hud_enabled)
return
combo_hud_enabled = TRUE
for (var/hudtype in list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC, DATA_HUD_BOT_PATH))
var/datum/atom_hud/atom_hud = GLOB.huds[hudtype]
atom_hud.show_to(mob)
for (var/hudtrait in ADMIN_HUDS)
ADD_TRAIT(mob, hudtrait, ADMIN_TRAIT)
for (var/datum/atom_hud/alternate_appearance/basic/antagonist_hud/antag_hud in GLOB.active_alternate_appearances)
antag_hud.show_to(mob)
@@ -362,9 +364,8 @@ ADMIN_VERB(combo_hud, R_ADMIN, "Toggle Combo HUD", "Toggles the Admin Combo HUD.
combo_hud_enabled = FALSE
for (var/hudtype in list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC, DATA_HUD_BOT_PATH))
var/datum/atom_hud/atom_hud = GLOB.huds[hudtype]
atom_hud.hide_from(mob)
for (var/hudtrait in ADMIN_HUDS)
REMOVE_TRAIT(mob, hudtrait, ADMIN_TRAIT)
for (var/datum/atom_hud/alternate_appearance/basic/antagonist_hud/antag_hud in GLOB.active_alternate_appearances)
antag_hud.hide_from(mob)
@@ -372,6 +373,8 @@ ADMIN_VERB(combo_hud, R_ADMIN, "Toggle Combo HUD", "Toggles the Admin Combo HUD.
mob.lighting_cutoff = mob.default_lighting_cutoff()
mob.update_sight()
#undef ADMIN_HUDS
ADMIN_VERB(show_traitor_panel, R_ADMIN, "Show Traitor Panel", "Edit mobs's memory and role", ADMIN_CATEGORY_GAME, mob/target_mob)
var/datum/mind/target_mind = target_mob.mind
if(!target_mind)