[MIRROR] Antag HUDs will now animate if you have multiple antagonists, and will no longer clear on deconversion [MDB IGNORE] (#9397)

* Antag HUDs will now animate if you have multiple antagonists, and will no longer clear on deconversion (#62718)

About The Pull Request

This is for the admin combo HUD. Players shouldn't notice any difference (except at roundend).
2021-11-09T16-27-26.mp4

Removes the ability to set custom antag HUDs for custom admin teams for complexity, though if there's a large enough demand I can try to bring it back in another PR.

Fixes #59767

TM candidate only so that I can make sure antags aren't getting leaked to people who shouldn't see them.
Changelog

cl
fix: Antag HUDs will no longer clear on deconversion if the player was another antag.
qol: Antag HUDs (as seen by admins and at the round end) will now animate between all antagonists, rather than just choosing the most latest.
/cl

* Antag HUDs will now animate if you have multiple antagonists, and will no longer clear on deconversion

* Update sol_fed.dm

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-11-14 23:27:01 +00:00
committed by GitHub
parent 74d6eea9b5
commit 2e0e84a6dd
37 changed files with 152 additions and 349 deletions
+1 -1
View File
@@ -739,7 +739,7 @@ GLOBAL_PROTECT(admin_verbs_hideable)
if(!holder)
return
if(has_antag_hud())
if(combo_hud_enabled)
toggle_combo_hud()
holder.deactivate()
+1 -37
View File
@@ -35,7 +35,7 @@
var/team_name = stripped_input(user,"Team name ?")
if(!team_name)
return
var/datum/team/custom/T = new()
var/datum/team/T = new()
T.name = team_name
message_admins("[key_name_admin(usr)] created new [name] antagonist team.")
@@ -145,39 +145,3 @@
/datum/team/proc/get_admin_commands()
return list()
//Custom team subtype created by the panel, allow forcing hud for the team for now
/datum/team/custom
var/datum/atom_hud/antag/custom_hud
var/custom_hud_state = "traitor"
/datum/team/custom/add_member(datum/mind/new_member)
. = ..()
if(custom_hud)
custom_hud.join_hud(new_member.current)
set_antag_hud(new_member.current,custom_hud_state)
/datum/team/custom/remove_member(datum/mind/member)
. = ..()
if(custom_hud)
custom_hud.leave_hud(member.current)
/datum/team/custom/get_admin_commands()
. = ..()
.["Force HUD"] = CALLBACK(src,.proc/admin_force_hud)
//This is here if you want admin created teams to tell each other apart easily.
/datum/team/custom/proc/admin_force_hud(mob/user)
var/list/possible_icons = icon_states('icons/mob/hud.dmi')
var/new_hud_state = input(user,"Choose hud icon state","Custom HUD","traitor") as null|anything in sort_list(possible_icons)
if(!new_hud_state)
return
//suppose could ask for color too
custom_hud_state = new_hud_state
custom_hud = new
custom_hud.self_visible = TRUE
GLOB.huds += custom_hud //Make it show in admin hud
for(var/datum/mind/M in members)
custom_hud.join_hud(M.current)
set_antag_hud(M.current,custom_hud_state)
+9 -13
View File
@@ -401,30 +401,26 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_ADMIN))
return
var/adding_hud = !has_antag_hud()
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]
(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)
(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(adding_hud)
if(combo_hud_enabled)
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"].", confidential = TRUE)
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]
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!
/datum/admins/proc/show_traitor_panel(mob/target_mob in GLOB.mob_list)
set category = "Admin.Game"