Reworks anon dchat mode into full anon mode (#18282)

* Reworks anon dchat mode

* Update code/modules/client/preference/preferences_toggles.dm
This commit is contained in:
AffectedArc07
2022-07-14 16:52:49 +01:00
committed by GitHub
parent 490de764de
commit 0c0b201668
16 changed files with 97 additions and 33 deletions
+27 -2
View File
@@ -87,9 +87,34 @@
/datum/mind/proc/is_original_mob(mob/M)
return original_mob_UID == M.UID()
// Do not use for admin related things as this can hide the mob's ckey
/datum/mind/proc/get_display_key()
var/clientKey = current?.client?.get_display_key()
return clientKey ? clientKey : key
// Lets try find a client so we can check their prefs
var/client/C = null
var/cannonical_key = ckey(key)
if(current?.client)
// Active client
C = current.client
else if(cannonical_key in GLOB.directory)
// Do a directory lookup on the last ckey this mind had
// If theyre online we can grab them still and check prefs
C = GLOB.directory[cannonical_key]
// Ok we found a client, be it their active or their last
// Now we see if we need to respect their privacy
var/out_ckey
if(C)
if(C.prefs.toggles2 & PREFTOGGLE_2_ANON)
out_ckey = "(Anon)"
else
out_ckey = C.ckey
else
// No client. Just mark as DC'd.
out_ckey = "(Disconnected)"
return out_ckey
/datum/mind/proc/transfer_to(mob/living/new_character)
var/datum/atom_hud/antag/hud_to_transfer = antag_hud //we need this because leave_hud() will clear this list