[MIRROR] remove old inputs (#10038)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-02-02 02:22:56 +01:00
committed by GitHub
co-authored by Kashargul
parent f3ebea3af1
commit 965f8f4a61
101 changed files with 302 additions and 282 deletions
@@ -341,7 +341,7 @@
queue -= queue[index]
if("clear_queue")
// Remove all entries from the queue except the currently processing recipe.
var/confirm = alert(usr, "Are you sure you want to clear the running queue?", "Confirm", "No", "Yes")
var/confirm = tgui_alert(usr, "Are you sure you want to clear the running queue?", "Confirm", list("No", "Yes"))
if(confirm == "Yes")
if(busy)
// Oh no, I've broken code convention to remove all entries but the first.
@@ -362,7 +362,7 @@
if("emergency_stop")
// Stops everything if that's desirable for some reason.
if(busy)
var/confirm = alert(usr, "Are you sure you want to stall the machine?", "Confirm", "Yes", "No")
var/confirm = tgui_alert(usr, "Are you sure you want to stall the machine?", "Confirm", list("Yes", "No"))
if(confirm == "Yes")
stalled = TRUE
if("bottle_product")
@@ -388,7 +388,7 @@
if("rem_recipe")
// Allows the user to remove recipes while the machine is idle.
if(!busy)
var/confirm = alert(usr, "Are you sure you want to remove this recipe?", "Confirm", "No", "Yes")
var/confirm = tgui_alert(usr, "Are you sure you want to remove this recipe?", "Confirm", list("No", "Yes"))
if(confirm == "Yes")
var/index = params["rm_index"]
if(index in recipes)
@@ -479,12 +479,12 @@
// This proc is lets users create recipes step-by-step and exports a comma delineated list to chat. It's intended to teach how to use the machine.
/obj/machinery/chemical_synthesizer/proc/babystep_recipe(mob/user)
var/rec_name = sanitizeSafe(input(user, "Name your recipe. Consider including the output volume.", "Recipe naming", null) as text, MAX_NAME_LEN)
var/rec_name = sanitizeSafe(tgui_input_text(user, "Name your recipe. Consider including the output volume.", "Recipe naming"))
if(!rec_name || (rec_name in recipes)) // Code requires each recipe to have a unique name.
to_chat(user, "Please provide a unique recipe name!")
return
var/steps = 2 * CLAMP(round(input(user, "How many steps does your recipe contain (16 max)?", "Steps", null) as num), 0, RECIPE_MAX_STEPS) // Round to get a whole integer, clamp to ensure proper range.
var/steps = 2 * tgui_input_number(user, "How many steps does your recipe contain (16 max)?", "Steps", 1, RECIPE_MAX_STEPS, 1) // Round to get a whole integer, clamp to ensure proper range.
if(!steps)
to_chat(user, "Please input a valid number of steps!")
return
@@ -496,7 +496,7 @@
to_chat(user, "Please select a chemical!")
return
new_rec[++new_rec.len] = label // Add the reagent ID.
var/amount = CLAMP(round(input(user, "How much of the chemical would you like to add?", "Volume", null) as num), 0, src.reagents.maximum_volume)
var/amount = tgui_input_number(user, "How much of the chemical would you like to add?", "Volume", 1, src.reagents.maximum_volume, 1)
if(!amount)
to_chat(user, "Please select a volume!")
return
@@ -509,12 +509,12 @@
// This proc allows users to copy-paste a comma delineated list to create a recipe. The recipe will cause a stall() if formatted incorrectly.
/obj/machinery/chemical_synthesizer/proc/import_recipe(mob/user)
var/rec_name = sanitizeSafe(input(user, "Name your recipe. Consider including the output volume.", "Recipe naming", null) as text, MAX_NAME_LEN)
var/rec_name = sanitizeSafe(tgui_input_text(user, "Name your recipe. Consider including the output volume.", "Recipe naming", max_length=MAX_NAME_LEN), MAX_NAME_LEN)
if(!rec_name || (rec_name in recipes)) // Code requires each recipe to have a unique name.
to_chat(user, "Please provide a unique recipe name!")
return
var/rec_input = input(user, "Input your recipe as 'Chem1,vol1,Chem2,vol2,...'", "Import recipe", null)
var/rec_input = tgui_input_text(user, "Input your recipe as 'Chem1,vol1,Chem2,vol2,...'", "Import recipe")
if(!rec_input || (length(rec_input) > RECIPE_MAX_STRING) || !findtext(rec_input, ",")) // The smallest possible recipe will contain 1 comma.
to_chat(user, "Invalid input or recipe max length exceeded!")
return