Skip to content

Commit f9dd2de

Browse files
[READY] [TGUI] Uplinks, PDAs and Power Consoles (Dont question it) (ParadiseSS13#14403)
* Uplinks * Main menu + Status display control * Signaler + Homescreen Fixes * TGUI Power Monitors * PDA Power Monitor * PDA Medical Records * PDA Security Records * PDA Secbot Control (Pain) * PDA Mule Control (I hate this system) * PDA Supply Records * PDA Janitor Locator * PDA Notekeeper * PDA Manifest * PDA Atmos Scanner * Steel pass 1 * PDA Messenger * Removes browserPDA-era icons * PDA Nanomob (Why do we still support this thing) * Fixes random power monitor quirk * More steel tweaks * Even more steel tweaks * TM Tweaks Round 1 * \ref --> UID() * Styling
1 parent 2a53521 commit f9dd2de

File tree

92 files changed

+2822
-1885
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2822
-1885
lines changed

code/datums/cache/powermonitor.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GLOBAL_DATUM_INIT(powermonitor_repository, /datum/repository/powermonitor, new()
1313

1414
for(var/obj/machinery/computer/monitor/pMon in GLOB.power_monitors)
1515
if( !(pMon.stat & (NOPOWER|BROKEN)) && !pMon.is_secret_monitor )
16-
pMonData[++pMonData.len] = list ("Name" = pMon.name, "ref" = "\ref[pMon]")
16+
pMonData[++pMonData.len] = list ("Name" = pMon.name, "uid" = "[pMon.UID()]")
1717

1818
cache_entry.timestamp = world.time //+ 30 SECONDS
1919
cache_entry.data = pMonData

code/datums/uplink_item.dm

-4
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
5959

6060
return uplink_items
6161

62-
/datum/nano_item_lists
63-
var/list/items_nano
64-
var/list/items_reference
65-
6662
// You can change the order of the list by putting datums before/after one another OR
6763
// you can use the last variable to make sure it appears last, well have the category appear last.
6864

code/game/machinery/camera/camera.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
var/datum/data/pda/app/notekeeper/N = PDA.find_program(/datum/data/pda/app/notekeeper)
183183
if(N)
184184
itemname = PDA.name
185-
info = N.notehtml
185+
info = N.note
186186
to_chat(U, "You hold \the [itemname] up to the camera ...")
187187
U.changeNext_move(CLICK_CD_MELEE)
188188
for(var/mob/O in GLOB.player_list)

code/game/machinery/computer/power.dm

+41-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,17 @@
99
light_color = LIGHT_COLOR_ORANGE
1010
circuit = /obj/item/circuitboard/powermonitor
1111
var/datum/powernet/powernet = null
12-
var/datum/nano_module/power_monitor/power_monitor
12+
var/datum/tgui_module/power_monitor/power_monitor
13+
/// Will this monitor be hidden from viewers?
1314
var/is_secret_monitor = FALSE
15+
/// How many records to keep of supply and demand
16+
var/record_size = 60
17+
/// Interval between power snapshots
18+
var/record_interval = 5 SECONDS
19+
/// Time to next record power
20+
var/next_record = 0
21+
/// The history list itself of the power
22+
var/list/history = list()
1423

1524
/obj/machinery/computer/monitor/secret //Hides the power monitor (such as ones on ruins & CentCom) from PDA's to prevent metagaming.
1625
name = "outdated power monitoring console"
@@ -28,6 +37,8 @@
2837
..()
2938
GLOB.powermonitor_repository.update_cache()
3039
powernet = find_powernet()
40+
history["supply"] = list()
41+
history["demand"] = list()
3142

3243
/obj/machinery/computer/monitor/Destroy()
3344
GLOB.power_monitors -= src
@@ -56,10 +67,35 @@
5667
return
5768
// Update the powernet
5869
powernet = find_powernet()
59-
ui_interact(user)
70+
tgui_interact(user)
6071

61-
/obj/machinery/computer/monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
62-
power_monitor.ui_interact(user, ui_key, ui, force_open)
72+
/obj/machinery/computer/monitor/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_default_state)
73+
power_monitor.tgui_interact(user, ui_key, ui, force_open)
6374

6475
/obj/machinery/computer/monitor/interact(mob/user)
65-
power_monitor.ui_interact(user)
76+
power_monitor.tgui_interact(user)
77+
78+
/obj/machinery/computer/monitor/process()
79+
record()
80+
81+
/**
82+
* Power snapshot recording proc
83+
*
84+
* This proc handles recording powernet history for the graph on the TGUI
85+
* It is called every process(), but only logs every 5 seconds
86+
*/
87+
/obj/machinery/computer/monitor/proc/record()
88+
if(world.time >= next_record)
89+
next_record = world.time + record_interval
90+
if(!powernet)
91+
return
92+
93+
var/list/supply = history["supply"]
94+
supply += powernet.viewavail
95+
if(length(supply) > record_size)
96+
supply.Cut(1, 2)
97+
98+
var/list/demand = history["demand"]
99+
demand += powernet.viewload
100+
if(length(demand) > record_size)
101+
demand.Cut(1, 2)

0 commit comments

Comments
 (0)