From d446d0ed6d2b8562e48c287611ec1d29f94f8311 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sun, 4 Mar 2018 05:26:22 -0600 Subject: [PATCH] [MIRROR] Admin combohud verb (#5785) * Admin combohud verb (#36096) * combohuds * Update randomverbs.dm * Admin combohud verb --- code/modules/admin/admin_verbs.dm | 2 ++ code/modules/admin/verbs/randomverbs.dm | 31 ++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 9258da7325..fd1631e417 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -64,6 +64,7 @@ GLOBAL_LIST_INIT(admin_verbs_admin, world.AVerbsAdmin()) /client/proc/cmd_change_command_name, /client/proc/cmd_admin_check_player_exp, /* shows players by playtime */ /client/proc/toggle_antag_hud, /*toggle display of the admin antag hud*/ + /client/proc/toggle_combo_hud, // toggle display of the combination pizza antag and taco sci/med/eng hud /client/proc/toggle_AI_interact, /*toggle admin ability to interact with machines as an AI*/ /client/proc/open_shuttle_manipulator, /* Opens shuttle manipulator UI */ /client/proc/deadchat, @@ -229,6 +230,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list( /client/proc/toggle_nuke, /client/proc/cmd_display_del_log, /client/proc/toggle_antag_hud, + /client/proc/toggle_combo_hud, /client/proc/debug_huds )) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index eea838b4e8..84979efe22 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1014,7 +1014,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits set name = "Toggle AntagHUD" set desc = "Toggles the Admin AntagHUD" - if(!holder) + if(!check_rights(R_ADMIN)) return var/adding_hud = !has_antag_hud() @@ -1028,6 +1028,35 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits log_admin("[key_name(usr)] toggled their admin antag HUD [adding_hud ? "ON" : "OFF"].") SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Antag HUD", "[adding_hud ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/client/proc/toggle_combo_hud() + set category = "Admin" + set name = "Toggle Combo HUD" + set desc = "Toggles the Admin Combo HUD (antag, sci, med, eng)" + + if(!check_rights(R_ADMIN)) + return + + var/adding_hud = !has_antag_hud() + + 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] + (adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr) + for(var/datum/atom_hud/antag/H in GLOB.huds) // add antag huds + (adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr) + + if (adding_hud) + mob.lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE + else + mob.lighting_alpha = initial(mob.lighting_alpha) + + mob.update_sight() + + to_chat(usr, "You toggled your admin combo HUD [adding_hud ? "ON" : "OFF"].") + message_admins("[key_name_admin(usr)] toggled their admin combo HUD [adding_hud ? "ON" : "OFF"].") + log_admin("[key_name(usr)] toggled their admin combo HUD [adding_hud ? "ON" : "OFF"].") + SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Combo HUD", "[adding_hud ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + /client/proc/has_antag_hud() var/datum/atom_hud/A = GLOB.huds[ANTAG_HUD_TRAITOR] return A.hudusers[mob]