Merge branch 'master' of https://github.com/VOREStation/VOREStation into tgui-input-framework-hotfix

This commit is contained in:
ItsSelis
2022-06-20 17:44:33 +02:00
114 changed files with 635 additions and 455 deletions
+3 -3
View File
@@ -45,7 +45,7 @@
to_chat(usr, "<span class='notice'>Electronic warfare [S.electronic_warfare ? "enabled" : "disabled"].</span>")
. = TRUE
if("age")
var/new_age = input(usr,"What age would you like to put on this card?","Agent Card Age", S.age) as null|num
var/new_age = tgui_input_number(usr,"What age would you like to put on this card?","Agent Card Age", S.age)
if(!isnull(new_age) && tgui_status(usr, state) == STATUS_INTERACTIVE)
if(new_age < 0)
S.age = initial(S.age)
@@ -63,7 +63,7 @@
to_chat(usr, "<span class='notice'>Appearance changed to [choice].</span>")
. = TRUE
if("assignment")
var/new_job = sanitize(input(usr,"What assignment would you like to put on this card?\nChanging assignment will not grant or remove any access levels.","Agent Card Assignment", S.assignment) as null|text)
var/new_job = sanitize(tgui_input_text(usr,"What assignment would you like to put on this card?\nChanging assignment will not grant or remove any access levels.","Agent Card Assignment", S.assignment))
if(!isnull(new_job) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.assignment = new_job
to_chat(usr, "<span class='notice'>Occupation changed to '[new_job]'.</span>")
@@ -97,7 +97,7 @@
var/mob/living/carbon/human/H = usr
if(H.dna)
default = md5(H.dna.uni_identity)
var/new_fingerprint_hash = sanitize(input(usr,"What fingerprint hash would you like to be written on this card?","Agent Card Fingerprint Hash",default) as null|text)
var/new_fingerprint_hash = sanitize(tgui_input_text(usr,"What fingerprint hash would you like to be written on this card?","Agent Card Fingerprint Hash",default))
if(!isnull(new_fingerprint_hash) && tgui_status(usr, state) == STATUS_INTERACTIVE)
S.fingerprint_hash = new_fingerprint_hash
to_chat(usr, "<span class='notice'>Fingerprint hash changed to '[new_fingerprint_hash]'.</span>")
@@ -93,8 +93,8 @@
if(can_change(APPEARANCE_RACE) && (params["race"] in valid_species))
if(target.change_species(params["race"]))
if(params["race"] == "Custom Species")
target.custom_species = sanitize(input(usr, "Input custom species name:",
"Custom Species Name") as null|text, MAX_NAME_LEN)
target.custom_species = sanitize(tgui_input_text(usr, "Input custom species name:",
"Custom Species Name", null, MAX_NAME_LEN), MAX_NAME_LEN)
cut_data()
generate_data(usr)
changed_hook(APPEARANCECHANGER_CHANGED_RACE)
@@ -113,7 +113,7 @@
return 1
if("skin_tone")
if(can_change_skin_tone())
var/new_s_tone = input(usr, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Skin Tone", -target.s_tone + 35) as num|null
var/new_s_tone = tgui_input_number(usr, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Skin Tone", -target.s_tone + 35, 220, 1)
if(isnum(new_s_tone) && can_still_topic(usr, state))
new_s_tone = 35 - max(min( round(new_s_tone), 220),1)
changed_hook(APPEARANCECHANGER_CHANGED_SKINTONE)
+2 -2
View File
@@ -324,11 +324,11 @@
post_status(src, params["statdisp"], user = usr)
if("setmsg1")
stat_msg1 = reject_bad_text(sanitize(input(usr, "Line 1", "Enter Message Text", stat_msg1) as text|null, 40), 40)
stat_msg1 = reject_bad_text(sanitize(tgui_input_text(usr, "Line 1", "Enter Message Text", stat_msg1, 40), 40), 40)
setMenuState(usr, COMM_SCREEN_STAT)
if("setmsg2")
stat_msg2 = reject_bad_text(sanitize(input(usr, "Line 2", "Enter Message Text", stat_msg2) as text|null, 40), 40)
stat_msg2 = reject_bad_text(sanitize(tgui_input_text(usr, "Line 2", "Enter Message Text", stat_msg2, 40), 40), 40)
setMenuState(usr, COMM_SCREEN_STAT)
// OMG CENTCOMM LETTERHEAD
+2 -2
View File
@@ -89,7 +89,7 @@
return TRUE
if("change_supplied_law_position")
var/new_position = input(usr, "Enter new supplied law position between 1 and [MAX_SUPPLIED_LAW_NUMBER], inclusive. Inherent laws at the same index as a supplied law will not be stated.", "Law Position", supplied_law_position) as num|null
var/new_position = tgui_input_number(usr, "Enter new supplied law position between 1 and [MAX_SUPPLIED_LAW_NUMBER], inclusive. Inherent laws at the same index as a supplied law will not be stated.", "Law Position", supplied_law_position)
if(isnum(new_position) && can_still_topic(usr, state))
supplied_law_position = CLAMP(new_position, 1, MAX_SUPPLIED_LAW_NUMBER)
return TRUE
@@ -98,7 +98,7 @@
if(is_malf(usr))
var/datum/ai_law/AL = locate(params["edit_law"]) in owner.laws.all_laws()
if(AL)
var/new_law = sanitize(input(usr, "Enter new law. Leaving the field blank will cancel the edit.", "Edit Law", AL.law))
var/new_law = sanitize(tgui_input_text(usr, "Enter new law. Leaving the field blank will cancel the edit.", "Edit Law", AL.law))
if(new_law && new_law != AL.law && is_malf(usr) && can_still_topic(usr, state))
log_and_message_admins("has changed a law of [owner] from '[AL.law]' to '[new_law]'")
AL.law = new_law
@@ -192,7 +192,7 @@
if(computer && program.can_run(usr, 1) && id_card)
var/t1 = params["assign_target"]
if(t1 == "Custom")
var/temp_t = sanitize(input(usr, "Enter a custom job assignment.","Assignment", id_card.assignment), 45)
var/temp_t = sanitize(tgui_input_text(usr, "Enter a custom job assignment.","Assignment", id_card.assignment, 45), 45)
//let custom jobs function as an impromptu alt title, mainly for sechuds
if(temp_t)
id_card.assignment = temp_t
+5 -5
View File
@@ -279,7 +279,7 @@
var/oldtext = html_decode(msg_body)
oldtext = replacetext(oldtext, "\[editorbr\]", "\n")
var/newtext = sanitize(replacetext(input(usr, "Enter your message. You may use most tags from paper formatting", "Message Editor", oldtext) as message|null, "\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), "\n", "\[editorbr\]"), 20000)
if(newtext)
msg_body = newtext
return 1
@@ -362,13 +362,13 @@
return 1
if("changepassword")
var/oldpassword = sanitize(input(user,"Please enter your old password:", "Password Change"), 100)
var/oldpassword = sanitize(tgui_input_text(user,"Please enter your old password:", "Password Change", null, 100), 100)
if(!oldpassword)
return 1
var/newpassword1 = sanitize(input(user,"Please enter your new password:", "Password Change"), 100)
var/newpassword1 = sanitize(tgui_input_text(user,"Please enter your new password:", "Password Change", null, 100), 100)
if(!newpassword1)
return 1
var/newpassword2 = sanitize(input(user,"Please re-enter your new password:", "Password Change"), 100)
var/newpassword2 = sanitize(tgui_input_text(user,"Please re-enter your new password:", "Password Change", null, 100), 100)
if(!newpassword2)
return 1
@@ -399,7 +399,7 @@
error = "Error exporting file. Are you using a functional and NTOS-compliant device?"
return 1
var/filename = sanitize(input(user,"Please specify file name:", "Message export"), 100)
var/filename = sanitize(tgui_input_text(user,"Please specify file name:", "Message export", null, 100), 100)
if(!filename)
return 1