Merge branch 'master' into upstream-merge-13139

This commit is contained in:
Nadyr
2022-06-23 01:03:05 -04:00
committed by GitHub
162 changed files with 1065 additions and 575 deletions
@@ -123,7 +123,7 @@
switch(action)
if("add_player_info")
var/key = params["ckey"]
var/add = tgui_input_text(usr, "Write your comment below.", "Add Player Info", multiline = TRUE)
var/add = tgui_input_text(usr, "Write your comment below.", "Add Player Info", multiline = TRUE, prevent_enter = TRUE)
if(!add) return
notes_add(key,add,usr)
@@ -328,4 +328,4 @@
PlayerNotesPageLegacy(text2num(href_list["index"]), filter)
if("filter")
PlayerNotesFilterLegacy()
return
return
+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)
+4 -4
View File
@@ -260,7 +260,7 @@
if(message_cooldown > world.time)
to_chat(usr, "<span class='warning'>Please allow at least one minute to pass between announcements.</span>")
return
var/input = tgui_input_text(usr, "Please write a message to announce to the station crew.", "Priority Announcement", multiline = TRUE)
var/input = tgui_input_text(usr, "Please write a message to announce to the station crew.", "Priority Announcement", multiline = TRUE, prevent_enter = TRUE)
if(!input || message_cooldown > world.time || ..() || !(is_authenticated(usr) == COMM_AUTHENTICATION_MAX))
return
if(length(input) < COMM_MSGLEN_MINIMUM)
@@ -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
@@ -340,7 +340,7 @@
var/input = sanitize(tgui_input_text(usr, "Please choose a message to transmit to [using_map.boss_short] via quantum entanglement. \
Please be aware that this process is very expensive, and abuse will lead to... termination. \
Transmission does not guarantee a response. \
There is a 30 second delay before you may send another message, be clear, full and concise.", "Central Command Quantum Messaging", multiline = TRUE))
There is a 30 second delay before you may send another message, be clear, full and concise.", "Central Command Quantum Messaging", multiline = TRUE, prevent_enter = TRUE))
if(!input || ..() || !(is_authenticated(usr) == COMM_AUTHENTICATION_MAX))
return
if(length(input) < COMM_CCMSGLEN_MINIMUM)
+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
+8 -7
View File
@@ -180,17 +180,17 @@
/datum/tgui/proc/send_full_update(custom_data, force)
if(!user.client || !initialized || closing)
return
if(!COOLDOWN_FINISHED(src, refresh_cooldown))
refreshing = TRUE
addtimer(CALLBACK(src, .proc/send_full_update), TGUI_REFRESH_FULL_UPDATE_COOLDOWN, TIMER_UNIQUE)
return
refreshing = FALSE
//if(!COOLDOWN_FINISHED(src, refresh_cooldown))
//refreshing = TRUE
//addtimer(CALLBACK(src, .proc/send_full_update), TGUI_REFRESH_FULL_UPDATE_COOLDOWN, TIMER_UNIQUE)
//return
//refreshing = FALSE
var/should_update_data = force || status >= STATUS_UPDATE
window.send_message("update", get_payload(
custom_data,
with_data = should_update_data,
with_static_data = TRUE))
COOLDOWN_START(src, refresh_cooldown, TGUI_REFRESH_FULL_UPDATE_COOLDOWN)
//COOLDOWN_START(src, refresh_cooldown, TGUI_REFRESH_FULL_UPDATE_COOLDOWN)
/**
* public
@@ -221,7 +221,8 @@
"title" = title,
"status" = status,
"interface" = interface,
"refreshing" = refreshing,
//"refreshing" = refreshing,
"refreshing" = FALSE,
"map" = (using_map && using_map.path) ? using_map.path : "Unknown",
"mapZLevel" = map_z_level,
"window" = list(