mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 13:09:11 +01:00
Input Conversion Part 2
This commit is contained in:
@@ -261,7 +261,7 @@
|
||||
if("max")
|
||||
target_pressure = max_pressure_setting
|
||||
if("set")
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure Control",src.target_pressure) as num
|
||||
var/new_pressure = tgui_input_number(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure Control",src.target_pressure,max_pressure_setting,0)
|
||||
src.target_pressure = between(0, new_pressure, max_pressure_setting)
|
||||
|
||||
if("set_flow_rate")
|
||||
@@ -272,7 +272,7 @@
|
||||
if("max")
|
||||
set_flow_rate = air1.volume
|
||||
if("set")
|
||||
var/new_flow_rate = input(usr,"Enter new flow rate limit (0-[air1.volume]L/s)","Flow Rate Control",src.set_flow_rate) as num
|
||||
var/new_flow_rate = tgui_input_number(usr,"Enter new flow rate limit (0-[air1.volume]L/s)","Flow Rate Control",src.set_flow_rate,air1.volume,0)
|
||||
src.set_flow_rate = between(0, new_flow_rate, air1.volume)
|
||||
|
||||
update_icon()
|
||||
|
||||
@@ -225,7 +225,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
if("max")
|
||||
target_pressure = max_pressure_setting
|
||||
if("set")
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure control",src.target_pressure) as num
|
||||
var/new_pressure = tgui_input_number(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure control",src.target_pressure,max_pressure_setting,0)
|
||||
src.target_pressure = between(0, new_pressure, max_pressure_setting)
|
||||
. = TRUE
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
if("set_flow_rate")
|
||||
if(!configuring || use_power)
|
||||
return
|
||||
var/new_flow_rate = input(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate) as num
|
||||
var/new_flow_rate = tgui_input_number(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate,max_flow_rate,0)
|
||||
set_flow_rate = between(0, new_flow_rate, max_flow_rate)
|
||||
. = TRUE
|
||||
if("switch_mode")
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
. = TRUE
|
||||
if(!configuring || use_power)
|
||||
return
|
||||
var/new_flow_rate = input(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate) as num
|
||||
var/new_flow_rate = tgui_input_number(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate,max_flow_rate,0)
|
||||
set_flow_rate = between(0, new_flow_rate, max_flow_rate)
|
||||
if("switch_mode")
|
||||
. = TRUE
|
||||
@@ -265,7 +265,7 @@
|
||||
if(non_locked < 1)
|
||||
return
|
||||
|
||||
var/new_con = (input(usr,"Enter a new concentration (0-[round(remain_con * 100, 0.5)])%","Concentration control", min(remain_con, old_con)*100) as num) / 100
|
||||
var/new_con = (tgui_input_number(usr,"Enter a new concentration (0-[round(remain_con * 100, 0.5)])%","Concentration control", min(remain_con, old_con)*100, round(comain_con * 100, 0.5), 0)) / 100
|
||||
|
||||
//cap it between 0 and the max remaining concentration
|
||||
new_con = between(0, new_con, remain_con)
|
||||
|
||||
@@ -214,8 +214,8 @@ var/global/list/Holiday = list() //Holidays are lists now, so we can have more t
|
||||
|
||||
Holiday = list()
|
||||
|
||||
var/H = input(src,"What holiday is it today?","Set Holiday") as text
|
||||
var/B = input(src,"Now explain what the holiday is about","Set Holiday") as message
|
||||
var/H = tgui_input_text(src,"What holiday is it today?","Set Holiday")
|
||||
var/B = tgui_input_text(src,"Now explain what the holiday is about","Set Holiday", multiline = TRUE)
|
||||
|
||||
|
||||
Holiday[H] = B
|
||||
|
||||
@@ -59,23 +59,23 @@ var/global/list/additional_antag_types = list()
|
||||
var/choice = ""
|
||||
switch(href_list["set"])
|
||||
if("shuttle_delay")
|
||||
choice = input(usr, "Enter a new shuttle delay multiplier") as num
|
||||
choice = tgui_input_number(usr, "Enter a new shuttle delay multiplier", null, null, 20, 1)
|
||||
if(!choice || choice < 1 || choice > 20)
|
||||
return
|
||||
shuttle_delay = choice
|
||||
if("antag_scaling")
|
||||
choice = input(usr, "Enter a new antagonist cap scaling coefficient.") as num
|
||||
choice = tgui_input_number(usr, "Enter a new antagonist cap scaling coefficient.", null, null, 100, 0)
|
||||
if(isnull(choice) || choice < 0 || choice > 100)
|
||||
return
|
||||
antag_scaling_coeff = choice
|
||||
if("event_modifier_moderate")
|
||||
choice = input(usr, "Enter a new moderate event time modifier.") as num
|
||||
choice = tgui_input_number(usr, "Enter a new moderate event time modifier.", null, null, 100, 0)
|
||||
if(isnull(choice) || choice < 0 || choice > 100)
|
||||
return
|
||||
event_delay_mod_moderate = choice
|
||||
refresh_event_modifiers()
|
||||
if("event_modifier_severe")
|
||||
choice = input(usr, "Enter a new moderate event time modifier.") as num
|
||||
choice = tgui_input_number(usr, "Enter a new moderate event time modifier.", null, null, 100, 0)
|
||||
if(isnull(choice) || choice < 0 || choice > 100)
|
||||
return
|
||||
event_delay_mod_major = choice
|
||||
|
||||
@@ -124,10 +124,10 @@
|
||||
if("Location")
|
||||
mode = 1
|
||||
|
||||
var/locationx = input(usr, "Please input the x coordinate to search for.", "Location?" , "") as num
|
||||
var/locationx = tgui_input_number(usr, "Please input the x coordinate to search for.", "Location?" , "")
|
||||
if(!locationx || !(usr in view(1,src)))
|
||||
return
|
||||
var/locationy = input(usr, "Please input the y coordinate to search for.", "Location?" , "") as num
|
||||
var/locationy = tgui_input_number(usr, "Please input the y coordinate to search for.", "Location?" , "")
|
||||
if(!locationy || !(usr in view(1,src)))
|
||||
return
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ update_flag
|
||||
pressure = 10*ONE_ATMOSPHERE
|
||||
. = TRUE
|
||||
else if(pressure == "input")
|
||||
pressure = input(usr, "New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure) as num|null
|
||||
pressure = tgui_input_number(usr, "New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure, 10*ONE_ATMOSPHERE, ONE_ATMOSPHERE/10)
|
||||
if(!isnull(pressure) && !..())
|
||||
. = TRUE
|
||||
else if(text2num(pressure) != null)
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
if(W.is_screwdriver())
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
|
||||
var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT))
|
||||
var/input = sanitize(tgui_input_text(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT))
|
||||
if(!input)
|
||||
to_chat(usr, "No input found please hang up and try your call again.")
|
||||
return
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
var/area/camera_area = get_area(src)
|
||||
var/temptag = "[sanitize(camera_area.name)] ([rand(1, 999)])"
|
||||
input = sanitizeSafe(input(usr, "How would you like to name the camera?", "Set Camera Name", camera_name ? camera_name : temptag), MAX_NAME_LEN)
|
||||
input = sanitizeSafe(tgui_input_text(usr, "How would you like to name the camera?", "Set Camera Name", camera_name ? camera_name : temptag), MAX_NAME_LEN)
|
||||
|
||||
state = 4
|
||||
var/obj/machinery/camera/C = new(src.loc)
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
if(is_authenticated() && modify)
|
||||
var/t1 = params["assign_target"]
|
||||
if(t1 == "Custom")
|
||||
var/temp_t = sanitize(input(usr, "Enter a custom job assignment.","Assignment"), 45)
|
||||
var/temp_t = sanitize(tgui_input_text(usr, "Enter a custom job assignment.","Assignment"), 45)
|
||||
//let custom jobs function as an impromptu alt title, mainly for sechuds
|
||||
if(temp_t && modify)
|
||||
modify.assignment = temp_t
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
. = TRUE
|
||||
|
||||
if("network")
|
||||
var/newnet = input(usr, "Specify the new network for this machine. This will break all current links.", src, network) as null|text
|
||||
var/newnet = tgui_input_text(usr, "Specify the new network for this machine. This will break all current links.", src, network)
|
||||
if(newnet && canAccess(usr))
|
||||
|
||||
if(length(newnet) > 15)
|
||||
|
||||
@@ -40,7 +40,7 @@ var/global/datum/book_manager/book_mgr = new()
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
return
|
||||
|
||||
var/isbn = input(usr, "ISBN number?", "Delete Book") as num | null
|
||||
var/isbn = tgui_input_number(usr, "ISBN number?", "Delete Book")
|
||||
if(!isbn)
|
||||
return
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
if("send_message")
|
||||
var/obj/item/mecha_parts/mecha_tracking/MT = locate(params["mt"])
|
||||
if(istype(MT))
|
||||
var/message = sanitize(input(usr, "Input message", "Transmit message") as text)
|
||||
var/message = sanitize(tgui_input_text(usr, "Input message", "Transmit message"))
|
||||
var/obj/mecha/M = MT.in_mecha()
|
||||
if(message && M)
|
||||
M.occupant_message(message)
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
var/obj/effect/spawner/newbomb/proto = /obj/effect/spawner/newbomb/radio/custom
|
||||
|
||||
var/p = input(usr, "Enter phoron amount (mol):","Phoron", initial(proto.phoron_amt)) as num|null
|
||||
var/p = tgui_input_number(usr, "Enter phoron amount (mol):","Phoron", initial(proto.phoron_amt))
|
||||
if(p == null) return
|
||||
|
||||
var/o = input(usr, "Enter oxygen amount (mol):","Oxygen", initial(proto.oxygen_amt)) as num|null
|
||||
var/o = tgui_input_number(usr, "Enter oxygen amount (mol):","Oxygen", initial(proto.oxygen_amt))
|
||||
if(o == null) return
|
||||
|
||||
var/c = input(usr, "Enter carbon dioxide amount (mol):","Carbon Dioxide", initial(proto.carbon_amt)) as num|null
|
||||
var/c = tgui_input_number(usr, "Enter carbon dioxide amount (mol):","Carbon Dioxide", initial(proto.carbon_amt))
|
||||
if(c == null) return
|
||||
|
||||
new /obj/effect/spawner/newbomb/radio/custom(get_turf(mob), p, o, c)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/client/proc/kaboom()
|
||||
var/power = input(src, "power?", "power?") as num
|
||||
var/power = tgui_input_number(src, "power?", "power?")
|
||||
var/turf/T = get_turf(src.mob)
|
||||
explosion_rec(T, power)
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
/obj/structure/closet/body_bag/attackby(var/obj/item/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/pen))
|
||||
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
|
||||
var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null)
|
||||
if (user.get_active_hand() != W)
|
||||
return
|
||||
if (!in_range(src, user) && src.loc != user)
|
||||
|
||||
@@ -322,7 +322,7 @@
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("rename")
|
||||
var/new_name = sanitizeSafe(input(usr,"Please enter your name.","Communicator",usr.name) )
|
||||
var/new_name = sanitizeSafe(tgui_input_text(usr,"Please enter your name.","Communicator",usr.name) )
|
||||
if(new_name)
|
||||
register_device(new_name)
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
to_chat(user, "<span class='warning'>The MMI must go in after everything else!</span>")
|
||||
|
||||
if (istype(W, /obj/item/weapon/pen))
|
||||
var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
|
||||
if (!t)
|
||||
return
|
||||
if (!in_range(src, usr) && src.loc != usr)
|
||||
|
||||
@@ -399,7 +399,7 @@
|
||||
|
||||
/obj/item/stack/attack_hand(mob/user as mob)
|
||||
if (user.get_inactive_hand() == src)
|
||||
var/N = input(usr, "How many stacks of [src] would you like to split off? There are currently [amount].", "Split stacks", 1) as num|null
|
||||
var/N = tgui_input_number(usr, "How many stacks of [src] would you like to split off? There are currently [amount].", "Split stacks", 1, amount, 1)
|
||||
if(N)
|
||||
var/obj/item/stack/F = src.split(N)
|
||||
if (F)
|
||||
|
||||
@@ -843,7 +843,7 @@
|
||||
if(!M.mind)
|
||||
return 0
|
||||
|
||||
var/input = sanitizeSafe(input(usr, "What do you want to name the plushie?", ,""), MAX_NAME_LEN)
|
||||
var/input = sanitizeSafe(tgui_input_text(usr, "What do you want to name the plushie?", ,""), MAX_NAME_LEN)
|
||||
|
||||
if(src && input && !M.stat && in_range(M,src))
|
||||
name = input
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
to_chat(user, "<span class='warning'>Circuit controls are locked.</span>")
|
||||
return
|
||||
var/existing_networks = jointext(network,",")
|
||||
var/input = sanitize(input(usr, "Which networks would you like to connect this camera console circuit to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Multitool-Circuitboard interface", existing_networks))
|
||||
var/input = sanitize(tgui_input_text(usr, "Which networks would you like to connect this camera console circuit to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Multitool-Circuitboard interface", existing_networks))
|
||||
if(!input)
|
||||
to_chat(usr, "No input found please hang up and try your call again.")
|
||||
return
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
..()
|
||||
|
||||
/obj/item/weapon/plastique/attack_self(mob/user as mob)
|
||||
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
|
||||
var/newtime = tgui_input_number(usr, "Please set the timer.", "Timer", 10, 60000, 10)
|
||||
if(user.get_active_hand() == src)
|
||||
newtime = CLAMP(newtime, 10, 60000)
|
||||
timer = newtime
|
||||
|
||||
@@ -288,7 +288,7 @@ Implant Specifics:<BR>"}
|
||||
|
||||
/obj/item/weapon/implant/explosive/post_implant(mob/source as mob)
|
||||
elevel = tgui_alert(usr, "What sort of explosion would you prefer?", "Implant Intent", list("Localized Limb", "Destroy Body", "Full Explosion"))
|
||||
phrase = input(usr, "Choose activation phrase:") as text
|
||||
phrase = tgui_input_text(usr, "Choose activation phrase:")
|
||||
var/list/replacechars = list("'" = "","\"" = "",">" = "","<" = "","(" = "",")" = "")
|
||||
phrase = replace_characters(phrase, replacechars)
|
||||
usr.mind.store_memory("Explosive implant in [source] can be activated by saying something containing the phrase ''[src.phrase]'', <B>say [src.phrase]</B> to attempt to activate.", 0, 0)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
/obj/item/weapon/implantcase/attackby(obj/item/weapon/I as obj, mob/user as mob)
|
||||
..()
|
||||
if (istype(I, /obj/item/weapon/pen))
|
||||
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
|
||||
var/t = tgui_input_text(user, "What would you like the label to be?", text("[]", src.name), null)
|
||||
if (user.get_active_hand() != I)
|
||||
return
|
||||
if((!in_range(src, usr) && src.loc != user))
|
||||
|
||||
@@ -338,7 +338,7 @@
|
||||
var/mins = 0
|
||||
if(minutes > CMinutes)
|
||||
mins = minutes - CMinutes
|
||||
mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null
|
||||
mins = tgui_input_number(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440)
|
||||
if(!mins) return
|
||||
mins = min(525599,mins)
|
||||
minutes = CMinutes + mins
|
||||
@@ -1867,7 +1867,7 @@
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_set_wanted_desc"])
|
||||
src.admincaster_feed_message.body = sanitize(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
|
||||
src.admincaster_feed_message.body = sanitize(tgui_input_text(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
|
||||
src.access_news_network()
|
||||
|
||||
else if(href_list["ac_submit_wanted"])
|
||||
|
||||
@@ -478,7 +478,7 @@
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
if(ishuman(usr) || istype(usr, /mob/living/silicon/robot))
|
||||
casinoslave_price = input("Select the desired price (1-1000)", "Set Price") as num
|
||||
casinoslave_price = tgui_input_number("Select the desired price (1-1000)", "Set Price", null, null, 1000, 1)
|
||||
if(casinoslave_price>1000 || casinoslave_price<1)
|
||||
to_chat(user,"<span class='notice'>Invalid price.</span> ")
|
||||
return
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
else if(href_list["age"])
|
||||
var/min_age = get_min_age()
|
||||
var/max_age = get_max_age()
|
||||
var/new_age = input(user, "Choose your character's age:\n([min_age]-[max_age])", "Character Preference", pref.age) as num|null
|
||||
var/new_age = tgui_input_number(user, "Choose your character's age:\n([min_age]-[max_age])", "Character Preference", pref.age, max_age, min_age)
|
||||
if(new_age && CanUseTopic(user))
|
||||
pref.age = max(min(round(text2num(new_age)), max_age), min_age)
|
||||
return TOPIC_REFRESH
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
var/char
|
||||
var/keys[0]
|
||||
do
|
||||
char = input(usr, "Enter a single special character.\nYou may re-select the same characters.\nThe following characters are already in use by radio: ; : .\nThe following characters are already in use by special say commands: ! * ^", "Enter Character - [3 - keys.len] remaining") as null|text
|
||||
char = tgui_input_text(usr, "Enter a single special character.\nYou may re-select the same characters.\nThe following characters are already in use by radio: ; : .\nThe following characters are already in use by special say commands: ! * ^", "Enter Character - [3 - keys.len] remaining")
|
||||
if(char)
|
||||
if(length(char) > 1)
|
||||
tgui_alert_async(user, "Only single characters allowed.", "Error")
|
||||
|
||||
@@ -777,7 +777,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
else if(href_list["skin_tone"])
|
||||
if(!has_flag(mob_species, HAS_SKIN_TONE))
|
||||
return TOPIC_NOACTION
|
||||
var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference", (-pref.s_tone) + 35) as num|null
|
||||
var/new_s_tone = tgui_input_number(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference", (-pref.s_tone) + 35, 220, 1)
|
||||
if(new_s_tone && has_flag(mob_species, HAS_SKIN_TONE) && CanUseTopic(user))
|
||||
pref.s_tone = 35 - max(min( round(new_s_tone), 220),1)
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
@@ -59,11 +59,11 @@
|
||||
switch(href_list["flavor_text"])
|
||||
if("open")
|
||||
if("general")
|
||||
var/msg = sanitize(input(usr,"Give a general description of your character. This will be shown regardless of clothings.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]])) as message, extra = 0) //VOREStation Edit: separating out OOC notes
|
||||
var/msg = sanitize(tgui_input_text(usr,"Give a general description of your character. This will be shown regardless of clothings.","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE), extra = 0) //VOREStation Edit: separating out OOC notes
|
||||
if(CanUseTopic(user))
|
||||
pref.flavor_texts[href_list["flavor_text"]] = msg
|
||||
else
|
||||
var/msg = sanitize(input(usr,"Set the flavor text for your [href_list["flavor_text"]].","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]])) as message, extra = 0)
|
||||
var/msg = sanitize(tgui_input_text(usr,"Set the flavor text for your [href_list["flavor_text"]].","Flavor Text",html_decode(pref.flavor_texts[href_list["flavor_text"]]), multiline = TRUE), extra = 0)
|
||||
if(CanUseTopic(user))
|
||||
pref.flavor_texts[href_list["flavor_text"]] = msg
|
||||
SetFlavorText(user)
|
||||
@@ -73,11 +73,11 @@
|
||||
switch(href_list["flavour_text_robot"])
|
||||
if("open")
|
||||
if("Default")
|
||||
var/msg = sanitize(input(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"])) as message, extra = 0)
|
||||
var/msg = sanitize(tgui_input_text(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(pref.flavour_texts_robot["Default"]), multiline = TRUE), extra = 0)
|
||||
if(CanUseTopic(user))
|
||||
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
|
||||
else
|
||||
var/msg = sanitize(input(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]])) as message, extra = 0)
|
||||
var/msg = sanitize(tgui_input_text(usr,"Set the flavour text for your robot with [href_list["flavour_text_robot"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(pref.flavour_texts_robot[href_list["flavour_text_robot"]]), multiline = TRUE), extra = 0)
|
||||
if(CanUseTopic(user))
|
||||
pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg
|
||||
SetFlavourTextRobot(user)
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["select_alpha"])
|
||||
var/UI_style_alpha_new = input(user, "Select UI alpha (transparency) level, between 50 and 255.", "Global Preference", pref.UI_style_alpha) as num|null
|
||||
var/UI_style_alpha_new = tgui_input_number(user, "Select UI alpha (transparency) level, between 50 and 255.", "Global Preference", pref.UI_style_alpha, 255, 50)
|
||||
if(isnull(UI_style_alpha_new) || (UI_style_alpha_new < 50 || UI_style_alpha_new > 255) || !CanUseTopic(user)) return TOPIC_NOACTION
|
||||
pref.UI_style_alpha = UI_style_alpha_new
|
||||
return TOPIC_REFRESH
|
||||
@@ -100,7 +100,7 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["select_client_fps"])
|
||||
var/fps_new = input(user, "Input Client FPS (1-200, 0 uses server FPS)", "Global Preference", pref.client_fps) as null|num
|
||||
var/fps_new = tgui_input_number(user, "Input Client FPS (1-200, 0 uses server FPS)", "Global Preference", pref.client_fps, 200, 1)
|
||||
if(isnull(fps_new) || !CanUseTopic(user)) return TOPIC_NOACTION
|
||||
if(fps_new < 0 || fps_new > MAX_CLIENT_FPS) return TOPIC_NOACTION
|
||||
pref.client_fps = fps_new
|
||||
@@ -109,14 +109,14 @@
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["select_ambience_freq"])
|
||||
var/ambience_new = input(user, "Input how often you wish to hear ambience repeated! (1-60 MINUTES, 0 for disabled)", "Global Preference", pref.ambience_freq) as null|num
|
||||
var/ambience_new = tgui_input_number(user, "Input how often you wish to hear ambience repeated! (1-60 MINUTES, 0 for disabled)", "Global Preference", pref.ambience_freq, 60, 0)
|
||||
if(isnull(ambience_new) || !CanUseTopic(user)) return TOPIC_NOACTION
|
||||
if(ambience_new < 0 || ambience_new > 60) return TOPIC_NOACTION
|
||||
pref.ambience_freq = ambience_new
|
||||
return TOPIC_REFRESH
|
||||
|
||||
else if(href_list["select_ambience_chance"])
|
||||
var/ambience_chance_new = input(user, "Input the chance you'd like to hear ambience played to you (On area change, or by random ambience). 35 means a 35% chance to play ambience. This is a range from 0-100. 0 disables ambience playing entirely. This is also affected by Ambience Frequency.", "Global Preference", pref.ambience_freq) as null|num
|
||||
var/ambience_chance_new = tgui_input_number(user, "Input the chance you'd like to hear ambience played to you (On area change, or by random ambience). 35 means a 35% chance to play ambience. This is a range from 0-100. 0 disables ambience playing entirely. This is also affected by Ambience Frequency.", "Global Preference", pref.ambience_freq, 100, 0)
|
||||
if(isnull(ambience_chance_new) || !CanUseTopic(user)) return TOPIC_NOACTION
|
||||
if(ambience_chance_new < 0 || ambience_chance_new > 100) return TOPIC_NOACTION
|
||||
pref.ambience_chance = ambience_chance_new
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
var/channel = href_list["change_volume"]
|
||||
if(!(channel in pref.volume_channels))
|
||||
pref.volume_channels["[channel]"] = 1
|
||||
var/value = input(usr, "Choose your volume for [channel] (0-200%)", "[channel] volume", (pref.volume_channels[channel] * 100))
|
||||
var/value = tgui_input_number(usr, "Choose your volume for [channel] (0-200%)", "[channel] volume", (pref.volume_channels[channel] * 100), 200, 0)
|
||||
if(isnum(value))
|
||||
value = CLAMP(value, 0, 200)
|
||||
pref.volume_channels["[channel]"] = (value / 100)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
/datum/category_item/player_setup_item/volume_sliders/media/OnTopic(var/href, var/list/href_list, var/mob/user)
|
||||
if(href_list["change_media_volume"])
|
||||
if(CanUseTopic(user))
|
||||
var/value = input(usr, "Choose your Jukebox volume (0-100%)", "Jukebox volume", round(pref.media_volume * 100))
|
||||
var/value = tgui_input_number(usr, "Choose your Jukebox volume (0-100%)", "Jukebox volume", round(pref.media_volume * 100), 100, 0)
|
||||
if(isnum(value))
|
||||
value = CLAMP(value, 0, 100)
|
||||
pref.media_volume = value/100.0
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
/datum/category_item/player_setup_item/vore/size/OnTopic(var/href, var/list/href_list, var/mob/user)
|
||||
if(href_list["size_multiplier"])
|
||||
var/new_size = input(user, "Choose your character's size, ranging from 25% to 200%", "Set Size") as num|null
|
||||
var/new_size = tgui_input_number(user, "Choose your character's size, ranging from 25% to 200%", "Set Size", null, 200, 25)
|
||||
if (!ISINRANGE(new_size,25,200))
|
||||
pref.size_multiplier = 1
|
||||
to_chat(user, "<span class='notice'>Invalid size.</span>")
|
||||
@@ -72,11 +72,11 @@
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
else if(href_list["weight"])
|
||||
var/new_weight = input(user, "Choose your character's relative body weight.\n\
|
||||
var/new_weight = tgui_input_number(user, "Choose your character's relative body weight.\n\
|
||||
This measurement should be set relative to a normal 5'10'' person's body and not the actual size of your character.\n\
|
||||
If you set your weight to 500 because you're a naga or have metal implants then complain that you're a blob I\n\
|
||||
swear to god I will find you and I will punch you for not reading these directions!\n\
|
||||
([WEIGHT_MIN]-[WEIGHT_MAX])", "Character Preference") as num|null
|
||||
([WEIGHT_MIN]-[WEIGHT_MAX])", "Character Preference", null, WEIGHT_MAX, WEIGHT_MIN)
|
||||
if(new_weight)
|
||||
var/unit_of_measurement = tgui_alert(user, "Is that number in pounds (lb) or kilograms (kg)?", "Confirmation", list("Pounds", "Kilograms"))
|
||||
if(unit_of_measurement == "Pounds")
|
||||
|
||||
@@ -127,12 +127,12 @@
|
||||
creating_new_account = 1
|
||||
|
||||
if("add_funds")
|
||||
var/amount = input(usr, "Enter the amount you wish to add", "Silently add funds") as num
|
||||
var/amount = tgui_input_number(usr, "Enter the amount you wish to add", "Silently add funds")
|
||||
if(detailed_account_view)
|
||||
detailed_account_view.money = min(detailed_account_view.money + amount, fund_cap)
|
||||
|
||||
if("remove_funds")
|
||||
var/amount = input(usr, "Enter the amount you wish to remove", "Silently remove funds") as num
|
||||
var/amount = tgui_input_number(usr, "Enter the amount you wish to remove", "Silently remove funds")
|
||||
if(detailed_account_view)
|
||||
detailed_account_view.money = max(detailed_account_view.money - amount, -fund_cap)
|
||||
|
||||
|
||||
@@ -145,9 +145,9 @@
|
||||
if(href_list["choice"])
|
||||
switch(href_list["choice"])
|
||||
if("change_code")
|
||||
var/attempt_code = input(usr, "Re-enter the current EFTPOS access code", "Confirm old EFTPOS code") as num
|
||||
var/attempt_code = tgui_input_number(usr, "Re-enter the current EFTPOS access code", "Confirm old EFTPOS code")
|
||||
if(attempt_code == access_code)
|
||||
var/trycode = input(usr, "Enter a new access code for this device (4-6 digits, numbers only)", "Enter new EFTPOS code") as num
|
||||
var/trycode = tgui_input_number(usr, "Enter a new access code for this device (4-6 digits, numbers only)", "Enter new EFTPOS code", null, 999999, 1000)
|
||||
if(trycode >= 1000 && trycode <= 999999)
|
||||
access_code = trycode
|
||||
else
|
||||
@@ -163,8 +163,8 @@
|
||||
else
|
||||
to_chat(usr, "[bicon(src)]<span class='warning'>Incorrect code entered.</span>")
|
||||
if("link_account")
|
||||
var/attempt_account_num = input(usr, "Enter account number to pay EFTPOS charges into", "New account number") as num
|
||||
var/attempt_pin = input(usr, "Enter pin code", "Account pin") as num
|
||||
var/attempt_account_num = tgui_input_number(usr, "Enter account number to pay EFTPOS charges into", "New account number")
|
||||
var/attempt_pin = tgui_input_number(usr, "Enter pin code", "Account pin")
|
||||
linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1)
|
||||
if(linked_account)
|
||||
if(linked_account.suspended)
|
||||
@@ -176,7 +176,7 @@
|
||||
var/choice = sanitize(input(usr, "Enter reason for EFTPOS transaction", "Transaction purpose"))
|
||||
if(choice) transaction_purpose = choice
|
||||
if("trans_value")
|
||||
var/try_num = input(usr, "Enter amount for EFTPOS transaction", "Transaction amount") as num
|
||||
var/try_num = tgui_input_number(usr, "Enter amount for EFTPOS transaction", "Transaction amount")
|
||||
if(try_num < 0)
|
||||
tgui_alert_async(usr, "That is not a valid amount!")
|
||||
else
|
||||
@@ -187,7 +187,7 @@
|
||||
transaction_locked = 0
|
||||
transaction_paid = 0
|
||||
else
|
||||
var/attempt_code = input(usr, "Enter EFTPOS access code", "Reset Transaction") as num
|
||||
var/attempt_code = tgui_input_number(usr, "Enter EFTPOS access code", "Reset Transaction")
|
||||
if(attempt_code == access_code)
|
||||
transaction_locked = 0
|
||||
transaction_paid = 0
|
||||
@@ -229,7 +229,7 @@
|
||||
var/attempt_pin = ""
|
||||
var/datum/money_account/D = get_account(C.associated_account_number)
|
||||
if(D.security_level)
|
||||
attempt_pin = input(usr, "Enter pin code", "EFTPOS transaction") as num
|
||||
attempt_pin = tgui_input_number(usr, "Enter pin code", "EFTPOS transaction")
|
||||
D = null
|
||||
D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
|
||||
if(D)
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
return worth
|
||||
|
||||
/obj/item/weapon/spacecash/attack_self()
|
||||
var/amount = input(usr, "How many [initial_name]s do you want to take? (0 to [src.worth])", "Take Money", 20) as num
|
||||
var/amount = tgui_input_number(usr, "How many [initial_name]s do you want to take? (0 to [src.worth])", "Take Money", 20)
|
||||
if(!src || QDELETED(src))
|
||||
return
|
||||
amount = round(CLAMP(amount, 0, src.worth))
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
if("toggle_cash_lock")
|
||||
cash_locked = !cash_locked
|
||||
if("link_account")
|
||||
var/attempt_account_num = input(usr, "Enter account number", "New account number") as num
|
||||
var/attempt_pin = input(usr, "Enter PIN", "Account PIN") as num
|
||||
var/attempt_account_num = tgui_input_number(usr, "Enter account number", "New account number")
|
||||
var/attempt_pin = tgui_input_number(usr, "Enter PIN", "Account PIN")
|
||||
linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1)
|
||||
if(linked_account)
|
||||
if(linked_account.suspended)
|
||||
@@ -117,11 +117,11 @@
|
||||
else
|
||||
to_chat(usr, "[bicon(src)]<span class='warning'>Account not found.</span>")
|
||||
if("custom_order")
|
||||
var/t_purpose = sanitize(input(usr, "Enter purpose", "New purpose") as text)
|
||||
var/t_purpose = sanitize(tgui_input_text(usr, "Enter purpose", "New purpose"))
|
||||
if (!t_purpose || !Adjacent(usr)) return
|
||||
transaction_purpose = t_purpose
|
||||
item_list += t_purpose
|
||||
var/t_amount = round(input(usr, "Enter price", "New price") as num)
|
||||
var/t_amount = round(tgui_input_number(usr, "Enter price", "New price"))
|
||||
if (!t_amount || !Adjacent(usr) || t_amount < 0) return
|
||||
transaction_amount += t_amount
|
||||
price_list += t_amount
|
||||
@@ -129,7 +129,7 @@
|
||||
src.visible_message("[bicon(src)][transaction_purpose]: [t_amount] Thaler\s.")
|
||||
if("set_amount")
|
||||
var/item_name = locate(href_list["item"])
|
||||
var/n_amount = round(input(usr, "Enter amount", "New amount") as num)
|
||||
var/n_amount = round(tgui_input_number(usr, "Enter amount", "New amount"))
|
||||
n_amount = CLAMP(n_amount, 0, 20)
|
||||
if (!item_list[item_name] || !Adjacent(usr)) return
|
||||
transaction_amount += (n_amount - item_list[item_name]) * price_list[item_name]
|
||||
@@ -234,7 +234,7 @@
|
||||
var/datum/money_account/D = get_account(I.associated_account_number)
|
||||
var/attempt_pin = ""
|
||||
if(D && D.security_level)
|
||||
attempt_pin = input(usr, "Enter PIN", "Transaction") as num
|
||||
attempt_pin = tgui_input_number(usr, "Enter PIN", "Transaction")
|
||||
D = null
|
||||
D = attempt_account_access(I.associated_account_number, attempt_pin, 2)
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
return worth
|
||||
|
||||
/obj/item/weapon/spacecasinocash/attack_self()
|
||||
var/amount = input(usr, "How much credits worth of chips do you want to take? (0 to [src.worth])", "Take chips", 20) as num
|
||||
var/amount = tgui_input_number(usr, "How much credits worth of chips do you want to take? (0 to [src.worth])", "Take chips", 20)
|
||||
if(!src || QDELETED(src))
|
||||
return
|
||||
amount = round(CLAMP(amount, 0, src.worth))
|
||||
|
||||
@@ -101,8 +101,8 @@
|
||||
else
|
||||
to_chat(usr, "[bicon(src)]<span class='warning'>Insufficient access.</span>")
|
||||
if("link_account")
|
||||
var/attempt_account_num = input(usr, "Enter account number", "New account number") as num
|
||||
var/attempt_pin = input(usr, "Enter PIN", "Account PIN") as num
|
||||
var/attempt_account_num = tgui_input_number(usr, "Enter account number", "New account number")
|
||||
var/attempt_pin = tgui_input_number(usr, "Enter PIN", "Account PIN")
|
||||
linked_account = attempt_account_access(attempt_account_num, attempt_pin, 1)
|
||||
if(linked_account)
|
||||
if(linked_account.suspended)
|
||||
@@ -111,11 +111,11 @@
|
||||
else
|
||||
to_chat(usr, "[bicon(src)]<span class='warning'>Account not found.</span>")
|
||||
if("custom_order")
|
||||
var/t_purpose = sanitize(input(usr, "Enter purpose", "New purpose") as text)
|
||||
var/t_purpose = sanitize(tgui_input_text(usr, "Enter purpose", "New purpose"))
|
||||
if (!t_purpose || !Adjacent(usr)) return
|
||||
transaction_purpose = t_purpose
|
||||
item_list += t_purpose
|
||||
var/t_amount = round(input(usr, "Enter price", "New price") as num)
|
||||
var/t_amount = round(tgui_input_number(usr, "Enter price", "New price"))
|
||||
if (!t_amount || !Adjacent(usr)) return
|
||||
transaction_amount += t_amount
|
||||
price_list += t_amount
|
||||
@@ -123,7 +123,7 @@
|
||||
src.visible_message("[bicon(src)][transaction_purpose]: [t_amount] Thaler\s.")
|
||||
if("set_amount")
|
||||
var/item_name = locate(href_list["item"])
|
||||
var/n_amount = round(input(usr, "Enter amount", "New amount") as num)
|
||||
var/n_amount = round(tgui_input_number(usr, "Enter amount", "New amount"))
|
||||
n_amount = CLAMP(n_amount, 0, 20)
|
||||
if (!item_list[item_name] || !Adjacent(usr)) return
|
||||
transaction_amount += (n_amount - item_list[item_name]) * price_list[item_name]
|
||||
@@ -211,7 +211,7 @@
|
||||
var/datum/money_account/D = get_account(I.associated_account_number)
|
||||
var/attempt_pin = ""
|
||||
if(D && D.security_level)
|
||||
attempt_pin = input(usr, "Enter PIN", "Transaction") as num
|
||||
attempt_pin = tgui_input_number(usr, "Enter PIN", "Transaction")
|
||||
D = null
|
||||
D = attempt_account_access(I.associated_account_number, attempt_pin, 2)
|
||||
|
||||
|
||||
@@ -327,7 +327,7 @@ GLOBAL_LIST_EMPTY(vending_products)
|
||||
// Have the customer punch in the PIN before checking if there's enough money. Prevents people from figuring out acct is
|
||||
// empty at high security levels
|
||||
if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
|
||||
var/attempt_pin = input(usr, "Enter pin code", "Vendor transaction") as num
|
||||
var/attempt_pin = tgui_input_number(usr, "Enter pin code", "Vendor transaction")
|
||||
customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2)
|
||||
|
||||
if(!customer_account)
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
config.allow_random_events = text2num(href_list["pause_all"])
|
||||
log_and_message_admins("has [config.allow_random_events ? "resumed" : "paused"] countdown for all events.")
|
||||
else if(href_list["interval"])
|
||||
var/delay = input(usr, "Enter delay modifier. A value less than one means events fire more often, higher than one less often.", "Set Interval Modifier") as num|null
|
||||
var/delay = tgui_input_number(usr, "Enter delay modifier. A value less than one means events fire more often, higher than one less often.", "Set Interval Modifier")
|
||||
if(delay && delay > 0)
|
||||
var/datum/event_container/EC = locate(href_list["interval"])
|
||||
EC.delay_modifier = delay
|
||||
@@ -183,7 +183,7 @@
|
||||
var/datum/event_meta/EM = locate(href_list["set_type"])
|
||||
EM.event_type = type
|
||||
else if(href_list["set_weight"])
|
||||
var/weight = input(usr, "Enter weight. A higher value means higher chance for the event of being selected.", "Set Weight") as num|null
|
||||
var/weight = tgui_input_number(usr, "Enter weight. A higher value means higher chance for the event of being selected.", "Set Weight")
|
||||
if(weight && weight > 0)
|
||||
var/datum/event_meta/EM = locate(href_list["set_weight"])
|
||||
EM.weight = weight
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
if(params["amount"])
|
||||
amount = params["amount"]
|
||||
else
|
||||
amount = input(usr, "How many items?", "How many items would you like to take out?", 1) as num|null
|
||||
amount = tgui_input_number(usr, "How many items?", "How many items would you like to take out?", 1)
|
||||
|
||||
if(QDELETED(src) || QDELETED(usr) || !usr.Adjacent(src))
|
||||
return FALSE
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
players += player
|
||||
//players -= usr
|
||||
var/maxcards = max(min(cards.len,10),1)
|
||||
var/dcard = input(usr, "How many card(s) do you wish to deal? You may deal up to [maxcards] cards.") as num
|
||||
var/dcard = tgui_input_number(usr, "How many card(s) do you wish to deal? You may deal up to [maxcards] cards.", null, null, maxcards)
|
||||
if(dcard > maxcards)
|
||||
return
|
||||
var/mob/living/M = tgui_input_list(usr, "Who do you wish to deal [dcard] card(s)?", "Deal to whom?", players)
|
||||
@@ -321,7 +321,7 @@
|
||||
|
||||
var/i
|
||||
var/maxcards = min(cards.len,5) // Maximum of 5 cards at once
|
||||
var/discards = input(usr, "How many cards do you want to discard? You may discard up to [maxcards] card(s)") as num
|
||||
var/discards = tgui_input_number(usr, "How many cards do you want to discard? You may discard up to [maxcards] card(s)", null, null, maxcards, 0)
|
||||
if(discards > maxcards)
|
||||
return
|
||||
for (i = 0;i < discards;i++)
|
||||
|
||||
@@ -191,22 +191,22 @@
|
||||
stop_playing()
|
||||
|
||||
else if(href_list["setlinearfalloff"])
|
||||
var/amount = input(usr, "Set linear sustain duration in seconds", "Linear Sustain Duration") as null|num
|
||||
var/amount = tgui_input_number(usr, "Set linear sustain duration in seconds", "Linear Sustain Duration")
|
||||
if(!isnull(amount))
|
||||
set_linear_falloff_duration(round(amount * 10, world.tick_lag))
|
||||
|
||||
else if(href_list["setexpfalloff"])
|
||||
var/amount = input(usr, "Set exponential sustain factor", "Exponential sustain factor") as null|num
|
||||
var/amount = tgui_input_number(usr, "Set exponential sustain factor", "Exponential sustain factor")
|
||||
if(!isnull(amount))
|
||||
set_exponential_drop_rate(round(amount, 0.00001))
|
||||
|
||||
else if(href_list["setvolume"])
|
||||
var/amount = input(usr, "Set volume", "Volume") as null|num
|
||||
var/amount = tgui_input_number(usr, "Set volume", "Volume")
|
||||
if(!isnull(amount))
|
||||
set_volume(round(amount, 1))
|
||||
|
||||
else if(href_list["setdropoffvolume"])
|
||||
var/amount = input(usr, "Set dropoff threshold", "Dropoff Threshold Volume") as null|num
|
||||
var/amount = tgui_input_number(usr, "Set dropoff threshold", "Dropoff Threshold Volume")
|
||||
if(!isnull(amount))
|
||||
set_dropoff_volume(round(amount, 0.01))
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
set_instrument(choice)
|
||||
|
||||
else if(href_list["setnoteshift"])
|
||||
var/amount = input(usr, "Set note shift", "Note Shift") as null|num
|
||||
var/amount = tgui_input_number(usr, "Set note shift", "Note Shift")
|
||||
if(!isnull(amount))
|
||||
note_shift = clamp(amount, note_shift_min, note_shift_max)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
name = "string pin"
|
||||
|
||||
/datum/integrated_io/string/ask_for_pin_data(mob/user)
|
||||
var/new_data = input(usr, "Please type in a string.","[src] string writing") as null|text
|
||||
var/new_data = tgui_input_text(usr, "Please type in a string.","[src] string writing")
|
||||
new_data = sanitizeSafe(new_data, MAX_MESSAGE_LEN, 0, 0)
|
||||
|
||||
if(new_data && holder.check_interactivity(user) )
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data(O.data)].</span>")
|
||||
if("number")
|
||||
accepting_refs = 0
|
||||
new_data = input(usr, "Now type in a number.","[src] number writing") as null|num
|
||||
new_data = tgui_input_number(usr, "Now type in a number.","[src] number writing")
|
||||
if(isnum(new_data) && CanInteract(user, GLOB.tgui_physical_state))
|
||||
O.data = new_data
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data(O.data)].</span>")
|
||||
|
||||
@@ -928,7 +928,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/mob/living/M = tgui_input_list(src, "Select who to whisper to:", "Whisper to?", options)
|
||||
if(!M)
|
||||
return 0
|
||||
var/msg = sanitize(input(src, "Message:", "Spectral Whisper") as text|null)
|
||||
var/msg = sanitize(tgui_input_text(src, "Message:", "Spectral Whisper"))
|
||||
if(msg)
|
||||
log_say("(SPECWHISP to [key_name(M)]): [msg]", src)
|
||||
to_chat(M, "<span class='warning'> You hear a strange, unidentifiable voice in your head... <font color='purple'>[msg]</font></span>")
|
||||
|
||||
@@ -297,7 +297,7 @@ var/list/_simple_mob_default_emotes = list(
|
||||
|
||||
var/datum/gender/T = gender_datums[get_visible_gender()]
|
||||
|
||||
pose = sanitize(input(usr, "This is [src]. [T.he]...", "Pose", null) as text)
|
||||
pose = sanitize(tgui_input_text(usr, "This is [src]. [T.he]...", "Pose", null))
|
||||
|
||||
/mob/living/carbon/human/verb/set_flavor()
|
||||
set name = "Set Flavour Text"
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
if(!target) return
|
||||
|
||||
text = input(usr, "What would you like to say?", "Speak to creature", null, null)
|
||||
text = tgui_input_text(usr, "What would you like to say?", "Speak to creature", null, null)
|
||||
|
||||
text = sanitize(text)
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
set desc = "Whisper silently to someone over a distance."
|
||||
set category = "Abilities"
|
||||
|
||||
var/msg = sanitize(input(usr, "Message:", "Psychic Whisper") as text|null)
|
||||
var/msg = sanitize(tgui_input_text(usr, "Message:", "Psychic Whisper"))
|
||||
if(msg)
|
||||
log_say("(PWHISPER to [key_name(M)]) [msg]", src)
|
||||
to_chat(M, "<font color='green'>You hear a strange, alien voice in your head... <i>[msg]</i></font>")
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
return
|
||||
|
||||
var/nagmessage = "Adjust your mass to be a size between 25 to 200% (or between 1 to 600% in dorms area). Up-sizing consumes metal, downsizing returns metal."
|
||||
var/new_size = input(user, nagmessage, "Pick a Size", user.size_multiplier*100) as num|null
|
||||
var/new_size = tgui_input_number(user, nagmessage, "Pick a Size", user.size_multiplier*100, 600, 1)
|
||||
if(!new_size || !size_range_check(new_size))
|
||||
return
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
to_chat(src, "<span class='alium'>Their plasma vessel is missing.</span>")
|
||||
return
|
||||
|
||||
var/amount = input(usr, "Amount:", "Transfer Plasma to [M]") as num
|
||||
var/amount = tgui_input_number(usr, "Amount:", "Transfer Plasma to [M]")
|
||||
if (amount)
|
||||
amount = abs(round(amount))
|
||||
if(check_alien_ability(amount,0,O_PLASMA))
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
return
|
||||
|
||||
if(!new_type)
|
||||
new_type = input(usr, "Mob type path:", "Mob type") as text|null
|
||||
new_type = tgui_input_text(usr, "Mob type path:", "Mob type")
|
||||
|
||||
if(istext(new_type))
|
||||
new_type = text2path(new_type)
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
var/input
|
||||
if(!message)
|
||||
input = sanitize_or_reflect(input(src,"Choose an emote to display.") as text|null, src)
|
||||
input = sanitize_or_reflect(tgui_input_text(src,"Choose an emote to display."), src)
|
||||
else
|
||||
input = message
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
to_chat(src, "<span class='warning'>You cannot speak in IC (muted).</span>")
|
||||
return
|
||||
if (!message)
|
||||
message = input(usr, "Type a message to say.","Psay") as text|null
|
||||
message = tgui_input_text(usr, "Type a message to say.","Psay")
|
||||
message = sanitize_or_reflect(message,src)
|
||||
if (!message)
|
||||
return
|
||||
@@ -204,7 +204,7 @@
|
||||
to_chat(src, "<span class='warning'>You cannot speak in IC (muted).</span>")
|
||||
return
|
||||
if (!message)
|
||||
message = input(usr, "Type a message to emote.","Pme") as text|null
|
||||
message = tgui_input_text(usr, "Type a message to emote.","Pme")
|
||||
message = sanitize_or_reflect(message,src)
|
||||
if (!message)
|
||||
return
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
if("PRG_newtextfile")
|
||||
if(!HDD)
|
||||
return
|
||||
var/newname = sanitize(input(usr, "Enter file name or leave blank to cancel:", "File rename"))
|
||||
var/newname = sanitize(tgui_input_text(usr, "Enter file name or leave blank to cancel:", "File rename"))
|
||||
if(!newname)
|
||||
return
|
||||
var/datum/computer_file/data/F = new/datum/computer_file/data()
|
||||
|
||||
@@ -80,14 +80,14 @@
|
||||
if("ban_nid")
|
||||
if(!ntnet_global)
|
||||
return
|
||||
var/nid = input(usr,"Enter NID of device which you want to block from the network:", "Enter NID") as null|num
|
||||
var/nid = tgui_input_number(usr,"Enter NID of device which you want to block from the network:", "Enter NID")
|
||||
if(nid && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
ntnet_global.banned_nids |= nid
|
||||
return TRUE
|
||||
if("unban_nid")
|
||||
if(!ntnet_global)
|
||||
return
|
||||
var/nid = input(usr,"Enter NID of device which you want to unblock from the network:", "Enter NID") as null|num
|
||||
var/nid = tgui_input_number(usr,"Enter NID of device which you want to unblock from the network:", "Enter NID")
|
||||
if(nid && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
ntnet_global.banned_nids -= nid
|
||||
return TRUE
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
return 0
|
||||
|
||||
if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
|
||||
var/attempt_pin = input(usr, "Enter pin code", "Vendor transaction") as num
|
||||
var/attempt_pin = tgui_input_number(usr, "Enter pin code", "Vendor transaction")
|
||||
customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2)
|
||||
|
||||
if(!customer_account)
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
/datum/nifsoft/sizechange/activate()
|
||||
if((. = ..()))
|
||||
var/new_size = input(usr, "Put the desired size (25-200%), or (1-600%) in dormitory areas.", "Set Size", 200) as num|null
|
||||
var/new_size = tgui_input_number(usr, "Put the desired size (25-200%), or (1-600%) in dormitory areas.", "Set Size", 200, 600, 1)
|
||||
|
||||
if (!nif.human.size_range_check(new_size))
|
||||
if(new_size)
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
. = TRUE
|
||||
|
||||
if("calibration")
|
||||
var/input = input(usr, "0-9", "disperser calibration", 0) as num|null
|
||||
var/input = tgui_input_number(usr, "0-9", "disperser calibration", 0, 9, 0)
|
||||
if(!isnull(input)) //can be zero so we explicitly check for null
|
||||
var/calnum = sanitize_integer(text2num(params["calibration"]), 0, caldigit)//sanitiiiiize
|
||||
calibration[calnum + 1] = sanitize_integer(input, 0, 9, 0)//must add 1 because js indexes from 0
|
||||
@@ -189,14 +189,14 @@
|
||||
. = TRUE
|
||||
|
||||
if("strength")
|
||||
var/input = input(usr, "1-5", "disperser strength", 1) as num|null
|
||||
var/input = tgui_input_number(usr, "1-5", "disperser strength", 1, 5, 1)
|
||||
if(input && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
strength = sanitize_integer(input, 1, 5, 1)
|
||||
middle.update_idle_power_usage(strength * range * 100)
|
||||
. = TRUE
|
||||
|
||||
if("range")
|
||||
var/input = input(usr, "1-5", "disperser radius", 1) as num|null
|
||||
var/input = tgui_input_number(usr, "1-5", "disperser radius", 1, 5, 1)
|
||||
if(input && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
range = sanitize_integer(input, 1, 5, 1)
|
||||
middle.update_idle_power_usage(strength * range * 100)
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
. = TRUE
|
||||
|
||||
if("set_global_limit")
|
||||
var/newlim = input(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num
|
||||
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100, 100, 0)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
linked.thrust_limit = clamp(newlim/100, 0, 1)
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
if("set_limit")
|
||||
var/datum/ship_engine/E = locate(params["engine"])
|
||||
var/newlim = input(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit()) as num
|
||||
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit(), 100, 0)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
var/limit = clamp(newlim/100, 0, 1)
|
||||
|
||||
@@ -171,10 +171,10 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
R.fields["x"] = linked.x
|
||||
R.fields["y"] = linked.y
|
||||
if("new")
|
||||
var/newx = input(usr, "Input new entry x coordinate", "Coordinate input", linked.x) as num
|
||||
var/newx = tgui_input_number(usr, "Input new entry x coordinate", "Coordinate input", linked.x)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return TRUE
|
||||
var/newy = input(usr, "Input new entry y coordinate", "Coordinate input", linked.y) as num
|
||||
var/newy = tgui_input_number(usr, "Input new entry y coordinate", "Coordinate input", linked.y)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
R.fields["x"] = CLAMP(newx, 1, world.maxx)
|
||||
@@ -191,14 +191,14 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
|
||||
if("setcoord")
|
||||
if(params["setx"])
|
||||
var/newx = input(usr, "Input new destiniation x coordinate", "Coordinate input", dx) as num|null
|
||||
var/newx = tgui_input_number(usr, "Input new destiniation x coordinate", "Coordinate input", dx)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return
|
||||
if(newx)
|
||||
dx = CLAMP(newx, 1, world.maxx)
|
||||
|
||||
if(params["sety"])
|
||||
var/newy = input(usr, "Input new destiniation y coordinate", "Coordinate input", dy) as num|null
|
||||
var/newy = tgui_input_number(usr, "Input new destiniation y coordinate", "Coordinate input", dy)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return
|
||||
if(newy)
|
||||
@@ -216,13 +216,13 @@ GLOBAL_LIST_EMPTY(all_waypoints)
|
||||
. = TRUE
|
||||
|
||||
if("speedlimit")
|
||||
var/newlimit = input(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null
|
||||
var/newlimit = tgui_input_number(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000)
|
||||
if(newlimit)
|
||||
speedlimit = CLAMP(newlimit/1000, 0, 100)
|
||||
. = TRUE
|
||||
|
||||
if("accellimit")
|
||||
var/newlimit = input(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null
|
||||
var/newlimit = tgui_input_number(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000)
|
||||
if(newlimit)
|
||||
accellimit = max(newlimit/1000, 0)
|
||||
. = TRUE
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
if(sensors)
|
||||
switch(action)
|
||||
if("range")
|
||||
var/nrange = input(usr, "Set new sensors range", "Sensor range", sensors.range) as num|null
|
||||
var/nrange = tgui_input_number(usr, "Set new sensors range", "Sensor range", sensors.range)
|
||||
if(tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
if(nrange)
|
||||
|
||||
@@ -282,7 +282,7 @@
|
||||
if(new_signature)
|
||||
signature = new_signature
|
||||
*/
|
||||
signature = sanitize(input(usr, "Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature))
|
||||
signature = sanitize(tgui_input_text(usr, "Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature))
|
||||
|
||||
/obj/item/weapon/pen/proc/get_signature(var/mob/user)
|
||||
return (user && user.real_name) ? user.real_name : "Anonymous"
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
return TRUE
|
||||
switch(action)
|
||||
if("Edit")
|
||||
var/n = input(usr, "Please enter message", name, notehtml) as message
|
||||
var/n = tgui_input_text(usr, "Please enter message", name, notehtml, multiline = TRUE)
|
||||
if(pda.loc == usr)
|
||||
note = adminscrub(n)
|
||||
notehtml = html_decode(note)
|
||||
|
||||
@@ -978,7 +978,7 @@ var/list/possible_cable_coil_colours = list(
|
||||
|
||||
/obj/item/stack/cable_coil/alien/attack_hand(mob/user as mob)
|
||||
if (user.get_inactive_hand() == src)
|
||||
var/N = input(usr, "How many units of wire do you want to take from [src]? You can only take up to [amount] at a time.", "Split stacks", 1) as num|null
|
||||
var/N = tgui_input_number(usr, "How many units of wire do you want to take from [src]? You can only take up to [amount] at a time.", "Split stacks", 1)
|
||||
if(N && N <= amount)
|
||||
var/obj/item/stack/cable_coil/CC = new/obj/item/stack/cable_coil(user.loc)
|
||||
CC.amount = N
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
if(default_deconstruction_crowbar(user, W))
|
||||
return
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
var/new_ident = input(usr, "Enter a new ident tag.", name, comp_id) as null|text
|
||||
var/new_ident = tgui_input_text(usr, "Enter a new ident tag.", name, comp_id)
|
||||
if(new_ident && user.Adjacent(src))
|
||||
comp_id = new_ident
|
||||
return
|
||||
@@ -337,7 +337,7 @@
|
||||
|
||||
/obj/machinery/computer/turbine_computer/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
var/new_ident = input(usr, "Enter a new ident tag.", name, id) as null|text
|
||||
var/new_ident = tgui_input_text(usr, "Enter a new ident tag.", name, id)
|
||||
if(new_ident && user.Adjacent(src))
|
||||
id = new_ident
|
||||
return
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
return
|
||||
|
||||
if(tgui_alert(usr, "Do you wish the mob to have a player?","Assign Player?",list("No","Yes")) == "No")
|
||||
var/spawn_count = input(usr, "How many mobs do you wish the pod to contain?", "Drop Pod Selection", null) as num
|
||||
var/spawn_count = tgui_input_number(usr, "How many mobs do you wish the pod to contain?", "Drop Pod Selection", null)
|
||||
if(spawn_count <= 0)
|
||||
return
|
||||
for(var/i=0;i<spawn_count;i++)
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
var/datum/random_map/M
|
||||
if(tgui_alert(usr, "Do you wish to customise the map?","Customize",list("Yes","No")) == "Yes")
|
||||
var/seed = tgui_input_text(usr, "Seed? (blank for none)")
|
||||
var/lx = input(usr, "X-size? (blank for default)") as num|null
|
||||
var/ly = input(usr, "Y-size? (blank for default)") as num|null
|
||||
var/lx = tgui_input_number(usr, "X-size? (blank for default)")
|
||||
var/ly = tgui_input_number(usr, "Y-size? (blank for default)")
|
||||
M = new map_datum(seed,null,null,null,lx,ly,1)
|
||||
else
|
||||
M = new map_datum(null,null,null,null,null,null,1)
|
||||
@@ -65,9 +65,9 @@
|
||||
return
|
||||
var/datum/random_map/M = random_maps[choice]
|
||||
if(istype(M))
|
||||
var/tx = input(usr, "X? (default to current turf)") as num|null
|
||||
var/ty = input(usr, "Y? (default to current turf)") as num|null
|
||||
var/tz = input(usr, "Z? (default to current turf)") as num|null
|
||||
var/tx = tgui_input_number(usr, "X? (default to current turf)")
|
||||
var/ty = tgui_input_number(usr, "Y? (default to current turf)")
|
||||
var/tz = tgui_input_number(usr, "Z? (default to current turf)")
|
||||
if(isnull(tx) || isnull(ty) || isnull(tz))
|
||||
var/turf/T = get_turf(usr)
|
||||
tx = !isnull(tx) ? tx : T.x
|
||||
@@ -98,8 +98,8 @@
|
||||
var/datum/random_map/overlay_map = random_maps[choice]
|
||||
|
||||
if(istype(base_map) && istype(overlay_map))
|
||||
var/tx = input(usr, "X? (default to 1)") as num|null
|
||||
var/ty = input(usr, "Y? (default to 1)") as num|null
|
||||
var/tx = tgui_input_number(usr, "X? (default to 1)")
|
||||
var/ty = tgui_input_number(usr, "Y? (default to 1)")
|
||||
if(!tx) tx = 1
|
||||
if(!ty) ty = 1
|
||||
message_admins("[key_name_admin(usr)] has applied [overlay_map.name] to [base_map.name] at x[tx],y[ty].")
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
OutputBeaker = null
|
||||
|
||||
if("adjust temp")
|
||||
target_temp = input(usr, "Choose a target temperature.", "Temperature.", T20C) as num
|
||||
target_temp = tgui_input_number(usr, "Choose a target temperature.", "Temperature.", T20C)
|
||||
target_temp = CLAMP(target_temp, min_temp, max_temp)
|
||||
|
||||
update_icon()
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
|
||||
if(istype(I, /obj/item/device/multitool))
|
||||
if(panel_open)
|
||||
var/input = sanitize(input(usr, "What id would you like to give this conveyor?", "Multitool-Conveyor interface", id))
|
||||
var/input = sanitize(tgui_input_text(usr, "What id would you like to give this conveyor?", "Multitool-Conveyor interface", id))
|
||||
if(!input)
|
||||
to_chat(user, "No input found. Please hang up and try your call again.")
|
||||
return
|
||||
@@ -304,7 +304,7 @@
|
||||
|
||||
if(istype(I, /obj/item/device/multitool))
|
||||
if(panel_open)
|
||||
var/input = sanitize(input(usr, "What id would you like to give this conveyor switch?", "Multitool-Conveyor interface", id))
|
||||
var/input = sanitize(tgui_input_text(usr, "What id would you like to give this conveyor switch?", "Multitool-Conveyor interface", id))
|
||||
if(!input)
|
||||
to_chat(user, "No input found. Please hang up and try your call again.")
|
||||
return
|
||||
|
||||
@@ -369,7 +369,7 @@
|
||||
return
|
||||
|
||||
if(params["target_href"] == "size_multiplier")
|
||||
var/new_size = input(user, "Choose your character's size, ranging from 25% to 200%", "Character Preference") as num|null
|
||||
var/new_size = tgui_input_number(user, "Choose your character's size, ranging from 25% to 200%", "Character Preference", null, 200, 25)
|
||||
if(new_size && ISINRANGE(new_size,25,200))
|
||||
active_br.sizemult = (new_size/100)
|
||||
update_preview_icon()
|
||||
|
||||
@@ -505,14 +505,14 @@
|
||||
|
||||
switch(action)
|
||||
if("set_range")
|
||||
var/new_range = input(usr, "Enter new field range (1-[world.maxx]). Leave blank to cancel.", "Field Radius Control", field_radius) as num
|
||||
var/new_range = tgui_input_number(usr, "Enter new field range (1-[world.maxx]). Leave blank to cancel.", "Field Radius Control", field_radius, world.maxx, 1)
|
||||
if(!new_range)
|
||||
return TRUE
|
||||
target_radius = between(1, new_range, world.maxx)
|
||||
return TRUE
|
||||
|
||||
if("set_input_cap")
|
||||
var/new_cap = round(input(usr, "Enter new input cap (in kW). Enter 0 or nothing to disable input cap.", "Generator Power Control", round(input_cap / 1000)) as num)
|
||||
var/new_cap = round(tgui_input_number(usr, "Enter new input cap (in kW). Enter 0 or nothing to disable input cap.", "Generator Power Control", round(input_cap / 1000)))
|
||||
if(!new_cap)
|
||||
input_cap = 0
|
||||
return
|
||||
|
||||
@@ -274,7 +274,7 @@
|
||||
to_chat(user, "<span class='danger'>This account does not own any shares of [S.name]!</span>")
|
||||
return
|
||||
var/price = S.current_value
|
||||
var/amt = round(input(user, "How many shares? \n(Have: [avail], unit price: [price])", "Sell shares in [S.name]", 0) as num|null)
|
||||
var/amt = round(tgui_input_number(user, "How many shares? \n(Have: [avail], unit price: [price])", "Sell shares in [S.name]", 0))
|
||||
amt = min(amt, S.shareholders[logged_in])
|
||||
|
||||
if (!user || (!(user in range(1, src)) && iscarbon(user)))
|
||||
@@ -309,7 +309,7 @@
|
||||
var/avail = S.available_shares
|
||||
var/price = S.current_value
|
||||
var/canbuy = round(b / price)
|
||||
var/amt = round(input(user, "How many shares? \n(Available: [avail], unit price: [price], can buy: [canbuy])", "Buy shares in [S.name]", 0) as num|null)
|
||||
var/amt = round(tgui_input_number(user, "How many shares? \n(Available: [avail], unit price: [price], can buy: [canbuy])", "Buy shares in [S.name]", 0))
|
||||
if (!user || (!(user in range(1, src)) && iscarbon(user)))
|
||||
return
|
||||
if (li != logged_in)
|
||||
|
||||
@@ -470,7 +470,7 @@
|
||||
var/new_name = target.real_name
|
||||
while(target.client)
|
||||
if(!target) return
|
||||
var/try_name = input(target,"Pick a name for your new form!", "New Name", target.name)
|
||||
var/try_name = tgui_input_text(target,"Pick a name for your new form!", "New Name", target.name)
|
||||
var/clean_name = sanitizeName(try_name, allow_numbers = TRUE)
|
||||
if(clean_name)
|
||||
var/okay = tgui_alert(target,"New name will be '[clean_name]', ok?", "Confirmation",list("Cancel","Ok"))
|
||||
@@ -562,7 +562,7 @@
|
||||
var/new_name = ""
|
||||
while(!new_name)
|
||||
if(!target) return
|
||||
var/try_name = input(target,"Pick a name for your new form!", "New Name", target.name)
|
||||
var/try_name = tgui_input_text(target,"Pick a name for your new form!", "New Name", target.name)
|
||||
var/clean_name = sanitizeName(try_name, allow_numbers = TRUE)
|
||||
if(clean_name)
|
||||
var/okay = tgui_alert(target,"New name will be '[clean_name]', ok?", "Confirmation",list("Cancel","Ok"))
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(H.dna)
|
||||
default = H.dna.b_type
|
||||
var/new_blood_type = sanitize(input(usr,"What blood type would you like to be written on this card?","Agent Card Blood Type",default) as null|text)
|
||||
var/new_blood_type = sanitize(tgui_input_text(usr,"What blood type would you like to be written on this card?","Agent Card Blood Type",default))
|
||||
if(!isnull(new_blood_type) && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
S.blood_type = new_blood_type
|
||||
to_chat(usr, "<span class='notice'>Blood type changed to '[new_blood_type]'.</span>")
|
||||
@@ -86,7 +86,7 @@
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(H.dna)
|
||||
default = H.dna.unique_enzymes
|
||||
var/new_dna_hash = sanitize(input(usr,"What DNA hash would you like to be written on this card?","Agent Card DNA Hash",default) as null|text)
|
||||
var/new_dna_hash = sanitize(tgui_input_text(usr,"What DNA hash would you like to be written on this card?","Agent Card DNA Hash",default))
|
||||
if(!isnull(new_dna_hash) && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
S.dna_hash = new_dna_hash
|
||||
to_chat(usr, "<span class='notice'>DNA hash changed to '[new_dna_hash]'.</span>")
|
||||
@@ -103,7 +103,7 @@
|
||||
to_chat(usr, "<span class='notice'>Fingerprint hash changed to '[new_fingerprint_hash]'.</span>")
|
||||
. = TRUE
|
||||
if("name")
|
||||
var/new_name = sanitizeName(input(usr,"What name would you like to put on this card?","Agent Card Name", S.registered_name) as null|text)
|
||||
var/new_name = sanitizeName(tgui_input_text(usr,"What name would you like to put on this card?","Agent Card Name", S.registered_name))
|
||||
if(!isnull(new_name) && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
S.registered_name = new_name
|
||||
S.update_name()
|
||||
@@ -114,7 +114,7 @@
|
||||
to_chat(usr, "<span class='notice'>Photo changed.</span>")
|
||||
. = TRUE
|
||||
if("sex")
|
||||
var/new_sex = sanitize(input(usr,"What sex would you like to put on this card?","Agent Card Sex", S.sex) as null|text)
|
||||
var/new_sex = sanitize(tgui_input_text(usr,"What sex would you like to put on this card?","Agent Card Sex", S.sex))
|
||||
if(!isnull(new_sex) && tgui_status(usr, state) == STATUS_INTERACTIVE)
|
||||
S.sex = new_sex
|
||||
to_chat(usr, "<span class='notice'>Sex changed to '[new_sex]'.</span>")
|
||||
|
||||
@@ -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 = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") as null|message
|
||||
var/input = tgui_input_text(usr, "Please write a message to announce to the station crew.", "Priority Announcement", multiline = TRUE)
|
||||
if(!input || message_cooldown > world.time || ..() || !(is_authenticated(usr) == COMM_AUTHENTICATION_MAX))
|
||||
return
|
||||
if(length(input) < COMM_MSGLEN_MINIMUM)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
switch(action)
|
||||
if("set_tag")
|
||||
var/new_ident = sanitize_text(input(usr, "Enter a new ident tag.", "Gyrotron Control", gyro_tag) as null|text)
|
||||
var/new_ident = sanitize_text(tgui_input_text(usr, "Enter a new ident tag.", "Gyrotron Control", gyro_tag))
|
||||
if(new_ident)
|
||||
gyro_tag = new_ident
|
||||
return TRUE
|
||||
|
||||
@@ -319,8 +319,8 @@
|
||||
R.fields["x"] = linked.x
|
||||
R.fields["y"] = linked.y
|
||||
if("new")
|
||||
var/newx = input(usr, "Input new entry x coordinate", "Coordinate input", linked.x) as num
|
||||
var/newy = input(usr, "Input new entry y coordinate", "Coordinate input", linked.y) as num
|
||||
var/newx = tgui_input_number(usr, "Input new entry x coordinate", "Coordinate input", linked.x)
|
||||
var/newy = tgui_input_number(usr, "Input new entry y coordinate", "Coordinate input", linked.y)
|
||||
R.fields["x"] = CLAMP(newx, 1, world.maxx)
|
||||
R.fields["y"] = CLAMP(newy, 1, world.maxy)
|
||||
known_sectors[sec_name] = R
|
||||
@@ -335,12 +335,12 @@
|
||||
|
||||
if("setcoord")
|
||||
if(params["setx"])
|
||||
var/newx = input(usr, "Input new destiniation x coordinate", "Coordinate input", dx) as num|null
|
||||
var/newx = tgui_input_number(usr, "Input new destiniation x coordinate", "Coordinate input", dx)
|
||||
if(newx)
|
||||
dx = CLAMP(newx, 1, world.maxx)
|
||||
|
||||
if(params["sety"])
|
||||
var/newy = input(usr, "Input new destiniation y coordinate", "Coordinate input", dy) as num|null
|
||||
var/newy = tgui_input_number(usr, "Input new destiniation y coordinate", "Coordinate input", dy)
|
||||
if(newy)
|
||||
dy = CLAMP(newy, 1, world.maxy)
|
||||
. = TRUE
|
||||
@@ -356,13 +356,13 @@
|
||||
. = TRUE
|
||||
|
||||
if("speedlimit")
|
||||
var/newlimit = input(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000) as num|null
|
||||
var/newlimit = tgui_input_number(usr, "Input new speed limit for autopilot (0 to brake)", "Autopilot speed limit", speedlimit*1000)
|
||||
if(newlimit)
|
||||
speedlimit = CLAMP(newlimit/1000, 0, 100)
|
||||
. = TRUE
|
||||
|
||||
if("accellimit")
|
||||
var/newlimit = input(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000) as num|null
|
||||
var/newlimit = tgui_input_number(usr, "Input new acceleration limit", "Acceleration limit", accellimit*1000)
|
||||
if(newlimit)
|
||||
accellimit = max(newlimit/1000, 0)
|
||||
. = TRUE
|
||||
@@ -402,7 +402,7 @@
|
||||
. = TRUE
|
||||
|
||||
if("set_global_limit")
|
||||
var/newlim = input(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100) as num
|
||||
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100%)", "Thrust limit", linked.thrust_limit*100, 100, 0)
|
||||
linked.thrust_limit = clamp(newlim/100, 0, 1)
|
||||
for(var/datum/ship_engine/E in linked.engines)
|
||||
E.set_thrust_limit(linked.thrust_limit)
|
||||
@@ -416,7 +416,7 @@
|
||||
|
||||
if("set_limit")
|
||||
var/datum/ship_engine/E = locate(params["engine"])
|
||||
var/newlim = input(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit()) as num
|
||||
var/newlim = tgui_input_number(usr, "Input new thrust limit (0..100)", "Thrust limit", E.get_thrust_limit(), 100, 0)
|
||||
var/limit = clamp(newlim/100, 0, 1)
|
||||
if(istype(E))
|
||||
E.set_thrust_limit(limit)
|
||||
@@ -437,7 +437,7 @@
|
||||
/* END ENGINES */
|
||||
/* SENSORS */
|
||||
if("range")
|
||||
var/nrange = input(usr, "Set new sensors range", "Sensor range", sensors.range) as num|null
|
||||
var/nrange = tgui_input_number(usr, "Set new sensors range", "Sensor range", sensors.range)
|
||||
if(nrange)
|
||||
sensors.set_range(CLAMP(nrange, 1, world.view))
|
||||
. = TRUE
|
||||
|
||||
@@ -129,12 +129,12 @@
|
||||
s_multiplier[stage] = max(1, round(initial(E.maxm)/2))
|
||||
else if(href_list["chance"])
|
||||
var/datum/disease2/effect/Eff = s[stage]
|
||||
var/I = input(usr, "Chance, per tick, of this effect happening (min 0, max [initial(Eff.chance_maxm)])", "Effect Chance", s_chance[stage]) as null|num
|
||||
var/I = tgui_input_number(usr, "Chance, per tick, of this effect happening (min 0, max [initial(Eff.chance_maxm)])", "Effect Chance", s_chance[stage], initial(Eff.chance_maxm), 0)
|
||||
if(I == null || I < 0 || I > initial(Eff.chance_maxm)) return
|
||||
s_chance[stage] = I
|
||||
else if(href_list["multiplier"])
|
||||
var/datum/disease2/effect/Eff = s[stage]
|
||||
var/I = input(usr, "Multiplier for this effect (min 1, max [initial(Eff.maxm)])", "Effect Multiplier", s_multiplier[stage]) as null|num
|
||||
var/I = tgui_input_number(usr, "Multiplier for this effect (min 1, max [initial(Eff.maxm)])", "Effect Multiplier", s_multiplier[stage], initial(Eff.maxm), 1)
|
||||
if(I == null || I < 1 || I > initial(Eff.maxm)) return
|
||||
s_multiplier[stage] = I
|
||||
if("species")
|
||||
@@ -150,7 +150,7 @@
|
||||
if(!infectee.species || !(infectee.species.get_bodytype() in species))
|
||||
infectee = null
|
||||
if("ichance")
|
||||
var/I = input(usr, "Input infection chance", "Infection Chance", infectionchance) as null|num
|
||||
var/I = tgui_input_number(usr, "Input infection chance", "Infection Chance", infectionchance)
|
||||
if(!I) return
|
||||
infectionchance = I
|
||||
if("stype")
|
||||
@@ -158,7 +158,7 @@
|
||||
if(!S) return
|
||||
spreadtype = S
|
||||
if("speed")
|
||||
var/S = input(usr, "Input speed", "Speed", speed) as null|num
|
||||
var/S = tgui_input_number(usr, "Input speed", "Speed", speed)
|
||||
if(!S) return
|
||||
speed = S
|
||||
if("antigen")
|
||||
@@ -172,7 +172,7 @@
|
||||
else if(href_list["reset"])
|
||||
antigens = list()
|
||||
if("resistance")
|
||||
var/S = input(usr, "Input % resistance to antibiotics", "Resistance", resistance) as null|num
|
||||
var/S = tgui_input_number(usr, "Input % resistance to antibiotics", "Resistance", resistance)
|
||||
if(!S) return
|
||||
resistance = S
|
||||
if("infectee")
|
||||
|
||||
@@ -1025,7 +1025,7 @@
|
||||
host.vore_selected.escapechance = sanitize_integer(escape_chance_input, 0, 100, initial(host.vore_selected.escapechance))
|
||||
. = TRUE
|
||||
if("b_escapetime")
|
||||
var/escape_time_input = input(user, "Set number of seconds for prey to escape on resist (1-60)", "Prey Escape Time") as num|null
|
||||
var/escape_time_input = tgui_input_number(user, "Set number of seconds for prey to escape on resist (1-60)", "Prey Escape Time", null, 60, 1)
|
||||
if(!isnull(escape_time_input))
|
||||
host.vore_selected.escapetime = sanitize_integer(escape_time_input*10, 10, 600, initial(host.vore_selected.escapetime))
|
||||
. = TRUE
|
||||
|
||||
Reference in New Issue
Block a user