Input Patches

This commit is contained in:
Casey
2022-06-29 02:00:16 -04:00
committed by CHOMPStation2
parent e2227297a5
commit b66a47e086
11 changed files with 26 additions and 20 deletions

View File

@@ -68,7 +68,7 @@
names += componentsubtypes names += componentsubtypes
names += "---Elements---" names += "---Elements---"
names += sortTim(subtypesof(/datum/element), /proc/cmp_typepaths_asc) names += sortTim(subtypesof(/datum/element), /proc/cmp_typepaths_asc)
var/result = tgui_input_text(usr, "Choose a component/element to add:", "Add Component/Element", names) var/result = tgui_input_list(usr, "Choose a component/element to add:", "Add Component/Element", names)
if(!usr || !result || result == "---Components---" || result == "---Elements---") if(!usr || !result || result == "---Components---" || result == "---Elements---")
return return
if(QDELETED(src)) if(QDELETED(src))

View File

@@ -7,7 +7,7 @@
to_chat(src, "Only administrators may use this command.") to_chat(src, "Only administrators may use this command.")
return return
var/input = sanitize(tgui_input_text(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg, MAX_PAPER_MESSAGE_LEN, TRUE), MAX_PAPER_MESSAGE_LEN, extra = 0) var/input = sanitize(tgui_input_text(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg, MAX_PAPER_MESSAGE_LEN, TRUE, prevent_enter = TRUE), MAX_PAPER_MESSAGE_LEN, extra = 0)
if(!input || input == "") if(!input || input == "")
custom_event_msg = null custom_event_msg = null
log_admin("[usr.key] has cleared the custom event text.") log_admin("[usr.key] has cleared the custom event text.")

View File

