mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Input Patches
This commit is contained in:
@@ -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))
|
||||||
|
|||||||
@@ -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.")
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ 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
|
||||||
|
|
||||||
if(href_list["antagfaction"])
|
if(href_list["antagfaction"])
|
||||||
var/choice = tgui_input_list(user, "Please choose an antagonistic faction to work for.", "Character Preference", antag_faction_choices + list("None","Other"), pref.antag_faction)
|
var/choice = tgui_input_list(user, "Please choose an antagonistic faction to work for.", "Character Preference", antag_faction_choices + list("None","Other"), pref.antag_faction)
|
||||||
if(!choice || !CanUseTopic(user))
|
if(!choice || !CanUseTopic(user))
|
||||||
@@ -60,7 +60,7 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None")
|
|||||||
else
|
else
|
||||||
pref.antag_faction = choice
|
pref.antag_faction = choice
|
||||||
return TOPIC_REFRESH
|
return TOPIC_REFRESH
|
||||||
|
|
||||||
if(href_list["antagvis"])
|
if(href_list["antagvis"])
|
||||||
var/choice = tgui_input_list(user, "Please choose an antagonistic visibility level.", "Character Preference", antag_visiblity_choices, pref.antag_vis)
|
var/choice = tgui_input_list(user, "Please choose an antagonistic visibility level.", "Character Preference", antag_visiblity_choices, pref.antag_vis)
|
||||||
if(!choice || !CanUseTopic(user))
|
if(!choice || !CanUseTopic(user))
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
data["error"] = error
|
data["error"] = error
|
||||||
if(!computer || !HDD)
|
if(!computer || !HDD)
|
||||||
data["error"] = "I/O ERROR: Unable to access hard drive."
|
data["error"] = "I/O ERROR: Unable to access hard drive."
|
||||||
|
|
||||||
data["filedata"] = null
|
data["filedata"] = null
|
||||||
data["filename"] = null
|
data["filename"] = null
|
||||||
data["files"] = list()
|
data["files"] = list()
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -229,4 +229,4 @@
|
|||||||
data["filedata"] = pencode2html(loaded_data)
|
data["filedata"] = pencode2html(loaded_data)
|
||||||
data["filename"] = "UNNAMED"
|
data["filename"] = "UNNAMED"
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|||||||
@@ -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...")
|
||||||
@@ -503,7 +503,7 @@
|
|||||||
set name = "NMe"
|
set name = "NMe"
|
||||||
set desc = "Emote into your NIF's Soulcatcher."
|
set desc = "Emote into your NIF's Soulcatcher."
|
||||||
set category = "IC"
|
set category = "IC"
|
||||||
|
|
||||||
src.nme_act(message)
|
src.nme_act(message)
|
||||||
|
|
||||||
/mob/proc/nme_act(message as text|null)
|
/mob/proc/nme_act(message as text|null)
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -231,10 +231,10 @@
|
|||||||
/datum/tgui_module/email_client/tgui_act(action, params)
|
/datum/tgui_module/email_client/tgui_act(action, params)
|
||||||
if(..())
|
if(..())
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
var/mob/living/user = usr
|
var/mob/living/user = usr
|
||||||
check_for_new_messages(1) // Any actual interaction (button pressing) is considered as acknowledging received message, for the purpose of notification icons.
|
check_for_new_messages(1) // Any actual interaction (button pressing) is considered as acknowledging received message, for the purpose of notification icons.
|
||||||
|
|
||||||
switch(action)
|
switch(action)
|
||||||
if("login")
|
if("login")
|
||||||
log_in()
|
log_in()
|
||||||
@@ -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
|
||||||
@@ -473,4 +473,4 @@
|
|||||||
|
|
||||||
if("remove_attachment")
|
if("remove_attachment")
|
||||||
msg_attachment = null
|
msg_attachment = null
|
||||||
return 1
|
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/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.
|
||||||
|
|||||||
Reference in New Issue
Block a user