diff --git a/SQL/paradise_schema.sql b/SQL/paradise_schema.sql index c33487d0394..9af8a0e261d 100644 --- a/SQL/paradise_schema.sql +++ b/SQL/paradise_schema.sql @@ -246,6 +246,7 @@ CREATE TABLE `player` ( `sound` mediumint(8) DEFAULT '31', `randomslot` tinyint(1) DEFAULT '0', `volume` smallint(4) DEFAULT '100', + `nanoui_fancy` smallint(4) DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `ckey` (`ckey`) ) ENGINE=InnoDB AUTO_INCREMENT=32446 DEFAULT CHARSET=latin1; diff --git a/SQL/paradise_schema_prefixed.sql b/SQL/paradise_schema_prefixed.sql index d4d75838020..e2ea56d7582 100644 --- a/SQL/paradise_schema_prefixed.sql +++ b/SQL/paradise_schema_prefixed.sql @@ -246,6 +246,7 @@ CREATE TABLE `SS13_player` ( `sound` mediumint(8) DEFAULT '31', `randomslot` tinyint(1) DEFAULT '0', `volume` smallint(4) DEFAULT '100', + `nanoui_fancy` smallint(4) DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `ckey` (`ckey`) ) ENGINE=InnoDB AUTO_INCREMENT=32446 DEFAULT CHARSET=latin1; diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index b8f4ce565af..a8f97d08947 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -80,6 +80,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts var/ooccolor = "#b82e00" var/be_special = list() //Special role selection var/UI_style = "Midnight" + var/nanoui_fancy = TRUE var/toggles = TOGGLES_DEFAULT var/sound = SOUND_DEFAULT var/UI_style_color = "#ffffff" @@ -389,6 +390,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "
" dat += "

General Settings

" dat += "UI Style: [UI_style]
" + dat += "Fancy NanoUI: [(nanoui_fancy) ? "Yes" : "No"]
" dat += "Custom UI settings:
" dat += "Color: [UI_style_color]
__

