mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Input Patches
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
names += componentsubtypes
|
||||
names += "---Elements---"
|
||||
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---")
|
||||
return
|
||||
if(QDELETED(src))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
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 == "")
|
||||
custom_event_msg = null
|
||||
log_admin("[usr.key] has cleared the custom event text.")
|
||||
|
||||
@@ -44,7 +44,7 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None")
|
||||
return TOPIC_REFRESH
|
||||
|
||||
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))
|
||||
pref.exploit_record = exploitmsg
|
||||
return TOPIC_REFRESH
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
else if(href_list["import"])
|
||||
var/t = ""
|
||||
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))
|
||||
return
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
set desc = "Set your description."
|
||||
set category = "Abilities"
|
||||
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)
|
||||
desc = newdesc
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
var/oldtext = html_decode(F.stored_data)
|
||||
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)
|
||||
return
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
var/oldtext = html_decode(loaded_data)
|
||||
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)
|
||||
return
|
||||
loaded_data = newtext
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
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 \
|
||||
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)
|
||||
inside_flavor = new_flavor
|
||||
nif.notify("Updating VR environment...")
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
if (!istype(src,/datum/admins))
|
||||
to_chat(usr, "Error: you are not an admin!")
|
||||
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)
|
||||
|
||||
/datum/admins/proc/PlayerNotesPageLegacy(page, filter)
|
||||
@@ -298,7 +298,7 @@
|
||||
|
||||
if(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
|
||||
|
||||
notes_add(key,add,usr)
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
var/oldtext = html_decode(msg_body)
|
||||
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)
|
||||
msg_body = newtext
|
||||
return 1
|
||||
|
||||
@@ -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/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))
|
||||
resize(new_size/100, uncapped = has_large_resize_bounds(), ignore_prefs = TRUE)
|
||||
<<<<<<< HEAD
|
||||
if(temporary_form) //CHOMPEdit - resizing both our forms
|
||||
var/mob/living/L = temporary_form
|
||||
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
|
||||
=======
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user