[MIRROR] Encode changes (#11301)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-08-04 16:23:19 -07:00
committed by GitHub
parent 5e6a4639d0
commit 4e2361f8df
202 changed files with 370 additions and 408 deletions

View File

@@ -81,7 +81,7 @@
return TOPIC_REFRESH
if("exploitable_record")
var/exploitmsg = sanitize(tgui_input_text(user,"Set exploitable information about you here.","Exploitable Information", html_decode(pref.exploit_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH, extra = 0)
var/exploitmsg = tgui_input_text(user,"Set exploitable information about you here.","Exploitable Information", html_decode(pref.exploit_record), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE)
if(!isnull(exploitmsg) && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.exploit_record = exploitmsg
return TOPIC_REFRESH
@@ -91,7 +91,7 @@
if(!choice || !CanUseTopic(user))
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = sanitize(tgui_input_text(user, "Please enter a faction.", "Character Preference", null, MAX_NAME_LEN), MAX_NAME_LEN)
var/raw_choice = tgui_input_text(user, "Please enter a faction.", "Character Preference", null, MAX_NAME_LEN)
if(raw_choice)
pref.antag_faction = raw_choice
else

View File

@@ -201,7 +201,7 @@
pref.directory_erptag = new_erptag
return TOPIC_REFRESH
if("directory_ad")
var/msg = sanitize(tgui_input_text(user,"Write your advertisement here!", "Flavor Text", html_decode(pref.directory_ad), multiline = TRUE, prevent_enter = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
var/msg = tgui_input_text(user,"Write your advertisement here!", "Flavor Text", html_decode(pref.directory_ad), MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
if(!msg)
return
pref.directory_ad = msg
@@ -221,7 +221,7 @@
pref.borg_petting = pref.borg_petting ? 0 : 1;
return TOPIC_REFRESH
if("edit_private_notes")
var/new_metadata = sanitize(tgui_input_text(user,"Write some notes for yourself. These can be anything that is useful, whether it's character events that you want to remember or a bit of lore. Things that you would normally stick in a txt file for yourself!", "Private Notes", html_decode(pref.read_preference(/datum/preference/text/living/private_notes)), multiline = TRUE, prevent_enter = TRUE), extra = 0)
var/new_metadata = tgui_input_text(user,"Write some notes for yourself. These can be anything that is useful, whether it's character events that you want to remember or a bit of lore. Things that you would normally stick in a txt file for yourself!", "Private Notes", html_decode(pref.read_preference(/datum/preference/text/living/private_notes)), MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
if(new_metadata)
pref.update_preference_by_type(/datum/preference/text/living/private_notes, new_metadata)
return TOPIC_REFRESH
@@ -247,29 +247,29 @@
pref.vantag_preference = names_list[selection]
return TOPIC_REFRESH
if("custom_say")
var/say_choice = sanitize(tgui_input_text(user, "This word or phrase will appear instead of 'says': [pref.real_name] says, \"Hi.\"", "Custom Say", pref.custom_say, 12), 12)
var/say_choice = tgui_input_text(user, "This word or phrase will appear instead of 'says': [pref.real_name] says, \"Hi.\"", "Custom Say", pref.custom_say, 12)
if(say_choice)
pref.custom_say = say_choice
return TOPIC_REFRESH
if("custom_whisper")
var/whisper_choice = sanitize(tgui_input_text(user, "This word or phrase will appear instead of 'whispers': [pref.real_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper, 12), 12)
var/whisper_choice = tgui_input_text(user, "This word or phrase will appear instead of 'whispers': [pref.real_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper, 12)
if(whisper_choice)
pref.custom_whisper = whisper_choice
return TOPIC_REFRESH
if("custom_ask")
var/ask_choice = sanitize(tgui_input_text(user, "This word or phrase will appear instead of 'asks': [pref.real_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask, 12), 12)
var/ask_choice = tgui_input_text(user, "This word or phrase will appear instead of 'asks': [pref.real_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask, 12)
if(ask_choice)
pref.custom_ask = ask_choice
return TOPIC_REFRESH
if("custom_exclaim")
var/exclaim_choice = sanitize(tgui_input_text(user, "This word or phrase will appear instead of 'exclaims', 'shouts' or 'yells': [pref.real_name] exclaims, \"Hi!\"", "Custom Exclaim", pref.custom_exclaim, 12), 12)
var/exclaim_choice = tgui_input_text(user, "This word or phrase will appear instead of 'exclaims', 'shouts' or 'yells': [pref.real_name] exclaims, \"Hi!\"", "Custom Exclaim", pref.custom_exclaim, 12)
if(exclaim_choice)
pref.custom_exclaim = exclaim_choice
return TOPIC_REFRESH
if("custom_heat")
tgui_alert(user, "You are setting custom heat messages. These will overwrite your species' defaults. To return to defaults, click reset.")
var/old_message = pref.custom_heat.Join("\n\n")
var/new_message = sanitize(tgui_input_text(user,"Use double enter between messages to enter a new one. Must be at least 3 characters long, 160 characters max and up to 10 messages are allowed.","Heat Discomfort messages",old_message, multiline= TRUE, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0)
var/new_message = sanitize(tgui_input_text(user,"Use double enter between messages to enter a new one. Must be at least 3 characters long, 160 characters max and up to 10 messages are allowed.","Heat Discomfort messages",old_message, multiline= TRUE, encode = FALSE, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0)
if(length(new_message) > 0)
var/list/raw_list = splittext(new_message,"\n\n")
if(raw_list.len > 10)
@@ -285,7 +285,7 @@
if("custom_cold")
tgui_alert(user, "You are setting custom cold messages. These will overwrite your species' defaults. To return to defaults, click reset.")
var/old_message = pref.custom_heat.Join("\n\n")
var/new_message = sanitize(tgui_input_text(user,"Use double enter between messages to enter a new one. Must be at least 3 characters long, 160 characters max and up to 10 messages are allowed.","Cold Discomfort messages",old_message, multiline= TRUE, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0)
var/new_message = sanitize(tgui_input_text(user,"Use double enter between messages to enter a new one. Must be at least 3 characters long, 160 characters max and up to 10 messages are allowed.","Cold Discomfort messages",old_message, multiline= TRUE, encode = FALSE, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0)
if(length(new_message) > 0)
var/list/raw_list = splittext(new_message,"\n\n")
if(raw_list.len > 10)
@@ -329,7 +329,7 @@
pref.custom_heat = list()
return TOPIC_REFRESH
if("custom_species")
var/raw_choice = sanitize(tgui_input_text(user, "Input your custom species name:",
"Character Preference", pref.custom_species, MAX_NAME_LEN), MAX_NAME_LEN)
var/raw_choice = tgui_input_text(user, "Input your custom species name:",
"Character Preference", pref.custom_species, MAX_NAME_LEN)
pref.custom_species = raw_choice
return TOPIC_REFRESH

View File

@@ -212,7 +212,7 @@
if(!choice)
return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = sanitize(tgui_input_text(user, "Please enter a custom ringtone. If this doesn't match any of the other listed choices, your PDA will use the default (\"beep\") sound.", "Character Preference", null, 20), 20)
var/raw_choice = tgui_input_text(user, "Please enter a custom ringtone. If this doesn't match any of the other listed choices, your PDA will use the default (\"beep\") sound.", "Character Preference", null, 20)
if(raw_choice)
pref.ringtone = raw_choice
else

View File

@@ -218,7 +218,7 @@ var/datum/gear_tweak/custom_name/gear_tweak_free_name = new()
return
if(valid_custom_names)
return tgui_input_list(user, "Choose an item name.", "Character Preference", valid_custom_names, metadata)
var/san_input = sanitize(tgui_input_text(user, "Choose the item's name. Leave it blank to use the default name.", "Item Name", metadata, MAX_LNAME_LEN), MAX_LNAME_LEN, extra = 0)
var/san_input = tgui_input_text(user, "Choose the item's name. Leave it blank to use the default name.", "Item Name", metadata, MAX_LNAME_LEN)
return san_input ? san_input : get_default()
/datum/gear_tweak/custom_name/tweak_item(var/obj/item/I, var/metadata)
@@ -250,7 +250,7 @@ var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new()
return
if(valid_custom_desc)
return tgui_input_list(user, "Choose an item description.", "Character Preference",valid_custom_desc, metadata)
var/san_input = sanitize(tgui_input_text(user, "Choose the item's description. Leave it blank to use the default description.", "Item Description", metadata, multiline = TRUE, prevent_enter = TRUE), extra = 0)
var/san_input = tgui_input_text(user, "Choose the item's description. Leave it blank to use the default description.", "Item Description", metadata, MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
return san_input ? san_input : get_default()
/datum/gear_tweak/custom_desc/tweak_item(var/obj/item/I, var/metadata)
@@ -606,7 +606,7 @@ var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new()
return ""
/datum/gear_tweak/collar_tag/get_metadata(var/user, var/metadata)
return sanitize( tgui_input_text(user, "Choose the tag text", "Character Preference", metadata, MAX_NAME_LEN), MAX_NAME_LEN )
return tgui_input_text(user, "Choose the tag text", "Character Preference", metadata, MAX_NAME_LEN)
/datum/gear_tweak/collar_tag/tweak_item(var/obj/item/clothing/accessory/collar/C, var/metadata)
if(metadata == "")

View File

@@ -306,7 +306,7 @@ GLOBAL_LIST_EMPTY(chardirectory_photos)
return set_for_mind_or_prefs(user, action, !visible, can_set_prefs, can_set_mind)
if ("editAd")
var/current_ad = (can_set_mind ? user.mind.directory_ad : null) || (can_set_prefs ? user.client.prefs.directory_ad : null)
var/new_ad = sanitize(tgui_input_text(user, "Change your character ad", "Character Ad", current_ad, multiline = TRUE, prevent_enter = TRUE), extra = 0)
var/new_ad = tgui_input_text(user, "Change your character ad", "Character Ad", current_ad, MAX_MESSAGE_LEN, TRUE, prevent_enter = TRUE)
if(isnull(new_ad))
return
return set_for_mind_or_prefs(user, action, new_ad, can_set_prefs, can_set_mind)