mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
@@ -183,7 +183,7 @@
|
||||
"dA" = (/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/wall/r_wall,/area/space)
|
||||
"dB" = (/obj/structure/cable{d1 = 2; d2 = 4; icon_state = "2-4"},/obj/structure/cable{d1 = 2; d2 = 8; icon_state = "2-8"; tag = ""},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor/plating/airless,/area/space)
|
||||
"dC" = (/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor/plating/airless,/area/space)
|
||||
"dD" = (/obj/structure/disposaloutlet{dir = 4},/turf/simulated/floor/plating/airless,/area/space)
|
||||
"dD" = (/obj/structure/disposaloutlet{dir = 4},/obj/structure/disposalpipe/trunk{dir = 8},/turf/simulated/floor/plating/airless,/area/space)
|
||||
"dE" = (/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced{dir = 4},/obj/machinery/atmospherics/pipe/simple/hidden/supply{level = 1},/turf/simulated/floor{tag = "icon-vault (NORTHEAST)"; icon_state = "vault"; dir = 5},/area/turret_protected/tcomsat)
|
||||
"dF" = (/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced{dir = 1},/turf/space,/area/turret_protected/tcomsat)
|
||||
"dG" = (/obj/structure/window/reinforced{dir = 1},/obj/structure/lattice,/obj/machinery/light,/turf/space,/area/turret_protected/tcomsat)
|
||||
|
||||
Vendored
+3
-3
@@ -18,10 +18,10 @@ var/global/datum/repository/apc/apc_repository = new()
|
||||
var/obj/machinery/power/apc/A = term.master
|
||||
L += A
|
||||
|
||||
var/list/Status = list(0,0,1,1) // Status: off, auto-off, on, auto-on
|
||||
var/list/chg = list(0,1,1) // Charging: no, charging, full
|
||||
var/list/Status = list("Off","AOff","On","AOn") // Status: off, auto-off, on, auto-on
|
||||
var/list/chg = list("N","C","F") // Charging: no, charging, full
|
||||
for(var/obj/machinery/power/apc/A in L)
|
||||
apcData[++apcData.len] = list("Name" = html_encode(A.area.name), "Equipment" = Status[A.equipment+1], "Lights" = Status[A.lighting+1], "Environment" = Status[A.environ+1], "CellPct" = A.cell ? round(A.cell.percent(),1) : -1, "CellStatus" = A.cell ? chg[A.charging+1] : 0)
|
||||
apcData[++apcData.len] = list("Name" = html_encode(A.area.name), "Equipment" = Status[A.equipment+1], "Lights" = Status[A.lighting+1], "Environment" = Status[A.environ+1], "CellPct" = A.cell ? round(A.cell.percent(),1) : "M", "CellStatus" = A.cell ? chg[A.charging+1] : "M", "Load" = round(A.lastused_total,1))
|
||||
|
||||
cache_entry.timestamp = world.time + 5 SECONDS
|
||||
cache_entry.data = apcData
|
||||
|
||||
@@ -14,9 +14,12 @@
|
||||
/obj/machinery/computer/monitor/New()
|
||||
..()
|
||||
power_monitor = new(src)
|
||||
powernet = find_powernet()
|
||||
powermonitor_repository.update_cache()
|
||||
|
||||
/obj/machinery/computer/monitor/initialize()
|
||||
..()
|
||||
powernet = find_powernet()
|
||||
|
||||
/obj/machinery/computer/monitor/Destroy()
|
||||
if (src in machines) // So the cache can properly update
|
||||
removeAtProcessing()
|
||||
@@ -27,11 +30,6 @@
|
||||
..()
|
||||
powermonitor_repository.update_cache()
|
||||
|
||||
/obj/machinery/computer/monitor/process()
|
||||
if(!powernet)
|
||||
powernet = find_powernet()
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/monitor/proc/find_powernet()
|
||||
var/obj/structure/cable/attached = null
|
||||
var/turf/T = loc
|
||||
|
||||
@@ -289,6 +289,7 @@
|
||||
values["powerconnected"] = 1
|
||||
values["poweravail"] = powmonitor.powernet.avail
|
||||
values["powerload"] = num2text(powmonitor.powernet.viewload,10)
|
||||
values["powerdemand"] = powmonitor.powernet.load
|
||||
values["apcs"] = apc_repository.apc_data(powmonitor)
|
||||
else
|
||||
values["powerconnected"] = 0
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
return
|
||||
data["poweravail"] = powermonitor.powernet.avail
|
||||
data["powerload"] = num2text(powermonitor.powernet.viewload,10)
|
||||
data["powerdemand"] = powermonitor.powernet.load
|
||||
data["apcs"] = apc_repository.apc_data(powermonitor)
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
|
||||
@@ -44,6 +44,12 @@
|
||||
return powernet.avail
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/power/proc/load()
|
||||
if(powernet)
|
||||
return powernet.load
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/power/proc/disconnect_terminal() // machines without a terminal will just return, no harm no fowl.
|
||||
return
|
||||
|
||||
+20
-14
@@ -535,7 +535,15 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
|
||||
{{if data.records.powerconnected == 1}}
|
||||
<div class="item">
|
||||
<div class="itemLabelNarrow">
|
||||
<b>Current Load</b>:
|
||||
<b>Total Power:</b>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
<span class="average">{{:data.records.poweravail}} W</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="itemLabelNarrow">
|
||||
<b>Total Load:</b>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
<span class="average">{{:data.records.powerload}} W</span>
|
||||
@@ -543,24 +551,22 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="itemLabelNarrow">
|
||||
<b>Total Power</b>:
|
||||
<b>Total Demand:</b>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
<span class="average">{{:data.records.poweravail}} W</span>
|
||||
<span class="average">{{:data.records.powerdemand}} W</span>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="item">
|
||||
<table class="curvedEdges"><tbody>
|
||||
{{for data.records.apcs}}
|
||||
{{if index % 20 === 0}}
|
||||
<tr class=><th> Area </th><th> Eqp. </th><th> Lgt. </th><th> Env </th><th> Cell </th></tr>
|
||||
{{/if}}
|
||||
<tr class=><td><span class="average">{{:value.Name}}</span></td>
|
||||
{{:helper.string('<td bgcolor="{0}"> </td>', value.Equipment==1 ? '#4f7529' : '#8f1414')}}
|
||||
{{:helper.string('<td bgcolor="{0}"> </td>', value.Lights==1 ? '#4f7529' : '#8f1414')}}
|
||||
{{:helper.string('<td bgcolor="{0}"> </td>', value.Environment==1 ? '#4f7529' : '#8f1414')}}
|
||||
{{:helper.string('<td bgcolor="{0}">{1}</td>', value.CellStatus==1 ? '#4f7529' : '#8f1414', value.CellStatus==-1 ? 'No Cell' : value.CellPct + '%')}}
|
||||
<table class="curvedEdges" style="text-align: center;"><tbody>
|
||||
<tr><th>Area</th><th>Equip.</th><th>Lighting</th><th>Environ.</th><th>Cell</th><th>Load</th></tr>
|
||||
{{for data.records.apcs}}
|
||||
<tr><td style="text-align: left; font-weight: bold;">{{:value.Name}}</td>
|
||||
{{:helper.string('<td width="55px" bgcolor="{0}">{1}</td>', value.Equipment == "On" || value.Equipment == "AOn" ? '#4f7529' : '#8f1414', value.Equipment)}}
|
||||
{{:helper.string('<td width="55px" bgcolor="{0}">{1}</td>', value.Lights == "On" || value.Lights == "AOn" ? '#4f7529' : '#8f1414', value.Lights)}}
|
||||
{{:helper.string('<td width="55px" bgcolor="{0}">{1}</td>', value.Environment == "On" || value.Environment == "AOn" ? '#4f7529' : '#8f1414', value.Environment)}}
|
||||
{{:helper.string('<td style="text-align: center;" width="65px" bgcolor="{0}">{1}{2}</td>', value.CellStatus == "F" ? '#4f7529' : value.CellStatus == "C" ? '#cd6500' : '#8f1414', value.CellStatus == "M" ? 'No Cell' : value.CellPct + '%', value.CellStatus == "M" ? '' : ' (' + value.CellStatus + ')')}}
|
||||
<td width="55px">{{:value.Load}}W</td>
|
||||
</tr>
|
||||
{{/for}}
|
||||
</tbody></table>
|
||||
|
||||
@@ -21,14 +21,6 @@ Used In File(s): \code\modules\nano\modules\power_monitor.dm
|
||||
{{:helper.link('Return', 'gear', { 'return' : 1 }, null, null)}}
|
||||
{{/if}}
|
||||
<h2>Powernet Status</h2>
|
||||
<div class="item">
|
||||
<div class="itemLabelNarrow">
|
||||
<b>Current Load:</b>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
<span class="average">{{:data.powerload}} W</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="itemLabelNarrow">
|
||||
<b>Total Power:</b>
|
||||
@@ -38,14 +30,31 @@ Used In File(s): \code\modules\nano\modules\power_monitor.dm
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<table class="curvedEdges"><tbody>
|
||||
<tr><th>Area</th><th>Equip.</th><th>Lighting</th><th>Environ.</th><th>Cell</th></tr>
|
||||
<div class="itemLabelNarrow">
|
||||
<b>Total Load:</b>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
<span class="average">{{:data.powerload}} W</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="itemLabelNarrow">
|
||||
<b>Total Demand:</b>
|
||||
</div>
|
||||
<div class="itemContent">
|
||||
<span class="average">{{:data.powerdemand}} W</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<table class="curvedEdges" style="text-align: center;"><tbody>
|
||||
<tr><th>Area</th><th>Equip.</th><th>Lighting</th><th>Environ.</th><th>Cell</th><th>Load</th></tr>
|
||||
{{for data.apcs}}
|
||||
<tr><td><span class="average">{{:value.Name}}</span></td>
|
||||
{{:helper.string('<td width="55px" bgcolor="{0}"> </td>', value.Equipment == 1 ? '#4f7529' : '#8f1414')}}
|
||||
{{:helper.string('<td width="55px" bgcolor="{0}"> </td>', value.Lights == 1 ? '#4f7529' : '#8f1414')}}
|
||||
{{:helper.string('<td width="55px" bgcolor="{0}"> </td>', value.Environment == 1 ? '#4f7529' : '#8f1414')}}
|
||||
{{:helper.string('<td style="text-align: center;" width="35px" bgcolor="{0}">{1}</td>', value.CellStatus == 1 ? '#4f7529' : '#8f1414', value.CellStatus == -1 ? 'No Cell' : value.CellPct + '%')}}
|
||||
<tr><td style="text-align: left; font-weight: bold;">{{:value.Name}}</td>
|
||||
{{:helper.string('<td width="55px" bgcolor="{0}">{1}</td>', value.Equipment == "On" || value.Equipment == "AOn" ? '#4f7529' : '#8f1414', value.Equipment)}}
|
||||
{{:helper.string('<td width="55px" bgcolor="{0}">{1}</td>', value.Lights == "On" || value.Lights == "AOn" ? '#4f7529' : '#8f1414', value.Lights)}}
|
||||
{{:helper.string('<td width="55px" bgcolor="{0}">{1}</td>', value.Environment == "On" || value.Environment == "AOn" ? '#4f7529' : '#8f1414', value.Environment)}}
|
||||
{{:helper.string('<td style="text-align: center;" width="65px" bgcolor="{0}">{1}{2}</td>', value.CellStatus == "F" ? '#4f7529' : value.CellStatus == "C" ? '#cd6500' : '#8f1414', value.CellStatus == "M" ? 'No Cell' : value.CellPct + '%', value.CellStatus == "M" ? '' : ' (' + value.CellStatus + ')')}}
|
||||
<td width="65px">{{:value.Load}}W</td>
|
||||
</tr>
|
||||
{{/for}}
|
||||
</tbody></table>
|
||||
|
||||
Reference in New Issue
Block a user