Remove many incorrect uses of usr (#8296)

This commit is contained in:
Raeschen
2024-04-25 16:33:15 +02:00
committed by GitHub
parent 4436ea38d3
commit 8d04b28ec2
22 changed files with 250 additions and 247 deletions
@@ -142,7 +142,7 @@
return TOPIC_NOACTION
else if(href_list["reset_nickname"])
var/nick_choice = tgui_alert(usr, "Wipe your Nickname? This will completely remove any chosen nickname(s).","Wipe Nickname",list("Yes","No"))
var/nick_choice = tgui_alert(user, "Wipe your Nickname? This will completely remove any chosen nickname(s).","Wipe Nickname",list("Yes","No")) //ChompEDIT - usr removal
if(nick_choice == "Yes")
pref.nickname = null
return TOPIC_REFRESH
@@ -229,30 +229,30 @@
return TOPIC_REFRESH
else if(href_list["edit_ooc_notes"])
var/new_metadata = strip_html_simple(tgui_input_text(usr, "Enter any information you'd like others to see, such as Roleplay-preferences. This will not be saved permanently unless you click save in the Character Setup panel!", "Game Preference" , html_decode(pref.metadata), multiline = TRUE, prevent_enter = TRUE))
var/new_metadata = strip_html_simple(tgui_input_text(user, "Enter any information you'd like others to see, such as Roleplay-preferences. This will not be saved permanently unless you click save in the Character Setup panel!", "Game Preference" , html_decode(pref.metadata), multiline = TRUE, prevent_enter = TRUE)) //ChompEDIT - usr removal
if(new_metadata && CanUseTopic(user))
pref.metadata = new_metadata
else if(href_list["edit_ooc_note_likes"])
var/new_metadata = strip_html_simple(tgui_input_text(usr, "Enter any information you'd like others to see relating to your LIKED roleplay preferences. This will not be saved permanently unless you click save in the Character Setup panel! Type \"!clear\" to empty.", "Game Preference" , html_decode(pref.metadata_likes), multiline = TRUE, prevent_enter = TRUE))
var/new_metadata = strip_html_simple(tgui_input_text(user, "Enter any information you'd like others to see relating to your LIKED roleplay preferences. This will not be saved permanently unless you click save in the Character Setup panel! Type \"!clear\" to empty.", "Game Preference" , html_decode(pref.metadata_likes), multiline = TRUE, prevent_enter = TRUE)) //ChompEDIT - usr removal
if(new_metadata && CanUseTopic(user))
if(new_metadata == "!clear")
new_metadata = ""
pref.metadata_likes = new_metadata
else if(href_list["edit_ooc_note_dislikes"])
var/new_metadata = strip_html_simple(tgui_input_text(usr, "Enter any information you'd like others to see relating to your DISLIKED roleplay preferences. This will not be saved permanently unless you click save in the Character Setup panel! Type \"!clear\" to empty.", "Game Preference" , html_decode(pref.metadata_dislikes), multiline = TRUE, prevent_enter = TRUE))
var/new_metadata = strip_html_simple(tgui_input_text(user, "Enter any information you'd like others to see relating to your DISLIKED roleplay preferences. This will not be saved permanently unless you click save in the Character Setup panel! Type \"!clear\" to empty.", "Game Preference" , html_decode(pref.metadata_dislikes), multiline = TRUE, prevent_enter = TRUE)) //ChompEDIT - usr removal
if(new_metadata && CanUseTopic(user))
if(new_metadata == "!clear")
new_metadata = ""
pref.metadata_dislikes = new_metadata
//CHOMPEdit Start
else if(href_list["edit_ooc_note_favs"])
var/new_metadata = strip_html_simple(tgui_input_text(usr, "Enter any information you'd like others to see relating to your FAVOURITE roleplay preferences. This will not be saved permanently unless you click save in the Character Setup panel! Type \"!clear\" to empty.", "Game Preference" , html_decode(pref.metadata_favs), multiline = TRUE, prevent_enter = TRUE))
var/new_metadata = strip_html_simple(tgui_input_text(user, "Enter any information you'd like others to see relating to your FAVOURITE roleplay preferences. This will not be saved permanently unless you click save in the Character Setup panel! Type \"!clear\" to empty.", "Game Preference" , html_decode(pref.metadata_favs), multiline = TRUE, prevent_enter = TRUE)) //ChompEDIT - usr removal
if(new_metadata && CanUseTopic(user))
if(new_metadata == "!clear")
new_metadata = ""
pref.metadata_favs = new_metadata
else if(href_list["edit_ooc_note_maybes"])
var/new_metadata = strip_html_simple(tgui_input_text(usr, "Enter any information you'd like others to see relating to your MAYBE roleplay preferences. This will not be saved permanently unless you click save in the Character Setup panel! Type \"!clear\" to empty.", "Game Preference" , html_decode(pref.metadata_maybes), multiline = TRUE, prevent_enter = TRUE))
var/new_metadata = strip_html_simple(tgui_input_text(user, "Enter any information you'd like others to see relating to your MAYBE roleplay preferences. This will not be saved permanently unless you click save in the Character Setup panel! Type \"!clear\" to empty.", "Game Preference" , html_decode(pref.metadata_maybes), multiline = TRUE, prevent_enter = TRUE)) //ChompEDIT - usr removal
if(new_metadata && CanUseTopic(user))
if(new_metadata == "!clear")
new_metadata = ""
@@ -120,7 +120,7 @@
if(new_lang && pref.alternate_languages.len < (S.num_alternate_languages + pref.extra_languages))
var/datum/language/chosen_lang = GLOB.all_languages[new_lang]
if(istype(chosen_lang))
var/choice = tgui_alert(usr, "[chosen_lang.desc]",chosen_lang.name, list("Take","Cancel"))
var/choice = tgui_alert(user, "[chosen_lang.desc]",chosen_lang.name, list("Take","Cancel")) //ChompEDIT - usr removal
if(choice != "Cancel" && pref.alternate_languages.len < (S.num_alternate_languages + pref.extra_languages))
pref.alternate_languages |= new_lang
return TOPIC_REFRESH
@@ -129,7 +129,7 @@
var/char
var/keys[0]
do
char = tgui_input_text(usr, "Enter a single special character.\nYou may re-select the same characters.\nThe following characters are already in use by radio: ; : .\nThe following characters are already in use by special say commands: ! * ^", "Enter Character - [3 - keys.len] remaining")
char = tgui_input_text(user, "Enter a single special character.\nYou may re-select the same characters.\nThe following characters are already in use by radio: ; : .\nThe following characters are already in use by special say commands: ! * ^", "Enter Character - [3 - keys.len] remaining") //ChompEDIT - usr removal
if(char)
if(length(char) > 1)
tgui_alert_async(user, "Only single characters allowed.", "Error")
@@ -698,7 +698,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
var/desc_id = href_list["change_descriptor"]
if(pref.body_descriptors[desc_id])
var/datum/mob_descriptor/descriptor = mob_species.descriptors[desc_id]
var/choice = tgui_input_list(usr, "Please select a descriptor.", "Descriptor", descriptor.chargen_value_descriptors)
var/choice = tgui_input_list(user, "Please select a descriptor.", "Descriptor", descriptor.chargen_value_descriptors) //ChompEDIT - usr removal
if(choice && mob_species.descriptors[desc_id]) // Check in case they sneakily changed species.
pref.body_descriptors[desc_id] = descriptor.chargen_value_descriptors[choice]
return TOPIC_REFRESH
@@ -711,7 +711,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["show_species"])
// Actual whitelist checks are handled elsewhere, this is just for accessing the preview window.
var/choice = tgui_input_list(usr, "Which species would you like to look at?", "Species Choice", GLOB.playable_species)
var/choice = tgui_input_list(user, "Which species would you like to look at?", "Species Choice", GLOB.playable_species) //ChompEDIT - usr removal
if(!choice) return
pref.species_preview = choice
SetSpecies(preference_mob())
@@ -719,7 +719,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
return TOPIC_HANDLED
else if(href_list["disabilities_yw"])
Disabilities_YW(usr)
Disabilities_YW(user) //ChompEDIT - usr removal
else if(href_list["set_species"])
user << browse(null, "window=species")
@@ -1236,7 +1236,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["disabilities"])
var/disability_flag = text2num(href_list["disabilities"])
pref.disabilities ^= disability_flag
Disabilities_YW(usr) //YW Edit
Disabilities_YW(user) //YW Edit //ChompEDIT - usr removal
else if(href_list["toggle_preview_value"])
pref.equip_preview_mob ^= text2num(href_list["toggle_preview_value"])
@@ -1270,23 +1270,23 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
else if(href_list["wingdings"])
pref.wingdings = !pref.wingdings
Disabilities_YW(usr)
Disabilities_YW(user) //ChompEDIT - usr removal
else if(href_list["colorblind_mono"])
pref.colorblind_mono = !pref.colorblind_mono
Disabilities_YW(usr)
Disabilities_YW(user) //ChompEDIT - usr removal
else if(href_list["colorblind_vulp"])
pref.colorblind_vulp = !pref.colorblind_vulp
Disabilities_YW(usr)
Disabilities_YW(user) //ChompEDIT - usr removal
else if(href_list["colorblind_taj"])
pref.colorblind_taj = !pref.colorblind_taj
Disabilities_YW(usr)
Disabilities_YW(user) //ChompEDIT - usr removal
else if(href_list["haemophilia"])
pref.haemophilia = !pref.haemophilia
Disabilities_YW(usr)
Disabilities_YW(user) //ChompEDIT - usr removal
else if(href_list["reset_disabilities"])
pref.wingdings = 0
@@ -1294,7 +1294,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
pref.colorblind_taj = 0
pref.colorblind_vulp = 0
pref.haemophilia = 0
Disabilities_YW(usr)
Disabilities_YW(user) //ChompEDIT - usr removal
//YW Add End
@@ -1433,7 +1433,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
//vorestation edit end
dat += "<td width = 200 align='center'>"
if("preview" in cached_icon_states(current_species.icobase))
usr << browse_rsc(icon(current_species.icobase,"preview"), "species_preview_[current_species.name].png")
user << browse_rsc(icon(current_species.icobase,"preview"), "species_preview_[current_species.name].png") //ChompEDIT usr -> user
dat += "<img src='species_preview_[current_species.name].png' width='64px' height='64px'><br/><br/>"
dat += "<b>Language:</b> [current_species.species_language]<br/>"
dat += "<small>"
@@ -170,7 +170,7 @@ var/global/list/valid_ringtones = list(
var/datum/gear_tweak/gt = locate(href_list["tweak"])
if(!gt)
return TOPIC_NOACTION
var/new_metadata = gt.get_metadata(usr, get_metadata(underwear, gt))
var/new_metadata = gt.get_metadata(user, get_metadata(underwear, gt)) //ChompEDIT - usr removal
if(new_metadata)
set_metadata(underwear, gt, new_metadata)
return TOPIC_REFRESH_UPDATE_PREVIEW
@@ -153,19 +153,19 @@
return TOPIC_REFRESH
else if(href_list["reset_medrecord"])
var/resetmed_choice = tgui_alert(usr, "Wipe your Medical Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No"))
var/resetmed_choice = tgui_alert(user, "Wipe your Medical Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No")) //ChompEDIT - usr removal
if(resetmed_choice == "Yes")
pref.med_record = null
return TOPIC_REFRESH
else if(href_list["reset_emprecord"])
var/resetemp_choice = tgui_alert(usr, "Wipe your Employment Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No"))
var/resetemp_choice = tgui_alert(user, "Wipe your Employment Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No")) //ChompEDIT - usr removal
if(resetemp_choice == "Yes")
pref.gen_record = null
return TOPIC_REFRESH
else if(href_list["reset_secrecord"])
var/resetsec_choice = tgui_alert(usr, "Wipe your Security Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No"))
var/resetsec_choice = tgui_alert(user, "Wipe your Security Records? This cannot be reverted if you have not saved your character recently! You may wish to make a backup first.","Reset Records",list("Yes","No")) //ChompEDIT - usr removal
if(resetsec_choice == "Yes")
pref.sec_record = null
return TOPIC_REFRESH
@@ -69,11 +69,11 @@
switch(href_list["flavor_text"])
if("open")
if("general")
var/msg = strip_html_simple(tgui_input_text(usr,"Give a general description of your character. This will be shown regardless of clothings. Put in a single space to make blank.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE)) //VOREStation Edit: separating out OOC notes
var/msg = strip_html_simple(tgui_input_text(user,"Give a general description of your character. This will be shown regardless of clothings. Put in a single space to make blank.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE)) //VOREStation Edit: separating out OOC notes //ChompEDIT - usr removal
if(CanUseTopic(user) && msg)
pref.flavor_texts[href_list["flavor_text"]] = msg
else
var/msg = strip_html_simple(tgui_input_text(usr,"Set the flavor text for your [href_list["flavor_text"]]. Put in a single space to make blank.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE))
var/msg = strip_html_simple(tgui_input_text(user,"Set the flavor text for your [href_list["flavor_text"]]. Put in a single space to make blank.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE, prevent_enter = TRUE)) //ChompEDIT - usr removal
if(CanUseTopic(user) && msg)
pref.flavor_texts[href_list["flavor_text"]] = msg
SetFlavorText(user)
@@ -83,23 +83,23 @@
switch(href_list["flavour_text_robot"])
if("open")
if("Default")
var/msg = strip_html_simple(tgui_input_text(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting. Put in a single space to make blank.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"]), multiline = TRUE, prevent_enter = TRUE))
var/msg = strip_html_simple(tgui_input_text(user,"Set the default flavour text for your robot. It will be used for any module without individual setting. Put in a single space to make blank.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"]), multiline = TRUE, prevent_enter = TRUE)) //ChompEDIT - usr removal
if(CanUseTopic(user) && msg)
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
else
var/msg = strip_html_simple(tgui_input_text(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this blank, default flavour text will be used for this module. Put in a single space to make blank.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]]), multiline = TRUE, prevent_enter = TRUE))
var/msg = strip_html_simple(tgui_input_text(user,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this blank, default flavour text will be used for this module. Put in a single space to make blank.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]]), multiline = TRUE, prevent_enter = TRUE)) //ChompEDIT - usr removal
if(CanUseTopic(user) && msg)
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
SetFlavourTextRobot(user)
return TOPIC_HANDLED
else if(href_list["custom_link"])
var/new_link = strip_html_simple(tgui_input_text(usr, "Enter a link to add on to your examine text! This should be a related image link/gallery, or things like your F-list. This is not the place for memes.", "Custom Link" , html_decode(pref.custom_link), max_length = 100, encode = TRUE, prevent_enter = TRUE))
if(new_link && CanUseTopic(usr))
var/new_link = strip_html_simple(tgui_input_text(user, "Enter a link to add on to your examine text! This should be a related image link/gallery, or things like your F-list. This is not the place for memes.", "Custom Link" , html_decode(pref.custom_link), max_length = 100, encode = TRUE, prevent_enter = TRUE)) //ChompEDIT - usr removal
if(new_link && CanUseTopic(user)) //ChompEDIT - usr removal
if(length(new_link) > 100)
to_chat(usr, "<span class = 'warning'>Your entry is too long, it must be 100 characters or less.</span>")
to_chat(user, "<span class = 'warning'>Your entry is too long, it must be 100 characters or less.</span>") //ChompEDIT - usr removal
return
pref.custom_link = new_link
log_admin("[usr]/[usr.ckey] set their custom link to [pref.custom_link]")
log_admin("[user]/[user.ckey] set their custom link to [pref.custom_link]") //ChompEDIT - usr removal
return ..()
@@ -255,7 +255,7 @@
var/datum/job/job = locate(href_list["select_alt_title"])
if (job)
var/choices = list(job.title) + job.alt_titles
var/choice = tgui_input_list(usr, "Choose a title for [job.title].", "Choose Title", choices, pref.GetPlayerAltTitle(job))
var/choice = tgui_input_list(user, "Choose a title for [job.title].", "Choose Title", choices, pref.GetPlayerAltTitle(job)) //ChompEDIT - usr removal
if(choice && CanUseTopic(user))
SetPlayerAltTitle(job, choice)
return (pref.equip_preview_mob ? TOPIC_REFRESH_UPDATE_PREVIEW : TOPIC_REFRESH)
@@ -40,7 +40,7 @@
var/channel = href_list["change_volume"]
if(!(channel in pref.volume_channels))
pref.volume_channels["[channel]"] = 1
var/value = tgui_input_number(usr, "Choose your volume for [channel] (0-200%)", "[channel] volume", (pref.volume_channels[channel] * 100), 200, 0)
var/value = tgui_input_number(user, "Choose your volume for [channel] (0-200%)", "[channel] volume", (pref.volume_channels[channel] * 100), 200, 0) //ChompEDIT - usr removal
if(isnum(value))
value = CLAMP(value, 0, 200)
pref.volume_channels["[channel]"] = (value / 100)
@@ -74,7 +74,7 @@
/datum/volume_panel/tgui_data(mob/user)
if(!user.client || !user.client.prefs)
return list("error" = TRUE)
var/list/data = ..()
data["volume_channels"] = user.client.prefs.volume_channels
return data
@@ -33,7 +33,7 @@
/datum/category_item/player_setup_item/volume_sliders/media/OnTopic(var/href, var/list/href_list, var/mob/user)
if(href_list["change_media_volume"])
if(CanUseTopic(user))
var/value = tgui_input_number(usr, "Choose your Jukebox volume (0-100%)", "Jukebox volume", round(pref.media_volume * 100), 100, 0)
var/value = tgui_input_number(user, "Choose your Jukebox volume (0-100%)", "Jukebox volume", round(pref.media_volume * 100), 100, 0) //ChompEDIT - usr removal
if(isnum(value))
value = CLAMP(value, 0, 100)
pref.media_volume = value/100.0
@@ -198,7 +198,7 @@
else if(href_list["voice_freq"])
var/list/preset_voice_freqs = list("high" = MAX_VOICE_FREQ, "middle-high" = 56250, "middle" = 42500, "middle-low"= 28750, "low" = MIN_VOICE_FREQ, "custom" = 1, "random" = 0)
var/choice = tgui_input_list(usr, "What would you like to set your voice frequency to? ([MIN_VOICE_FREQ] - [MAX_VOICE_FREQ])", "Voice Frequency", preset_voice_freqs)
var/choice = tgui_input_list(user, "What would you like to set your voice frequency to? ([MIN_VOICE_FREQ] - [MAX_VOICE_FREQ])", "Voice Frequency", preset_voice_freqs) //ChompEDIT - usr removal
if(!choice)
return
choice = preset_voice_freqs[choice]
@@ -231,7 +231,7 @@
"goon speak roach",
"goon speak skelly",
"xeno speak") // CHOMPedit
var/choice = tgui_input_list(usr, "Which set of sounds would you like to use for your character's speech sounds?", "Voice Sounds", possible_voice_types)
var/choice = tgui_input_list(user, "Which set of sounds would you like to use for your character's speech sounds?", "Voice Sounds", possible_voice_types)
if(!pref.voice_sound)
pref.voice_sound = "goon speak 1" //CHOMPEdit - Defaults voice to a less jarring sound
else if(!choice)
@@ -240,7 +240,7 @@
pref.voice_sound = choice
return TOPIC_REFRESH
else if(href_list["customize_speech_bubble"])
var/choice = tgui_input_list(usr, "What speech bubble style do you want to use? (default for automatic selection)", "Custom Speech Bubble", selectable_speech_bubbles)
var/choice = tgui_input_list(user, "What speech bubble style do you want to use? (default for automatic selection)", "Custom Speech Bubble", selectable_speech_bubbles)
if(!choice)
pref.custom_speech_bubble = "default"
else
@@ -289,7 +289,7 @@
// CHOMPEdit Start: Pain/Scream/Death sounds
else if(href_list["species_sound_options"]) // You shouldn't be able to see this option if you don't have the option to select a custom icon base, so we don't need to re-check for safety here.
var/list/possible_species_sound_types = species_sound_map
var/choice = tgui_input_list(usr, "Which set of sounds would you like to use for your character's species sounds? (Cough, Sneeze, Scream, Pain, Gasp, Death)", "Species Sounds", possible_species_sound_types)
var/choice = tgui_input_list(user, "Which set of sounds would you like to use for your character's species sounds? (Cough, Sneeze, Scream, Pain, Gasp, Death)", "Species Sounds", possible_species_sound_types)
if(!choice)
return TOPIC_REFRESH // No choice? Don't reset our selection
else
@@ -376,19 +376,19 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
else if(href_list["custom_base"])
var/list/choices = pref.get_custom_bases_for_species()
var/text_choice = tgui_input_list(usr, "Pick an icon set for your species:","Icon Base", choices)
var/text_choice = tgui_input_list(user, "Pick an icon set for your species:","Icon Base", choices) //ChompEDIT - usr removal
if(text_choice in choices)
pref.custom_base = text_choice
return TOPIC_REFRESH_UPDATE_PREVIEW
else if(href_list["blood_color"])
var/color_choice = input(usr, "Pick a blood color (does not apply to synths)","Blood Color",pref.blood_color) as color
var/color_choice = input(user, "Pick a blood color (does not apply to synths)","Blood Color",pref.blood_color) as color //ChompEDIT - usr removal
if(color_choice)
pref.blood_color = sanitize_hexcolor(color_choice, default="#A10808")
return TOPIC_REFRESH
else if(href_list["blood_reset"])
var/choice = tgui_alert(usr, "Reset blood color to human default (#A10808)?","Reset Blood Color",list("Reset","Cancel"))
var/choice = tgui_alert(user, "Reset blood color to human default (#A10808)?","Reset Blood Color",list("Reset","Cancel")) //ChompEDIT - usr removal
if(choice == "Reset")
pref.blood_color = "#A10808"
return TOPIC_REFRESH
@@ -401,7 +401,7 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
else if(href_list["clicked_pos_trait"])
var/datum/trait/trait = text2path(href_list["clicked_pos_trait"])
var/choice = tgui_alert(usr, "Remove [initial(trait.name)] and regain [initial(trait.cost)] points?","Remove Trait",list("Remove","Cancel"))
var/choice = tgui_alert(user, "Remove [initial(trait.name)] and regain [initial(trait.cost)] points?","Remove Trait",list("Remove","Cancel")) //ChompEDIT - usr removal
if(choice == "Remove")
pref.pos_traits -= trait
var/datum/trait/instance = all_traits[trait]
@@ -410,7 +410,7 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
else if(href_list["clicked_neu_trait"])
var/datum/trait/trait = text2path(href_list["clicked_neu_trait"])
var/choice = tgui_alert(usr, "Remove [initial(trait.name)]?","Remove Trait",list("Remove","Cancel"))
var/choice = tgui_alert(user, "Remove [initial(trait.name)]?","Remove Trait",list("Remove","Cancel")) //ChompEDIT - usr removal
if(choice == "Remove")
pref.neu_traits -= trait
var/datum/trait/instance = all_traits[trait]
@@ -419,7 +419,7 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
else if(href_list["clicked_neg_trait"])
var/datum/trait/trait = text2path(href_list["clicked_neg_trait"])
var/choice = tgui_alert(usr, "Remove [initial(trait.name)] and lose [initial(trait.cost)] points?","Remove Trait",list("Remove","Cancel"))
var/choice = tgui_alert(user, "Remove [initial(trait.name)] and lose [initial(trait.cost)] points?","Remove Trait",list("Remove","Cancel")) //ChompEDIT - usr removal
if(choice == "Remove")
pref.neg_traits -= trait
var/datum/trait/instance = all_traits[trait]
@@ -432,25 +432,25 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
return TOPIC_REFRESH
else if(href_list["custom_say"])
var/say_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'says': [pref.real_name] says, \"Hi.\"", "Custom Say", pref.custom_say, 12), 12)
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) //ChompEDIT - usr removal
if(say_choice)
pref.custom_say = say_choice
return TOPIC_REFRESH
else if(href_list["custom_whisper"])
var/whisper_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'whispers': [pref.real_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper, 12), 12)
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) //ChompEDIT - usr removal
if(whisper_choice)
pref.custom_whisper = whisper_choice
return TOPIC_REFRESH
else if(href_list["custom_ask"])
var/ask_choice = sanitize(tgui_input_text(usr, "This word or phrase will appear instead of 'asks': [pref.real_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask, 12), 12)
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) //ChompEDIT - usr removal
if(ask_choice)
pref.custom_ask = ask_choice
return TOPIC_REFRESH
else if(href_list["custom_exclaim"])
var/exclaim_choice = sanitize(tgui_input_text(usr, "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 = 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) //ChompEDIT - usr removal
if(exclaim_choice)
pref.custom_exclaim = exclaim_choice
return TOPIC_REFRESH
@@ -458,7 +458,7 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
else if(href_list["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(usr,"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, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0) //ChompEDIT - usr removal
if(length(new_message) > 0)
var/list/raw_list = splittext(new_message,"\n\n")
if(raw_list.len > 10)
@@ -475,7 +475,7 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
else if(href_list["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_cold.Join("\n\n") //CHOMP Edit
var/new_message = sanitize(tgui_input_text(usr,"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, prevent_enter = TRUE), MAX_MESSAGE_LEN,0,0,0) //ChompEDIT - usr removal
if(length(new_message) > 0)
var/list/raw_list = splittext(new_message,"\n\n")
if(raw_list.len > 10)
@@ -490,37 +490,37 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
return TOPIC_REFRESH
else if(href_list["reset_say"])
var/say_choice = tgui_alert(usr, "Reset your Custom Say Verb?","Reset Verb",list("Yes","No"))
var/say_choice = tgui_alert(user, "Reset your Custom Say Verb?","Reset Verb",list("Yes","No")) //ChompEDIT - usr removal
if(say_choice == "Yes")
pref.custom_say = null
return TOPIC_REFRESH
else if(href_list["reset_whisper"])
var/whisper_choice = tgui_alert(usr, "Reset your Custom Whisper Verb?","Reset Verb",list("Yes","No"))
var/whisper_choice = tgui_alert(user, "Reset your Custom Whisper Verb?","Reset Verb",list("Yes","No")) //ChompEDIT - usr removal
if(whisper_choice == "Yes")
pref.custom_whisper = null
return TOPIC_REFRESH
else if(href_list["reset_ask"])
var/ask_choice = tgui_alert(usr, "Reset your Custom Ask Verb?","Reset Verb",list("Yes","No"))
var/ask_choice = tgui_alert(user, "Reset your Custom Ask Verb?","Reset Verb",list("Yes","No")) //ChompEDIT - usr removal
if(ask_choice == "Yes")
pref.custom_ask = null
return TOPIC_REFRESH
else if(href_list["reset_exclaim"])
var/exclaim_choice = tgui_alert(usr, "Reset your Custom Exclaim Verb?","Reset Verb",list("Yes","No"))
var/exclaim_choice = tgui_alert(user, "Reset your Custom Exclaim Verb?","Reset Verb",list("Yes","No")) //ChompEDIT - usr removal
if(exclaim_choice == "Yes")
pref.custom_exclaim = null
return TOPIC_REFRESH
else if(href_list["reset_cold"])
var/cold_choice = tgui_alert(usr, "Reset your Custom Cold Discomfort messages?", "Reset Discomfort",list("Yes","No"))
var/cold_choice = tgui_alert(user, "Reset your Custom Cold Discomfort messages?", "Reset Discomfort",list("Yes","No")) //ChompEDIT - usr removal
if(cold_choice == "Yes")
pref.custom_cold = list()
return TOPIC_REFRESH
else if(href_list["reset_heat"])
var/heat_choice = tgui_alert(usr, "Reset your Custom Heat Discomfort messages?", "Reset Discomfort",list("Yes","No"))
var/heat_choice = tgui_alert(user, "Reset your Custom Heat Discomfort messages?", "Reset Discomfort",list("Yes","No")) //ChompEDIT - usr removal
if(heat_choice == "Yes")
pref.custom_heat = list()
return TOPIC_REFRESH
@@ -585,12 +585,12 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
var/trait_choice
var/done = FALSE
while(!done)
trait_choice = tgui_input_list(usr, message, title, nicelist)
trait_choice = tgui_input_list(user, message, title, nicelist) //ChompEDIT - usr removal
if(!trait_choice)
done = TRUE
if(trait_choice in nicelist)
var/datum/trait/path = nicelist[trait_choice]
var/choice = tgui_alert(usr, "\[Cost:[initial(path.cost)]\] [initial(path.desc)]",initial(path.name), list("Take Trait","Go Back"))
var/choice = tgui_alert(user, "\[Cost:[initial(path.cost)]\] [initial(path.desc)]",initial(path.name), list("Take Trait","Go Back")) //ChompEDIT - usr removal
if(choice != "Go Back")
done = TRUE
@@ -603,20 +603,20 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
var/conflict = FALSE
if(pref.dirty_synth && !(instance.can_take & SYNTHETICS))
tgui_alert_async(usr, "The trait you've selected can only be taken by organic characters!", "Error")
tgui_alert_async(user, "The trait you've selected can only be taken by organic characters!", "Error") //ChompEDIT - usr removal
//pref.dirty_synth = 0 //Just to be sure //CHOMPEdit this shit broke, stop.
return TOPIC_REFRESH
if(pref.gross_meatbag && !(instance.can_take & ORGANICS))
tgui_alert_async(usr, "The trait you've selected can only be taken by synthetic characters!", "Error")
tgui_alert_async(user, "The trait you've selected can only be taken by synthetic characters!", "Error") //ChompEDIT - usr removal
return TOPIC_REFRESH
if(pref.species in instance.banned_species)
tgui_alert_async(usr, "The trait you've selected cannot be taken by the species you've chosen!", "Error")
tgui_alert_async(user, "The trait you've selected cannot be taken by the species you've chosen!", "Error") //ChompEDIT - usr removal
return TOPIC_REFRESH
if( LAZYLEN(instance.allowed_species) && !(pref.species in instance.allowed_species))
tgui_alert_async(usr, "The trait you've selected cannot be taken by the species you've chosen!", "Error")
tgui_alert_async(user, "The trait you've selected cannot be taken by the species you've chosen!", "Error") //ChompEDIT - usr removal
return TOPIC_REFRESH
if(trait_choice in pref.pos_traits + pref.neu_traits + pref.neg_traits)
@@ -640,7 +640,7 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
break varconflict
if(conflict)
tgui_alert_async(usr, "You cannot take this trait and [conflict] at the same time. Please remove that trait, or pick another trait to add.", "Error")
tgui_alert_async(user, "You cannot take this trait and [conflict] at the same time. Please remove that trait, or pick another trait to add.", "Error") //ChompEDIT - usr removal
return TOPIC_REFRESH
instance.apply_pref(pref)