@@ -44,7 +44,7 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None")
return TOPIC_REFRESH return TOPIC_REFRESH
if(href_list["exploitable_record"]) if(href_list["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), MAX_RECORD_LENGTH, extra = 0) 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)
if(!isnull(exploitmsg) && !jobban_isbanned(user, "Records") && CanUseTopic(user)) if(!isnull(exploitmsg) && !jobban_isbanned(user, "Records") && CanUseTopic(user))
pref.exploit_record = exploitmsg pref.exploit_record = exploitmsg
return TOPIC_REFRESH return TOPIC_REFRESH

View File

@@ -130,7 +130,7 @@
else if(href_list["import"]) else if(href_list["import"])
var/t = "" var/t = ""
do do
t = html_encode(tgui_input_text(usr, "Please paste the entire song, formatted:", text("[]", name), t, multiline = TRUE)) t = html_encode(tgui_input_text(usr, "Please paste the entire song, formatted:", text("[]", name), t, multiline = TRUE, prevent_enter = TRUE))
if(!in_range(parent, usr)) if(!in_range(parent, usr))
return return

View File

@@ -30,7 +30,7 @@
set desc = "Set your description." set desc = "Set your description."
set category = "Abilities" set category = "Abilities"
var/newdesc var/newdesc
newdesc = sanitizeSafe(tgui_input_text(src,"Set your description. Max 4096 chars.", "Description set",""), MAX_MESSAGE_LEN) newdesc = sanitizeSafe(tgui_input_text(src,"Set your description. Max 4096 chars.", "Description set","", prevent_enter = TRUE), MAX_MESSAGE_LEN)
if(newdesc) if(newdesc)
desc = newdesc desc = newdesc

View File

@@ -63,7 +63,7 @@
var/oldtext = html_decode(F.stored_data) var/oldtext = html_decode(F.stored_data)
oldtext = replacetext(oldtext, "\[br\]", "\n") oldtext = replacetext(oldtext, "\[br\]", "\n")
var/newtext = sanitize(replacetext(tgui_input_text(usr, "Editing file [open_file]. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH) var/newtext = sanitize(replacetext(tgui_input_text(usr, "Editing file [open_file]. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE, prevent_enter = TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH)
if(!newtext) if(!newtext)
return return

View File

@@ -166,7 +166,7 @@
var/oldtext = html_decode(loaded_data) var/oldtext = html_decode(loaded_data)
oldtext = replacetext(oldtext, "\[br\]", "\n") oldtext = replacetext(oldtext, "\[br\]", "\n")
var/newtext = sanitize(replacetext(tgui_input_text(usr, "Editing file '[open_file]'. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH) var/newtext = sanitize(replacetext(tgui_input_text(usr, "Editing file '[open_file]'. You may use most tags used in paper formatting:", "Text Editor", oldtext, MAX_TEXTFILE_LENGTH, TRUE, prevent_enter = TRUE), "\n", "\[br\]"), MAX_TEXTFILE_LENGTH)
if(!newtext) if(!newtext)
return return
loaded_data = newtext loaded_data = newtext

View File

@@ -128,7 +128,7 @@
var/new_flavor = tgui_input_text(nif.human, "Type what the prey sees after being 'caught'. This will be \ var/new_flavor = tgui_input_text(nif.human, "Type what the prey sees after being 'caught'. This will be \
printed after an intro ending with: \"Around you, you see...\" to the prey. If you already \ printed after an intro ending with: \"Around you, you see...\" to the prey. If you already \
have prey, this will be printed to them after \"Your surroundings change to...\". Limit 2048 char.", \ have prey, this will be printed to them after \"Your surroundings change to...\". Limit 2048 char.", \
"VR Environment", html_decode(inside_flavor), MAX_MESSAGE_LEN*2, TRUE) "VR Environment", html_decode(inside_flavor), MAX_MESSAGE_LEN*2, TRUE, prevent_enter = TRUE)
new_flavor = sanitize(new_flavor, MAX_MESSAGE_LEN*2) new_flavor = sanitize(new_flavor, MAX_MESSAGE_LEN*2)
inside_flavor = new_flavor inside_flavor = new_flavor
nif.notify("Updating VR environment...") nif.notify("Updating VR environment...")

View File

@@ -191,7 +191,7 @@
if (!istype(src,/datum/admins)) if (!istype(src,/datum/admins))
to_chat(usr, "Error: you are not an admin!") to_chat(usr, "Error: you are not an admin!")
return return
var/filter = tgui_input_text(usr, "Filter string (case-insensitive regex)", "Player notes filter") var/filter = input(usr, "Filter string (case-insensitive regex)", "Player notes filter")
PlayerNotesPageLegacy(1, filter) PlayerNotesPageLegacy(1, filter)
/datum/admins/proc/PlayerNotesPageLegacy(page, filter) /datum/admins/proc/PlayerNotesPageLegacy(page, filter)
@@ -298,7 +298,7 @@
if(href_list["add_player_info_legacy"]) if(href_list["add_player_info_legacy"])
var/key = href_list["add_player_info_legacy"] var/key = href_list["add_player_info_legacy"]
var/add = sanitize(tgui_input_text(usr, "Add Player Info (Legacy)")) var/add = sanitize(input(usr, "Add Player Info (Legacy)"))
if(!add) return if(!add) return
notes_add(key,add,usr) notes_add(key,add,usr)

View File

@@ -279,7 +279,7 @@
var/oldtext = html_decode(msg_body) var/oldtext = html_decode(msg_body)
oldtext = replacetext(oldtext, "\[editorbr\]", "\n") oldtext = replacetext(oldtext, "\[editorbr\]", "\n")
var/newtext = sanitize(replacetext(tgui_input_text(usr, "Enter your message. You may use most tags from paper formatting", "Message Editor", oldtext, 20000, TRUE), "\n", "\[editorbr\]"), 20000) var/newtext = sanitize(replacetext(tgui_input_text(usr, "Enter your message. You may use most tags from paper formatting", "Message Editor", oldtext, 20000, TRUE, prevent_enter = TRUE), "\n", "\[editorbr\]"), 20000)
if(newtext) if(newtext)
msg_body = newtext msg_body = newtext
return 1 return 1

View File

@@ -140,13 +140,19 @@
var/nagmessage = "Adjust your mass to be a size between 25 to 200% (or 1% to 600% in dormitories). (DO NOT ABUSE)" var/nagmessage = "Adjust your mass to be a size between 25 to 200% (or 1% to 600% in dormitories). (DO NOT ABUSE)"
var/default = size_multiplier * 100 var/default = size_multiplier * 100
var/new_size = tgui_input_number(usr, nagmessage, "Pick a Size", default) var/new_size = tgui_input_number(usr, nagmessage, "Pick a Size", default, 600, 1)
if(size_range_check(new_size)) if(size_range_check(new_size))
resize(new_size/100, uncapped = has_large_resize_bounds(), ignore_prefs = TRUE) resize(new_size/100, uncapped = has_large_resize_bounds(), ignore_prefs = TRUE)
<<<<<<< HEAD
if(temporary_form) //CHOMPEdit - resizing both our forms if(temporary_form) //CHOMPEdit - resizing both our forms
var/mob/living/L = temporary_form var/mob/living/L = temporary_form
L.resize(new_size/100, uncapped = has_large_resize_bounds(), ignore_prefs = TRUE) L.resize(new_size/100, uncapped = has_large_resize_bounds(), ignore_prefs = TRUE)
//CHOMPEDIT - I don't need to be informed every time a prommie changes sizes //CHOMPEDIT - I don't need to be informed every time a prommie changes sizes
=======
// I'm not entirely convinced that `src ? ADMIN_JMP(src) : "null"` here does anything
// but just in case it does, I'm leaving the null-src checking
log_admin("[key_name(src)] used the resize command in-game to be [new_size]% size. [src ? ADMIN_JMP(src) : "null"]")
>>>>>>> c94decbc74... Merge pull request #13194 from ItsSelis/tgui-inputfix
/* /*
//Add the set_size() proc to usable verbs. By commenting this out, we can leave the proc and hand it to species that need it. //Add the set_size() proc to usable verbs. By commenting this out, we can leave the proc and hand it to species that need it.