mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
[READY] Atmos Refactor Part 7 (I think) - Kills signals + TGUIs stuff (#19867)
* I AM NOT A KING. I AM NOT A GOD. I AM LUNACY. * THE SCOPE CREEP * This was done in vi. No langserver. Send help. * Progress * Some issues fixed * The code builds, but the maps dont * CC builds, I doubt anything else does * Do this now * Safety * The map compiles * THE MAPPING HELL * Airlock controllers dont work * Fixed bombs * AND THATS FIXED * Phantom edit * Restores LL I think * The mapmerge hooks are actually retarded * Fixes spawners * Half working air control * Picky * Hyper efficient tank monitor * Sanity * Laying the framework * Improved alert console * Dont think this is actually done anywhere * Metering * ONE HUNDRED AND ~~EIGHTY~~ TWENTY SEVEN * WE ARE READY FOR BOX TO BUILD * One map done * Well that was easy * Another one * I think this is done * I should have removed this * I would make a russian joke but <current event> * Delta WIP * Makes delta work * Early review * TM safeguard * oops * METAAAAAAAAAAAAAAAAAAAAAAAAA * Fix #4213 * Trailing * oh for piss sake * Shutter fix * Roundstart ATs can go away * Review pass 1 * What could go wrong * BOOM BOOM BOOM * Not needed * Fix seed vault * Oops * Review changes
This commit is contained in:
@@ -346,12 +346,6 @@ SUBSYSTEM_DEF(air)
|
||||
for(var/obj/machinery/atmospherics/A in machines_to_init)
|
||||
A.atmos_init()
|
||||
count++
|
||||
if(istype(A, /obj/machinery/atmospherics/unary/vent_pump))
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/T = A
|
||||
T.broadcast_status()
|
||||
else if(istype(A, /obj/machinery/atmospherics/unary/vent_scrubber))
|
||||
var/obj/machinery/atmospherics/unary/vent_scrubber/T = A
|
||||
T.broadcast_status()
|
||||
return count
|
||||
|
||||
//this can't be done with setup_atmos_machinery() because
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// why is this an SS if it has no fire or init
|
||||
// this should be a global datum for piss sake
|
||||
// AND YES I KNOW AN SS IS A GLOBAL DATUM, THATS NOT THE POINT
|
||||
SUBSYSTEM_DEF(alarm)
|
||||
name = "Alarm"
|
||||
flags = SS_NO_INIT | SS_NO_FIRE
|
||||
|
||||
@@ -70,6 +70,7 @@ SUBSYSTEM_DEF(atoms)
|
||||
for(var/I in late_loaders)
|
||||
var/atom/A = I
|
||||
A.LateInitialize()
|
||||
CHECK_TICK
|
||||
if(noisy)
|
||||
log_startup_progress("Late initialized [length(late_loaders)] atoms in [stop_watch(watch)]s")
|
||||
else
|
||||
|
||||
@@ -88,9 +88,9 @@ SUBSYSTEM_DEF(tgui)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/get_open_ui(mob/user, datum/src_object, ui_key)
|
||||
var/src_object_key = "[src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
return null // No UIs open.
|
||||
else if(isnull(open_uis[src_object_key][ui_key]) || !istype(open_uis[src_object_key][ui_key], /list))
|
||||
else if(isnull(open_uis[src_object_key][ui_key]) || !islist(open_uis[src_object_key][ui_key]))
|
||||
return null // No UIs open for this object.
|
||||
|
||||
for(var/datum/tgui/ui in open_uis[src_object_key][ui_key]) // Find UIs for this object.
|
||||
@@ -110,7 +110,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/update_uis(datum/src_object, update_static_data = FALSE)
|
||||
var/src_object_key = "[src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
return 0 // Couldn't find any UIs for this object.
|
||||
|
||||
var/update_count = 0
|
||||
@@ -135,7 +135,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
if(!src_object.unique_datum_id) // First check if the datum has an UID set
|
||||
return 0
|
||||
var/src_object_key = "[src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
return 0 // Couldn't find any UIs for this object.
|
||||
|
||||
var/close_count = 0
|
||||
@@ -146,6 +146,29 @@ SUBSYSTEM_DEF(tgui)
|
||||
close_count++ // Count each UI we close.
|
||||
return close_count
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the amount of open UIs on an object
|
||||
* Returns the number of UIs open.
|
||||
*
|
||||
* * datum/src_object - The object/datum which owns the UIs.
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/get_open_ui_count(datum/src_object)
|
||||
if(!src_object.unique_datum_id) // First check if the datum has an UID set
|
||||
return 0
|
||||
var/src_object_key = "[src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
return 0 // Couldn't find any UIs for this object.
|
||||
|
||||
var/open_count = 0
|
||||
for(var/ui_key in open_uis[src_object_key])
|
||||
for(var/datum/tgui/ui in open_uis[src_object_key][ui_key])
|
||||
if(ui && ui.src_object && ui.user && ui.src_object.ui_host(ui.user)) // Check the UI is valid.
|
||||
open_count++ // Count each UI thats open
|
||||
|
||||
return open_count
|
||||
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
@@ -173,7 +196,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
* * ui_key - If provided, only update UIs with this UI key. (OPTIONAL)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/update_user_uis(mob/user, datum/src_object = null, ui_key = null)
|
||||
if(isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0)
|
||||
if(isnull(user.open_uis) || !islist(user.open_uis) || open_uis.len == 0)
|
||||
return 0 // Couldn't find any UIs for this user.
|
||||
|
||||
var/update_count = 0
|
||||
@@ -194,7 +217,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
* * ui_key - If provided, only close UIs with this UI key. (OPTIONAL)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/close_user_uis(mob/user, datum/src_object = null, ui_key = null)
|
||||
if(isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0)
|
||||
if(isnull(user.open_uis) || !islist(user.open_uis) || open_uis.len == 0)
|
||||
return 0 // Couldn't find any UIs for this user.
|
||||
|
||||
var/close_count = 0
|
||||
@@ -213,9 +236,9 @@ SUBSYSTEM_DEF(tgui)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/on_open(datum/tgui/ui)
|
||||
var/src_object_key = "[ui.src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
open_uis[src_object_key] = list(ui.ui_key = list()) // Make a list for the ui_key and src_object.
|
||||
else if(isnull(open_uis[src_object_key][ui.ui_key]) || !istype(open_uis[src_object_key][ui.ui_key], /list))
|
||||
else if(isnull(open_uis[src_object_key][ui.ui_key]) || !islist(open_uis[src_object_key][ui.ui_key]))
|
||||
open_uis[src_object_key][ui.ui_key] = list() // Make a list for the ui_key.
|
||||
|
||||
// Append the UI to all the lists.
|
||||
@@ -234,9 +257,9 @@ SUBSYSTEM_DEF(tgui)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/on_close(datum/tgui/ui)
|
||||
var/src_object_key = "[ui.src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
return FALSE // It wasn't open.
|
||||
else if(isnull(open_uis[src_object_key][ui.ui_key]) || !istype(open_uis[src_object_key][ui.ui_key], /list))
|
||||
else if(isnull(open_uis[src_object_key][ui.ui_key]) || !islist(open_uis[src_object_key][ui.ui_key]))
|
||||
return FALSE // It wasn't open.
|
||||
|
||||
processing_uis.Remove(ui) // Remove it from the list of processing UIs.
|
||||
@@ -274,10 +297,10 @@ SUBSYSTEM_DEF(tgui)
|
||||
* * mob/target - The client's new mob.
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/on_transfer(mob/source, mob/target)
|
||||
if(!source || isnull(source.open_uis) || !istype(source.open_uis, /list) || open_uis.len == 0)
|
||||
if(!source || isnull(source.open_uis) || !islist(source.open_uis) || open_uis.len == 0)
|
||||
return FALSE // The old mob had no open UIs.
|
||||
|
||||
if(isnull(target.open_uis) || !istype(target.open_uis, /list))
|
||||
if(isnull(target.open_uis) || !islist(target.open_uis))
|
||||
target.open_uis = list() // Create a list for the new mob if needed.
|
||||
|
||||
for(var/datum/tgui/ui in source.open_uis)
|
||||
|
||||
Reference in New Issue
Block a user