mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
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:
@@ -35,12 +35,23 @@
|
|||||||
|
|
||||||
// TODO: Move these to a cache, similar to cameras
|
// TODO: Move these to a cache, similar to cameras
|
||||||
for(var/obj/machinery/alarm/alarm in (monitored_alarms.len ? monitored_alarms : machines))
|
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["alarms"] = alarms
|
||||||
|
data["station_levels"] = using_map.station_levels
|
||||||
|
|
||||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||||
if(!ui)
|
if(!ui)
|
||||||
ui = new(user, src, ui_key, "atmos_control.tmpl", src.name, 625, 625, state = state)
|
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.set_initial_data(data)
|
||||||
ui.open()
|
ui.open()
|
||||||
ui.set_auto_update(1)
|
ui.set_auto_update(1)
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
<div class="notice" style="height: 22px">
|
||||||
|
{{:helper.link('Show Air Alrms On Map', 'pin-s', {'showMap' : 1})}}
|
||||||
|
</div>
|
||||||
<div class='item'>
|
<div class='item'>
|
||||||
{{for data.alarms}}
|
{{for data.alarms}}
|
||||||
{{:helper.link(value.name, null, {'alarm' : value.ref}, null, value.danger == 2 ? 'redButton' : (value.danger == 1 ? 'yellowButton' : null))}}
|
{{:helper.link(value.name, null, {'alarm' : value.ref}, null, value.danger == 2 ? 'redButton' : (value.danger == 1 ? 'yellowButton' : null))}}
|
||||||
|
|||||||
13
nano/templates/atmos_control_map_content.tmpl
Normal file
13
nano/templates/atmos_control_map_content.tmpl
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!--
|
||||||
|
Title: Atmos Control Console (Map Content)
|
||||||
|
Used In File(s): \code\modules\nano\modules\atmos_control.dm
|
||||||
|
-->
|
||||||
|
{{for data.alarms}}
|
||||||
|
{{if value.z == config.mapZLevel}}
|
||||||
|
<div class="mapIcon mapIcon16 linkActive {{:value.danger == 2 ? 'dead' : (value.danger == 1 ? 'deadish' : null)}}" style="left: {{:(value.x + 0.2)}}px; bottom: {{:(value.y - 14.75)}}px;" unselectable="on" data-href="{{: NanoUtility.generateHref({'alarm' : value.ref}) }}">
|
||||||
|
<div class="tooltip hidden">
|
||||||
|
<span>{{:value.name}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/for}}
|
||||||
18
nano/templates/atmos_control_map_header.tmpl
Normal file
18
nano/templates/atmos_control_map_header.tmpl
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<!--
|
||||||
|
Title: Atmos Control Console (Map Header)
|
||||||
|
Used In File(s): \code\modules\nano\modules\atmos_control.dm
|
||||||
|
-->
|
||||||
|
{{:helper.link('Show List', 'script', {'showMap' : 0})}}
|
||||||
|
<div style="float: right;">
|
||||||
|
<span style="float: left;">Z Level: </span>
|
||||||
|
{{for data.station_levels }}
|
||||||
|
{{:helper.link(value, null, {'mapZLevel' : value}) }}
|
||||||
|
{{/for}}
|
||||||
|
</div>
|
||||||
|
<div style="float: right; width: 240px;">
|
||||||
|
<span style="float: left;">Zoom Level: </span>
|
||||||
|
<div unselectable="on" class="link zoomLink" data-zoom-level="4">x1.0</div>
|
||||||
|
<div unselectable="on" class="link zoomLink" data-zoom-level="6">x1.5</div>
|
||||||
|
<div unselectable="on" class="link zoomLink" data-zoom-level="8">x2.0</div>
|
||||||
|
<div unselectable="on" class="link zoomLink" data-zoom-level="12">x2.5</div>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user