mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-25 22:28:44 +01:00
TGUI Engineering: Squashed Edition (Commits Below)
TGUI APCs TGUI vending machines Fix AI default_tgui_interaction TGUI Airlocks Station & Atmospheric Alert TGUI + Misc NTOS-TGUI Fixes TGUI Air Alarms & Central Atmospheric Control Airlock TGUI TG... got rid of UI for fire alarm. í´· TGUI Gas Heating/Cooling System TGUI Gas Pump & Passive Gate + Fixes TGUI Omni Atmospherics TGUI Pipe Dispensers & RPD TGUI IntelliCore & Vending Fix TGUI Handheld Tanks TGUI Portable Pump & Scrubber TGUI Tank Dispenser & Canisters TGUI Radios TGUI SMES & Air Alarm adjustment Tweak vending machine interfaces a tad TGUI Algae Farm TGUI general_air_control - Distro & Waste Console - Riot Control Console - Atmos Intake Console - Engine Cooling Console TGUI Heavy Scrubber Control (and body scanner fix) TGUI trinary devices & shutoff monitor TGUI Telecomms Log Browser TGUI Telecomms Machine Browser TGUI Spaceheater Internal Panel TGUI Gravity Generator TGUI Id Cards & Fix ID Card Images TGUI Id Card Redesign TGUI Turbolift TGUI Suit Cycler & Suit Storage Unit & Vending Fixes TGUI Power Monitor TGUI Signalers TGUI Employment Records TGUI Drone Console TGUI RIGSuits TGUI PA & PACMAN, and Margin Fix TGUI Solar Panels & Fix Power Monitor Adjust TGUI modules & their interaction with NTOS TGUI RCON TGUI Message Monitor Bump TGUI line limit to 120 (ParadiseSS13/Paradise#14002) TGUI Exonet & NTNet Relay TGUI Telecomms Multitool Menu TGUI Shield Capacitor & Shield Generator TGUI Supermatter-everything & Refactors
This commit is contained in:
@@ -53,12 +53,18 @@
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/attack_ai(mob/user as mob)
|
||||
ui_interact(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/attack_hand(mob/user as mob)
|
||||
ui_interact(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
/obj/machinery/atmospherics/unary/freezer/tgui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "GasTemperatureSystem", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/tgui_data(mob/user)
|
||||
// this is the data which will be sent to the ui
|
||||
var/data[0]
|
||||
data["on"] = use_power ? 1 : 0
|
||||
@@ -76,34 +82,26 @@
|
||||
temp_class = "average"
|
||||
data["gasTemperatureClass"] = temp_class
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "freezer.tmpl", "Gas Cooling System", 440, 300)
|
||||
// when the ui is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
// open the new ui window
|
||||
ui.open()
|
||||
// auto update every Master Controller tick
|
||||
ui.set_auto_update(1)
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/Topic(href, href_list)
|
||||
/obj/machinery/atmospherics/unary/freezer/tgui_act(action, params)
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["toggleStatus"])
|
||||
update_use_power(!use_power)
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
set_temperature = min(set_temperature + amount, 1000)
|
||||
else
|
||||
set_temperature = max(set_temperature + amount, 0)
|
||||
if(href_list["setPower"]) //setting power to 0 is redundant anyways
|
||||
var/new_setting = between(0, text2num(href_list["setPower"]), 100)
|
||||
set_power_level(new_setting)
|
||||
return TRUE
|
||||
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("toggleStatus")
|
||||
update_use_power(!use_power)
|
||||
update_icon()
|
||||
if("setGasTemperature")
|
||||
var/amount = text2num(params["temp"])
|
||||
if(amount > 0)
|
||||
set_temperature = min(amount, 1000)
|
||||
else
|
||||
set_temperature = max(amount, 0)
|
||||
if("setPower") //setting power to 0 is redundant anyways
|
||||
var/new_setting = between(0, text2num(params["value"]), 100)
|
||||
set_power_level(new_setting)
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
|
||||
@@ -75,12 +75,18 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/attack_ai(mob/user as mob)
|
||||
ui_interact(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/attack_hand(mob/user as mob)
|
||||
ui_interact(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
/obj/machinery/atmospherics/unary/heater/tgui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "GasTemperatureSystem", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/tgui_data(mob/user)
|
||||
// this is the data which will be sent to the ui
|
||||
var/data[0]
|
||||
data["on"] = use_power ? 1 : 0
|
||||
@@ -91,39 +97,31 @@
|
||||
data["targetGasTemperature"] = round(set_temperature)
|
||||
data["powerSetting"] = power_setting
|
||||
|
||||
var/temp_class = "normal"
|
||||
var/temp_class = "average"
|
||||
if(air_contents.temperature > (T20C+40))
|
||||
temp_class = "bad"
|
||||
data["gasTemperatureClass"] = temp_class
|
||||
|
||||
// update the ui if it exists, returns null if no ui is passed/found
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
// the ui does not exist, so we'll create a new() one
|
||||
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
|
||||
ui = new(user, src, ui_key, "freezer.tmpl", "Gas Heating System", 440, 300)
|
||||
// when the ui is first opened this is the data it will use
|
||||
ui.set_initial_data(data)
|
||||
// open the new ui window
|
||||
ui.open()
|
||||
// auto update every Master Controller tick
|
||||
ui.set_auto_update(1)
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/Topic(href, href_list)
|
||||
/obj/machinery/atmospherics/unary/heater/tgui_act(action, params)
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["toggleStatus"])
|
||||
update_use_power(!use_power)
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
if(amount > 0)
|
||||
set_temperature = min(set_temperature + amount, max_temperature)
|
||||
else
|
||||
set_temperature = max(set_temperature + amount, 0)
|
||||
if(href_list["setPower"]) //setting power to 0 is redundant anyways
|
||||
var/new_setting = between(0, text2num(href_list["setPower"]), 100)
|
||||
set_power_level(new_setting)
|
||||
return TRUE
|
||||
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("toggleStatus")
|
||||
update_use_power(!use_power)
|
||||
update_icon()
|
||||
if("setGasTemperature")
|
||||
var/amount = text2num(params["temp"])
|
||||
if(amount > 0)
|
||||
set_temperature = min(amount, max_temperature)
|
||||
else
|
||||
set_temperature = max(amount, 0)
|
||||
if("setPower") //setting power to 0 is redundant anyways
|
||||
var/new_setting = between(0, text2num(params["value"]), 100)
|
||||
set_power_level(new_setting)
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
|
||||
@@ -374,6 +374,12 @@
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if("reset_external_pressure" in signal.data)
|
||||
external_pressure_bound = ONE_ATMOSPHERE
|
||||
|
||||
if("reset_internal_pressure" in signal.data)
|
||||
internal_pressure_bound = 0
|
||||
|
||||
if(signal.data["init"] != null)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user