" dat += "Alpha (transparency): [UI_style_alpha]
" @@ -1488,6 +1490,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts else UI_style = "Midnight" + if("nanoui") + nanoui_fancy = !nanoui_fancy + if("UIcolor") var/UI_style_color_new = input(user, "Choose your UI color, dark colors are not recommended!", UI_style_color) as color|null if(!UI_style_color_new) return diff --git a/code/modules/client/preferences_mysql.dm b/code/modules/client/preferences_mysql.dm index fe5deb793e1..9b873baec73 100644 --- a/code/modules/client/preferences_mysql.dm +++ b/code/modules/client/preferences_mysql.dm @@ -10,7 +10,8 @@ toggles, sound, randomslot, - volume + volume, + nanoui_fancy FROM [format_table_name("player")] WHERE ckey='[C.ckey]'"} ) @@ -34,6 +35,7 @@ sound = text2num(query.item[8]) randomslot = text2num(query.item[9]) volume = text2num(query.item[10]) + nanoui_fancy = text2num(query.item[11]) //Sanitize ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor)) @@ -46,6 +48,7 @@ UI_style_alpha = sanitize_integer(UI_style_alpha, 0, 255, initial(UI_style_alpha)) randomslot = sanitize_integer(randomslot, 0, 1, initial(randomslot)) volume = sanitize_integer(volume, 0, 100, initial(volume)) + nanoui_fancy = sanitize_integer(nanoui_fancy, 0, 1, initial(nanoui_fancy)) return 1 /datum/preferences/proc/save_preferences(client/C) @@ -67,7 +70,8 @@ toggles='[toggles]', sound='[sound]', randomslot='[randomslot]', - volume='[volume]' + volume='[volume]', + nanoui_fancy='[nanoui_fancy]' WHERE ckey='[C.ckey]'"} ) diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 57ebadb21a9..cddb25bd118 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -186,7 +186,15 @@ nanoui is used to open and update nano browser uis "autoUpdateContent" = auto_update_content, "showMap" = show_map, "mapZLevel" = map_z_level, - "user" = list("name" = user.name) + "user" = list( + "name" = user.name, + "fancy" = user.client.prefs.nanoui_fancy + ), + "window" = list( + "width" = width, + "height" = height, + "ref" = window_id + ) ) return config_data @@ -334,7 +342,6 @@ nanoui is used to open and update nano browser uis /datum/nanoui/proc/get_html() // before the UI opens, add the layout files based on the layout key - add_stylesheet("layout_[layout_key].css") add_template("layout", "layout_[layout_key].tmpl") var/head_content = "" diff --git a/nano/Gulpfile.coffee b/nano/Gulpfile.coffee index fbd8abd45fc..a8c604a2280 100644 --- a/nano/Gulpfile.coffee +++ b/nano/Gulpfile.coffee @@ -5,11 +5,14 @@ s = # Project Paths input = - fonts: "**/*.{eot,woff2}" + fonts: "**/*.{eot,woff2}" + images: "images" + layouts: "layouts/" scripts: - lib: "scripts/libraries" - main: "scripts/nano" + lib: "scripts/libraries" + main: "scripts/nano" styles: "styles" + templates: "templates/" output = dir: "assets" @@ -20,6 +23,7 @@ output = ### Pacakages ### bower = require "main-bower-files" +child_process = require "child_process" del = require "del" gulp = require "gulp" merge = require "merge-stream" @@ -45,12 +49,28 @@ gulp.task "default", ["fonts", "scripts", "styles"] gulp.task "clean", -> del glob output.dir +gulp.task "watch", -> + gulp.watch [glob input.images], ["reload"] + gulp.watch [glob input.layouts], ["reload"] + gulp.watch [glob input.scripts.lib], ["reload"] + gulp.watch [glob input.scripts.main], ["reload"] + gulp.watch [glob input.styles], ["reload"] + gulp.watch [glob input.templates], ["reload"] + +gulp.task "reload", ["default"], -> + child_process.exec "reload.bat", (err, stdout, stderr) -> + return console.log err if err + + gulp.task "fonts", ["clean"], -> gulp.src bower input.fonts .pipe gulp.dest output.dir gulp.task "scripts", ["clean"], -> lib = gulp.src glob input.scripts.lib + etc = gulp.src bower "**/*.js" + + merged = merge lib, etc .pipe g.order(["jquery.js", "jquery*.js", "*.js"]) @@ -66,15 +86,13 @@ gulp.task "scripts", ["clean"], -> .pipe g.if(s.min, g.uglify().on('error', util.log)) .pipe gulp.dest output.dir - merge lib, main - gulp.task "styles", ["clean"], -> lib = gulp.src bower "**/*.css" .pipe g.replace("../fonts/", "") main = gulp.src glob input.styles .pipe g.filter(["*.less", "!_*.less"]) - .pipe g.less() + .pipe g.less({paths: [input.images]}) .pipe g.postcss([ p.autoprefixer({browsers: ["last 2 versions", "ie >= 8"]}), p.gradient, diff --git a/nano/assets/libraries.min.js b/nano/assets/libraries.min.js index a7a9d42ff80..047902609a2 100644 --- a/nano/assets/libraries.min.js +++ b/nano/assets/libraries.min.js @@ -1,5 +1,5 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t="length"in e&&e.length,n=oe.type(e);return"function"===n||oe.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function i(e,t,n){if(oe.isFunction(t))return oe.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return oe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(de.test(t))return oe.filter(t,e,n);t=oe.filter(t,e)}return oe.grep(e,function(e){return oe.inArray(e,t)>=0!==n})}function o(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function r(e){var t=xe[e]={};return oe.each(e.match(be)||[],function(e,n){t[n]=!0}),t}function s(){he.addEventListener?(he.removeEventListener("DOMContentLoaded",a,!1),e.removeEventListener("load",a,!1)):(he.detachEvent("onreadystatechange",a),e.detachEvent("onload",a))}function a(){(he.addEventListener||"load"===event.type||"complete"===he.readyState)&&(s(),oe.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var i="data-"+t.replace(Ne,"-$1").toLowerCase();if(n=e.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Ce.test(n)?oe.parseJSON(n):n}catch(o){}oe.data(e,t,n)}else n=void 0}return n}function u(e){var t;for(t in e)if(("data"!==t||!oe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,i){if(oe.acceptData(e)){var o,r,s=oe.expando,a=e.nodeType,l=a?oe.cache:e,u=a?e[s]:e[s]&&s;if(u&&l[u]&&(i||l[u].data)||void 0!==n||"string"!=typeof t)return u||(u=a?e[s]=Q.pop()||oe.guid++:s),l[u]||(l[u]=a?{}:{toJSON:oe.noop}),("object"==typeof t||"function"==typeof t)&&(i?l[u]=oe.extend(l[u],t):l[u].data=oe.extend(l[u].data,t)),r=l[u],i||(r.data||(r.data={}),r=r.data),void 0!==n&&(r[oe.camelCase(t)]=n),"string"==typeof t?(o=r[t],null==o&&(o=r[oe.camelCase(t)])):o=r,o}}function f(e,t,n){if(oe.acceptData(e)){var i,o,r=e.nodeType,s=r?oe.cache:e,a=r?e[oe.expando]:oe.expando;if(s[a]){if(t&&(i=n?s[a]:s[a].data)){oe.isArray(t)?t=t.concat(oe.map(t,oe.camelCase)):t in i?t=[t]:(t=oe.camelCase(t),t=t in i?[t]:t.split(" ")),o=t.length;for(;o--;)delete i[t[o]];if(n?!u(i):!oe.isEmptyObject(i))return}(n||(delete s[a].data,u(s[a])))&&(r?oe.cleanData([e],!0):ne.deleteExpando||s!=s.window?delete s[a]:s[a]=null)}}}function d(){return!0}function p(){return!1}function h(){try{return he.activeElement}catch(e){}}function g(e){var t=We.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function m(e,t){var n,i,o=0,r=typeof e.getElementsByTagName!==_e?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==_e?e.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],n=e.childNodes||e;null!=(i=n[o]);o++)!t||oe.nodeName(i,t)?r.push(i):oe.merge(r,m(i,t));return void 0===t||t&&oe.nodeName(e,t)?oe.merge([e],r):r}function v(e){Pe.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t){return oe.nodeName(e,"table")&&oe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function b(e){return e.type=(null!==oe.find.attr(e,"type"))+"/"+e.type,e}function x(e){var t=Ye.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,i=0;null!=(n=e[i]);i++)oe._data(n,"globalEval",!t||oe._data(t[i],"globalEval"))}function T(e,t){if(1===t.nodeType&&oe.hasData(e)){var n,i,o,r=oe._data(e),s=oe._data(t,r),a=r.events;if(a){delete s.handle,s.events={};for(n in a)for(i=0,o=a[n].length;o>i;i++)oe.event.add(t,n,a[n][i])}s.data&&(s.data=oe.extend({},s.data))}}function _(e,t){var n,i,o;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!ne.noCloneEvent&&t[oe.expando]){o=oe._data(t);for(i in o.events)oe.removeEvent(t,i,o.handle);t.removeAttribute(oe.expando)}"script"===n&&t.text!==e.text?(b(t).text=e.text,x(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),ne.html5Clone&&e.innerHTML&&!oe.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Pe.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function C(t,n){var i,o=oe(n.createElement(t)).appendTo(n.body),r=e.getDefaultComputedStyle&&(i=e.getDefaultComputedStyle(o[0]))?i.display:oe.css(o[0],"display");return o.detach(),r}function N(e){var t=he,n=Ze[e];return n||(n=C(e,t),"none"!==n&&n||(Je=(Je||oe("