From 35d09e7cc0e307870dd4ddfbe6e9b8597a0624cd Mon Sep 17 00:00:00 2001 From: Tkdrg Date: Sat, 24 Oct 2015 02:35:33 -0300 Subject: [PATCH] Adds Admin-only Antag HUDs Togglable by a verb in the Admin tab. Only Rev, Cult, Ops and Shadowling atm because the others don't have huds/have more than one hud and I'm too lazy to handle it properly here. Also adds a debug verb for huds. --- code/modules/admin/admin_verbs.dm | 10 +++++++--- code/modules/admin/verbs/debug.dm | 10 +++++++++- code/modules/admin/verbs/randomverbs.dm | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index f7818ccb1b0..4f421cbeced 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -58,8 +58,9 @@ var/list/admin_verbs_admin = list( /client/proc/admin_cancel_shuttle, /*allows us to cancel the emergency shuttle, sending it back to centcom*/ /client/proc/cmd_admin_direct_narrate, /*send text directly to a player with no padding. Useful for narratives and fluff-text*/ /client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/ - /client/proc/cmd_admin_local_narrate, //sends text to all mobs within view of atmo + /client/proc/cmd_admin_local_narrate, /*sends text to all mobs within view of atom*/ /client/proc/cmd_admin_create_centcom_report, + /client/proc/toggle_antag_hud /*toggle display of the admin antag hud*/ ) var/list/admin_verbs_ban = list( /client/proc/unban_panel, @@ -136,7 +137,8 @@ var/list/admin_verbs_debug = list( /client/proc/populate_world, /client/proc/cmd_display_del_log, /client/proc/reset_latejoin_spawns, - /client/proc/create_outfits + /client/proc/create_outfits, + /client/proc/debug_huds ) var/list/admin_verbs_possess = list( /proc/possess, @@ -214,7 +216,9 @@ var/list/admin_verbs_hideable = list( /client/proc/panicbunker, /client/proc/admin_change_sec_level, /client/proc/toggle_nuke, - /client/proc/cmd_display_del_log + /client/proc/cmd_display_del_log, + /client/proc/toggle_antag_hud, + /client/proc/debug_huds ) /client/proc/add_admin_verbs() diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index aaed2a84488..375399cb580 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -767,4 +767,12 @@ var/global/list/g_fancy_list_of_types = null for(var/path in SSgarbage.noqdelhint) dat += "[path]
" - usr << browse(dat, "window=dellog") \ No newline at end of file + usr << browse(dat, "window=dellog") + +/client/proc/debug_huds(i as num) + set category = "Debug" + set name = "Debug HUDs" + set desc = "Debug the data or antag HUDs" + + if(!holder) return + debug_variables(huds[i]) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 18b04e6e779..01acb9822f3 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -910,3 +910,22 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits "} usr << browse(dat, "window=dressup;size=550x600") + +/client/proc/toggle_antag_hud() + set category = "Admin" + set name = "Toggle AntagHUD" + set desc = "Toggles the Admin AntagHUD" + + if(!holder) return + + var/datum/atom_hud/magical = huds[ANTAG_HUD_WIZ] + var/adding_hud = (usr in magical.hudusers) ? 0 : 1 + + for(var/datum/atom_hud/H in huds) + if(istype(H, /datum/atom_hud/antag)) + (adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr) + + usr << "You toggled your admin antag HUD [adding_hud ? "ON" : "OFF"]." + message_admins("[key_name_admin(usr)] toggled their admin antag HUD [adding_hud ? "ON" : "OFF"].") + log_admin("[key_name(usr)] toggled their admin antag HUD [adding_hud ? "ON" : "OFF"].") + feedback_add_details("admin_verb","TAH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!