diff --git a/code/modules/nano/modules/power_monitor.dm b/code/modules/nano/modules/power_monitor.dm index 94223fc4ef..032b648fbf 100644 --- a/code/modules/nano/modules/power_monitor.dm +++ b/code/modules/nano/modules/power_monitor.dm @@ -29,6 +29,10 @@ 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) diff --git a/code/modules/power/sensors/powernet_sensor.dm b/code/modules/power/sensors/powernet_sensor.dm index 27e434b562..bfc8959139 100644 --- a/code/modules/power/sensors/powernet_sensor.dm +++ b/code/modules/power/sensors/powernet_sensor.dm @@ -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 diff --git a/nano/templates/power_monitor.tmpl b/nano/templates/power_monitor.tmpl index bf07238784..5e6b557663 100644 --- a/nano/templates/power_monitor.tmpl +++ b/nano/templates/power_monitor.tmpl @@ -2,6 +2,7 @@
{{:helper.link('Show List', 'cancel', { 'clear' : 1})}} Sensor selected: {{:data.focus.name}}
+ {{:helper.link('Show APCs On Map', 'pin-s', {'showMap' : 1})}} {{if data.focus.error}} {{:data.focus.error}} {{else}} diff --git a/nano/templates/power_monitor_map_content.tmpl b/nano/templates/power_monitor_map_content.tmpl new file mode 100644 index 0000000000..291903144d --- /dev/null +++ b/nano/templates/power_monitor_map_content.tmpl @@ -0,0 +1,33 @@ + +{{if data.focus}} + {{for data.focus.apc_data}} + {{if value.z == config.mapZLevel}} +
+ +
+ {{/if}} + {{/for}} +{{/if}} \ No newline at end of file diff --git a/nano/templates/power_monitor_map_header.tmpl b/nano/templates/power_monitor_map_header.tmpl new file mode 100644 index 0000000000..22ae30247f --- /dev/null +++ b/nano/templates/power_monitor_map_header.tmpl @@ -0,0 +1,25 @@ + +{{:helper.link('Show Network Information', 'script', {'showMap' : 0})}} +{{if data.focus}}Sensor selected: {{:data.focus.name}}{{/if}} +
+ Zoom Level:  + + + + +
+
+
Sensors:
+
+{{for data.all_sensors}} + {{if value.alarm}} + {{:helper.link(value.name, 'alert', { 'setsensor' : value.name})}} + {{else}} + {{:helper.link(value.name, '' , { 'setsensor' : value.name})}} + {{/if}} +{{empty}} + WARN: No Sensors Detected! +{{/for}}