diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm
index 653d3bb374..facb9e4402 100644
--- a/code/game/machinery/autolathe.dm
+++ b/code/game/machinery/autolathe.dm
@@ -27,6 +27,8 @@
var/datum/wires/autolathe/wires = null
+ var/filtertext
+
/obj/machinery/autolathe/New()
..()
wires = new(src)
@@ -72,11 +74,14 @@
material_bottom += "
[stored_material[material]]/[storage_capacity[material]] | "
dat += "[material_top.Join()][material_bottom.Join()]
"
+ dat += "Filter: [filtertext ? filtertext : "None Set"]
"
dat += "Printable Designs
"
for(var/datum/category_item/autolathe/R in current_category.items)
if(R.hidden && !hacked)
continue
+ if(filtertext && findtext(R.name, filtertext) == 0)
+ continue
var/can_make = 1
var/list/material_string = list()
var/list/multiplier_string = list()
@@ -108,12 +113,14 @@
multiplier_string += "\[x[i]\]"
multiplier_string += "\[x[max_sheets]\]"
- dat += "| [R.hidden ? "*" : ""][can_make ? "" : ""][R.name][can_make ? "" : ""][R.hidden ? "*" : ""][multiplier_string.Join()] | [material_string.Join()] |
"
+ dat += "| [R.hidden ? "*" : ""][can_make ? "" : ""][R.name][can_make ? "" : ""][R.hidden ? "*" : ""][multiplier_string.Join()] | [material_string.Join()] |
"
dat += "
"
- user << browse(dat.Join(), "window=autolathe")
- onclose(user, "autolathe")
+ dat = jointext(dat, null)
+ var/datum/browser/popup = new(user, "autolathe", "Autolathe Production Menu", 550, 700)
+ popup.set_content(dat)
+ popup.open()
/obj/machinery/autolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(busy)
@@ -229,6 +236,16 @@
to_chat(usr, "The autolathe is busy. Please wait for completion of previous operation.")
return
+ else if(href_list["setfilter"])
+ var/filterstring = input(usr, "Input a filter string, or blank to not filter:", "Design Filter", filtertext) as null|text
+ if(!Adjacent(usr))
+ return
+ if(isnull(filterstring)) //Clicked Cancel
+ return
+ if(filterstring == "") //Cleared value
+ filtertext = null
+ filtertext = sanitize(filterstring, 25)
+
if(href_list["change_category"])
var/choice = input("Which category do you wish to display?") as null|anything in machine_recipes.categories
diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm
index 192df50bec..db70d08863 100755
--- a/code/modules/research/rdconsole.dm
+++ b/code/modules/research/rdconsole.dm
@@ -48,6 +48,9 @@ won't update every console in existence) but it's more of a hassle to do. Also,
req_access = list(access_research) //Data and setting manipulation requires scientist access.
+ var/protofilter //String to filter protolathe designs by
+ var/circuitfilter //String to filter circuit designs by
+
/obj/machinery/computer/rdconsole/proc/CallMaterialName(var/ID)
var/return_name = ID
switch(return_name)
@@ -169,7 +172,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
else if(href_list["updt_tech"]) //Update the research holder with information from the technology disk.
screen = 0.0
- spawn(50)
+ spawn(5 SECONDS)
screen = 1.2
files.AddTech2Known(t_disk.stored)
updateUsrDialog()
@@ -192,7 +195,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
else if(href_list["updt_design"]) //Updates the research holder with design data from the design disk.
screen = 0.0
- spawn(50)
+ spawn(5 SECONDS)
screen = 1.4
files.AddDesign2Known(d_disk.blueprint)
updateUsrDialog()
@@ -235,7 +238,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
screen = 0.1
updateUsrDialog()
flick("d_analyzer_process", linked_destroy)
- spawn(24)
+ spawn(2.4 SECONDS)
if(linked_destroy)
linked_destroy.busy = 0
if(!linked_destroy.loaded_item)
@@ -283,7 +286,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
to_chat(usr, "You must connect to the network first.")
else
griefProtection() //Putting this here because I dont trust the sync process
- spawn(30)
+ spawn(3 SECONDS)
if(src)
for(var/obj/machinery/r_n_d/server/S in machines)
var/server_processed = 0
@@ -319,8 +322,38 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(being_built)
linked_lathe.addToQueue(being_built)
+ else if(href_list["buildfive"]) //Causes the Protolathe to build 5 of something.
+ if(linked_lathe)
+ var/datum/design/being_built = null
+ for(var/datum/design/D in files.known_designs)
+ if(D.id == href_list["buildfive"])
+ being_built = D
+ break
+ if(being_built)
+ for(var/i = 1 to 5)
+ linked_lathe.addToQueue(being_built)
+
screen = 3.1
- updateUsrDialog()
+
+ else if(href_list["protofilter"])
+ var/filterstring = input(usr, "Input a filter string, or blank to not filter:", "Design Filter", protofilter) as null|text
+ if(!Adjacent(usr))
+ return
+ if(isnull(filterstring)) //Clicked Cancel
+ return
+ if(filterstring == "") //Cleared value
+ protofilter = null
+ protofilter = sanitize(filterstring, 25)
+
+ else if(href_list["circuitfilter"])
+ var/filterstring = input(usr, "Input a filter string, or blank to not filter:", "Design Filter", circuitfilter) as null|text
+ if(!Adjacent(usr))
+ return
+ if(isnull(filterstring)) //Clicked Cancel
+ return
+ if(filterstring == "") //Cleared value
+ circuitfilter = null
+ circuitfilter = sanitize(filterstring, 25)
else if(href_list["imprint"]) //Causes the Circuit Imprinter to build something.
if(linked_imprinter)
@@ -332,7 +365,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(being_built)
linked_imprinter.addToQueue(being_built)
screen = 4.1
- updateUsrDialog()
else if(href_list["disposeI"] && linked_imprinter) //Causes the circuit imprinter to dispose of a single reagent (all of it)
linked_imprinter.reagents.del_reagent(href_list["dispose"])
@@ -489,7 +521,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
else if(d_disk)
dat += "Disk Operations"
else
- dat += "Disk Operations"
+ dat += "Disk Operations"
if(linked_destroy)
dat += "Destructive Analyzer Menu"
if(linked_lathe)
@@ -638,9 +670,12 @@ won't update every console in existence) but it's more of a hassle to do. Also,
dat += "Material Amount: [linked_lathe.TotalMaterials()] cm3 (MAX: [linked_lathe.max_material_storage])
"
dat += "Chemical Volume: [linked_lathe.reagents.total_volume] (MAX: [linked_lathe.reagents.maximum_volume])
"
dat += ""
+ dat += "Filter: [protofilter ? protofilter : "None Set"]"
for(var/datum/design/D in files.known_designs)
if(!D.build_path || !(D.build_type & PROTOLATHE))
continue
+ if(protofilter && findtext(D.name, protofilter) == 0)
+ continue
var/temp_dat
for(var/M in D.materials)
temp_dat += ", [D.materials[M]*linked_lathe.mat_efficiency] [CallMaterialName(M)]"
@@ -649,7 +684,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(temp_dat)
temp_dat = " \[[copytext(temp_dat, 3)]\]"
if(linked_lathe.canBuild(D))
- dat += "- [D.name][temp_dat]"
+ dat += "
- [D.name](x5)[temp_dat]"
else
dat += "
- [D.name][temp_dat]"
dat += "
"
@@ -683,7 +718,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(3.3) //Protolathe Chemical Storage Submenu
dat += "Main Menu || "
dat += "Protolathe Menu
"
- dat += "Chemical Storage
"
+ dat += "Chemical Storage:
"
for(var/datum/reagent/R in linked_lathe.reagents.reagent_list)
dat += "Name: [R.name] | Units: [R.volume] "
dat += "(Purge)
"
@@ -692,7 +727,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(3.4) // Protolathe queue
dat += "Main Menu || "
dat += "Protolathe Menu
"
- dat += "Queue
"
+ dat += "Protolathe Construction Queue:
"
if(!linked_lathe.queue.len)
dat += "Empty"
else
@@ -721,9 +756,12 @@ won't update every console in existence) but it's more of a hassle to do. Also,
dat += "Material Amount: [linked_imprinter.TotalMaterials()] cm3
"
dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]
"
dat += ""
+ dat += "Filter: [circuitfilter ? circuitfilter : "None Set"]"
for(var/datum/design/D in files.known_designs)
if(!D.build_path || !(D.build_type & IMPRINTER))
continue
+ if(circuitfilter && findtext(D.name, circuitfilter) == 0)
+ continue
var/temp_dat
for(var/M in D.materials)
temp_dat += ", [D.materials[M]*linked_imprinter.mat_efficiency] [CallMaterialName(M)]"
@@ -794,8 +832,10 @@ won't update every console in existence) but it's more of a hassle to do. Also,
dat += "List of Researched Technologies and Designs:"
dat += GetResearchListInfo()
- user << browse("Research and Development Console
[dat.Join()]", "window=rdconsole;size=850x600")
- onclose(user, "rdconsole")
+ dat = jointext(dat, null)
+ var/datum/browser/popup = new(user, "rdconsole", "Research and Development Console", 850, 600)
+ popup.set_content(dat)
+ popup.open()
/obj/machinery/computer/rdconsole/robotics
name = "Robotics R&D Console"