TGUI Input Conversions

This commit is contained in:
Casey
2022-06-18 23:58:15 -04:00
committed by CHOMPStation2
parent 1740fb34de
commit 928a321b5f
201 changed files with 2350 additions and 491 deletions

View File

@@ -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()

View File

@@ -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

View File

@@ -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")

View File

@@ -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(remain_con * 100, 0.5), 0)) / 100
//cap it between 0 and the max remaining concentration
new_con = between(0, new_con, remain_con)

View File

@@ -147,7 +147,7 @@ var/global/vs_control/vsc = new
var/newvar = vw
switch(how)
if("Numeric")
newvar = input(user,"Enter a number:","Settings",newvar) as num
newvar = tgui_input_number(user,"Enter a number:","Settings",newvar)
if("Bit Flag")
var/flag = tgui_input_list(user,"Toggle which bit?","Settings", bitflags)
flag = text2num(flag)
@@ -158,9 +158,9 @@ var/global/vs_control/vsc = new
if("Toggle")
newvar = !newvar
if("Text")
newvar = input(user,"Enter a string:","Settings",newvar) as text
newvar = tgui_input_text(user,"Enter a string:","Settings",newvar)
if("Long Text")
newvar = input(user,"Enter text:","Settings",newvar) as message
newvar = tgui_input_text(user,"Enter text:","Settings",newvar, multiline = TRUE)
vw = newvar
if(ch in plc.settings)
plc.vars[ch] = vw

View File

@@ -344,7 +344,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
var/newname
for(var/i=1,i<=3,i++) //we get 3 attempts to pick a suitable name.
newname = input(src,"You are \a [role]. Would you like to change your name to something else?", "Name change",oldname) as text
newname = tgui_input_text(src,"You are \a [role]. Would you like to change your name to something else?", "Name change",oldname)
if((world.time-time_passed)>3000)
return //took too long
newname = sanitizeName(newname, ,allow_numbers) //returns null if the name doesn't meet some basic requirements. Tidies up a few other things like bad-characters.
@@ -1357,7 +1357,7 @@ var/mob/dview/dview_mob = new
/proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
if (value == FALSE) //nothing should be calling us with a number, so this is safe
value = input(usr, "Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text
value = tgui_input_text(usr, "Enter type to find (blank for all, cancel to cancel)", "Search for type")
if (isnull(value))
return
value = trim(value)

View File

@@ -114,7 +114,7 @@
M.maptext = "Movable"
M.maptext_width = 64
var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") as text
var/screen_l = tgui_input_text(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object")
if(!screen_l)
return
@@ -133,7 +133,7 @@
S.maptext = "Snap"
S.maptext_width = 64
var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") as text
var/screen_l = tgui_input_text(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object")
if(!screen_l)
return

View File

@@ -352,13 +352,13 @@ SUBSYSTEM_DEF(game_master)
choose_game_master(usr)
if(href_list["set_staleness"])
var/amount = input(usr, "How much staleness should there be?", "Game Master") as null|num
var/amount = tgui_input_number(usr, "How much staleness should there be?", "Game Master")
if(!isnull(amount))
staleness = amount
message_admins("GM staleness was set to [amount] by [usr.key].")
if(href_list["set_danger"])
var/amount = input(usr, "How much danger should there be?", "Game Master") as null|num
var/amount = tgui_input_number(usr, "How much danger should there be?", "Game Master")
if(!isnull(amount))
danger = amount
message_admins("GM danger was set to [amount] by [usr.key].")

View File

@@ -88,7 +88,7 @@ SUBSYSTEM_DEF(media_tracks)
return
// Required
var/url = input(C, "REQUIRED: Provide URL for track, or paste JSON if you know what you're doing. See code comments.", "Track URL") as message|null
var/url = tgui_input_text(C, "REQUIRED: Provide URL for track, or paste JSON if you know what you're doing. See code comments.", "Track URL", multiline = TRUE)
if(!url)
return
@@ -126,21 +126,35 @@ SUBSYSTEM_DEF(media_tracks)
report_progress("New media track added by [C]: [T.title]")
sort_tracks()
return
<<<<<<< HEAD
var/title = input(C, "REQUIRED: Provide title for track", "Track Title") as text|null
if(!title)
return
var/duration = input(C, "REQUIRED: Provide duration for track (in deciseconds, aka seconds*10)", "Track Duration") as num|null
=======
var/title = tgui_input_text(C, "REQUIRED: Provide title for track", "Track Title")
if(!title)
return
var/duration = tgui_input_number(C, "REQUIRED: Provide duration for track (in deciseconds, aka seconds*10)", "Track Duration")
>>>>>>> b875945450... Merge pull request #13112 from ItsSelis/tgui-input-conversions
if(!duration)
return
// Optional
var/artist = input(C, "Optional: Provide artist for track", "Track Artist") as text|null
var/artist = tgui_input_text(C, "Optional: Provide artist for track", "Track Artist")
if(isnull(artist)) // Cancel rather than empty string
return
<<<<<<< HEAD
var/genre = input(C, "Optional: Provide genre for track (try to match an existing one)", "Track Genre") as text|null
=======
var/genre = tgui_input_text(C, "Optional: Provide genre for track (try to match an existing one)", "Track Genre")
>>>>>>> b875945450... Merge pull request #13112 from ItsSelis/tgui-input-conversions
if(isnull(genre)) // Cancel rather than empty string
return
@@ -188,7 +202,7 @@ SUBSYSTEM_DEF(media_tracks)
if(!check_rights(R_DEBUG|R_FUN))
return
var/track = input(C, "Input track title or URL to remove (must be exact)", "Remove Track") as text|null
var/track = tgui_input_text(C, "Input track title or URL to remove (must be exact)", "Remove Track")
if(!track)
return

View File

@@ -363,15 +363,15 @@ SUBSYSTEM_DEF(supply)
// Will add an item entry to the specified export receipt on the user-side list
/datum/controller/subsystem/supply/proc/add_export_item(var/datum/exported_crate/E, var/mob/user)
var/new_name = input(user, "Name", "Please enter the name of the item.") as null|text
var/new_name = tgui_input_text(user, "Name", "Please enter the name of the item.")
if(!new_name)
return
var/new_quantity = input(user, "Name", "Please enter the quantity of the item.") as null|num
var/new_quantity = tgui_input_number(user, "Name", "Please enter the quantity of the item.")
if(!new_quantity)
return
var/new_value = input(user, "Name", "Please enter the value of the item.") as null|num
var/new_value = tgui_input_number(user, "Name", "Please enter the value of the item.")
if(!new_value)
return

View File

@@ -244,11 +244,11 @@ SUBSYSTEM_DEF(vote)
choices.Add(antag.role_text)
choices.Add("None")
if(VOTE_CUSTOM)
question = sanitizeSafe(input(usr, "What is the vote for?") as text|null)
question = sanitizeSafe(tgui_input_text(usr, "What is the vote for?"))
if(!question)
return 0
for(var/i = 1 to 10)
var/option = capitalize(sanitize(input(usr, "Please enter an option or hit cancel to finish") as text|null))
var/option = capitalize(sanitize(tgui_input_text(usr, "Please enter an option or hit cancel to finish")))
if(!option || mode || !usr.client)
break
choices.Add(option)

View File

@@ -68,7 +68,7 @@
names += componentsubtypes
names += "---Elements---"
names += sortTim(subtypesof(/datum/element), /proc/cmp_typepaths_asc)
var/result = input(usr, "Choose a component/element to add:", "Add Component/Element", names)
var/result = tgui_input_text(usr, "Choose a component/element to add:", "Add Component/Element", names)
if(!usr || !result || result == "---Components---" || result == "---Elements---")
return
if(QDELETED(src))

View File

@@ -99,7 +99,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form)
if(href_list["feedback_edit_body"])
// This is deliberately not sanitized here, and is instead checked when hitting the submission button,
// as we want to give the user a chance to fix it without needing to rewrite the whole thing.
feedback_body = input(my_client, "Please write your feedback here.", "Feedback Body", feedback_body) as null|message
feedback_body = tgui_input_text(my_client, "Please write your feedback here.", "Feedback Body", feedback_body, multiline = TRUE)
display() // Refresh the window with new information.
return

View File

@@ -132,29 +132,29 @@
return
if(href_list["filter_id"])
var/id_to_search = input(my_client, "Write feedback ID here.", "Filter by ID", null) as null|num
var/id_to_search = tgui_input_number(my_client, "Write feedback ID here.", "Filter by ID", null)
if(id_to_search)
last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_ID, id_to_search, TRUE)
if(href_list["filter_author"])
var/author_to_search = input(my_client, "Write desired key or hash here. Partial keys/hashes are allowed.", "Filter by Author", null) as null|text
var/author_to_search = tgui_input_text(my_client, "Write desired key or hash here. Partial keys/hashes are allowed.", "Filter by Author", null)
if(author_to_search)
last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_AUTHOR, author_to_search)
if(href_list["filter_topic"])
var/topic_to_search = input(my_client, "Write desired topic here. Partial topics are allowed. \
\nThe current topics in the config are [english_list(config.sqlite_feedback_topics)].", "Filter by Topic", null) as null|text
var/topic_to_search = tgui_input_text(my_client, "Write desired topic here. Partial topics are allowed. \
\nThe current topics in the config are [english_list(config.sqlite_feedback_topics)].", "Filter by Topic", null)
if(topic_to_search)
last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_TOPIC, topic_to_search)
if(href_list["filter_content"])
var/content_to_search = input(my_client, "Write desired content to find here. Partial matches are allowed.", "Filter by Content", null) as null|message
var/content_to_search = tgui_input_text(my_client, "Write desired content to find here. Partial matches are allowed.", "Filter by Content", null, multiline = TRUE)
if(content_to_search)
last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_CONTENT, content_to_search)
if(href_list["filter_datetime"])
var/datetime_to_search = input(my_client, "Write desired datetime. Partial matches are allowed.\n\
Format is 'YYYY-MM-DD HH:MM:SS'.", "Filter by Datetime", null) as null|text
var/datetime_to_search = tgui_input_text(my_client, "Write desired datetime. Partial matches are allowed.\n\
Format is 'YYYY-MM-DD HH:MM:SS'.", "Filter by Datetime", null)
if(datetime_to_search)
last_query = feedback_filter(SQLITE_FEEDBACK_COLUMN_DATETIME, datetime_to_search)

View File

@@ -190,7 +190,7 @@
assigned_role = new_role
else if (href_list["memory_edit"])
var/new_memo = sanitize(input("Write new memory", "Memory", memory) as null|message)
var/new_memo = sanitize(tgui_input_text("Write new memory", "Memory", memory, multiline = TRUE))
if (isnull(new_memo)) return
memory = new_memo
@@ -198,7 +198,7 @@
var/datum/mind/mind = locate(href_list["amb_edit"])
if(!mind)
return
var/new_ambition = input("Enter a new ambition", "Memory", mind.ambitions) as null|message
var/new_ambition = tgui_input_text("Enter a new ambition", "Memory", mind.ambitions, multiline = TRUE)
if(isnull(new_ambition))
return
if(mind)
@@ -296,7 +296,7 @@
if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]"))
def_num = objective.target_amount
var/target_number = input("Input target number:", "Objective", def_num) as num|null
var/target_number = tgui_input_number("Input target number:", "Objective", def_num)
if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist.
return
@@ -314,7 +314,7 @@
new_objective.target_amount = target_number
if ("custom")
var/expl = sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null)
var/expl = sanitize(tgui_input_text("Custom objective:", "Objective", objective ? objective.explanation_text : ""))
if (!expl) return
new_objective = new /datum/objective
new_objective.owner = src
@@ -410,7 +410,7 @@
// var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() No longer needed, uses stored in mind
var/crystals
crystals = tcrystals
crystals = input("Amount of telecrystals for [key]", crystals) as null|num
crystals = tgui_input_number("Amount of telecrystals for [key]", crystals)
if (!isnull(crystals))
tcrystals = crystals

View File

