mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
[MIRROR] Station monitoring console patches [MDB IGNORE] (#19086)
* Station monitoring console patches (#73096) ## About The Pull Request - Distro & Waste loop sensors were only displaying the values of the air on its turf not the actual pipes they were on, so the values were always constant. Thats fixed now. - Created a macro to map chamber id to air sensor to avoid typos. This also fixed being unable to connect to the waste loop sensor due to a typo in the word "_sensor". - When reconnecting to a different chamber other than distro & waste `atmos_chambers` is not lost when switching so you can once again connect back to distro & waste. After reconnecting make sure to again select the chamber from the drop down box cause the ui doesn't update automatically https://user-images.githubusercontent.com/110812394/215701505-105eba4d-d5d1-4a09-9ac7-0ab73fee2196.mp4 Fixes #73055 ## Changelog 🆑 fix: distro & waste sensors not reading values from the actual pipes they are on fix: losing distro & waste options from the drop-down box after connecting to a new sensor. refactor: all occurrences of _sensor with a macro to avoid typos. /🆑 --------- Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> * Station monitoring console patches --------- Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
This commit is contained in:
co-authored by
Mothblocks
SyncIt21
parent
03d9def35d
commit
0253fdf5ba
@@ -31,6 +31,8 @@
|
||||
#define ATMOS_GAS_MONITOR_DISTRO "distro"
|
||||
#define ATMOS_GAS_MONITOR_WASTE "waste"
|
||||
|
||||
///maps a chamber id to its air sensor
|
||||
#define CHAMBER_SENSOR_FROM_ID(chamber_id) ((chamber_id) + "_sensor")
|
||||
///maps an air sensor's chamber id to its input valve[ i.e. outlet_injector] id
|
||||
#define CHAMBER_INPUT_FROM_ID(chamber_id) ((chamber_id) + "_in")
|
||||
///maps an air sensor's chamber id to its output valve[i.e. vent pump] id
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
var/chamber_id
|
||||
|
||||
/obj/machinery/air_sensor/Initialize(mapload)
|
||||
id_tag = chamber_id + "_sensor"
|
||||
id_tag = CHAMBER_SENSOR_FROM_ID(chamber_id)
|
||||
var/static/list/multitool_tips = list(
|
||||
TOOL_MULTITOOL = list(
|
||||
SCREENTIP_CONTEXT_LMB = "Link logged injectors/vents",
|
||||
|
||||
@@ -11,11 +11,20 @@
|
||||
/// Assoc of list[chamber_id] = readable_chamber_name
|
||||
var/list/atmos_chambers
|
||||
|
||||
/// Used when control = FALSE to store the original atmos chambers so they dont get lost when reconnecting
|
||||
var/list/always_displayed_chambers
|
||||
|
||||
/// Whether we can actually adjust the chambers or not.
|
||||
var/control = TRUE
|
||||
/// Whether we are allowed to reconnect.
|
||||
var/reconnecting = TRUE
|
||||
|
||||
/obj/machinery/computer/atmos_control/Initialize(mapload, obj/item/circuitboard/C)
|
||||
. = ..()
|
||||
//special case for the station monitering console. We dont want to loose these chambers during reconnecting
|
||||
if(!control && !isnull(atmos_chambers))
|
||||
always_displayed_chambers = atmos_chambers.Copy()
|
||||
|
||||
/// Reconnect only works for station based chambers.
|
||||
/obj/machinery/computer/atmos_control/proc/reconnect(mob/user)
|
||||
if(!reconnecting)
|
||||
@@ -38,6 +47,10 @@
|
||||
return FALSE
|
||||
|
||||
atmos_chambers = list()
|
||||
//these are chambers we always want to display even after reconnecting
|
||||
if(always_displayed_chambers)
|
||||
for(var/chamber_id in always_displayed_chambers)
|
||||
atmos_chambers[chamber_id] = always_displayed_chambers[chamber_id]
|
||||
atmos_chambers[new_id] = new_name
|
||||
|
||||
name = new_name + (control ? " Control" : " Monitor")
|
||||
@@ -69,7 +82,7 @@
|
||||
chamber_info["id"] = chamber_id
|
||||
chamber_info["name"] = atmos_chambers[chamber_id]
|
||||
|
||||
var/obj/machinery/sensor = GLOB.objects_by_id_tag["[chamber_id]_sensor"]
|
||||
var/obj/machinery/sensor = GLOB.objects_by_id_tag[CHAMBER_SENSOR_FROM_ID(chamber_id)]
|
||||
if (!isnull(sensor))
|
||||
chamber_info["gasmix"] = gas_mixture_parser(sensor.return_air())
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
var/chamber_id
|
||||
|
||||
/obj/machinery/meter/monitored/Initialize(mapload, new_piping_layer)
|
||||
id_tag = chamber_id + "_sensor"
|
||||
id_tag = CHAMBER_SENSOR_FROM_ID(chamber_id)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/meter/monitored/layer2
|
||||
|
||||
@@ -401,7 +401,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
|
||||
if(info.type == /datum/pipe_info/sensor)
|
||||
var/datum/pipe_info/sensor/sensor_info = info
|
||||
var/obj/machinery/air_sensor/sensor = sensor_info.id
|
||||
if(GLOB.objects_by_id_tag[initial(sensor.chamber_id) + "_sensor"] != null)
|
||||
if(GLOB.objects_by_id_tag[CHAMBER_SENSOR_FROM_ID(initial(sensor.chamber_id))] != null)
|
||||
continue
|
||||
|
||||
r += list(list("pipe_name" = info.name, "pipe_index" = i, "selected" = (info == recipe), "all_layers" = info.all_layers))
|
||||
|
||||
@@ -58,6 +58,9 @@
|
||||
icon_state = "meter"
|
||||
SSair.stop_processing_machine(src)
|
||||
|
||||
/obj/machinery/meter/return_air()
|
||||
return target?.return_air() || ..()
|
||||
|
||||
/obj/machinery/meter/process_atmos()
|
||||
var/datum/gas_mixture/pipe_air = target.return_air()
|
||||
if(!pipe_air)
|
||||
|
||||
Reference in New Issue
Block a user