mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge pull request #4970 from Novacat/nova-ert
Emergency Chemistry/NanoUI/Timer subsystem fixes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
SUBSYSTEM_DEF(nanoui)
|
||||
name = "NanoUI"
|
||||
wait = 20
|
||||
wait = 5
|
||||
// a list of current open /nanoui UIs, grouped by src_object and ui_key
|
||||
var/list/open_uis = list()
|
||||
// a list of current open /nanoui UIs, not grouped, for use in processing
|
||||
@@ -23,6 +23,8 @@ SUBSYSTEM_DEF(nanoui)
|
||||
if(copytext(filename, length(filename)) != "/") // filenames which end in "/" are actually directories, which we want to ignore
|
||||
if(fexists(path + filename))
|
||||
asset_files.Add(fcopy_rsc(path + filename)) // add this file to asset_files for sending to clients when they connect
|
||||
for(var/i in GLOB.clients)
|
||||
addtimer(CALLBACK(src, .proc/send_resources, i), 10)
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/nanoui/Recover()
|
||||
@@ -40,3 +42,10 @@ SUBSYSTEM_DEF(nanoui)
|
||||
for(var/thing in processing_uis)
|
||||
var/datum/nanoui/UI = thing
|
||||
UI.process()
|
||||
|
||||
//Sends asset files to a client, called on client/New()
|
||||
/datum/controller/subsystem/nanoui/proc/send_resources(client)
|
||||
if(!subsystem_initialized)
|
||||
return
|
||||
for(var/file in asset_files)
|
||||
client << browse_rsc(file) // send the file to the client
|
||||
@@ -4,6 +4,7 @@ PROCESSING_SUBSYSTEM_DEF(chemistry)
|
||||
flags = SS_BACKGROUND|SS_POST_FIRE_TIMING
|
||||
init_order = INIT_ORDER_CHEMISTRY
|
||||
var/list/chemical_reactions = list()
|
||||
var/list/chemical_reactions_by_reagent = list()
|
||||
var/list/chemical_reagents = list()
|
||||
|
||||
/datum/controller/subsystem/processing/chemistry/Recover()
|
||||
@@ -22,15 +23,16 @@ PROCESSING_SUBSYSTEM_DEF(chemistry)
|
||||
// more than one chemical it will still only appear in only one of the sublists.
|
||||
/datum/controller/subsystem/processing/chemistry/proc/initialize_chemical_reactions()
|
||||
var/paths = typesof(/datum/chemical_reaction) - /datum/chemical_reaction
|
||||
SSchemistry.chemical_reactions = list()
|
||||
chemical_reactions = list()
|
||||
chemical_reactions_by_reagent = list()
|
||||
|
||||
for(var/path in paths)
|
||||
var/datum/chemical_reaction/D = new path()
|
||||
var/datum/chemical_reaction/D = new path
|
||||
chemical_reactions += D
|
||||
if(D.required_reagents && D.required_reagents.len)
|
||||
var/reagent_id = D.required_reagents[1]
|
||||
if(!chemical_reactions[reagent_id])
|
||||
chemical_reactions[reagent_id] = list()
|
||||
chemical_reactions[reagent_id] += D
|
||||
LAZYINITLIST(chemical_reactions_by_reagent[reagent_id])
|
||||
chemical_reactions_by_reagent[reagent_id] += D
|
||||
|
||||
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
|
||||
/datum/controller/subsystem/processing/chemistry/proc/initialize_chemical_reagents()
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
SUBSYSTEM_DEF(timer)
|
||||
name = "Timer"
|
||||
wait = 1 //SS_TICKER subsystem, so wait is in ticks
|
||||
priority = FIRE_PRIORITY_TIMERS //VOREStation Emergency Edit
|
||||
init_order = INIT_ORDER_TIMER
|
||||
|
||||
flags = SS_TICKER|SS_NO_INIT
|
||||
|
||||
Reference in New Issue
Block a user