push
This commit is contained in:
@@ -41,12 +41,17 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
|
||||
LAZYOR(GLOB.mobs_with_editable_flavor_text[M], src)
|
||||
add_verb(M, /mob/proc/manage_flavor_tests)
|
||||
|
||||
if(save_key && ishuman(target))
|
||||
if(!save_key)
|
||||
return
|
||||
if(ishuman(target))
|
||||
RegisterSignal(target, COMSIG_HUMAN_PREFS_COPIED_TO, .proc/update_prefs_flavor_text)
|
||||
else if(iscyborg(target))
|
||||
RegisterSignal(target, COMSIG_MOB_ON_NEW_MIND, .proc/borged_update_flavor_text)
|
||||
RegisterSignal(target, COMSIG_MOB_CLIENT_JOINED_FROM_LOBBY, .proc/borged_update_flavor_text)
|
||||
|
||||
/datum/element/flavor_text/Detach(atom/A)
|
||||
. = ..()
|
||||
UnregisterSignal(A, list(COMSIG_PARENT_EXAMINE, COMSIG_HUMAN_PREFS_COPIED_TO))
|
||||
UnregisterSignal(A, list(COMSIG_PARENT_EXAMINE, COMSIG_HUMAN_PREFS_COPIED_TO, COMSIG_MOB_ON_NEW_MIND, COMSIG_MOB_CLIENT_JOINED_FROM_LOBBY))
|
||||
texts_by_atom -= A
|
||||
if(can_edit && ismob(A))
|
||||
var/mob/M = A
|
||||
@@ -149,6 +154,20 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
|
||||
if(P.features.Find(save_key))
|
||||
texts_by_atom[H] = P.features[save_key]
|
||||
|
||||
/datum/element/flavor_text/proc/borged_update_flavor_text(mob/new_character, client/C)
|
||||
C = C || GET_CLIENT(new_character)
|
||||
if(!C)
|
||||
LAZYREMOVE(texts_by_atom, new_character)
|
||||
return
|
||||
var/datum/preferences/P = C.prefs
|
||||
if(!P)
|
||||
LAZYREMOVE(texts_by_atom, new_character)
|
||||
return
|
||||
if(P.custom_names["cyborg"] == new_character.real_name)
|
||||
LAZYSET(texts_by_atom, new_character, P.features[save_key])
|
||||
else
|
||||
LAZYREMOVE(texts_by_atom, new_character)
|
||||
|
||||
//subtypes with additional hooks for DNA and preferences.
|
||||
/datum/element/flavor_text/carbon
|
||||
//list of antagonists etcetera that should have nothing to do with people's snowflakes.
|
||||
|
||||
Reference in New Issue
Block a user