Always disable combo HUD on disassociate (#64662)

* Always disable combo HUD on disassociate

* Useless old comments
This commit is contained in:
Mothblocks
2022-02-04 19:36:29 +13:00
committed by GitHub
parent 36a83ed8b3
commit 54ecdcc05b
4 changed files with 47 additions and 22 deletions
-3
View File
@@ -727,9 +727,6 @@ GLOBAL_PROTECT(admin_verbs_hideable)
if(!holder)
return
if(combo_hud_enabled)
toggle_combo_hud()
holder.deactivate()
to_chat(src, span_interface("You are now a normal player."))
+6 -3
View File
@@ -103,10 +103,13 @@ GLOBAL_PROTECT(href_token)
GLOB.deadmins[target] = src
GLOB.admin_datums -= target
deadmined = TRUE
var/client/C
if ((C = owner) || (C = GLOB.directory[target]))
var/client/client = owner || GLOB.directory[target]
if (!isnull(client))
disassociate()
add_verb(C, /client/proc/readmin)
add_verb(client, /client/proc/readmin)
client.disable_combo_hud()
/datum/admins/proc/associate(client/client)
if(IsAdminAdvancedProcCall())
+40 -15
View File
@@ -367,27 +367,52 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_ADMIN))
return
combo_hud_enabled = !combo_hud_enabled
for(var/hudtype in list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED)) // add data huds
var/datum/atom_hud/H = GLOB.huds[hudtype]
(combo_hud_enabled) ? H.add_hud_to(usr) : H.remove_hud_from(usr)
for(var/datum/atom_hud/alternate_appearance/basic/antagonist_hud/H in GLOB.active_alternate_appearances) // add antag huds
(combo_hud_enabled) ? H.add_hud_to(usr) : H.remove_hud_from(usr)
if(prefs.toggles & COMBOHUD_LIGHTING)
if(combo_hud_enabled)
mob.lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
else
mob.lighting_alpha = initial(mob.lighting_alpha)
mob.update_sight()
if (combo_hud_enabled)
disable_combo_hud()
else
enable_combo_hud()
to_chat(usr, "You toggled your admin combo HUD [combo_hud_enabled ? "ON" : "OFF"].", confidential = TRUE)
message_admins("[key_name_admin(usr)] toggled their admin combo HUD [combo_hud_enabled ? "ON" : "OFF"].")
log_admin("[key_name(usr)] toggled their admin combo HUD [combo_hud_enabled ? "ON" : "OFF"].")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Combo HUD", "[combo_hud_enabled ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/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_ADVANCED))
var/datum/atom_hud/atom_hud = GLOB.huds[hudtype]
atom_hud.add_hud_to(mob)
for (var/datum/atom_hud/alternate_appearance/basic/antagonist_hud/antag_hud in GLOB.active_alternate_appearances)
antag_hud.add_hud_to(mob)
if (prefs.toggles & COMBOHUD_LIGHTING)
mob.lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
mob.update_sight()
/client/proc/disable_combo_hud()
if (!combo_hud_enabled)
return
combo_hud_enabled = FALSE
for (var/hudtype in list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_ADVANCED))
var/datum/atom_hud/atom_hud = GLOB.huds[hudtype]
atom_hud.remove_hud_from(mob)
for (var/datum/atom_hud/alternate_appearance/basic/antagonist_hud/antag_hud in GLOB.active_alternate_appearances)
antag_hud.remove_hud_from(mob)
if (prefs.toggles & COMBOHUD_LIGHTING)
mob.lighting_alpha = initial(mob.lighting_alpha)
mob.update_sight()
/datum/admins/proc/show_traitor_panel(mob/target_mob in GLOB.mob_list)
set category = "Admin.Game"
set desc = "Edit mobs's memory and role"