Address a number of TGUI issues

- SmartFridge has been tweaked to look better
 - ChemMaster no longer puts the units in bottle names by default
 - Trinary filter reads last_flow_rate again
 - Operating computer now works based off percentage of health, rather
   than real health (note, a tesh at -50 won't die until -100, but it'll
   trigger the -100% alarm)
 - Clicking on the knob in the canister UI no longer brings up a number
   input too small to enter values in the valid range. For right now,
   the knob stays, but this may be reconsidered in favor of a
   NumberInput if more people would prefer accessibility over
   skeuomorphism UI design.
 - Pipe dispenser has a bent pipe option again
This commit is contained in:
ShadowLarkens
2020-08-14 10:28:20 -07:00
parent c7a562b53d
commit f2d180ad09
13 changed files with 57 additions and 56 deletions

View File

@@ -52,7 +52,16 @@
var/list/r = list()
for(var/i in 1 to cat.len)
var/datum/pipe_recipe/info = cat[i]
r += list(list("pipe_name" = info.name, "pipe_index" = i))
r += list(list("pipe_name" = info.name, "ref" = "\ref[info]"))
// Stationary pipe dispensers don't allow you to pre-select pipe directions.
// This makes it impossble to spawn bent versions of bendable pipes.
// We add a "Bent" pipe type with a special param to work around it.
if(info.dirtype == PIPE_BENDABLE)
r += list(list(
"pipe_name" = ("Bent " + info.name),
"ref" = "\ref[info]",
"bent" = TRUE
))
data["categories"] += list(list("cat_name" = c, "recipes" = r))
return data
@@ -68,24 +77,24 @@
if("p_layer")
p_layer = text2num(params["p_layer"])
if("dispense_pipe")
if(!wait)
var/list/recipes
if(disposals)
recipes = GLOB.disposal_pipe_recipes
else
recipes = GLOB.atmos_pipe_recipes
if(!wait)
var/datum/pipe_recipe/recipe = locate(params["ref"])
if(!istype(recipe))
return
var/datum/pipe_recipe/recipe = recipes[params["category"]][text2num(params["pipe_type"])]
var/target_dir = NORTH
if(params["bent"])
target_dir = NORTHEAST
var/obj/created_object = null
if(istype(recipe, /datum/pipe_recipe/pipe))
var/datum/pipe_recipe/pipe/R = recipe
created_object = new R.construction_type(loc, recipe.pipe_type, NORTH)
created_object = new R.construction_type(loc, recipe.pipe_type, target_dir)
var/obj/item/pipe/P = created_object
P.setPipingLayer(p_layer)
else if(istype(recipe, /datum/pipe_recipe/disposal))
var/datum/pipe_recipe/disposal/D = recipe
var/obj/structure/disposalconstruct/C = new(loc, D.pipe_type, NORTH, 0, D.subtype ? D.subtype : 0)
var/obj/structure/disposalconstruct/C = new(loc, D.pipe_type, target_dir, 0, D.subtype ? D.subtype : 0)
C.update()
created_object = C
else if(istype(recipe, /datum/pipe_recipe/meter))

View File

@@ -79,10 +79,6 @@ GLOBAL_LIST_INIT(disposal_pipe_recipes, list(
var/dirtype // If using an RPD, this tells more about what previews to show.
var/pipe_type
// Render an HTML link to select this pipe type. Returns text.
/datum/pipe_recipe/proc/Render(dispenser)
return "<A href='?src=\ref[dispenser]&[Params()]'>[name]</A><BR>"
// Get preview for UIs
/datum/pipe_recipe/proc/get_preview(selected_dir)
var/list/dirs
@@ -123,10 +119,6 @@ GLOBAL_LIST_INIT(disposal_pipe_recipes, list(
return rows
// Parameters for the Topic link returned by Render(). Returns text.
/datum/pipe_recipe/proc/Params()
return ""
//
// Subtype for actual pipes
//
@@ -144,18 +136,6 @@ GLOBAL_LIST_INIT(disposal_pipe_recipes, list(
icon_state_m = "[icon_state]m"
paintable = ispath(path, /obj/machinery/atmospherics/pipe) && !(ispath(path, /obj/machinery/atmospherics/pipe/vent)) // VOREStation Add
// Render an HTML link to select this pipe type
/datum/pipe_recipe/pipe/Render(dispenser)
var/dat = ..(dispenser)
// Stationary pipe dispensers don't allow you to pre-select pipe directions.
// This makes it impossble to spawn bent versions of bendable pipes.
// We add a "Bent" pipe type with a preset diagonal direction to work around it.
if(istype(dispenser, /obj/machinery/pipedispenser) && (dirtype == PIPE_BENDABLE))
dat += "<A href='?src=\ref[dispenser]&[Params()]&dir=[NORTHEAST]'>Bent [name]</A><BR>"
return dat
/datum/pipe_recipe/pipe/Params()
return "makepipe=[pipe_type]"
//
// Subtype for meters
@@ -168,9 +148,6 @@ GLOBAL_LIST_INIT(disposal_pipe_recipes, list(
/datum/pipe_recipe/meter/New(label)
name = label
/datum/pipe_recipe/meter/Params()
return "makemeter=1"
//
// Subtype for disposal pipes
//
@@ -185,9 +162,3 @@ GLOBAL_LIST_INIT(disposal_pipe_recipes, list(
subtype = sort
if (dirtype == PIPE_TRIN_M)
icon_state_m = replacetext(state, "j1", "j2")
/datum/pipe_recipe/disposal/Params()
var/param = "dmake=[pipe_type]"
if (subtype)
param += "&sort=[subtype]"
return param