mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 01:53:35 +01:00
added input cancelling to pda msg, chemmaster ops, borg mod selection
This commit is contained in:
@@ -849,7 +849,9 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
|
||||
/obj/item/device/pda/proc/create_message(var/mob/living/U = usr, var/obj/item/device/pda/P)
|
||||
|
||||
var/t = input(U, "Please enter message", name, null) as text
|
||||
var/t = input(U, "Please enter message", name, null) as text|null
|
||||
if(!t)
|
||||
return
|
||||
t = sanitize(copytext(t, 1, MAX_MESSAGE_LEN))
|
||||
t = readd_quotes(t)
|
||||
if (!t || !istype(P))
|
||||
|
||||
@@ -26,11 +26,12 @@
|
||||
|
||||
/mob/living/silicon/robot/proc/use_power()
|
||||
if (is_component_functioning("power cell") && cell)
|
||||
for(var/obj/item/borg/B in module.modules)
|
||||
if(B.powerneeded)
|
||||
if((cell.charge * 100 / cell.maxcharge) < B.powerneeded)
|
||||
src << "Deactivating [B.name] due to lack of power!"
|
||||
unEquip(B)
|
||||
if(module)
|
||||
for(var/obj/item/borg/B in module.modules)
|
||||
if(B.powerneeded)
|
||||
if((cell.charge * 100 / cell.maxcharge) < B.powerneeded)
|
||||
src << "Deactivating [B.name] due to lack of power!"
|
||||
unEquip(B)
|
||||
if(src.cell.charge <= 0)
|
||||
uneq_all()
|
||||
update_headlamp(1)
|
||||
|
||||
@@ -224,7 +224,9 @@ var/list/robot_verbs_default = list(
|
||||
modules = list("Peacekeeper")
|
||||
if(mmi != null && mmi.alien)
|
||||
modules = "Hunter"
|
||||
modtype = input("Please, select a module!", "Robot", null, null) in modules
|
||||
modtype = input("Please, select a module!", "Robot", null, null) as null|anything in modules
|
||||
if(!modtype)
|
||||
return
|
||||
designation = modtype
|
||||
var/module_sprites[0] //Used to store the associations between sprite names and sprite index.
|
||||
|
||||
|
||||
@@ -569,12 +569,19 @@
|
||||
else if (href_list["createpill"] || href_list["createpill_multiple"])
|
||||
if(!condi)
|
||||
var/count = 1
|
||||
if (href_list["createpill_multiple"]) count = isgoodnumber(input("Select the number of pills to make.", 10, pillamount) as num)
|
||||
if (href_list["createpill_multiple"])
|
||||
count = input("Select the number of pills to make.", 10, pillamount) as num|null
|
||||
if(count == null)
|
||||
return
|
||||
count = isgoodnumber(count)
|
||||
if (count > 20) count = 20 //Pevent people from creating huge stacks of pills easily. Maybe move the number to defines?
|
||||
if (count <= 0) return
|
||||
var/amount_per_pill = reagents.total_volume/count
|
||||
if (amount_per_pill > 50) amount_per_pill = 50
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your pill!","[reagents.get_master_reagent_name()] ([amount_per_pill] units)"))
|
||||
var/name = input(usr,"Name:","Name your pill!","[reagents.get_master_reagent_name()] ([amount_per_pill] units)") as text|null
|
||||
if(!name)
|
||||
return
|
||||
name = reject_bad_text(name)
|
||||
while (count--)
|
||||
var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc)
|
||||
if(!name) name = reagents.get_master_reagent_name()
|
||||
@@ -588,7 +595,10 @@
|
||||
P.forceMove(loaded_pill_bottle)
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your bag!",reagents.get_master_reagent_name()))
|
||||
var/name = input(usr,"Name:","Name your bag!",reagents.get_master_reagent_name()) as text|null
|
||||
if(!name)
|
||||
return
|
||||
name = reject_bad_text(name)
|
||||
var/obj/item/weapon/reagent_containers/food/condiment/pack/P = new/obj/item/weapon/reagent_containers/food/condiment/pack(src.loc)
|
||||
if(!name) name = reagents.get_master_reagent_name()
|
||||
P.originalname = name
|
||||
@@ -598,13 +608,20 @@
|
||||
else if (href_list["createpatch"] || href_list["createpatch_multiple"])
|
||||
if(!condi)
|
||||
var/count = 1
|
||||
if (href_list["createpatch_multiple"]) count = isgoodnumber(input("Select the number of patches to make.", 10, patchamount) as num)
|
||||
if (href_list["createpatch_multiple"])
|
||||
count = input("Select the number of patches to make.", 10, patchamount) as num|null
|
||||
if(count == null)
|
||||
return
|
||||
count = isgoodnumber(count)
|
||||
if(!count || count <= 0)
|
||||
return
|
||||
if (count > 20) count = 20 //Pevent people from creating huge stacks of patches easily. Maybe move the number to defines?
|
||||
var/amount_per_patch = reagents.total_volume/count
|
||||
if (amount_per_patch > 40) amount_per_patch = 40
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your patch!","[reagents.get_master_reagent_name()] ([amount_per_patch] units)"))
|
||||
var/name = input(usr,"Name:","Name your patch!","[reagents.get_master_reagent_name()] ([amount_per_patch] units)") as text|null
|
||||
if(!name)
|
||||
return
|
||||
name = reject_bad_text(name)
|
||||
while (count--)
|
||||
var/obj/item/weapon/reagent_containers/pill/patch/P = new/obj/item/weapon/reagent_containers/pill/patch(src.loc)
|
||||
if(!name) name = reagents.get_master_reagent_name()
|
||||
@@ -614,7 +631,10 @@
|
||||
reagents.trans_to(P,amount_per_patch)
|
||||
else if (href_list["createbottle"])
|
||||
if(!condi)
|
||||
var/name = reject_bad_text(input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name()))
|
||||
var/name = input(usr,"Name:","Name your bottle!",reagents.get_master_reagent_name()) as text|null
|
||||
if(!name)
|
||||
return
|
||||
name = reject_bad_text(name)
|
||||
var/obj/item/weapon/reagent_containers/glass/bottle/P = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
|
||||
if(!name) name = reagents.get_master_reagent_name()
|
||||
P.name = "[name] bottle"
|
||||
|
||||
Reference in New Issue
Block a user