@@ -16,10 +16,10 @@
item_cost = 20
/datum/uplink_item/abstract/announcements/fake_centcom/extra_args(var/mob/user)
var/title = sanitize(input(usr, "Enter your announcement title.", "Announcement Title") as null|text)
var/title = sanitize(tgui_input_text(usr, "Enter your announcement title.", "Announcement Title"))
if(!title)
return
var/message = sanitize(input(usr, "Enter your announcement message.", "Announcement Title") as null|text)
var/message = sanitize(tgui_input_text(usr, "Enter your announcement message.", "Announcement Title"))
if(!message)
return
return list("title" = title, "message" = message)

View File

@@ -41,9 +41,9 @@
to_chat(src, "<span class='warning'>While you may perhaps have goals, this verb's meant to only be visible \
to antagonists. Please make a bug report!</span>")
return
var/new_ambitions = input(src, "Write a short sentence of what your character hopes to accomplish \
var/new_ambitions = tgui_input_text(src, "Write a short sentence of what your character hopes to accomplish \
today as an antagonist. Remember that this is purely optional. It will be shown at the end of the \
round for everybody else.", "Ambitions", mind.ambitions) as null|message
round for everybody else.", "Ambitions", mind.ambitions, multiline = TRUE)
if(isnull(new_ambitions))
return
new_ambitions = sanitize(new_ambitions)

View File

@@ -19,7 +19,7 @@
if(!holder) return
var/choice = input(usr, "Which Z-level do you wish to set the base turf for?") as num|null
var/choice = tgui_input_number(usr, "Which Z-level do you wish to set the base turf for?")
if(!choice)
return

View File

@@ -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

View File

@@ -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

View File

@@ -93,8 +93,8 @@
if(!ability_prechecks(user, price))
return
var/title = input(usr, "Select message title: ")
var/text = input(usr, "Select message text: ")
var/title = tgui_input_text(usr, "Select message title: ")
var/text = tgui_input_text(usr, "Select message text: ")
if(!title || !text || !ability_pay(user, price))
to_chat(user, "Hack Aborted")
return

View File

@@ -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
@@ -160,7 +160,7 @@
to_chat(usr, "You set the pinpointer to locate [targetitem]")
if("DNA")
var/DNAstring = input(usr, "Input DNA string to search for." , "Please Enter String." , "")
var/DNAstring = tgui_input_text(usr, "Input DNA string to search for." , "Please Enter String." , "")
if(!DNAstring)
return
for(var/mob/living/carbon/M in mob_list)

View File

@@ -481,7 +481,7 @@ var/global/list/all_objectives = list()
var/tmp_obj = new custom_target
var/custom_name = tmp_obj:name
qdel(tmp_obj)
custom_name = sanitize(input(usr, "Enter target name:", "Objective target", custom_name) as text|null)
custom_name = sanitize(tgui_input_text(usr, "Enter target name:", "Objective target", custom_name))
if (!custom_name) return
target_name = custom_name
steal_target = custom_target

View File

@@ -49,12 +49,12 @@
if("Cancel")
return
if("Speak")
var/what_to_say = input(user, "What do you want \the [illusion] to say?","Illusion Speak") as null|text
var/what_to_say = tgui_input_text(user, "What do you want \the [illusion] to say?","Illusion Speak")
//what_to_say = sanitize(what_to_say) //Sanitize occurs inside say() already.
if(what_to_say)
illusion.say(what_to_say)
if("Emote")
var/what_to_emote = input(user, "What do you want \the [illusion] to do?","Illusion Emote") as null|text
var/what_to_emote = tgui_input_text(user, "What do you want \the [illusion] to do?","Illusion Emote")
if(what_to_emote)
illusion.emote(what_to_emote)

View File

@@ -675,7 +675,7 @@
var/list/selected = TLV["temperature"]
var/max_temperature = min(selected[3] - T0C, MAX_TEMPERATURE)
var/min_temperature = max(selected[2] - T0C, MIN_TEMPERATURE)
var/input_temperature = input(usr, "What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C) as num|null
var/input_temperature = tgui_input_number(usr, "What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C, max_temperature, min_temperature)
if(isnum(input_temperature))
if(input_temperature > max_temperature || input_temperature < min_temperature)
to_chat(usr, "Temperature must be between [min_temperature]C and [max_temperature]C")
@@ -729,7 +729,7 @@
var/env = params["env"]
var/name = params["var"]
var/value = input(usr, "New [name] for [env]:", name, TLV[env][name]) as num|null
var/value = tgui_input_number(usr, "New [name] for [env]:", name, TLV[env][name])
if(!isnull(value) && !..())
if(value < 0)
TLV[env][name] = -1

View File

@@ -47,7 +47,7 @@
turn_off()
return
if(istype(I, /obj/item/device/multitool))
var/new_temp = input(usr, "Input a new target temperature, in degrees C.","Target Temperature", 20) as num
var/new_temp = tgui_input_number(usr, "Input a new target temperature, in degrees C.","Target Temperature", 20)
if(!Adjacent(user) || user.incapacitated())
return
new_temp = convert_c2k(new_temp)

View File

@@ -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)

View File

@@ -176,7 +176,7 @@
if(!isnull(materials.get_material_amount(material)) && materials.get_material_amount(material) < round(making.resources[material] * coeff))
max_sheets = 0
//Build list of multipliers for sheets.
multiplier = input(usr, "How many do you want to print? (0-[max_sheets])") as num|null
multiplier = tgui_input_number(usr, "How many do you want to print? (0-[max_sheets])", null, null, max_sheets, 0)
if(!multiplier || multiplier <= 0 || multiplier > max_sheets || tgui_status(usr, state) != STATUS_INTERACTIVE)
return FALSE

View File

@@ -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)

View File

@@ -1182,7 +1182,7 @@
// 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)

View File

@@ -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

View File

@@ -170,15 +170,15 @@
mode = params["mode"]
if("giv_name")
var/nam = sanitizeName(input(usr, "Person pass is issued to", "Name", giv_name) as text|null)
var/nam = sanitizeName(tgui_input_text(usr, "Person pass is issued to", "Name", giv_name))
if(nam)
giv_name = nam
if("reason")
var/reas = sanitize(input(usr, "Reason why pass is issued", "Reason", reason) as text|null)
var/reas = sanitize(tgui_input_text(usr, "Reason why pass is issued", "Reason", reason))
if(reas)
reason = reas
if("duration")
var/dur = input(usr, "Duration (in minutes) during which pass is valid (up to 360 minutes).", "Duration") as num|null //VOREStation Edit
var/dur = tgui_input_number(usr, "Duration (in minutes) during which pass is valid (up to 360 minutes).", "Duration", null, 360, 0)
if(dur)
if(dur > 0 && dur <= 360) //VOREStation Edit
duration = dur

View File

@@ -243,7 +243,7 @@
. = TRUE
//Change the password - KEY REQUIRED
if("pass")
var/dkey = trim(input(usr, "Please enter the current decryption key.") as text|null)
var/dkey = trim(tgui_input_text(usr, "Please enter the current decryption key."))
if(dkey && dkey != "")
if(linkedServer.decryptkey == dkey)
var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):"))
@@ -325,7 +325,7 @@
. = TRUE
if("addtoken")
linkedServer.spamfilter += input(usr,"Enter text you want to be filtered out","Token creation") as text|null
linkedServer.spamfilter += tgui_input_text(usr,"Enter text you want to be filtered out","Token creation")
. = TRUE
if("deltoken")

View File

@@ -82,7 +82,7 @@
to_chat(usr, "Unauthorized Access.")
. = TRUE
if("warn")
var/warning = sanitize(input(usr, "Message:", "Enter your message here!", ""))
var/warning = sanitize(tgui_input_text(usr, "Message:", "Enter your message here!", ""))
if(!warning)
return
var/obj/item/weapon/implant/I = locate(params["imp"])

View File

@@ -221,12 +221,12 @@
visible_message("<span class='warning'>[src]'s monitor flashes, \"[reqtime - world.time] seconds remaining until another requisition form may be printed.\"</span>")
return FALSE
var/amount = clamp(input(usr, "How many crates? (0 to 20)") as num|null, 0, 20)
var/amount = clamp(tgui_input_number(usr, "How many crates? (0 to 20)", null, null, 20, 0), 0, 20)
if(!amount)
return FALSE
var/timeout = world.time + 600
var/reason = sanitize(input(usr, "Reason:","Why do you require this item?","") as null|text)
var/reason = sanitize(tgui_input_text(usr, "Reason:","Why do you require this item?",""))
if(world.time > timeout)
to_chat(usr, "<span class='warning'>Error. Request timed out.</span>")
return FALSE
@@ -280,7 +280,7 @@
return FALSE
var/timeout = world.time + 600
var/reason = sanitize(input(usr, "Reason:","Why do you require this item?","") as null|text)
var/reason = sanitize(tgui_input_text(usr, "Reason:","Why do you require this item?",""))
if(world.time > timeout)
to_chat(usr, "<span class='warning'>Error. Request timed out.</span>")
return FALSE
@@ -323,7 +323,7 @@
return FALSE
if(!(authorization & SUP_ACCEPT_ORDERS))
return FALSE
var/new_val = sanitize(input(usr, params["edit"], "Enter the new value for this field:", params["default"]) as null|text)
var/new_val = sanitize(tgui_input_text(usr, params["edit"], "Enter the new value for this field:", params["default"]))
if(!new_val)
return FALSE
@@ -396,7 +396,7 @@
var/list/L = E.contents[params["index"]]
var/field = tgui_alert(usr, "Select which field to edit", "Field Choice", list("Name", "Quantity", "Value"))
var/new_val = sanitize(input(usr, field, "Enter the new value for this field:", L[lowertext(field)]) as null|text)
var/new_val = sanitize(tgui_input_text(usr, field, "Enter the new value for this field:", L[lowertext(field)]))
if(!new_val)
return
@@ -439,7 +439,7 @@
return FALSE
if(!(authorization & SUP_ACCEPT_ORDERS))
return FALSE
var/new_val = sanitize(input(usr, params["edit"], "Enter the new value for this field:", params["default"]) as null|text)
var/new_val = sanitize(tgui_input_text(usr, params["edit"], "Enter the new value for this field:", params["default"]))
if(!new_val)
return

View File

@@ -305,7 +305,7 @@
if(auth)
var/t1 = href_list["assign"]
if(t1 == "Custom")
var/temp_t = sanitize(input(usr, "Enter a custom job assignment.","Assignment"))
var/temp_t = sanitize(tgui_input_text(usr, "Enter a custom job assignment.","Assignment"))
if(temp_t)
t1 = temp_t
set_default_access(t1)

View File

@@ -693,7 +693,7 @@ var/list/dispenser_presets = list()
* "gearlist" = array of types (yes the types are not valid json, byond parses them into real types.)
* "req_one_access" = array of numbers (accesses)
*/
var/input = input(usr, "Paste new gear pack JSON below. See example/code comments.", "Admin-load Dispenser", example) as null|message
var/input = tgui_input_text(usr, "Paste new gear pack JSON below. See example/code comments.", "Admin-load Dispenser", example, multiline = TRUE)
if(!input)
return

View File

@@ -401,20 +401,20 @@
return
// Required
var/url = input(C, "REQUIRED: Provide URL for track", "Track URL") as text|null
var/url = tgui_input_text(C, "REQUIRED: Provide URL for track", "Track URL")
if(!url)
return
var/title = input(C, "REQUIRED: Provide title for track", "Track Title") as text|null
var/title = tgui_input_text(C, "REQUIRED: Provide title for track", "Track Title")
if(!title)
return
var/duration = input(C, "REQUIRED: Provide duration for track (in deciseconds, aka seconds*10)", "Track Duration") as num|null
var/duration = tgui_input_number(C, "REQUIRED: Provide duration for track (in deciseconds, aka seconds*10)", "Track Duration")
if(!duration)
return
// Optional
var/artist = input(C, "Optional: Provide artist for track", "Track Artist") as text|null
var/artist = tgui_input_text(C, "Optional: Provide artist for track", "Track Artist")
if(isnull(artist)) // Cancel rather than empty string
return
@@ -428,7 +428,7 @@
if(!check_rights(R_FUN|R_ADMIN))
return
var/track = input(C, "Input track title or URL to remove (must be exact)", "Remove Track") as text|null
var/track = tgui_input_text(C, "Input track title or URL to remove (must be exact)", "Remove Track")
if(!track)
return

