mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 07:33:34 +01:00
Card Mod, Power Monitor and Console Presets.
This commit is contained in:
Vendored
+6
-6
@@ -1,8 +1,8 @@
|
||||
var/global/datum/repository/apc/apc_repository = new()
|
||||
|
||||
/datum/repository/apc/proc/apc_data(var/obj/machinery/computer/monitor/powermonitor)
|
||||
/datum/repository/apc/proc/apc_data(datum/powernet/powernet)
|
||||
var/apcData[0]
|
||||
|
||||
|
||||
var/datum/cache_entry/cache_entry = cache_data
|
||||
if(!cache_entry)
|
||||
cache_entry = new/datum/cache_entry
|
||||
@@ -10,10 +10,10 @@ var/global/datum/repository/apc/apc_repository = new()
|
||||
|
||||
if(world.time < cache_entry.timestamp)
|
||||
return cache_entry.data
|
||||
|
||||
if(powermonitor && !isnull(powermonitor.powernet))
|
||||
|
||||
if(powernet)
|
||||
var/list/L = list()
|
||||
for(var/obj/machinery/power/terminal/term in powermonitor.powernet.nodes)
|
||||
for(var/obj/machinery/power/terminal/term in powernet.nodes)
|
||||
if(istype(term.master, /obj/machinery/power/apc))
|
||||
var/obj/machinery/power/apc/A = term.master
|
||||
L += A
|
||||
@@ -24,5 +24,5 @@ var/global/datum/repository/apc/apc_repository = new()
|
||||
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
|
||||
cache_entry.data = apcData
|
||||
return apcData
|
||||
Reference in New Issue
Block a user