Add nanomap to the Atmos Control Computer

* In addition to showing a list of air alarms, the atmos computer now shows them as pins on the nanomap.
* Since the atmos computer shows all z-levels, the nanomap will be mutli-z.  Limited to station levels of course.
This commit is contained in:
Leshana
2017-05-22 16:15:47 -04:00
parent 5744812469
commit 388d6785ec
4 changed files with 46 additions and 1 deletions
+12 -1
View File
@@ -35,12 +35,23 @@
// 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["station_levels"] = using_map.station_levels
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)