View File

@@ -314,7 +314,7 @@
if(speed <= 0)
speed = 1
if("setpath")
var/newpath = sanitize(input(usr, "Please define a new path!",,path) as text|null)
var/newpath = sanitize(tgui_input_text(usr, "Please define a new path!",,path))
if(newpath && newpath != "")
moving = 0 // stop moving
path = newpath

View File

@@ -28,7 +28,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(usr, "No input found please hang up and try your call again.")
return

View File

@@ -150,7 +150,7 @@ Transponder Codes:<UL>"}
usr.set_machine(src)
if(href_list["locedit"])
var/newloc = sanitize(input(usr, "Enter New Location", "Navigation Beacon", location) as text|null)
var/newloc = sanitize(tgui_input_text(usr, "Enter New Location", "Navigation Beacon", location))
if(newloc)
location = newloc
updateDialog()
@@ -158,12 +158,12 @@ Transponder Codes:<UL>"}
else if(href_list["edit"])
var/codekey = href_list["code"]
var/newkey = input(usr, "Enter Transponder Code Key", "Navigation Beacon", codekey) as text|null
var/newkey = tgui_input_text(usr, "Enter Transponder Code Key", "Navigation Beacon", codekey)
if(!newkey)
return
var/codeval = codes[codekey]
var/newval = input(usr, "Enter Transponder Code Value", "Navigation Beacon", codeval) as text|null
var/newval = tgui_input_text(usr, "Enter Transponder Code Value", "Navigation Beacon", codeval)
if(!newval)
newval = codekey
return
@@ -180,11 +180,11 @@ Transponder Codes:<UL>"}
else if(href_list["add"])
var/newkey = input(usr, "Enter New Transponder Code Key", "Navigation Beacon") as text|null
var/newkey = tgui_input_text(usr, "Enter New Transponder Code Key", "Navigation Beacon")
if(!newkey)
return
var/newval = input(usr, "Enter New Transponder Code Value", "Navigation Beacon") as text|null
var/newval = tgui_input_text(usr, "Enter New Transponder Code Value", "Navigation Beacon")
if(!newval)
newval = "1"
return

View File

@@ -97,7 +97,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/pointdefense)
/obj/machinery/pointdefense_control/attackby(var/obj/item/W, var/mob/user)
if(W?.is_multitool())
var/new_ident = input(user, "Enter a new ident tag.", "[src]", id_tag) as null|text
var/new_ident = tgui_input_text(user, "Enter a new ident tag.", "[src]", id_tag)
if(new_ident && new_ident != id_tag && user.Adjacent(src) && CanInteract(user, GLOB.tgui_physical_state))
// Check for duplicate controllers with this ID
for(var/obj/machinery/pointdefense_control/PC as anything in GLOB.pointdefense_controllers)
@@ -212,7 +212,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/pointdefense)
/obj/machinery/pointdefense/attackby(var/obj/item/W, var/mob/user)
if(W?.is_multitool())
var/new_ident = input(user, "Enter a new ident tag.", "[src]", id_tag) as null|text
var/new_ident = tgui_input_text(user, "Enter a new ident tag.", "[src]", id_tag)
if(new_ident && new_ident != id_tag && user.Adjacent(src) && CanInteract(user, GLOB.tgui_physical_state))
to_chat(user, "<span class='notice'>You register [src] with the [new_ident] network.</span>")
id_tag = new_ident

View File

@@ -153,7 +153,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if(reject_bad_text(params["write"]))
recipient = params["write"] //write contains the string of the receiving department's name
var/new_message = sanitize(input(usr, "Write your message:", "Awaiting Input", ""))
var/new_message = sanitize(tgui_input_text(usr, "Write your message:", "Awaiting Input", ""))
if(new_message)
message = new_message
screen = RCS_MESSAUTH
@@ -169,7 +169,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
. = TRUE
if("writeAnnouncement")
var/new_message = sanitize(input(usr, "Write your message:", "Awaiting Input", ""))
var/new_message = sanitize(tgui_input_text(usr, "Write your message:", "Awaiting Input", ""))
if(new_message)
message = new_message
else
@@ -238,7 +238,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if(computer_deconstruction_screwdriver(user, O))
return
if(istype(O, /obj/item/device/multitool))
var/input = sanitize(input(usr, "What Department ID would you like to give this request console?", "Multitool-Request Console Interface", department))
var/input = sanitize(tgui_input_text(usr, "What Department ID would you like to give this request console?", "Multitool-Request Console Interface", department))
if(!input)
to_chat(usr, "No input found. Please hang up and try your call again.")
return

View File

@@ -128,7 +128,7 @@
. = TRUE
if("network")
var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
var/newnet = tgui_input_text(usr, "Which network do you want to view?", "Comm Monitor", network)
if(newnet && ((usr in range(1, src) || issilicon(usr))))
if(length(newnet) > 15)

View File

@@ -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)

View File

@@ -26,13 +26,13 @@
data["network"] = network
data["temp"] = temp
var/list/machinelistData = list()
var/list/machinelistData = list()
for(var/obj/machinery/telecomms/T in machinelist)
machinelistData.Add(list(list(
machinelistData.Add(list(list(
"id" = T.id,
"name" = T.name,
)))
data["machinelist"] = machinelistData
data["machinelist"] = machinelistData
data["selectedMachine"] = null
if(SelectedMachine)
@@ -100,7 +100,7 @@
. = TRUE
if("network")
var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
var/newnet = tgui_input_text(usr, "Which network do you want to view?", "Comm Monitor", network)
if(newnet && ((usr in range(1, src) || issilicon(usr))))
if(length(newnet) > 15)
set_temp("FAILED: NETWORK TAG STRING TOO LENGTHY", "bad")

View File

@@ -192,7 +192,7 @@
if(href_list["network"])
var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
var/newnet = tgui_input_text(usr, "Which network do you want to view?", "Comm Monitor", network)
if(newnet && ((usr in range(1, src) || issilicon(usr))))
if(length(newnet) > 15)

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -53,7 +53,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)

View File

@@ -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)
@@ -376,7 +376,7 @@
to_chat(usr, "<span class='danger'>Error: Cannot connect to Exonet node.</span>")
return FALSE
var/their_address = params["message"]
var/text = sanitizeSafe(input(usr,"Enter your message.","Text Message"))
var/text = sanitizeSafe(tgui_input_text(usr,"Enter your message.","Text Message"))
if(text)
exonet.send_message(their_address, "text", text)
im_list += list(list("address" = exonet.address, "to_address" = their_address, "im" = text))
@@ -424,7 +424,7 @@
selected_tab = params["switch_tab"]
if("edit")
var/n = input(usr, "Please enter message", name, notehtml) as message|null
var/n = tgui_input_text(usr, "Please enter message", name, notehtml, multiline = TRUE)
n = sanitizeSafe(n, extra = 0)
if(n)
note = html_decode(n)

View File

@@ -102,7 +102,7 @@
switch(href_list["action"])
if("Reply")
var/obj/item/device/communicator/comm = locate(href_list["target"])
var/message = input(usr, "Enter your message below.", "Reply")
var/message = tgui_input_text(usr, "Enter your message below.", "Reply")
if(message)
exonet.send_message(comm.exonet.address, "text", message)
@@ -153,7 +153,7 @@
if(choice)
var/obj/item/device/communicator/chosen_communicator = choice
var/mob/observer/dead/O = src
var/text_message = sanitize(input(src, "What do you want the message to say?") as message)
var/text_message = sanitize(tgui_input_text(src, "What do you want the message to say?", multiline = TRUE))
if(text_message && O.exonet)
O.exonet.send_message(chosen_communicator.exonet.address, "text", text_message)

View File

@@ -323,7 +323,7 @@ var/list/GPS_list = list()
. = TRUE
if(href_list["tag"])
var/a = input(usr, "Please enter desired tag.", name, gps_tag) as text
var/a = tgui_input_text(usr, "Please enter desired tag.", name, gps_tag)
a = uppertext(copytext(sanitize(a), 1, 11))
if(in_range(src, usr))
gps_tag = a

View File

@@ -40,7 +40,7 @@
user.audible_message("<B>[user.GetVoice()]</B>[user.GetAltName()] broadcasts, <FONT size=3>\"[message]\"</FONT>", runemessage = message)
/obj/item/device/megaphone/attack_self(var/mob/living/user)
var/message = sanitize(input(user, "Shout a message?", "Megaphone", null) as text)
var/message = sanitize(tgui_input_text(user, "Shout a message?", "Megaphone", null))
if(!message)
return
message = capitalize(message)

View File

@@ -49,7 +49,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
var/actual_pai_name
var/turf/location = get_turf(src)
if(choice == "No")
var/pai_name = input(user, "Choose your character's name", "Character Name") as text
var/pai_name = tgui_input_text(user, "Choose your character's name", "Character Name")
actual_pai_name = sanitize_name(pai_name, ,1)
if(isnull(actual_pai_name))
return ..()
@@ -73,7 +73,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
new_pai.key = user.key
card.setPersonality(new_pai)
if(!new_pai.savefile_load(new_pai))
var/pai_name = input(new_pai, "Choose your character's name", "Character Name") as text
var/pai_name = tgui_input_text(new_pai, "Choose your character's name", "Character Name")
actual_pai_name = sanitize_name(pai_name, ,1)
if(isnull(actual_pai_name))
return ..()
@@ -83,7 +83,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
new_pai.key = user.key
card.setPersonality(new_pai)
if(!new_pai.savefile_load(new_pai))
var/pai_name = input(new_pai, "Choose your character's name", "Character Name") as text
var/pai_name = tgui_input_text(new_pai, "Choose your character's name", "Character Name")
actual_pai_name = sanitize_name(pai_name, ,1)
if(isnull(actual_pai_name))
return ..()
@@ -328,7 +328,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
if(2)
radio.ToggleReception()
if(href_list["setlaws"])
var/newlaws = sanitize(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.pai_laws) as message)
var/newlaws = sanitize(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.pai_laws, multiline = TRUE))
if(newlaws)
pai.pai_laws = newlaws
to_chat(pai, "Your supplemental directives have been updated. Your new directives are:")

View File

@@ -417,7 +417,7 @@
return
else if(istype(I, /obj/item/weapon/pen))
if(loc == user && !user.incapacitated())
var/new_name = input(user, "What would you like to label the tape?", "Tape labeling") as null|text
var/new_name = tgui_input_text(user, "What would you like to label the tape?", "Tape labeling")
if(isnull(new_name)) return
new_name = sanitizeSafe(new_name)
if(new_name)

View File

@@ -22,7 +22,7 @@
named = 1
*/
var/message = sanitize(input(user,"Choose a message to relay to those around you.") as text|null)
var/message = sanitize(tgui_input_text(user,"Choose a message to relay to those around you."))
if(message)
audible_message("[bicon(src)] \The [src.name] states, \"[message]\"", runemessage = "synthesized speech")
if(ismob(loc))

View File

@@ -65,7 +65,7 @@
if(..())
return 1
if(href_list["channel"])
var/nc = input(usr, "Channel name", "Select new channel name", channel) as text|null
var/nc = tgui_input_text(usr, "Channel name", "Select new channel name", channel)
if(nc)
channel = nc
camera.c_tag = channel

View File

