mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
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:
@@ -207,23 +207,18 @@
|
|||||||
* @return nothing
|
* @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)
|
/datum/nanomanager/proc/send_resources(client)
|
||||||
var/list/css = flist(NANO_CSS_PATH)
|
var/list/nano_asset_dirs = list(\
|
||||||
var/list/images = flist(NANO_IMAGES_PATH)
|
"nano/css/",\
|
||||||
var/list/js = flist(NANO_JS_PATH)
|
"nano/images/",\
|
||||||
var/list/templates = flist(NANO_TEMPLATES_PATH)
|
"nano/js/",\
|
||||||
|
"nano/templates/"\
|
||||||
|
)
|
||||||
|
|
||||||
for(var/file in css)
|
var/list/files = null
|
||||||
client << browse_rsc(file(NANO_CSS_PATH + file))
|
for (var/path in nano_asset_dirs)
|
||||||
for(var/file in images)
|
files = flist(path)
|
||||||
client << browse_rsc(file(NANO_IMAGES_PATH + file))
|
for(var/file in files)
|
||||||
for(var/file in js)
|
if(copytext(file, length(file)) != "/") // files which end in "/" are actually directories, which we want to ignore
|
||||||
client << browse_rsc(file(NANO_JS_PATH + file))
|
client << browse_rsc(file(path + file)) // send the file to the client
|
||||||
for(var/file in templates)
|
|
||||||
client << browse_rsc(file(NANO_TEMPLATES_PATH + file))
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
{{:~displayBar(chargeLevel, 0, chargeMax)}}
|
{{:~displayBar(chargeLevel, 0, chargeMax)}}
|
||||||
<div style="clear: both; padding-top: 4px;">
|
<div style="clear: both; padding-top: 4px;">
|
||||||
{{:~link('MIN', null, {'input' : 'min'}, (chargeLevel > 0) ? null : 'disabled')}}
|
{{:~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('SET', null, {'input' : 'set'}, null)}}
|
||||||
|
{{:~link('MAX', null, {'input' : 'max'}, (chargeLevel < chargeMax) ? null : 'disabled')}}
|
||||||
<div style="float: left; width: 80px; text-align: center;"> {{:chargeLevel}} W </div>
|
<div style="float: left; width: 80px; text-align: center;"> {{:chargeLevel}} W </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -59,8 +59,8 @@
|
|||||||
{{:~displayBar(outputLevel, 0, outputMax)}}
|
{{:~displayBar(outputLevel, 0, outputMax)}}
|
||||||
<div style="clear: both; padding-top: 4px;">
|
<div style="clear: both; padding-top: 4px;">
|
||||||
{{:~link('MIN', null, {'output' : 'min'}, (outputLevel > 0) ? null : 'disabled')}}
|
{{:~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('SET', null, {'output' : 'set'}, null)}}
|
||||||
|
{{:~link('MAX', null, {'output' : 'max'}, (outputLevel < outputMax) ? null : 'disabled')}}
|
||||||
<div style="float: left; width: 80px; text-align: center;"> {{:outputLevel}} W </div>
|
<div style="float: left; width: 80px; text-align: center;"> {{:outputLevel}} W </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user