mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Merge remote-tracking branch 'upstream/master' into step-aside-aran-im-here-to-touch-your-precious
Conflicts: code/controllers/subsystem/ticker.dm
This commit is contained in:
@@ -89,14 +89,24 @@ Passive gate is similar to the regular pump except:
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[round(target_pressure,0.1)]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>
|
||||
"}
|
||||
/obj/machinery/atmospherics/binary/passive_gate/ui_interact(mob/user, ui_key = "main")
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
var/data = list()
|
||||
|
||||
data["on"] = on
|
||||
data["pressure_set"] = round(target_pressure*100) //Nano UI can't handle rounded non-integers, apparently.
|
||||
data["max_pressure"] = MAX_OUTPUT_PRESSURE
|
||||
|
||||
var/datum/nanoui/ui = SSnano.get_open_ui(user, src, ui_key)
|
||||
if (!ui)
|
||||
ui = new /datum/nanoui(user, src, ui_key, "atmos_gas_pump.tmpl", name, 400, 120)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
else
|
||||
ui.push_data(data)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/atmosinit()
|
||||
..()
|
||||
@@ -145,7 +155,7 @@ Passive gate is similar to the regular pump except:
|
||||
user << "<span class='danger'>Access denied.</span>"
|
||||
return
|
||||
usr.set_machine(src)
|
||||
interact(user)
|
||||
ui_interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Topic(href,href_list)
|
||||
@@ -154,7 +164,11 @@ Passive gate is similar to the regular pump except:
|
||||
on = !on
|
||||
investigate_log("was turned [on ? "on" : "off"] by [key_name(usr)]", "atmos")
|
||||
if(href_list["set_press"])
|
||||
target_pressure = max(0, min(4500, safe_input("Pressure control", "Enter new output pressure (0-4500kPa)", target_pressure)))
|
||||
switch(href_list["set_press"])
|
||||
if ("max")
|
||||
target_pressure = MAX_OUTPUT_PRESSURE
|
||||
if ("set")
|
||||
target_pressure = max(0, min(MAX_OUTPUT_PRESSURE, safe_input("Pressure control", "Enter new output pressure (0-[MAX_OUTPUT_PRESSURE] kPa)", target_pressure)))
|
||||
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", "atmos")
|
||||
usr.set_machine(src)
|
||||
src.update_icon()
|
||||
|
||||
Reference in New Issue
Block a user