diff --git a/code/controllers/subsystem/nanoUI.dm b/code/controllers/subsystem/nanoUI.dm index f9083f7e8ed..45fc8f8c1f4 100644 --- a/code/controllers/subsystem/nanoUI.dm +++ b/code/controllers/subsystem/nanoUI.dm @@ -9,10 +9,29 @@ var/datum/subsystem/nano/SSnano 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.Add(fcopy_rsc(path + filename)) + /datum/subsystem/nano/stat_entry() stat(name, "[round(cost,0.001)]ds (CPU:[round(cpu,1)]%) [processing_uis.len]") @@ -27,4 +46,4 @@ var/datum/subsystem/nano/SSnano ui.process() ++i continue - processing_uis.Cut(i, i+1) \ No newline at end of file + processing_uis.Cut(i, i+1) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 32ae0986467..5855d795633 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -239,25 +239,9 @@ var/next_external_rsc = 0 //send resources to the client. It's here in its own proc so we can move it around easiliy if need be /client/proc/send_resources() + //Send nanoui files to client + SSnano.send_resources(src) getFiles( - 'nano/js/libraries.min.js', - 'nano/js/nano_update.js', - 'nano/js/nano_config.js', - 'nano/js/nano_base_helpers.js', - 'nano/css/shared.css', - 'nano/css/icons.css', - 'nano/templates/chem_dispenser.tmpl', - 'nano/templates/chem_heater.tmpl', - 'nano/templates/smes.tmpl', - 'nano/templates/apc.tmpl', - 'nano/templates/cryo.tmpl', - 'nano/templates/solar_control.tmpl', - 'nano/images/uiBackground.png', - 'nano/images/uiIcons16.png', - 'nano/images/uiIcons24.png', - 'nano/images/uiLinkPendingIcon.gif', - 'nano/images/uiNoticeBackground.jpg', - 'nano/images/uiTitleFluff.png', 'html/search.js', 'html/panels.css', 'html/browser/common.css', diff --git a/code/modules/nano/nanomanager.dm b/code/modules/nano/nanomanager.dm index c463787a17e..07a6a4570dc 100644 --- a/code/modules/nano/nanomanager.dm +++ b/code/modules/nano/nanomanager.dm @@ -182,3 +182,7 @@ return 1 // success +//Send all needed nano ui files to the client +/datum/subsystem/nano/proc/send_resources(client) + for(var/file in asset_files) + client << browse_rsc(file)