From 99303e1328b4d1dde9dc4b4825f388d78a47d39a Mon Sep 17 00:00:00 2001 From: Pandora Date: Tue, 10 Sep 2024 20:38:46 +0100 Subject: [PATCH] Adds a 'slot nickname' field for easily ID'ing chara slots (#436) --- code/modules/client/preferences.dm | 15 ++++++++++++++- code/modules/client/preferences_savefile.dm | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index a0428133fd..b1c2331676 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -118,6 +118,7 @@ var/const/MAX_SAVE_SLOTS = 20 //character preferences var/real_name //our character's name + var/slot_label //the nickname for the saveslot var/be_random_name = FALSE //whether we are a random name every round var/human_name_ban = FALSE @@ -334,6 +335,8 @@ var/const/MAX_SAVE_SLOTS = 20 dat += "

Name: " dat += "[real_name]" dat += "®

" + dat += "Slot label: " + dat += "[slot_label ? "[slot_label]" : "---"]
" dat += "Always Pick Random Name: [be_random_name ? "Yes" : "No"]
" dat += "Always Pick Random Appearance: [be_random_body ? "Yes" : "No"]

" @@ -1260,6 +1263,15 @@ var/const/MAX_SAVE_SLOTS = 20 else to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") + if("slot_label") + var/raw_name = input(user, "Choose a short label or identifier for this character slot. This is not an in-character nickname:", "Character Preference") as text|null + if (raw_name) // Check to ensure that the user entered text (rather than cancel.) + var/new_name = reject_bad_name(raw_name) + if(new_name) + slot_label = new_name + else + to_chat(user, "Invalid name. Your slot name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") + if("xeno_vision_level_pref") var/static/list/vision_level_choices = list(XENO_VISION_LEVEL_NO_NVG, XENO_VISION_LEVEL_MID_NVG, XENO_VISION_LEVEL_FULL_NVG) var/choice = tgui_input_list(user, "Choose your default xeno vision level", "Vision level", vision_level_choices, theme="hive_status") @@ -2250,10 +2262,11 @@ var/const/MAX_SAVE_SLOTS = 20 for(var/i=1, i<=MAX_SAVE_SLOTS, i++) S.cd = "/character[i]" S["real_name"] >> name + S["slot_label"] >> slot_label if(!name) name = "Character[i]" if(i==default_slot) name = "[name]" - dat += "[name]
" + dat += "[name] ([slot_label])
" dat += "
" dat += "Close
" diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 28a53d866d..51d76e1d8e 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -515,6 +515,7 @@ //Character S["OOC_Notes"] >> metadata S["real_name"] >> real_name + S["slot_label"] >> slot_label S["name_is_always_random"] >> be_random_name S["body_is_always_random"] >> be_random_body S["gender"] >> gender @@ -680,6 +681,7 @@ //Character S["OOC_Notes"] << metadata S["real_name"] << real_name + S["slot_label"] << slot_label S["name_is_always_random"] << be_random_name S["body_is_always_random"] << be_random_body S["gender"] << gender