Merge pull request #4970 from Novacat/nova-ert

Emergency Chemistry/NanoUI/Timer subsystem fixes
This commit is contained in:
Novacat
2019-04-10 19:39:51 -04:00
committed by GitHub
7 changed files with 39 additions and 51 deletions

View File

@@ -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

View File

@@ -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()

View File

@@ -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