@@ -19,7 +19,7 @@
to_chat(usr, "The hailer is fried. The tiny input screen just shows a waving ASCII penis.")
return
var/new_message = input(usr, "Please enter new message (leave blank to reset).") as text
var/new_message = tgui_input_text(usr, "Please enter new message (leave blank to reset).")
if(!new_message || new_message == "")
use_message = "Halt! Security!"
else

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -133,7 +133,7 @@ AI MODULES
/obj/item/weapon/aiModule/safeguard/attack_self(var/mob/user as mob)
..()
var/targName = sanitize(input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name))
var/targName = sanitize(tgui_input_text(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name))
targetName = targName
desc = text("A 'safeguard' AI module: 'Safeguard []. Anyone threatening or attempting to harm [] is no longer to be considered a crew member, and is a threat which must be neutralized.'", targetName, targetName)
@@ -159,7 +159,7 @@ AI MODULES
/obj/item/weapon/aiModule/oneHuman/attack_self(var/mob/user as mob)
..()
var/targName = sanitize(input(usr, "Please enter the name of the person who is the only crew member.", "Who?", user.real_name))
var/targName = sanitize(tgui_input_text(usr, "Please enter the name of the person who is the only crew member.", "Who?", user.real_name))
targetName = targName
desc = text("A 'one crew member' AI module: 'Only [] is a crew member.'", targetName)
@@ -244,7 +244,7 @@ AI MODULES
if(new_lawpos < MIN_SUPPLIED_LAW_NUMBER) return
lawpos = min(new_lawpos, MAX_SUPPLIED_LAW_NUMBER)
var/newlaw = ""
var/targName = sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw))
var/targName = sanitize(tgui_input_text(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw))
newFreeFormLaw = targName
desc = "A 'freeform' AI module: ([lawpos]) '[newFreeFormLaw]'"
@@ -357,7 +357,7 @@ AI MODULES
/obj/item/weapon/aiModule/freeformcore/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
var/targName = sanitize(input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw))
var/targName = sanitize(tgui_input_text(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw))
newFreeFormLaw = targName
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
@@ -381,7 +381,7 @@ AI MODULES
/obj/item/weapon/aiModule/syndicate/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
var/targName = sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw))
var/targName = sanitize(tgui_input_text(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw))
newFreeFormLaw = targName
desc = "A hacked AI law module: '[newFreeFormLaw]'"

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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))

View File

