mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-24 04:28:12 +01:00
Merge pull request #3463 from VOREStation/multiz-consoles
Multiz consoles
This commit is contained in:
@@ -32,15 +32,27 @@
|
||||
/datum/nano_module/atmos_control/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state)
|
||||
var/data[0]
|
||||
var/alarms[0]
|
||||
var/turf/T = get_turf(nano_host())
|
||||
|
||||
// TODO: Move these to a cache, similar to cameras
|
||||
for(var/obj/machinery/alarm/alarm in (monitored_alarms.len ? monitored_alarms : machines))
|
||||
alarms[++alarms.len] = list("name" = sanitize(alarm.name), "ref"= "\ref[alarm]", "danger" = max(alarm.danger_level, alarm.alarm_area.atmosalm))
|
||||
alarms[++alarms.len] = list(
|
||||
"name" = sanitize(alarm.name),
|
||||
"ref"= "\ref[alarm]",
|
||||
"danger" = max(alarm.danger_level, alarm.alarm_area.atmosalm),
|
||||
"x" = alarm.x,
|
||||
"y" = alarm.y,
|
||||
"z" = alarm.z)
|
||||
data["alarms"] = alarms
|
||||
data["map_levels"] = using_map.get_map_levels(T.z)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "atmos_control.tmpl", src.name, 625, 625, state = state)
|
||||
// adding a template with the key "mapContent" enables the map ui functionality
|
||||
ui.add_template("mapContent", "atmos_control_map_content.tmpl")
|
||||
// adding a template with the key "mapHeader" replaces the map header content
|
||||
ui.add_template("mapHeader", "atmos_control_map_header.tmpl")
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
var/turf/T = get_turf(nano_host())
|
||||
|
||||
data["isAI"] = isAI(user)
|
||||
data["crewmembers"] = crew_repository.health_data(T)
|
||||
data["map_levels"] = using_map.get_map_levels(T.z, FALSE)
|
||||
data["crewmembers"] = list()
|
||||
for(var/z in (data["map_levels"] | T.z)) // Always show crew from the current Z even if we can't show a map
|
||||
data["crewmembers"] += crew_repository.health_data(z)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
@@ -30,6 +33,8 @@
|
||||
ui.add_template("mapContent", "crew_monitor_map_content.tmpl")
|
||||
// adding a template with the key "mapHeader" replaces the map header content
|
||||
ui.add_template("mapHeader", "crew_monitor_map_header.tmpl")
|
||||
if(!(ui.map_z_level in data["map_levels"]))
|
||||
ui.set_map_z_level(data["map_levels"][1])
|
||||
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
var/list/sensors = list()
|
||||
// Focus: If it remains null if no sensor is selected and UI will display sensor list, otherwise it will display sensor reading.
|
||||
var/obj/machinery/power/sensor/focus = null
|
||||
var/turf/T = get_turf(nano_host())
|
||||
|
||||
// Build list of data from sensor readings.
|
||||
for(var/obj/machinery/power/sensor/S in grid_sensors)
|
||||
@@ -25,10 +26,15 @@
|
||||
data["all_sensors"] = sensors
|
||||
if(focus)
|
||||
data["focus"] = focus.return_reading_data()
|
||||
data["map_levels"] = using_map.get_map_levels(T.z)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "power_monitor.tmpl", "Power Monitoring Console", 800, 500, state = state)
|
||||
// adding a template with the key "mapContent" enables the map ui functionality
|
||||
ui.add_template("mapContent", "power_monitor_map_content.tmpl")
|
||||
// adding a template with the key "mapHeader" replaces the map header content
|
||||
ui.add_template("mapHeader", "power_monitor_map_header.tmpl")
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
@@ -163,6 +163,10 @@
|
||||
// Cell Status
|
||||
APC_entry["cell_charge"] = A.cell ? round(A.cell.percent()) : "NO CELL"
|
||||
APC_entry["cell_status"] = A.cell ? chg[A.charging+1] : "N"
|
||||
// Location
|
||||
APC_entry["x"] = A.x
|
||||
APC_entry["y"] = A.y
|
||||
APC_entry["z"] = A.z
|
||||
// Other info
|
||||
APC_entry["total_load"] = reading_to_text(A.lastused_total)
|
||||
// Hopefully removes those goddamn \improper s which are screwing up the UI
|
||||
|
||||
Reference in New Issue
Block a user