mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
NanoUI Subsystem Fixes
Don't do this, the asset subsystem does this for you
This commit is contained in:
@@ -1,41 +1,17 @@
|
|||||||
SUBSYSTEM_DEF(nanoui)
|
SUBSYSTEM_DEF(nanoui)
|
||||||
name = "NanoUI"
|
name = "NanoUI"
|
||||||
wait = 5
|
wait = 5
|
||||||
|
flags = SS_NO_INIT
|
||||||
// a list of current open /nanoui UIs, grouped by src_object and ui_key
|
// a list of current open /nanoui UIs, grouped by src_object and ui_key
|
||||||
var/list/open_uis = list()
|
var/list/open_uis = list()
|
||||||
// a list of current open /nanoui UIs, not grouped, for use in processing
|
// a list of current open /nanoui UIs, not grouped, for use in processing
|
||||||
var/list/processing_uis = list()
|
var/list/processing_uis = list()
|
||||||
// a list of asset filenames which are to be sent to the client on user logon
|
|
||||||
var/list/asset_files = list()
|
|
||||||
|
|
||||||
/datum/controller/subsystem/nanoui/Initialize()
|
|
||||||
var/list/nano_asset_dirs = list(\
|
|
||||||
"nano/css/",\
|
|
||||||
"nano/images/",\
|
|
||||||
"nano/images/status_icons/",\
|
|
||||||
"nano/images/modular_computers/",\
|
|
||||||
"nano/js/",\
|
|
||||||
"nano/templates/"\
|
|
||||||
)
|
|
||||||
|
|
||||||
var/list/filenames = null
|
|
||||||
for (var/path in nano_asset_dirs)
|
|
||||||
filenames = flist(path)
|
|
||||||
for(var/filename in filenames)
|
|
||||||
if(copytext(filename, length(filename)) != "/") // filenames which end in "/" are actually directories, which we want to ignore
|
|
||||||
if(fexists(path + filename))
|
|
||||||
asset_files[filename] = fcopy_rsc(path + filename) // add this file to asset_files for sending to clients when they connect
|
|
||||||
.=..()
|
|
||||||
for(var/i in GLOB.clients)
|
|
||||||
send_resources(i)
|
|
||||||
|
|
||||||
/datum/controller/subsystem/nanoui/Recover()
|
/datum/controller/subsystem/nanoui/Recover()
|
||||||
if(SSnanoui.open_uis)
|
if(SSnanoui.open_uis)
|
||||||
open_uis |= SSnanoui.open_uis
|
open_uis |= SSnanoui.open_uis
|
||||||
if(SSnanoui.processing_uis)
|
if(SSnanoui.processing_uis)
|
||||||
processing_uis |= SSnanoui.processing_uis
|
processing_uis |= SSnanoui.processing_uis
|
||||||
if(SSnanoui.asset_files)
|
|
||||||
asset_files |= SSnanoui.asset_files
|
|
||||||
|
|
||||||
/datum/controller/subsystem/nanoui/stat_entry()
|
/datum/controller/subsystem/nanoui/stat_entry()
|
||||||
return ..("[processing_uis.len] UIs")
|
return ..("[processing_uis.len] UIs")
|
||||||
@@ -44,9 +20,3 @@ SUBSYSTEM_DEF(nanoui)
|
|||||||
for(var/thing in processing_uis)
|
for(var/thing in processing_uis)
|
||||||
var/datum/nanoui/UI = thing
|
var/datum/nanoui/UI = thing
|
||||||
UI.process()
|
UI.process()
|
||||||
|
|
||||||
//Sends asset files to a client, called on client/New()
|
|
||||||
/datum/controller/subsystem/nanoui/proc/send_resources(client)
|
|
||||||
if(!subsystem_initialized)
|
|
||||||
return
|
|
||||||
getFilesSlow(client, asset_files)
|
|
||||||
@@ -449,7 +449,7 @@
|
|||||||
to_chat(usr, "This can only be done on mobs with clients")
|
to_chat(usr, "This can only be done on mobs with clients")
|
||||||
return
|
return
|
||||||
|
|
||||||
SSnanoui.send_resources(H.client)
|
H.client.send_resources()
|
||||||
|
|
||||||
to_chat(usr, "Resource files sent")
|
to_chat(usr, "Resource files sent")
|
||||||
to_chat(H, "Your NanoUI Resource files have been refreshed")
|
to_chat(H, "Your NanoUI Resource files have been refreshed")
|
||||||
|
|||||||
@@ -168,7 +168,6 @@
|
|||||||
log_client_to_db()
|
log_client_to_db()
|
||||||
|
|
||||||
send_resources()
|
send_resources()
|
||||||
SSnanoui.send_resources(src)
|
|
||||||
|
|
||||||
if(!void)
|
if(!void)
|
||||||
void = new()
|
void = new()
|
||||||
|
|||||||
Reference in New Issue
Block a user