@@ -184,7 +184,7 @@
switch(param)
if("reason")
if(!value)
value = sanitize(input(usr, "Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null) as null|text)
value = sanitize(tgui_input_text(usr, "Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null))
value = sql_sanitize_text(value)
if(!value)
to_chat(usr, "Cancelled")
@@ -196,7 +196,7 @@
qdel(update_query) //CHOMPEdit TGSQL
if("duration")
if(!value)
value = input(usr, "Insert the new duration (in minutes) for [pckey]'s ban", "New Duration", "[duration]", null) as null|num
value = tgui_input_number(usr, "Insert the new duration (in minutes) for [pckey]'s ban", "New Duration", "[duration]", null)
if(!isnum(value) || !value)
to_chat(usr, "Cancelled")
return

View File

@@ -77,7 +77,7 @@
if("remove all")
to_chat(src, "<span class='filter_adminlog'><b>[TORFILE] was [fdel(TORFILE)?"":"not "]removed.</b></span>")
if("find")
var/input = input(src,"Please input an IP address to search for:","Find ToR ban",null) as null|text
var/input = tgui_input_text(src,"Please input an IP address to search for:","Find ToR ban",null)
if(input)
if(ToRban_isbanned(input))
to_chat(src, "<span class='filter_adminlog'><font color='green'><b>Address is a known ToR address</b></font></span>")

View File

@@ -709,12 +709,12 @@ var/datum/announcement/minor/admin_min_announcer = new
var/channel = tgui_input_list(usr, "Channel for message:","Channel", radiochannels)
if(channel) //They picked a channel
var/sender = input(usr, "Name of sender (max 75):", "Announcement", "Announcement Computer") as null|text
var/sender = tgui_input_text(usr, "Name of sender (max 75):", "Announcement", "Announcement Computer")
if(sender) //They put a sender
sender = sanitize(sender, 75, extra = 0)
var/message = input(usr, "Message content (max 500):", "Contents", "This is a test of the announcement system.") as null|message
var/msgverb = input(usr, "Name of verb (Such as 'states', 'says', 'asks', etc):", "Verb", "says") as null|text //VOREStation Addition
var/message = tgui_input_text(usr, "Message content (max 500):", "Contents", "This is a test of the announcement system.", multiline = TRUE)
var/msgverb = tgui_input_text(usr, "Name of verb (Such as 'states', 'says', 'asks', etc):", "Verb", "says")
if(message) //They put a message
message = sanitize(message, 500, extra = 0)
//VOREStation Edit Start
@@ -752,7 +752,7 @@ var/datum/announcement/minor/admin_min_announcer = new
The above will result in those messages playing, with a 5 second gap between each. Maximum of 20 messages allowed.</span>")
var/list/decomposed
var/message = input(usr,"See your chat box for instructions. Keep a copy elsewhere in case it is rejected when you click OK.", "Input Conversation", "") as null|message
var/message = tgui_input_text(usr,"See your chat box for instructions. Keep a copy elsewhere in case it is rejected when you click OK.", "Input Conversation", "", multiline = TRUE)
if(!message)
return
@@ -1120,7 +1120,7 @@ var/datum/announcement/minor/admin_min_announcer = new
if(!seedtype || !SSplants.seeds[seedtype])
return
var/amount = input(usr, "Amount of fruit to spawn", "Fruit Amount", 1) as null|num
var/amount = tgui_input_number(usr, "Amount of fruit to spawn", "Fruit Amount", 1)
if(!isnull(amount))
var/datum/seed/S = SSplants.seeds[seedtype]
S.harvest(usr,0,0,amount)
@@ -1533,7 +1533,7 @@ var/datum/announcement/minor/admin_min_announcer = new
var/crystals
if(check_rights(R_ADMIN|R_EVENT))
crystals = input(usr, "Amount of telecrystals for [H.ckey], currently [H.mind.tcrystals].", crystals) as null|num
crystals = tgui_input_number(usr, "Amount of telecrystals for [H.ckey], currently [H.mind.tcrystals].", crystals)
if (!isnull(crystals))
H.mind.tcrystals = crystals
var/msg = "[key_name(usr)] has modified [H.ckey]'s telecrystals to [crystals]."
@@ -1549,7 +1549,7 @@ var/datum/announcement/minor/admin_min_announcer = new
var/crystals
if(check_rights(R_ADMIN|R_EVENT))
crystals = input(usr, "Amount of telecrystals to give to [H.ckey], currently [H.mind.tcrystals].", crystals) as null|num
crystals = tgui_input_number(usr, "Amount of telecrystals to give to [H.ckey], currently [H.mind.tcrystals].", crystals)
if (!isnull(crystals))
H.mind.tcrystals += crystals
var/msg = "[key_name(usr)] has added [crystals] to [H.ckey]'s telecrystals."
@@ -1572,7 +1572,7 @@ var/datum/announcement/minor/admin_min_announcer = new
to_chat(usr, "Error: you are not an admin!")
return
var/replyorigin = input(src.owner, "Please specify who the fax is coming from", "Origin") as text|null
var/replyorigin = tgui_input_text(src.owner, "Please specify who the fax is coming from", "Origin")
var/obj/item/weapon/paper/admin/P = new /obj/item/weapon/paper/admin( null ) //hopefully the null loc won't cause trouble for us
faxreply = P
@@ -1587,7 +1587,7 @@ var/datum/announcement/minor/admin_min_announcer = new
/datum/admins/var/obj/item/weapon/paper/admin/faxreply // var to hold fax replies in
/datum/admins/proc/faxCallback(var/obj/item/weapon/paper/admin/P, var/obj/machinery/photocopier/faxmachine/destination)
var/customname = input(src.owner, "Pick a title for the report", "Title") as text|null
var/customname = tgui_input_text(src.owner, "Pick a title for the report", "Title")
P.name = "[P.origin] - [customname]"
P.desc = "This is a paper titled '" + P.name + "'."

View File

@@ -18,7 +18,7 @@
/client/proc/admin_memo_write()
var/savefile/F = new(MEMOFILE)
if(F)
var/memo = sanitize(input(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null) as null|message, extra = 0)
var/memo = sanitize(tgui_input_text(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null, multiline = TRUE), extra = 0)
switch(memo)
if(null)
return

View File

@@ -127,7 +127,7 @@ world/New()
if(M.client)
CID = M.client.computer_id
var/body = input(src.mob, "Describe in detail what you're reporting [M] for", "Report") as null|text
var/body = tgui_input_text(src.mob, "Describe in detail what you're reporting [M] for", "Report")
if(!body) return
@@ -174,7 +174,7 @@ world/New()
if(!found)
to_chat(src, "<b>* An error occured, sorry.</b>")
var/body = input(src.mob, "Enter a body for the news", "Body") as null|message
var/body = tgui_input_text(src.mob, "Enter a body for the news", "Body", multiline = TRUE)
if(!body) return
found.body = body

View File

@@ -180,7 +180,7 @@
if(istype(src.mob, /mob/new_player))
mob.name = capitalize(ckey)
else
var/new_key = ckeyEx(input(usr, "Enter your desired display name.", "Fake Key", key) as text|null)
var/new_key = ckeyEx(tgui_input_text(usr, "Enter your desired display name.", "Fake Key", key))
if(!new_key)
return
if(length(new_key) >= 26)
@@ -254,10 +254,10 @@
if("Big Bomb")
explosion(epicenter, 3, 5, 7, 5)
if("Custom Bomb")
var/devastation_range = input(usr, "Devastation range (in tiles):") as num
var/heavy_impact_range = input(usr, "Heavy impact range (in tiles):") as num
var/light_impact_range = input(usr, "Light impact range (in tiles):") as num
var/flash_range = input(usr, "Flash range (in tiles):") as num
var/devastation_range = tgui_input_number(usr, "Devastation range (in tiles):")
var/heavy_impact_range = tgui_input_number(usr, "Heavy impact range (in tiles):")
var/light_impact_range = tgui_input_number(usr, "Light impact range (in tiles):")
var/flash_range = tgui_input_number(usr, "Flash range (in tiles):")
explosion(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range)
message_admins("<font color='blue'>[ckey] creating an admin explosion at [epicenter.loc].</font>")
feedback_add_details("admin_verb","DB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -277,7 +277,7 @@
if ("Badmin") severity = 99
D.makerandom(severity)
D.infectionchance = input(usr, "How virulent is this disease? (1-100)", "Give Disease", D.infectionchance) as num
D.infectionchance = tgui_input_number(usr, "How virulent is this disease? (1-100)", "Give Disease", D.infectionchance)
if(istype(T,/mob/living/carbon/human))
var/mob/living/carbon/human/H = T
@@ -308,7 +308,7 @@
var/new_modifier_type = tgui_input_list(usr, "What modifier should we add to [L]?", "Modifier Type", possible_modifiers)
if(!new_modifier_type)
return
var/duration = input(usr, "How long should the new modifier last, in seconds. To make it last forever, write '0'.", "Modifier Duration") as num
var/duration = tgui_input_number(usr, "How long should the new modifier last, in seconds. To make it last forever, write '0'.", "Modifier Duration")
if(duration == 0)
duration = null
else
@@ -322,7 +322,7 @@
set name = "Make Sound"
set desc = "Display a message to everyone who can hear the target"
if(O)
var/message = sanitize(input(usr, "What do you want the message to be?", "Make Sound") as text|null)
var/message = sanitize(tgui_input_text(usr, "What do you want the message to be?", "Make Sound"))
if(!message)
return
O.audible_message(message)
@@ -406,7 +406,7 @@
var/mob/living/silicon/S = tgui_input_list(usr, "Select silicon.", "Rename Silicon.", silicon_mob_list)
if(!S) return
var/new_name = sanitizeSafe(input(src, "Enter new name. Leave blank or as is to cancel.", "[S.real_name] - Enter new silicon name", S.real_name))
var/new_name = sanitizeSafe(tgui_input_text(src, "Enter new name. Leave blank or as is to cancel.", "[S.real_name] - Enter new silicon name", S.real_name))
if(new_name && new_name != S.real_name)
log_and_message_admins("has renamed the silicon '[S.real_name]' to '[new_name]'")
S.SetName(new_name)

View File

@@ -39,9 +39,9 @@
if(isturf(orbiter))
to_chat(usr, "<span class = 'warning'>The orbiter cannot be a turf. It can only be used as a center.</span>")
return
var/distance = input(usr, "How large will their orbit radius be? (In pixels. 32 is 'near around a character)", "Orbit Radius", 32) as num|null
var/speed = input(usr, "How fast will they orbit (negative numbers spin clockwise)", "Orbit Speed", 20) as num|null
var/segments = input(usr, "How many segments will they have in their orbit? (3 is a triangle, 36 is a circle, etc)", "Orbit Segments", 36) as num|null
var/distance = tgui_input_number(usr, "How large will their orbit radius be? (In pixels. 32 is 'near around a character)", "Orbit Radius", 32)
var/speed = tgui_input_number(usr, "How fast will they orbit (negative numbers spin clockwise)", "Orbit Speed", 20)
var/segments = tgui_input_number(usr, "How many segments will they have in their orbit? (3 is a triangle, 36 is a circle, etc)", "Orbit Segments", 36)
var/clock = FALSE
if(!distance)
distance = 32

View File

@@ -21,7 +21,7 @@
target = null
targetselected = 0
var/procname = input(usr, "Proc path, eg: /proc/fake_blood","Path:", null) as text|null
var/procname = tgui_input_text(usr, "Proc path, eg: /proc/fake_blood","Path:", null)
if(!procname)
return
@@ -136,7 +136,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
if(!check_rights(R_DEBUG))
return
var/procname = input(usr, "Proc name, eg: fake_blood","Proc:", null) as text|null
var/procname = tgui_input_text(usr, "Proc name, eg: fake_blood","Proc:", null)
if(!procname)
return
if(!hascall(A,procname))
@@ -161,7 +161,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
to_chat(usr, .)
/client/proc/get_callproc_args()
var/argnum = input(usr, "Number of arguments","Number:",0) as num|null
var/argnum = tgui_input_number(usr, "Number of arguments","Number:",0)
if(isnull(argnum))
return null //Cancel

View File

@@ -22,13 +22,13 @@
if(F)
var/title = F["title"]
var/body = html2paper_markup(F["body"])
var/new_title = sanitize(input(src,"Write a good title for the news update. Note: HTML is NOT supported.","Write News", title) as null|text, extra = 0)
var/new_title = sanitize(tgui_input_text(src,"Write a good title for the news update. Note: HTML is NOT supported.","Write News", title), extra = 0)
if(!new_title)
return
var/new_body = sanitize(input(src,"Write the body of the news update here. Note: HTML is NOT supported, however paper markup is supported. \n\
var/new_body = sanitize(tgui_input_text(src,"Write the body of the news update here. Note: HTML is NOT supported, however paper markup is supported. \n\
Hitting enter will automatically add a line break. \n\
Valid markup includes: \[b\], \[i\], \[u\], \[large\], \[h1\], \[h2\], \[h3\]\ \[*\], \[hr\], \[small\], \[list\], \[table\], \[grid\], \
\[row\], \[cell\], \[logo\], \[sglogo\].","Write News", body) as null|message, extra = 0)
\[row\], \[cell\], \[logo\], \[sglogo\].","Write News", body, multiline = TRUE), extra = 0)
new_body = paper_markup2html(new_body)

View File

@@ -26,7 +26,7 @@
var/transition_area = tgui_input_list(user, "Which area is the transition area? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)", "Area Choice", area_choices)
if (!transition_area) return
var/move_duration = input(user, "How many seconds will this jump take?") as num
var/move_duration = tgui_input_number(user, "How many seconds will this jump take?")
S.long_jump(area_choices[origin_area], area_choices[destination_area], area_choices[transition_area], move_duration)
message_admins("<span class='notice'>[key_name_admin(user)] has initiated a jump from [origin_area] to [destination_area] lasting [move_duration] seconds for the [shuttle_tag] shuttle</span>", 1)

View File

@@ -113,7 +113,7 @@
var/task = href_list["editrights"]
if(task == "add")
var/new_ckey = ckey(input(usr,"New admin's ckey","Admin ckey", null) as text|null)
var/new_ckey = ckey(tgui_input_text(usr,"New admin's ckey","Admin ckey", null))
if(!new_ckey) return
if(new_ckey in admin_datums)
to_chat(usr, "<span class='filter_adminlog warning'>Error: Topic 'editrights': [new_ckey] is already an admin</span>")
@@ -151,7 +151,11 @@
switch(new_rank)
if(null,"") return
if("*New Rank*")
<<<<<<< HEAD
new_rank = input(usr, "Please input a new rank", "New custom rank", null, null) as null|text
=======
new_rank = tgui_input_text(usr, "Please input a new rank", "New custom rank")
>>>>>>> b875945450... Merge pull request #13112 from ItsSelis/tgui-input-conversions
if(config.admin_legacy_system)
new_rank = ckeyEx(new_rank)
if(!new_rank)
@@ -232,7 +236,7 @@
if(!check_rights(R_SERVER)) return
if (emergency_shuttle.wait_for_launch)
var/new_time_left = input(usr, "Enter new shuttle launch countdown (seconds):","Edit Shuttle Launch Time", emergency_shuttle.estimate_launch_time() ) as num
var/new_time_left = tgui_input_number(usr, "Enter new shuttle launch countdown (seconds):","Edit Shuttle Launch Time", emergency_shuttle.estimate_launch_time() )
emergency_shuttle.launch_time = world.time + new_time_left*10
@@ -240,7 +244,7 @@
message_admins("<font color='blue'>[key_name_admin(usr)] edited the Emergency Shuttle's launch time to [new_time_left*10]</font>", 1)
else if (emergency_shuttle.shuttle.has_arrive_time())
var/new_time_left = input(usr, "Enter new shuttle arrival time (seconds):","Edit Shuttle Arrival Time", emergency_shuttle.estimate_arrival_time() ) as num
var/new_time_left = tgui_input_number(usr, "Enter new shuttle arrival time (seconds):","Edit Shuttle Arrival Time", emergency_shuttle.estimate_arrival_time() )
emergency_shuttle.shuttle.arrive_time = world.time + new_time_left*10
log_admin("[key_name(usr)] edited the Emergency Shuttle's arrival time to [new_time_left]")
@@ -338,17 +342,17 @@
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
duration = GetExp(minutes)
reason = sanitize(input(usr,"Reason?","reason",reason2) as text|null)
reason = sanitize(tgui_input_text(usr,"Reason?","reason",reason2))
if(!reason) return
if("No")
temp = 0
duration = "Perma"
reason = sanitize(input(usr,"Reason?","reason",reason2) as text|null)
reason = sanitize(tgui_input_text(usr,"Reason?","reason",reason2))
if(!reason) return
log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
@@ -758,13 +762,13 @@
if(config.ban_legacy_system)
to_chat(usr, "<span class='filter_adminlog warning'>Your server is using the legacy banning system, which does not support temporary job bans. Consider upgrading. Aborting ban.</span>")
return
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
var/mins = tgui_input_number(usr,"How long (in minutes)?","Ban time",1440)
if(!mins)
return
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > config.mod_job_tempban_max)
to_chat(usr, "<span class='filter_adminlog warning'> Moderators can only job tempban up to [config.mod_job_tempban_max] minutes!</span>")
return
var/reason = sanitize(input(usr,"Reason?","Please State Reason","") as text|null)
var/reason = sanitize(tgui_input_text(usr,"Reason?","Please State Reason",""))
if(!reason)
return
@@ -789,7 +793,7 @@
return 1
if("No")
if(!check_rights(R_BAN)) return
var/reason = sanitize(input(usr,"Reason?","Please State Reason","") as text|null)
var/reason = sanitize(tgui_input_text(usr,"Reason?","Please State Reason",""))
if(reason)
var/msg
for(var/job in notbannedlist)
@@ -846,7 +850,7 @@
if (ismob(M))
if(!check_if_greater_rights_than(M.client))
return
var/reason = sanitize(input(usr, "Please enter reason.") as null|message)
var/reason = sanitize(tgui_input_text(usr, "Please enter reason.", multiline = TRUE))
if(!reason)
return
@@ -888,14 +892,14 @@
switch(tgui_alert(usr, "Temporary Ban?","Temporary Ban",list("Yes","No","Cancel")))
if("Yes")
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
var/mins = tgui_input_number(usr,"How long (in minutes)?","Ban time",1440)
if(!mins)
return
if(check_rights(R_MOD, 0) && !check_rights(R_BAN, 0) && mins > config.mod_tempban_max)
to_chat(usr, "<span class='warning'>Moderators can only job tempban up to [config.mod_tempban_max] minutes!</span>")
return
if(mins >= 525600) mins = 525599
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
var/reason = sanitize(tgui_input_text(usr,"Reason?","reason","Griefer"))
if(!reason)
return
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins)
@@ -919,7 +923,7 @@
//qdel(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
if("No")
if(!check_rights(R_BAN)) return
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
var/reason = sanitize(tgui_input_text(usr,"Reason?","reason","Griefer"))
if(!reason)
return
switch(tgui_alert(usr,"IP ban?","IP Ban",list("Yes","No","Cancel")))
@@ -1045,7 +1049,7 @@
if(!ismob(M))
to_chat(usr, "<span class='filter_adminlog'>this can only be used on instances of type /mob</span>")
var/speech = input(usr, "What will [key_name(M)] say?.", "Force speech", "") // Don't need to sanitize, since it does that in say(), we also trust our admins.
var/speech = tgui_input_text(usr, "What will [key_name(M)] say?.", "Force speech", "") // Don't need to sanitize, since it does that in say(), we also trust our admins.
if(!speech) return
M.say(speech)
speech = sanitize(speech) // Nah, we don't trust them
@@ -1463,7 +1467,7 @@
return
if(L.can_centcom_reply())
var/input = sanitize(input(src.owner, "Please enter a message to reply to [key_name(L)] via their headset.","Outgoing message from CentCom", ""))
var/input = sanitize(tgui_input_text(src.owner, "Please enter a message to reply to [key_name(L)] via their headset.","Outgoing message from CentCom", ""))
if(!input) return
to_chat(src.owner, "<span class='filter_adminlog'>You sent [input] to [L] via a secure channel.</span>")
@@ -1488,7 +1492,7 @@
to_chat(usr, "<span class='filter_adminlog'>The person you are trying to contact is not wearing a headset</span>")
return
var/input = sanitize(input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from a shadowy figure...", ""))
var/input = sanitize(tgui_input_text(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from a shadowy figure...", ""))
if(!input) return
to_chat(src.owner, "<span class='filter_adminlog'>You sent [input] to [H] via a secure channel.</span>")
@@ -1785,7 +1789,7 @@
src.access_news_network()
else if(href_list["ac_set_channel_name"])
src.admincaster_feed_channel.channel_name = sanitizeSafe(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
src.admincaster_feed_channel.channel_name = sanitizeSafe(tgui_input_text(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
src.access_news_network()
else if(href_list["ac_set_channel_lock"])
@@ -1817,11 +1821,11 @@
src.access_news_network()
else if(href_list["ac_set_new_title"])
src.admincaster_feed_message.title = sanitize(input(usr, "Enter the Feed title", "Network Channel Handler", ""))
src.admincaster_feed_message.title = sanitize(tgui_input_text(usr, "Enter the Feed title", "Network Channel Handler", ""))
src.access_news_network()
else if(href_list["ac_set_new_message"])
src.admincaster_feed_message.body = sanitize(input(usr, "Write your Feed story", "Network Channel Handler", "") as message)
src.admincaster_feed_message.body = sanitize(tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", "", multiline = TRUE))
src.access_news_network()
else if(href_list["ac_submit_new_message"])
@@ -1863,11 +1867,11 @@
src.access_news_network()
else if(href_list["ac_set_wanted_name"])
src.admincaster_feed_message.author = sanitize(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
src.admincaster_feed_message.author = sanitize(tgui_input_text(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
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"])
@@ -1972,7 +1976,7 @@
src.access_news_network()
else if(href_list["ac_set_signature"])
src.admincaster_signature = sanitize(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
src.admincaster_signature = sanitize(tgui_input_text(usr, "Provide your desired signature", "Network Identity Handler", ""))
src.access_news_network()
else if(href_list["populate_inactive_customitems"])

View File

@@ -491,7 +491,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
usr << browse(dat.Join(), "window=ahelp[id];size=620x480")
/datum/admin_help/proc/Retitle()
var/new_title = input(usr, "Enter a title for the ticket", "Rename Ticket", name) as text|null
var/new_title = tgui_input_text(usr, "Enter a title for the ticket", "Rename Ticket", name)
if(new_title)
name = new_title
//not saying the original name cause it could be a long ass message

View File

@@ -210,13 +210,13 @@
if(config.allow_admin_jump)
if(isnull(tx))
tx = input(usr, "Select X coordinate", "Move Atom", null, null) as null|num
tx = tgui_input_number(usr, "Select X coordinate", "Move Atom", null, null)
if(!tx) return
if(isnull(ty))
ty = input(usr, "Select Y coordinate", "Move Atom", null, null) as null|num
ty = tgui_input_number(usr, "Select Y coordinate", "Move Atom", null, null)
if(!ty) return
if(isnull(tz))
tz = input(usr, "Select Z coordinate", "Move Atom", null, null) as null|num
tz = tgui_input_number(usr, "Select Z coordinate", "Move Atom", null, null)
if(!tz) return
var/turf/T = locate(tx, ty, tz)
if(!T)

View File

@@ -57,7 +57,7 @@
if(AH)
message_admins("<span class='pm'>[key_name_admin(src)] has started replying to [key_name(C, 0, 0)]'s admin help.</span>")
var/msg = input(src,"Message:", "Private message to [key_name(C, 0, 0)]") as text|null
var/msg = tgui_input_text(src,"Message:", "Private message to [key_name(C, 0, 0)]")
if (!msg)
message_admins("<span class='pm'>[key_name_admin(src)] has cancelled their reply to [key_name(C, 0, 0)]'s admin help.</span>")
return
@@ -92,7 +92,7 @@
if(!ircreplyamount) //to prevent people from spamming irc
return
if(!msg)
msg = input(src,"Message:", "Private message to Administrator") as text|null
msg = tgui_input_text(src,"Message:", "Private message to Administrator")
if(!msg)
return
@@ -112,7 +112,7 @@
//get message text, limit it's length.and clean/escape html
if(!msg)
msg = input(src,"Message:", "Private message to [key_name(recipient, 0, 0)]") as text|null
msg = tgui_input_text(src,"Message:", "Private message to [key_name(recipient, 0, 0)]")
if(!msg)
return
@@ -188,7 +188,7 @@
spawn() //so we don't hold the caller proc up
var/sender = src
var/sendername = key
var/reply = input(recipient, msg,"Admin PM from-[sendername]", "") as text|null //show message and await a reply
var/reply = tgui_input_text(recipient, msg,"Admin PM from-[sendername]", "") //show message and await a reply
if(recipient && reply)
if(sender)
recipient.cmd_admin_pm(sender,reply) //sender is still about, let's reply to them

View File

@@ -257,16 +257,16 @@
if(BUILDMODE_EDIT)
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine")
master.buildmode.varholder = input(usr,"Enter variable name:" ,"Name", "name")
master.buildmode.varholder = tgui_input_text(usr,"Enter variable name:" ,"Name", "name")
if(master.buildmode.varholder in locked && !check_rights(R_DEBUG,0))
return 1
var/thetype = tgui_input_list(usr,"Select variable type:", "Type", list("text","number","mob-reference","obj-reference","turf-reference"))
if(!thetype) return 1
switch(thetype)
if("text")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value", "value") as text
master.buildmode.valueholder = tgui_input_text(usr,"Enter variable value:" ,"Value", "value")
if("number")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value", 123) as num
master.buildmode.valueholder = tgui_input_number(usr,"Enter variable value:" ,"Value", 123)
if("mob-reference")
master.buildmode.valueholder = tgui_input_list(usr,"Enter variable value:", "Value", mob_list)
if("obj-reference")
@@ -286,11 +286,11 @@
var/choice = tgui_alert(usr, "Change the new light range, power, or color?", "Light Maker", list("Range", "Power", "Color"))
switch(choice)
if("Range")
var/input = input(usr, "New light range.","Light Maker",3) as null|num
var/input = tgui_input_number(usr, "New light range.","Light Maker",3)
if(input)
new_light_range = input
if("Power")
var/input = input(usr, "New light power.","Light Maker",3) as null|num
var/input = tgui_input_number(usr, "New light power.","Light Maker",3)
if(input)
new_light_intensity = input
if("Color")
@@ -625,7 +625,7 @@
return
/obj/effect/bmode/buildmode/proc/get_path_from_partial_text(default_path)
var/desired_path = input(usr, "Enter full or partial typepath.","Typepath","[default_path]")
var/desired_path = tgui_input_text(usr, "Enter full or partial typepath.","Typepath","[default_path]")
var/list/types = typesof(/atom)
var/list/matches = list()

View File

@@ -74,7 +74,7 @@
M.g_skin = hex2num(copytext(new_skin, 4, 6))
M.b_skin = hex2num(copytext(new_skin, 6, 8))
var/new_tone = input(usr, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation") as text
var/new_tone = tgui_input_number(usr, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation", null, 220, 1)
if (new_tone)
M.s_tone = max(min(round(text2num(new_tone)), 220), 1)

View File

@@ -12,7 +12,7 @@
if("explosion")
if(tgui_alert(usr, "The game will be over. Are you really sure?", "Confirmation", list("Continue","Cancel")) == "Cancel")
return
var/parameter = input(src,"station_missed = ?","Enter Parameter",0) as num
var/parameter = tgui_input_number(src,"station_missed = ?","Enter Parameter",0,1,0)
var/override
switch(parameter)
if(1)

View File

@@ -152,7 +152,7 @@
if(tgui_alert(pai, "Do you want to load your pAI data?", "Load", list("Yes", "No")) == "Yes")
pai.savefile_load(pai)
else
pai.name = sanitizeSafe(input(pai, "Enter your pAI name:", "pAI Name", "Personal AI") as text)
pai.name = sanitizeSafe(tgui_input_text(pai, "Enter your pAI name:", "pAI Name", "Personal AI"))
card.setPersonality(pai)
for(var/datum/paiCandidate/candidate in paiController.pai_candidates)
if(candidate.key == choice.key)
@@ -662,9 +662,9 @@
var/datum/planet/planet = tgui_input_list(usr, "Which planet do you want to modify time on?", "Change Time", SSplanets.planets)
if(istype(planet))
var/datum/time/current_time_datum = planet.current_time
var/new_hour = input(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh"))) as null|num
var/new_hour = tgui_input_number(usr, "What hour do you want to change to?", "Change Time", text2num(current_time_datum.show_time("hh")))
if(!isnull(new_hour))
var/new_minute = input(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")) ) as null|num
var/new_minute = tgui_input_number(usr, "What minute do you want to change to?", "Change Time", text2num(current_time_datum.show_time("mm")) )
if(!isnull(new_minute))
var/type_needed = current_time_datum.type
var/datum/time/new_time = new type_needed()

View File

@@ -177,7 +177,7 @@
set desc = "This searches all the active jobban entries for the current round and outputs the results to standard output."
set category = "Debug"
var/job_filter = input(usr, "Contains what?","Job Filter") as text|null
var/job_filter = tgui_input_text(usr, "Contains what?","Job Filter")
if(!job_filter)
return

View File

@@ -4,8 +4,8 @@
if(!check_rights(R_FUN))
return
var/sum = input(usr, "How many times should we throw?") as num
var/side = input(usr, "Select the number of sides.") as num
var/sum = tgui_input_number(usr, "How many times should we throw?")
var/side = tgui_input_number(usr, "Select the number of sides.")
if(!side)
side = 6
if(!sum)

View File

@@ -8,7 +8,7 @@
if(!check_rights(R_DEBUG))
return
var/new_fps = round(input(usr, "Sets game frames-per-second. Can potentially break the game (default: [config.fps])", "FPS", world.fps) as num|null)
var/new_fps = round(tgui_input_number(usr, "Sets game frames-per-second. Can potentially break the game (default: [config.fps])", "FPS", world.fps))
if(new_fps <= 0)
to_chat(src, "<span class='danger'>Error: set_server_fps(): Invalid world.fps value. No changes made.</span>")
return

View File

@@ -279,13 +279,13 @@ var/list/debug_verbs = list (
/client/proc/count_objects_on_z_level()
set category = "Mapping"
set name = "Count Objects On Level"
var/level = input(usr, "Which z-level?","Level?") as text
var/level = tgui_input_text(usr, "Which z-level?","Level?")
if(!level) return
var/num_level = text2num(level)
if(!num_level) return
if(!isnum(num_level)) return
var/type_text = input(usr, "Which type path?","Path?") as text
var/type_text = tgui_input_text(usr, "Which type path?","Path?")
if(!type_text) return
var/type_path = text2path(type_text)
if(!type_path) return
@@ -323,7 +323,7 @@ var/list/debug_verbs = list (
set category = "Mapping"
set name = "Count Objects All"
var/type_text = input(usr, "Which type path?","") as text
var/type_text = tgui_input_text(usr, "Which type path?","")
if(!type_text) return
var/type_path = text2path(type_text)
if(!type_path) return

View File

@@ -86,7 +86,7 @@
if (!holder)
return
var/msg = sanitize(input(usr, "Message:", text("Subtle PM to [M.key]")) as text)
var/msg = sanitize(tgui_input_text(usr, "Message:", text("Subtle PM to [M.key]")))
if (!msg)
return
@@ -108,7 +108,7 @@
if (!holder)
return
var/msg = input(usr, "Message:", text("Enter the text you wish to appear to everyone:")) as text
var/msg = tgui_input_text(usr, "Message:", text("Enter the text you wish to appear to everyone:"))
if(!(msg[1] == "<" && msg[length(msg)] == ">")) //You can use HTML but only if the whole thing is HTML. Tries to prevent admin 'accidents'.
msg = sanitize(msg)
@@ -132,7 +132,7 @@
if(!M)
return
var/msg = input(usr, "Message:", text("Enter the text you wish to appear to your target:")) as text
var/msg = tgui_input_text(usr, "Message:", text("Enter the text you wish to appear to your target:"))
if(msg && !(msg[1] == "<" && msg[length(msg)] == ">")) //You can use HTML but only if the whole thing is HTML. Tries to prevent admin 'accidents'.
msg = sanitize(msg)
@@ -575,7 +575,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!holder)
return
var/input = sanitize(input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null)
var/input = sanitize(tgui_input_text(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", ""))
if(!input)
return
for(var/mob/living/silicon/ai/M in mob_list)
@@ -627,8 +627,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!holder)
return
var/input = sanitize(input(usr, "Please enter anything you want. Anything. Serious.", "What?", "") as message|null, extra = 0)
var/customname = sanitizeSafe(input(usr, "Pick a title for the report.", "Title") as text|null)
var/input = sanitize(tgui_input_text(usr, "Please enter anything you want. Anything. Serious.", "What?", "", multiline = TRUE), extra = 0)
var/customname = sanitizeSafe(tgui_input_text(usr, "Pick a title for the report.", "Title"))
if(!input)
return
if(!customname)
@@ -675,13 +675,13 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_DEBUG|R_FUN)) return //VOREStation Edit
var/devastation = input(usr, "Range of total devastation. -1 to none", text("Input")) as num|null
var/devastation = tgui_input_number(usr, "Range of total devastation. -1 to none", text("Input"))
if(devastation == null) return
var/heavy = input(usr, "Range of heavy impact. -1 to none", text("Input")) as num|null
var/heavy = tgui_input_number(usr, "Range of heavy impact. -1 to none", text("Input"))
if(heavy == null) return
var/light = input(usr, "Range of light impact. -1 to none", text("Input")) as num|null
var/light = tgui_input_number(usr, "Range of light impact. -1 to none", text("Input"))
if(light == null) return
var/flash = input(usr, "Range of flash. -1 to none", text("Input")) as num|null
var/flash = tgui_input_number(usr, "Range of flash. -1 to none", text("Input"))
if(flash == null) return
if ((devastation != -1) || (heavy != -1) || (light != -1) || (flash != -1))
@@ -703,13 +703,13 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_DEBUG|R_FUN)) return //VOREStation Edit
var/heavy = input(usr, "Range of heavy pulse.", text("Input")) as num|null
var/heavy = tgui_input_number(usr, "Range of heavy pulse.", text("Input"))
if(heavy == null) return
var/med = input(usr, "Range of medium pulse.", text("Input")) as num|null
var/med = tgui_input_number(usr, "Range of medium pulse.", text("Input"))
if(med == null) return
var/light = input(usr, "Range of light pulse.", text("Input")) as num|null
var/light = tgui_input_number(usr, "Range of light pulse.", text("Input"))
if(light == null) return
var/long = input(usr, "Range of long pulse.", text("Input")) as num|null
var/long = tgui_input_number(usr, "Range of long pulse.", text("Input"))
if(long == null) return
if (heavy || med || light || long)

View File

@@ -10,7 +10,7 @@
if(!picked_client)
return
var/list/types = typesof(/mob/living)
var/mob_type = input(src, "Mob path to spawn as?", "Mob") as text
var/mob_type = tgui_input_text(src, "Mob path to spawn as?", "Mob")
if(!mob_type)
return
var/list/matches = new()
@@ -81,7 +81,7 @@
if (!holder)
return
var/msg = input(usr, "Message:", text("Enter the text you wish to appear to everyone:")) as text
var/msg = tgui_input_text(usr, "Message:", text("Enter the text you wish to appear to everyone:"))
if(!(msg[1] == "<" && msg[length(msg)] == ">")) //You can use HTML but only if the whole thing is HTML. Tries to prevent admin 'accidents'.
msg = sanitize(msg)

View File

@@ -4,8 +4,13 @@
set category = "Fun"
if(!check_rights(R_ADMIN, R_FUN))
return
<<<<<<< HEAD
var/size_multiplier = input(usr, "Input size multiplier.", "Resize", 1) as num|null
=======
var/size_multiplier = tgui_input_number(usr, "Input size multiplier.", "Resize", 1)
>>>>>>> b875945450... Merge pull request #13112 from ItsSelis/tgui-input-conversions
if(!size_multiplier)
return //cancelled

View File

@@ -43,7 +43,7 @@ var/const/commandos_possible = 6 //if more Commandos are needed in the future
choice = null
while(!choice)
choice = sanitize(input(src, "Please specify which mission the strike team shall undertake.", "Specify Mission", ""))
choice = sanitize(tgui_input_text(src, "Please specify which mission the strike team shall undertake.", "Specify Mission", ""))
if(!choice)
if(tgui_alert(usr, "Error, no mission set. Do you want to exit the setup process?","Strike Team",list("Yes","No"))=="Yes")
return

View File

@@ -85,19 +85,19 @@
switch(.["class"])
if (VV_TEXT)
.["value"] = input(usr, "Enter new text:", "Text", current_value) as null|text
.["value"] = tgui_input_text(usr, "Enter new text:", "Text", current_value)
if (.["value"] == null)
.["class"] = null
return
if (VV_MESSAGE)
.["value"] = input(usr, "Enter new text:", "Text", current_value) as null|message
.["value"] = tgui_input_text(usr, "Enter new text:", "Text", current_value, multiline = TRUE)
if (.["value"] == null)
.["class"] = null
return
if (VV_NUM)
.["value"] = input(usr, "Enter new number:", "Num", current_value) as null|num
.["value"] = tgui_input_number(usr, "Enter new number:", "Num", current_value)
if (.["value"] == null)
.["class"] = null
return
@@ -124,7 +124,7 @@
var/type = current_value
var/error = ""
do
type = input(usr, "Enter type:[error]", "Type", type) as null|text
type = tgui_input_text(usr, "Enter type:[error]", "Type", type)
if (!type)
break
type = text2path(type)
@@ -229,7 +229,7 @@
var/type = current_value
var/error = ""
do
type = input(usr, "Enter type:[error]", "Type", type) as null|text
type = tgui_input_text(usr, "Enter type:[error]", "Type", type)
if (!type)
break
type = text2path(type)

View File

@@ -475,7 +475,7 @@
var/Text = href_list["adjustDamage"]
var/amount = input(usr, "Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num
var/amount = tgui_input_number(usr, "Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0)
if(!L)
to_chat(usr, "Mob doesn't exist anymore")

View File

@@ -214,7 +214,7 @@
if(tmr.timing)
to_chat(usr, "<span class='notice'>Clock is ticking already.</span>")
else
var/ntime = input(usr, "Enter desired time in seconds", "Time", "5") as num
var/ntime = tgui_input_number(usr, "Enter desired time in seconds", "Time", "5", 1000, 0)
if (ntime>0 && ntime<1000)
tmr.time = ntime
name = initial(name) + "([tmr.time] secs)"

View File

@@ -0,0 +1,485 @@
//Original Casino Code created by Shadowfire117#1269 - Ported from CHOMPstation
//Modified by GhostActual#2055 for use with VOREstation
//
//Roulette Table
//
/obj/structure/casino_table
name = "casino table"
desc = "this is an unremarkable table for a casino."
icon = 'icons/obj/casino.dmi'
icon_state = "roulette_table"
density = 1
anchored = 1
climbable = 1
layer = TABLE_LAYER
throwpass = 1
var/item_place = 1 //allows items to be placed on the table, but not on benches.
var/busy = 0
/obj/structure/casino_table/attackby(obj/item/W as obj, mob/user as mob)
if(item_place)
user.drop_item(src.loc)
return
/obj/structure/casino_table/roulette_table
name = "roulette"
desc = "Spin the roulette to try your luck."
icon_state = "roulette_wheel"
/obj/structure/casino_table/roulette_table/attack_hand(mob/user as mob)
if (busy)
to_chat(user,"<span class='notice'>You cannot spin now! The roulette is already spinning.</span> ")
return
visible_message("<span class='notice'>\ [user] spins the roulette and throws inside little ball.</span>")
playsound(src.loc, 'sound/machines/roulette.ogg', 40, 1)
busy = 1
icon_state = "roulette_wheel_spinning"
var/result = rand(0,36)
var/color = "green"
add_fingerprint(user)
if ((result>0 && result<11) || (result>18 && result<29))
if (result%2)
color="red"
else
color="black"
if ( (result>10 && result<19) || (result>28) )
if (result%2)
color="black"
else
color="red"
spawn(5 SECONDS)
visible_message("<span class='notice'>The roulette stops spinning, the ball landing on [result], [color].</span>")
busy=0
icon_state = "roulette_wheel"
/obj/structure/casino_table/roulette_chart
name = "roulette chart"
desc = "Roulette chart. Place your bets!"
icon_state = "roulette_table"
//
//Blackjack table - no sprite
//
/obj/structure/casino_table/blackjack_l
name = "gambling table"
desc = "Gambling table, try your luck and skills! "
icon_state = "blackjack_l"
/obj/structure/casino_table/blackjack_r
name = "gambling table"
desc = "Gambling table, try your luck and skills! "
icon_state = "blackjack_r"
/obj/structure/casino_table/blackjack_m
name = "gambling table"
desc = "Gambling table, try your luck and skills! "
icon_state = "blackjack_m"
//
//Wheel. Of. FORTUNE!
//
/obj/machinery/wheel_of_fortune
name = "wheel of fortune"
desc = "The Wheel of Fortune! Insert chips and may fortune favour the lucky one at the next lottery!"
icon = 'icons/obj/64x64.dmi'
icon_state = "wheel_of_fortune"
density = 1
anchored = 1
pixel_x = -16
req_access = list(300)
var/interval = 1
var/busy = 0
var/public_spin = 0
var/lottery_sale = "disabled"
var/lottery_price = 100
var/lottery_entries = 0
var/lottery_tickets = list()
var/lottery_tickets_ckeys = list()
var/datum/effect/effect/system/confetti_spread
var/confetti_strength = 15
/obj/machinery/wheel_of_fortune/attack_hand(mob/user as mob)
if (busy)
to_chat(user,"<span class='notice'>The wheel of fortune is already spinning!</span> ")
return
if(usr.incapacitated())
return
if(ishuman(usr) || istype(usr, /mob/living/silicon/robot))
switch(input(user,"Choose what to do","Wheel Of Fortune") in list("Spin the Wheel! (Not Lottery)", "Set the interval", "Cancel"))
if("Cancel")
return
if("Spin the Wheel! (Not Lottery)")
if(public_spin == 0)
to_chat(user,"<span class='notice'>The Wheel makes a sad beep, public spins are not enabled right now..</span> ")
return
else
to_chat(user,"<span class='notice'>You spin the wheel!</span> ")
spin_the_wheel("not_lottery")
if("Set the interval")
setinterval()
/obj/machinery/wheel_of_fortune/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (busy)
to_chat(user,"<span class='notice'>The wheel of fortune is already spinning!</span> ")
return
if(usr.incapacitated())
return
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
if(!check_access(W))
to_chat(user, "<span class='warning'>Access Denied.</span>")
return
else
to_chat(user, "<span class='warning'>Proper access, allowed staff controls.</span>")
if(ishuman(usr) || istype(usr, /mob/living/silicon/robot))
switch(input(user,"Choose what to do (Management)","Wheel Of Fortune (Management)") in list("Spin the Lottery Wheel!", "Toggle Lottery Sales", "Toggle Public Spins", "Reset Lottery", "Cancel"))
if("Cancel")
return
if("Spin the Lottery Wheel!")
to_chat(user,"<span class='notice'>You spin the wheel for the lottery!</span> ")
spin_the_wheel("lottery")
if("Toggle Lottery Sales")
if(lottery_sale == "disabled")
lottery_sale = "enabled"
to_chat(user,"<span class='notice'>Public Lottery sale has been enabled.</span> ")
else
lottery_sale = "disabled"
to_chat(user,"<span class='notice'>Public Lottery sale has been disabled.</span> ")
if("Toggle Public Spins")
if(public_spin == 0)
public_spin = 1
to_chat(user,"<span class='notice'>Public spins has been enabled.</span> ")
else
public_spin = 0
to_chat(user,"<span class='notice'>Public spins has been disabled.</span> ")
if("Reset Lottery")
var/confirm = tgui_alert(usr, "Are you sure you want to reset Lottery?", "Confirm Lottery Reset", list("Yes", "No"))
if(confirm == "Yes")
to_chat(user, "<span class='warning'>Lottery has been Reset!</span>")
lottery_entries = 0
lottery_tickets = list()
lottery_tickets_ckeys = list()
if(istype(W, /obj/item/weapon/spacecasinocash))
if(lottery_sale == "disabled")
to_chat(user, "<span class='warning'>Lottery sales are currently disabled.</span>")
return
else
if(user.client.ckey in lottery_tickets_ckeys)
to_chat(user, "<span class='warning'>The scanner beeps in an upset manner, you already have a ticket!</span>")
return
var/obj/item/weapon/spacecasinocash/C = W
insert_chip(C, user)
/obj/machinery/wheel_of_fortune/proc/insert_chip(var/obj/item/weapon/spacecasinocash/cashmoney, mob/user)
if (busy)
to_chat(user,"<span class='notice'>The Wheel of Fortune is busy, wait for it to be done to buy a lottery ticket.</span> ")
return
if(cashmoney.worth < lottery_price)
to_chat(user,"<span class='notice'>You dont have enough chips to buy a lottery ticket!</span> ")
return
to_chat(user,"<span class='notice'>You put [lottery_price] credits worth of chips into the Wheel of Fortune and it pings to notify of your lottery ticket registered!</span>")
cashmoney.worth -= lottery_price
cashmoney.update_icon()
if(cashmoney.worth <= 0)
usr.drop_from_inventory(cashmoney)
qdel(cashmoney)
cashmoney.update_icon()
lottery_entries++
lottery_tickets += "Number.[lottery_entries] [user.name]"
lottery_tickets_ckeys += user.client.ckey
/obj/machinery/wheel_of_fortune/proc/spin_the_wheel(var/mode)
var/result = 0
if(mode == "not_lottery")
busy = 1
icon_state = "wheel_of_fortune_spinning"
result = rand(1,interval)
spawn(5 SECONDS)
visible_message("<span class='notice'>The wheel of fortune stops spinning, the number is [result]!</span>")
src.confetti_spread = new /datum/effect/effect/system/confetti_spread()
src.confetti_spread.attach(src) //If somehow people start dragging slot machine
spawn(0)
for(var/i = 1 to confetti_strength)
src.confetti_spread.start()
sleep(10)
flick("[icon_state]-winning",src)
busy = 0
icon_state = "wheel_of_fortune"
if(mode == "lottery")
if(lottery_entries == 0)
visible_message("<span class='notice'>There are no tickets in the system!</span>")
return
busy = 1
icon_state = "wheel_of_fortune_spinning"
result = pick(lottery_tickets)
spawn(5 SECONDS)
visible_message("<span class='notice'>The wheel of fortune stops spinning, and the winner is [result]!</span>")
src.confetti_spread = new /datum/effect/effect/system/confetti_spread()
src.confetti_spread.attach(src) //If somehow people start dragging slot machine
spawn(0)
for(var/i = 1 to confetti_strength)
src.confetti_spread.start()
sleep(10)
flick("[icon_state]-winning",src)
busy = 0
icon_state = "wheel_of_fortune"
/obj/machinery/wheel_of_fortune/verb/setinterval()
set name = "Change interval"
set category = "Object"
set src in view(1)
if(usr.incapacitated())
return
if(ishuman(usr) || istype(usr, /mob/living/silicon/robot))
interval = tgui_input_number(usr, "Put the desired interval (1-1000)", "Set Interval", null, 1000, 1)
if(interval>1000 || interval<1)
usr << "<span class='notice'>Invalid interval.</span>"
return
usr << "<span class='notice'>You set the interval to [interval]</span>"
return
//
//Slave Terminal
//
/obj/machinery/casinoslave_handler
name = "Sentient Prize Automated Sales Machinery"
desc = "The Sentient Prize Automated Sales Machinery, also known as SPASM! Here one can see who is on sale as sentinet prizes, as well as selling self and also buying prizes."
icon = 'icons/obj/casino.dmi'
icon_state = "casinoslave_hub_off"
density = 1
anchored = 1
req_access = list(300)
var/casinoslave_sale = "disabled"
var/casinoslave_price = 100
var/collar_list = list()
var/slaves_ckeys_list = list() //Same trick as lottery, to keep life simple
var/obj/item/clothing/accessory/collar/casinoslave/selected_collar = null
/obj/machinery/casinoslave_handler/attack_hand(mob/living/user as mob)
if(usr.incapacitated())
return
if(casinoslave_sale == "disabled")
to_chat(user,"<span class='notice'>The SPASM is disabled.</span> ")
return
if(ishuman(usr) || istype(usr, /mob/living/silicon/robot))
switch(input(user,"Choose what to do","SPASM") in list("Show selected Prize", "Select Prize", "Become Prize (Please examine yourself first)", "Cancel"))
if("Cancel")
return
if("Show selected Prize")
if(QDELETED(selected_collar))
collar_list -= selected_collar
slaves_ckeys_list -= selected_collar.slaveckey
to_chat(user, "<span class='warning'>No collar is currently selected or the currently selected one has been destroyed or disabled.</span>")
selected_collar = null
return
to_chat(user, "<span class='warning'>Sentient Prize information</span>")
to_chat(user, "<span class='notice'>Name: [selected_collar.slavename]</span>")
to_chat(user, "<span class='notice'>Description: [selected_collar.slaveflavor]</span>")
to_chat(user, "<span class='notice'>OOC: [selected_collar.slaveooc]</span>")
if(selected_collar.ownername != null)
to_chat(user, "<span class='warning'>This prize is already owned by [selected_collar.ownername]</span>")
if("Select Prize")
selected_collar = tgui_input_list(user, "Select a prize", "Chose a collar", collar_list)
if(QDELETED(selected_collar))
collar_list -= selected_collar
slaves_ckeys_list -= selected_collar.slaveckey
to_chat(user, "<span class='warning'>No collars to chose, or selected collar has been destroyed or deactived, selection has been removed from list.</span>")
selected_collar = null
return
if("Become Prize (Please examine yourself first)") //Its awkward, but no easy way to obtain flavor_text due to server not loading text of mob until its been examined at least once.
var/safety_ckey = user.client.ckey
if(safety_ckey in slaves_ckeys_list)
to_chat(user, "<span class='warning'>The SPASM beeps in an upset manner, you already have a collar!</span>")
return
var/confirm = tgui_alert(usr, "Are you sure you want to become a sentient prize?", "Confirm Sentient Prize", list("Yes", "No"))
if(confirm == "Yes")
to_chat(user, "<span class='warning'>You are now a prize!</span>")
if(safety_ckey in slaves_ckeys_list)
to_chat(user, "<span class='warning'>The SPASM beeps in an upset manner, you already have a collar!</span>")
return
slaves_ckeys_list += user.ckey
var/obj/item/clothing/accessory/collar/casinoslave/C = new(src.loc)
C.slavename = "[user.name]"
C.slaveckey = "[user.ckey]"
C.slaveflavor = user.flavor_text
C.slaveooc = user.ooc_notes
C.name = "Sentient Prize Collar: Available! [user.name] purchaseable at the SPASM!"
C.desc = "SPASM collar. The tags shows in flashy colorful text the wearer is [user.name] and is currently available to buy at the Sentient Prize Automated Sales Machinery!"
C.icon_state = "casinoslave_available"
C.update_icon()
collar_list += C
spawn_casinochips(casinoslave_price, src.loc)
/obj/machinery/casinoslave_handler/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(usr.incapacitated())
return
if(istype(W, /obj/item/weapon/spacecasinocash))
if(casinoslave_sale == "disabled")
to_chat(user, "<span class='warning'>Sentient Prize sales are currently disabled.</span>")
return
if(!selected_collar.ownername)
var/obj/item/weapon/spacecasinocash/C = W
if(user.client.ckey == selected_collar.slaveckey)
insert_chip(C, user, "selfbuy")
return
else
insert_chip(C, user, "buy")
return
else
to_chat(user, "<span class='warning'>This Sentient Prize is already owned! If you are the owner you can release the prize by swiping the collar on the SPASM!</span>")
return
if(istype(W, /obj/item/clothing/accessory/collar/casinoslave))
var/obj/item/clothing/accessory/collar/casinoslave/C = W
if(user.name != C.slavename && user.name != C.ownername)
to_chat(user, "<span class='warning'>This Sentient Prize collar isn't yours, please give it to the one it tagged for, belongs to, or a casino staff member!</span>")
return
if(user.name == C.slavename)
if(!C.ownername)
to_chat(user,"<span class='notice'>If collar isn't disabled and entry removed, please select your entry and insert chips. Or contact staff if you need assistance.</span> ")
return
else
to_chat(user,"<span class='notice'>If collar isn't disabled and entry removed, please ask your owner to free you with collar swipe on the SPASM, or contact staff if you need assistance.</span> ")
return
if(user.name == C.ownername)
var/confirm = tgui_alert(usr, "Are you sure you want to wipe [C.slavename] entry?", "Confirm Sentient Prize Release", list("Yes", "No"))
if(confirm == "Yes")
to_chat(user, "<span class='warning'>[C.slavename] collar has been deleted from registry!</span>")
C.icon_state = "casinoslave"
C.update_icon()
C.name = "a disabled Sentient Prize Collar: [C.slavename]"
C.desc = "A collar worn by sentient prizes registered to a SPASM. The tag says its registered to [C.slavename], but harsh red text informs you its been disabled."
slaves_ckeys_list -= C.slaveckey
C.slaveckey = null
collar_list -= C
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
if(!check_access(W))
to_chat(user, "<span class='warning'>Access Denied.</span>")
return
else
to_chat(user, "<span class='warning'>Proper access, allowed staff controls.</span>")
if(ishuman(usr) || istype(usr, /mob/living/silicon/robot))
switch(input(user,"Choose what to do (Management)","SPASM (Management)") in list("Toggle Sentient Prize Sales", "Wipe Selected Prize Entry", "Change Prize Value", "Cancel"))
if("Cancel")
return
if("Toggle Sentient Prize Sales")
if(casinoslave_sale == "disabled")
casinoslave_sale = "enabled"
icon_state = "casinoslave_hub_on"
update_icon()
to_chat(user,"<span class='notice'>Prize sale has been enabled.</span> ")
else
casinoslave_sale = "disabled"
icon_state = "casinoslave_hub_off"
update_icon()
to_chat(user,"<span class='notice'>Prize sale has been disabled.</span> ")
if("Wipe Selected Prize Entry")
if(!selected_collar)
to_chat(user, "<span class='warning'>No collar selected!</span>")
return
if(QDELETED(selected_collar))
collar_list -= selected_collar
slaves_ckeys_list -= selected_collar.slaveckey
to_chat(user, "<span class='warning'>Collar has been destroyed!</span>")
selected_collar = null
return
var/safety_ckey = selected_collar.slaveckey
var/confirm = tgui_alert(usr, "Are you sure you want to wipe [selected_collar.slavename] entry?", "Confirm Sentient Prize", list("Yes", "No"))
if(confirm == "Yes")
if(safety_ckey == selected_collar.slaveckey)
to_chat(user, "<span class='warning'>[selected_collar.slavename] collar has been deleted from registry!</span>")
selected_collar.icon_state = "casinoslave"
selected_collar.update_icon()
selected_collar.name = "a disabled Sentient Prize Collar: [selected_collar.slavename]"
selected_collar.desc = "A collar worn by sentient prizes registered to a SPASM. The tag says its registered to [selected_collar.slavename], but harsh red text informs you its been disabled."
slaves_ckeys_list -= selected_collar.slaveckey
selected_collar.slaveckey = null
collar_list -= selected_collar
selected_collar = null
else
to_chat(user, "<span class='warning'>Registry deletion aborted! Changed collar selection!</span>")
return
if("Change Prize Value")
setprice(user)
/obj/machinery/casinoslave_handler/proc/insert_chip(var/obj/item/weapon/spacecasinocash/cashmoney, mob/user, var/buystate)
if(cashmoney.worth < casinoslave_price)
to_chat(user,"<span class='notice'>You dont have enough chips to pay for the sentient prize!</span> ")
return
cashmoney.worth -= casinoslave_price
cashmoney.update_icon()
if(cashmoney.worth <= 0)
usr.drop_from_inventory(cashmoney)
qdel(cashmoney)
cashmoney.update_icon()
if(buystate == "selfbuy")
to_chat(user,"<span class='notice'>You put [casinoslave_price] credits worth of chips into the SPASM and nullify your collar!</span> ")
selected_collar.icon_state = "casinoslave"
selected_collar.update_icon()
selected_collar.name = "a disabled Sentient Prize Collar: [selected_collar.slavename]"
selected_collar.desc = "A collar worn by sentient prizes registered to a SPASM. The tag says its registered to [selected_collar.slavename], but harsh red text informs you its been disabled."
slaves_ckeys_list -= selected_collar.slaveckey
selected_collar.slaveckey = null
collar_list -= selected_collar
selected_collar = null
if(buystate == "buy")
to_chat(user,"<span class='notice'>You put [casinoslave_price] credits worth of chips into the SPASM and it pings to inform you bought [selected_collar.slavename]!</span> ")
selected_collar.icon_state = "casinoslave_owned"
selected_collar.update_icon()
selected_collar.ownername = user.name
selected_collar.name = "Sentient Prize Collar: [selected_collar.slavename] owned by [selected_collar.ownername]!"
selected_collar.desc = "A collar worn by sentient prizes registered to a SPASM. The tag says its registered to [selected_collar.slavename] and they are owned by [selected_collar.ownername]."
selected_collar = null
/obj/machinery/casinoslave_handler/proc/setprice(mob/living/user as mob)
if(usr.incapacitated())
return
if(ishuman(usr) || istype(usr, /mob/living/silicon/robot))
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
to_chat(user,"<span class='notice'>You set the price to [casinoslave_price]</span> ")

View File

@@ -81,7 +81,7 @@
/datum/category_item/player_setup_item/general/basic/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["rename"])
var/raw_name = input(user, "Choose your character's name:", "Character Name") as text|null
var/raw_name = tgui_input_text(user, "Choose your character's name:", "Character Name")
if (!isnull(raw_name) && CanUseTopic(user))
var/new_name = sanitize_name(raw_name, pref.species, is_FBP())
if(new_name)
@@ -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

Some files were not shown because too many files have changed in this diff Show More