NanoUI Caching and SMES tweaks

* Made NanoUI caching code neater, added check for directories (which are ignored).
* Moved SET to between MIN and MAX on SMES UI.
This commit is contained in:
Mark Aherne (Faerdan)
2014-01-12 20:07:48 +00:00
parent 214fbeee99
commit c9191faa14
2 changed files with 14 additions and 19 deletions

View File

@@ -207,23 +207,18 @@
* @return nothing
*/
#define NANO_CSS_PATH "nano/css/"
#define NANO_IMAGES_PATH "nano/images/"
#define NANO_JS_PATH "nano/js/"
#define NANO_TEMPLATES_PATH "nano/templates/"
/datum/nanomanager/proc/send_resources(client)
var/list/css = flist(NANO_CSS_PATH)
var/list/images = flist(NANO_IMAGES_PATH)
var/list/js = flist(NANO_JS_PATH)
var/list/templates = flist(NANO_TEMPLATES_PATH)
var/list/nano_asset_dirs = list(\
"nano/css/",\
"nano/images/",\
"nano/js/",\
"nano/templates/"\
)
for(var/file in css)
client << browse_rsc(file(NANO_CSS_PATH + file))
for(var/file in images)
client << browse_rsc(file(NANO_IMAGES_PATH + file))
for(var/file in js)
client << browse_rsc(file(NANO_JS_PATH + file))
for(var/file in templates)
client << browse_rsc(file(NANO_TEMPLATES_PATH + file))
var/list/files = null
for (var/path in nano_asset_dirs)
files = flist(path)
for(var/file in files)
if(copytext(file, length(file)) != "/") // files which end in "/" are actually directories, which we want to ignore
client << browse_rsc(file(path + file)) // send the file to the client

View File

@@ -34,8 +34,8 @@
{{:~displayBar(chargeLevel, 0, chargeMax)}}
<div style="clear: both; padding-top: 4px;">
{{:~link('MIN', null, {'input' : 'min'}, (chargeLevel > 0) ? null : 'disabled')}}
{{:~link('MAX', null, {'input' : 'max'}, (chargeLevel < chargeMax) ? null : 'disabled')}}
{{:~link('SET', null, {'input' : 'set'}, null)}}
{{:~link('MAX', null, {'input' : 'max'}, (chargeLevel < chargeMax) ? null : 'disabled')}}
<div style="float: left; width: 80px; text-align: center;">&nbsp;{{:chargeLevel}} W&nbsp;</div>
</div>
</div>
@@ -59,8 +59,8 @@
{{:~displayBar(outputLevel, 0, outputMax)}}
<div style="clear: both; padding-top: 4px;">
{{:~link('MIN', null, {'output' : 'min'}, (outputLevel > 0) ? null : 'disabled')}}
{{:~link('MAX', null, {'output' : 'max'}, (outputLevel < outputMax) ? null : 'disabled')}}
{{:~link('SET', null, {'output' : 'set'}, null)}}
{{:~link('MAX', null, {'output' : 'max'}, (outputLevel < outputMax) ? null : 'disabled')}}
<div style="float: left; width: 80px; text-align: center;">&nbsp;{{:outputLevel}} W&nbsp;</div>
</div>
</div>