Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions code/controllers/subsystem/persistence/_persistence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions code/game/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
//Initializes Jumping on the player
AddComponent(/datum/component/jumper)
AddComponent(/datum/component/violation_observer, violation_aoe)
update_visible_name()
6 changes: 4 additions & 2 deletions modular_darkpack/modules/guestbook/code/guestbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@
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)
if(!silent)
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
Expand All @@ -112,14 +113,15 @@
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)
if(!silent)
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
Expand Down
8 changes: 7 additions & 1 deletion modular_darkpack/modules/guestbook/code/human_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
23 changes: 10 additions & 13 deletions modular_darkpack/modules/guestbook/code/persistent_guestbooks.dm
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tgui/packages/tgui/interfaces/Orbit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>(VIEWMODE.Health);

Expand Down
Loading