diff --git a/code/controllers/subsystem/persistence/_persistence.dm b/code/controllers/subsystem/persistence/_persistence.dm index 789835c2e826..56350e22778f 100644 --- a/code/controllers/subsystem/persistence/_persistence.dm +++ b/code/controllers/subsystem/persistence/_persistence.dm @@ -94,8 +94,6 @@ SUBSYSTEM_DEF(persistence) for(var/datum/transport_controller/linear/tram/transport as anything in SStransport.transports_by_type[TRANSPORT_TYPE_TRAM]) save_tram_history(transport.specific_transport_id) save_tram_counter() - save_guestbooks() // DARKPACK EDIT ADD - ///Loads up Poly's speech buffer. /datum/controller/subsystem/persistence/proc/load_poly() diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 572c031118cc..1b12e7c312d9 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -363,6 +363,7 @@ SUBSYSTEM_DEF(ticker) iter_human.increment_scar_slot() iter_human.load_persistent_scars() + iter_human.load_guestbook() // DARKPACK EDIT ADDITION if(!iter_human.hardcore_survival_score) continue diff --git a/code/game/say.dm b/code/game/say.dm index a1513cf91a12..952355248783 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -173,8 +173,8 @@ GLOBAL_LIST_INIT(freqtospan, list( if(known_name) namepart = "[known_name]" else - var/mob/living/carbon/human/human_narrator = reliable_narrator - namepart = "[human_narrator.get_generic_name(prefixed = TRUE, lowercase = TRUE)]" + var/mob/living/living_narrator = reliable_narrator + namepart = "[living_narrator.get_generic_name(prefixed = TRUE, lowercase = TRUE)]" if(radio_freq >= USABLE_RADIO_FREQUENCY_FOR_PHONE_RANGE) var/icon/phone_icon = icon('modular_darkpack/modules/phones/icons/chat_icon.dmi', "phone") diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index a741bbd301e7..56474508856f 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -249,6 +249,7 @@ humanc.increment_scar_slot() humanc.load_persistent_scars() + humanc.load_guestbook() // DARKPACK EDIT ADDITION if(GLOB.curse_of_madness_triggered) give_madness(humanc, GLOB.curse_of_madness_triggered) diff --git a/modular_darkpack/master_files/code/modules/mob/living/carbon/human/init_signals.dm b/modular_darkpack/master_files/code/modules/mob/living/carbon/human/init_signals.dm index efc32e1a5284..ada4c7cf1c42 100644 --- a/modular_darkpack/master_files/code/modules/mob/living/carbon/human/init_signals.dm +++ b/modular_darkpack/master_files/code/modules/mob/living/carbon/human/init_signals.dm @@ -4,6 +4,7 @@ RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_STAKED), PROC_REF(on_staked)) RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_STAKED), PROC_REF(on_unstaked)) RegisterSignal(src, COMSIG_MOB_CTRL_SHIFT_CLICKED, PROC_REF(attempt_guestbook_add)) + RegisterSignal(src, COMSIG_MOB_REQUESTING_SCREENTIP_NAME_FROM_USER, PROC_REF(name_override)) /// Gaining [TRAIT_STAKED] forces us into torpor if we're kindred, and just murders us if we're not. /mob/living/carbon/human/proc/on_staked(datum/source) @@ -20,3 +21,14 @@ if(iskindred(src)) cure_torpor(STAKE_TRAIT, TRUE) + +/// For Guestbooks. +/mob/living/carbon/human/proc/name_override(datum/source, list/returned_name, obj/item/held_item, mob/living/carbon/human/hovered) + SIGNAL_HANDLER + + if(!ishuman(hovered)) + return NONE + + var/known_name = mind.guestbook.get_known_name(src, hovered, hovered.real_name) + returned_name[1] = known_name ? "[known_name]" : "[hovered.name]" + return SCREENTIP_NAME_SET diff --git a/modular_darkpack/master_files/code/modules/mob/living/carbon/human/initialize.dm b/modular_darkpack/master_files/code/modules/mob/living/carbon/human/initialize.dm index c07e09c82a6a..0ac4a2ff2f89 100644 --- a/modular_darkpack/master_files/code/modules/mob/living/carbon/human/initialize.dm +++ b/modular_darkpack/master_files/code/modules/mob/living/carbon/human/initialize.dm @@ -4,3 +4,4 @@ //Initializes Jumping on the player AddComponent(/datum/component/jumper) AddComponent(/datum/component/violation_observer, violation_aoe) + update_visible_name() diff --git a/modular_darkpack/modules/guestbook/code/guestbook.dm b/modular_darkpack/modules/guestbook/code/guestbook.dm index 1e81b8ae6f78..258a58fa7caa 100644 --- a/modular_darkpack/modules/guestbook/code/guestbook.dm +++ b/modular_darkpack/modules/guestbook/code/guestbook.dm @@ -79,7 +79,7 @@ return FALSE return TRUE -/datum/guestbook/proc/add_guest(mob/user, mob/living/carbon/guest, real_name, given_name, silent = TRUE) +/datum/guestbook/proc/add_guest(mob/living/user, mob/living/carbon/guest, real_name, given_name, silent = TRUE) //Already exists, should be handled by rename_guest() var/existing_name = LAZYACCESS(known_names, real_name) if(existing_name) @@ -87,6 +87,7 @@ to_chat(user, span_warning("You already know them as \"[existing_name]\".")) return FALSE LAZYADDASSOC(known_names, real_name, given_name) + user.save_guestbook(known_names) if(!silent) to_chat(user, span_notice("You memorize the face of [guest] as \"[given_name]\".")) return TRUE @@ -112,7 +113,7 @@ return FALSE return TRUE -/datum/guestbook/proc/remove_guest(mob/user, mob/living/carbon/guest, real_name, silent = TRUE) +/datum/guestbook/proc/remove_guest(mob/living/user, mob/living/carbon/guest, real_name, silent = TRUE) //Already exists, should be handled by rename_guest() var/existing_name = LAZYACCESS(known_names, real_name) if(!existing_name) @@ -120,6 +121,7 @@ to_chat(user, span_warning("You don't know them in the first place.")) return FALSE LAZYREMOVE(known_names, real_name) + user.save_guestbook(known_names) if(!silent) to_chat(user, span_notice("You forget the face of \"[existing_name]\".")) return TRUE diff --git a/modular_darkpack/modules/guestbook/code/human_helpers.dm b/modular_darkpack/modules/guestbook/code/human_helpers.dm index da8d60536b37..60ce5106430a 100644 --- a/modular_darkpack/modules/guestbook/code/human_helpers.dm +++ b/modular_darkpack/modules/guestbook/code/human_helpers.dm @@ -26,7 +26,13 @@ else return "Puzzling" -/mob/living/carbon/human/proc/get_generic_name(prefixed = FALSE, lowercase = FALSE) +/mob/living/proc/get_generic_name(prefixed = FALSE, lowercase = FALSE) + var/final_string = name + if(prefixed) + final_string = "\A [final_string]" + return lowercase ? lowertext(final_string) : final_string + +/mob/living/carbon/human/get_generic_name(prefixed = FALSE, lowercase = FALSE) // var/visible_skin = GLOB.skin_tone_names[skin_tone] ? "[GLOB.skin_tone_names[skin_tone]] " : null // Removed until we think of a way to do this without calling people "ugly brown woman" var/visible_gender = get_gender() var/visible_age = get_age() diff --git a/modular_darkpack/modules/guestbook/code/persistent_guestbooks.dm b/modular_darkpack/modules/guestbook/code/persistent_guestbooks.dm index e5e2e5e46619..b906f9d62f77 100644 --- a/modular_darkpack/modules/guestbook/code/persistent_guestbooks.dm +++ b/modular_darkpack/modules/guestbook/code/persistent_guestbooks.dm @@ -1,15 +1,12 @@ ///Saves all guestbooks for everyone's original characters -/datum/controller/subsystem/persistence/proc/save_guestbooks() - for(var/i in GLOB.joined_player_list) - var/mob/living/carbon/human/ending_human = get_mob_by_ckey(i) - if(!istype(ending_human) || !ending_human.mind?.original_character_slot_index) - continue +/mob/living/proc/save_guestbook(list/known_names) + client.prefs.guestbook_names = known_names + client.prefs.save_character() - var/mob/living/carbon/human/original_human = ending_human.mind.original_character.resolve() - - if(!original_human) - continue - - if(original_human == ending_human) - original_human.client.prefs.guestbook_names = original_human.mind.guestbook.known_names - original_human.client.prefs.save_character() +/mob/living/proc/load_guestbook() + if(!mind || !mind.original_character_slot_index || !client) + return + var/list/known_names = client.prefs.guestbook_names + if(!known_names) + return + mind.guestbook.known_names = known_names diff --git a/tgui/packages/tgui/interfaces/Orbit/index.tsx b/tgui/packages/tgui/interfaces/Orbit/index.tsx index 3d77a33a58b9..add7b6e7bd89 100644 --- a/tgui/packages/tgui/interfaces/Orbit/index.tsx +++ b/tgui/packages/tgui/interfaces/Orbit/index.tsx @@ -16,7 +16,7 @@ import type { ViewMode } from './types'; export function Orbit(props) { const [autoObserve, setAutoObserve] = useState(false); const [bladeOpen, setBladeOpen] = useState(false); - const [realNameDisplay, setRealNameDisplay] = useState(false); + const [realNameDisplay, setRealNameDisplay] = useState(true); // DARKPACK EDIT, ORIGINAL: const [realNameDisplay, setRealNameDisplay] = useState(false); const [searchQuery, setSearchQuery] = useState(''); const [viewMode, setViewMode] = useState(VIEWMODE.Health);