TGUI input box conversions 1 (#63313)

This commit is contained in:
Jeremiah
2021-12-11 14:21:35 -08:00
committed by GitHub
parent f6d15afaa1
commit 1052bc19ed
32 changed files with 81 additions and 79 deletions
+3 -3
View File
@@ -37,10 +37,10 @@
to_chat(user, span_warning("You're still waiting for approval from your employers about your proposed name change, it'd be best to wait for now."))
return
var/new_name = stripped_input(user, message="What do you want to name \
var/new_name = tgui_input_text(user, "What do you want to name \
[station_name()]? Keep in mind particularly terrible names may be \
rejected by your employers, while names using the standard format, \
will automatically be accepted.", max_length=MAX_CHARTER_LEN)
rejected by your employers, while names using the standard format \
will be accepted automatically.", "Station Name", max_length = MAX_CHARTER_LEN)
if(response_timer_id)
to_chat(user, span_warning("You're still waiting for approval from your employers about your proposed name change, it'd be best to wait for now."))
+1 -1
View File
@@ -630,7 +630,7 @@ GLOBAL_LIST_EMPTY(PDAs)
//NOTEKEEPER FUNCTIONS===================================
if ("Edit")
var/n = stripped_multiline_input(U, "Please enter message", name, note)
var/n = tgui_input_text(U, "Please enter message", name, note, multiline = TRUE)
if (in_range(src, U) && loc == U)
if (ui_mode == PDA_UI_NOTEKEEPER && n)
note = n
+1 -1
View File
@@ -134,7 +134,7 @@
to_chat(pai, span_notice("You have been bound to a new master."))
pai.emittersemicd = FALSE
if("set_laws")
var/newlaws = stripped_multiline_input(usr, "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.laws.supplied[1], MAX_MESSAGE_LEN)
var/newlaws = tgui_input_text(usr, "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.laws.supplied[1], MAX_MESSAGE_LEN, TRUE)
if(newlaws && pai)
pai.add_supplied_law(0,newlaws)
if("toggle_holo")
@@ -274,7 +274,7 @@
/obj/item/grenade/chem_grenade/adv_release/multitool_act(mob/living/user, obj/item/tool)
if (active)
return
var/newspread = text2num(stripped_input(user, "Please enter a new spread amount", name))
var/newspread = tgui_input_number(user, "Please enter a new spread amount", name)
if (newspread != null && user.canUseTopic(src, BE_CLOSE))
newspread = round(newspread)
unit_spread = clamp(newspread, 5, 100)
+1 -1
View File
@@ -149,7 +149,7 @@
return ..()
if(weapon.tool_behaviour == TOOL_MULTITOOL)
var/newtime = text2num(stripped_input(user, "Please enter a new detonation time", name))
var/newtime = tgui_input_number(user, "Please enter a new detonation time", name)
if (newtime != null && user.canUseTopic(src, BE_CLOSE))
if(change_det_time(newtime))
to_chat(user, span_notice("You modify the time delay. It's set for [DisplayTimeText(det_time)]."))
+1 -2
View File
@@ -516,8 +516,7 @@
if(is_zero_amount(delete_if_zero = TRUE))
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
var/max = get_amount()
var/stackmaterial = round(input(user, "How many sheets do you wish to take out of this stack? (Maximum [max])", "Stack Split") as null|num)
max = get_amount()
var/stackmaterial = round(tgui_input_number(user, "How many sheets do you wish to take out of this stack?", "Stack Split", max_value = max))
stackmaterial = min(max, stackmaterial)
if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, FALSE, !iscyborg(user)))
return SECONDARY_ATTACK_CONTINUE_CHAIN