diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index be544adc57c..0091f50c5d6 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -52,13 +52,13 @@ var/refid = "\ref[D]" var/icon/sprite var/hash - + var/type = /list if (!islist) type = D.type - + if(istype(D,/atom)) var/atom/AT = D if(AT.icon && AT.icon_state) @@ -850,8 +850,22 @@ A.create_reagents(amount) if(A.reagents) + var/chosen_id var/list/reagent_options = sortList(chemical_reagents_list) - var/chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") in reagent_options|null + switch(alert(usr, "Choose a method.", "Add Reagents", "Enter ID", "Choose ID")) + if("Enter ID") + var/valid_id + while(!valid_id) + chosen_id = stripped_input(usr, "Enter the ID of the reagent you want to add.") + if(!chosen_id) //Get me out of here! + break + for(var/ID in reagent_options) + if(ID == chosen_id) + valid_id = 1 + if(!valid_id) + usr << "A reagent with that ID doesn't exist!" + if("Choose ID") + chosen_id = input(usr, "Choose a reagent to add.", "Choose a reagent.") as null|anything in reagent_options if(chosen_id) var/amount = input(usr, "Choose the amount to add.", "Choose the amount.", A.reagents.maximum_volume) as num if(amount)