Files
kiwistation/code/controllers/subsystem/nanoUI.dm
T
MrStonedOne ca4f4201e7 Asset Cache improvements!
Adds crew monitor to the asset cache system
Adds paper to the asset cache system

Added a way to send files to the client slowly without clogging up the queue. (This isn't technically "safe", but the client would only have issues if they didn't have that file already (rare), and only if they used a window that needed that asset (currently only nanoui windows) within the first 15 to 90 seconds of connecting (depending on ping))

Makes NanoUI use this slow send system to blindly send it's asset files. (Once bay's nanoui is ported, i'll improve this so that nanoui fully implements asset cache checking)

Makes asset cache use this system to send all registered asset files, so that ui windows don't have to wait for them if the client's been connected a while.
2015-11-25 02:11:04 -08:00

48 lines
1.2 KiB
Plaintext

var/datum/subsystem/nano/SSnano
/datum/subsystem/nano
name = "NanoUI"
can_fire = 1
wait = 10
priority = 16
var/list/open_uis = list() //a list of current open /nanoui UIs, grouped by src_object and ui_key
var/list/processing_uis = list() //a list of current open /nanoui UIs, not grouped, for use in processing
//List of asset filenames to be sent to the client on user login
var/list/asset_files = list()
/datum/subsystem/nano/New()
NEW_SS_GLOBAL(SSnano)
//Generate list of files to send to client for nano UI's
var/list/nano_asset_dirs = list(\
"nano/css/",\
"nano/images/",\
"nano/js/",\
"nano/templates/"\
)
var/list/filenames = null
for (var/path in nano_asset_dirs)
filenames = flist(path)
for(var/filename in filenames)
//Ignore directories
if(copytext(filename, length(filename)) != "/")
if(fexists(path + filename))
asset_files[filename] = fcopy_rsc(path + filename)
/datum/subsystem/nano/stat_entry()
..("P:[processing_uis.len]")
/datum/subsystem/nano/fire()
for(var/thing in SSnano.processing_uis)
if(thing)
var/datum/nanoui/ui = thing
if(ui.src_object && ui.user)
ui.process()
continue
processing_uis.Remove(thing)