Sheet handling is much nicer now

- Nanotrasen fabrication machinery, such as those for space pods and
  exosuits, now have functional ID locks for their respective departments

- Research machinery and the fabricators now allow you to eject a custom
  amount of sheets, so you don't have to spam-click

- Splitting sheets by hand is now done by prompt
This commit is contained in:
Crazylemon64
2015-12-08 14:23:48 -08:00
parent 97f2f91843
commit 7efa8ed13f
4 changed files with 25 additions and 10 deletions
+2 -1
View File
@@ -460,10 +460,11 @@
var/amount = text2num(href_list["remove_mat"])
var/material = href_list["material"]
if(href_list["custom_eject"])
amount = input("How much?", "How many sheets would you like to eject from the machine?", 1) as null|num
amount = input("How many sheets would you like to eject from the machine?", "How much?", 1) as null|num
amount = max(0,min(round(resources[material]/MINERAL_MATERIAL_AMOUNT),amount)) // Rounding errors aren't scary, as the mineral eject proc is smart
if (!amount)
return
amount = round(amount)
if(amount < 0 || amount > resources[material]) //href protection, except that resources[] is 2000 per sheet
return
+4 -2
View File
@@ -196,9 +196,10 @@
/obj/item/stack/attack_hand(mob/user as mob)
if (user.get_inactive_hand() == src)
var/desired = input("How much?", "How much would you like to grab from the stack?", 1) as null|num
var/desired = input("How much would you like to grab from the stack?", "How much?", 1) as null|num
if(!desired)
return
desired = round(desired)
desired = max(1,min(desired,src.max_amount,src.amount))
var/obj/item/stack/F = new src.type( user, desired)
F.copy_evidences(src)
@@ -221,9 +222,10 @@
return 1
var/to_transfer as num
if (user.get_inactive_hand()==src)
var/desired = input("How much?", "How much would you like to grab from the stack?", 1) as null|num
var/desired = input("How much would you like to grab from the stack?", "How much?", 1) as null|num
if(!desired)
return
desired = round(desired)
to_transfer = max(1,min(desired,S.max_amount-S.amount,src.amount))
else
to_transfer = min(src.amount, S.max_amount-S.amount)
+15 -5
View File
@@ -8,7 +8,7 @@
use_power = 1
idle_power_usage = 20
active_power_usage = 5000
req_access = list(access_robotics)
req_access = list(access_mechanic)
var/time_coeff = 1
var/resource_coeff = 1
var/time_coeff_tech = 1
@@ -155,9 +155,9 @@
var/output
for(var/resource in resources)
var/amount = min(res_max_amount, resources[resource])
output += "<span class=\"res_name\">[material2name(resource)]: </span>[amount] cm&sup3;"
output += "<span class=\"res_name\">[material2name(resource)]: </span>[amount] cm&sup3;, [round(resources[resource] / MINERAL_MATERIAL_AMOUNT,0.1)] sheets"
if(amount>0)
output += "<span style='font-size:80%;'> - Remove \[<a href='?src=\ref[src];remove_mat=1;material=[resource]'>1</a>\] | \[<a href='?src=\ref[src];remove_mat=10;material=[resource]'>10</a>\] | \[<a href='?src=\ref[src];remove_mat=[resources[resource] / MINERAL_MATERIAL_AMOUNT];material=[resource]'>All</a>\]</span>"
output += "<span style='font-size:80%;'> - Remove \[<a href='?src=\ref[src];remove_mat=1;material=[resource]'>1</a>\] | \[<a href='?src=\ref[src];remove_mat=10;material=[resource]'>10</a>\] | \[<a href='?src=\ref[src];remove_mat=1;material=[resource];custom_eject=1'>Custom</a>\] | \[<a href='?src=\ref[src];remove_mat=[resources[resource] / MINERAL_MATERIAL_AMOUNT];material=[resource]'>All</a>\]</span>"
output += "<br/>"
return output
@@ -322,8 +322,12 @@
return round(initial(D.construction_time)*time_coeff*time_coeff_tech, roundto)
/obj/machinery/spod_part_fabricator/attack_hand(mob/user)
if(!(..()))
return interact(user)
if(..())
return 1
if(!allowed(user) && !isobserver(user))
user << "<span class='warning'>Access denied.</span>"
return 1
return interact(user)
/obj/machinery/spod_part_fabricator/interact(mob/user as mob)
var/dat, left_part
@@ -457,6 +461,12 @@
if(href_list["remove_mat"] && href_list["material"])
var/amount = text2num(href_list["remove_mat"])
var/material = href_list["material"]
if(href_list["custom_eject"])
amount = input("How many sheets would you like to eject from the machine?", "How much?", 1) as null|num
amount = max(0,min(round(resources[material]/MINERAL_MATERIAL_AMOUNT),amount)) // Rounding errors aren't scary, as the mineral eject proc is smart
if (!amount)
return
amount = round(amount)
if(amount < 0 || amount > resources[material]) //href protection
return
+4 -2
View File
@@ -510,10 +510,11 @@ proc/CallMaterialName(ID)
else if(href_list["lathe_ejectsheet"] && linked_lathe) //Causes the protolathe to eject a sheet of material
var/desired_num_sheets
if (href_list["lathe_ejectsheet_amt"] == "custom")
desired_num_sheets = input("How much?", "How many sheets would you like to eject from the machine?", 1) as null|num
desired_num_sheets = input("How many sheets would you like to eject from the machine?", "How much?", 1) as null|num
desired_num_sheets = max(0,desired_num_sheets) // If you input too high of a number, the mineral datum will take care of it either way
if (!desired_num_sheets)
return
desired_num_sheets = round(desired_num_sheets) // No partial-sheet goofery
else
desired_num_sheets = text2num(href_list["lathe_ejectsheet_amt"])
var/MAT
@@ -539,10 +540,11 @@ proc/CallMaterialName(ID)
else if(href_list["imprinter_ejectsheet"] && linked_imprinter) //Causes the protolathe to eject a sheet of material
var/desired_num_sheets = text2num(href_list["imprinter_ejectsheet_amt"])
if (href_list["imprinter_ejectsheet_amt"] == "custom")
desired_num_sheets = input("How much?", "How many sheets would you like to eject from the machine?", 1) as null|num
desired_num_sheets = input("How many sheets would you like to eject from the machine?", "How much?", 1) as null|num
desired_num_sheets = max(0,desired_num_sheets) // for the imprinter they have something hacky, that still will guard against shenanigans. eh
if (!desired_num_sheets)
return
desired_num_sheets = round(desired_num_sheets) // No partial-sheet goofery
else
desired_num_sheets = text2num(href_list["imprinter_ejectsheet_amt"])
var/res_amount, type