diff --git a/css/dialogs.css b/css/dialogs.css index 4100b415..aa8ef5d4 100644 --- a/css/dialogs.css +++ b/css/dialogs.css @@ -83,7 +83,7 @@ } .empty_dialog { position: fixed; - z-index: 20; + z-index: 21; } dialog > content, dialog .dialog_wrapper > content { display: block; @@ -100,7 +100,7 @@ .dialog { position: fixed; - z-index: 20; + z-index: 21; top: 30px; } .dialog:not(.draggable) { diff --git a/js/animations/animation_controllers.js b/js/animations/animation_controllers.js index 17ed85a1..8acd593b 100644 --- a/js/animations/animation_controllers.js +++ b/js/animations/animation_controllers.js @@ -1613,7 +1613,7 @@ Interface.definePanels(() => {
- +
diff --git a/js/interface/dialog.js b/js/interface/dialog.js index 1577edbd..55d18696 100644 --- a/js/interface/dialog.js +++ b/js/interface/dialog.js @@ -745,6 +745,7 @@ window.Dialog = class Dialog { return this; } focus() { + Dialog.stack.remove(this); let blackout = document.getElementById('blackout'); blackout.style.display = 'block'; blackout.classList.toggle('darken', this.darken); @@ -755,7 +756,6 @@ window.Dialog = class Dialog { open_dialog = this.id; open_interface = this; Dialog.open = this; - Dialog.stack.remove(this); Dialog.stack.push(this); } hide() { @@ -926,7 +926,7 @@ window.MessageBox = class MessageBox extends Dialog { // Legacy Dialogs -function showDialog(dialog) { +function legacyShowDialog(dialog) { // todo: remove var obj = $('.dialog#'+dialog) $('.dialog').hide() if (open_menu) { @@ -955,11 +955,14 @@ function showDialog(dialog) { obj.css('max-height', (window.innerHeight-128)+'px') } } -function hideDialog() { +function legacyHideDialog() { // todo: remove $('#blackout').hide() $('.dialog').hide() open_dialog = false; open_interface = false; Prop.active_panel = undefined } +function hideDialog() { + console.warn('"hideDialog" is no longer supported!') +} diff --git a/js/interface/settings.js b/js/interface/settings.js index 185f574a..a4246f3b 100644 --- a/js/interface/settings.js +++ b/js/interface/settings.js @@ -84,6 +84,7 @@ class Setting { } set value(value) { let profile = Settings.dialog.content_vue?.profile; + if (this.type == 'number') value = Math.clamp(value, this.min, this.max) if (profile) { Vue.set(profile.settings, this.id, value); } else { @@ -807,7 +808,7 @@ onVueSetup(function() {
Profile: {{ profile_name }} -
{{ profile ? 'settings' : 'add' }}
+
{{ profile ? 'build' : 'add' }}

{{ title }}

diff --git a/js/io/io.js b/js/io/io.js index 5a0477c0..19e09d1f 100644 --- a/js/io/io.js +++ b/js/io/io.js @@ -143,7 +143,7 @@ async function loadImages(files, event) { }) } else if (method == 'extrude_with_cubes') { - showDialog('image_extruder'); + legacyShowDialog('image_extruder'); Extruder.drawImage(files[0]); } } @@ -178,7 +178,7 @@ var Extruder = { $('#scan_tolerance').on('input', function() { $('#scan_tolerance_label').text($(this).val()) }) - showDialog('image_extruder') + legacyShowDialog('image_extruder') Extruder.ext_img = new Image() Extruder.ext_img.src = isApp ? file.path.replace(/#/g, '%23') : file.content @@ -365,7 +365,7 @@ var Extruder = { Undo.finishEdit('Add extruded texture', {elements: selected, outliner: true, textures: [Texture.all[Texture.all.length-1]]}) - hideDialog() + legacyHideDialog() } } //Export @@ -678,7 +678,7 @@ BARS.defineActions(function() { readtype: 'image' }, function(files) { if (files.length) { - showDialog('image_extruder') + legacyShowDialog('image_extruder') Extruder.drawImage(files[0]) } }) diff --git a/js/modeling/transform.js b/js/modeling/transform.js index 7d4d846d..a51aea07 100644 --- a/js/modeling/transform.js +++ b/js/modeling/transform.js @@ -498,7 +498,7 @@ function getScaleAllGroups() { } function scaleAll(save, size) { if (save === true) { - hideDialog() + legacyHideDialog() } if (size === undefined) { size = $('#model_scale_label').val() @@ -635,7 +635,7 @@ function cancelScaleAll() { groups: getScaleAllGroups(), group_aspects: {transform: true}, }) - hideDialog() + legacyHideDialog() } function setScaleAllPivot(mode) { if (mode === 'selection') { @@ -1592,7 +1592,7 @@ BARS.defineActions(function() { getScaleAllGroups().forEach((g) => { g.old_origin = g.origin.slice(); }, Group, true) - showDialog('scaling') + legacyShowDialog('scaling') var v = Format.centered_grid ? 0 : 8; var origin = Group.selected ? Group.selected.origin : [v, 0, v]; $('#scaling_origin_x').val(origin[0]) diff --git a/js/predicate_editor.js b/js/predicate_editor.js index 35c3de74..b959caaa 100644 --- a/js/predicate_editor.js +++ b/js/predicate_editor.js @@ -312,11 +312,11 @@ const PredicateOverrideEditor = { - + diff --git a/lib/molang-prism-syntax.js b/lib/molang-prism-syntax.js index 08ffa1cf..01c25f0d 100644 --- a/lib/molang-prism-syntax.js +++ b/lib/molang-prism-syntax.js @@ -3,7 +3,7 @@ Prism.languages.molang = { 'function-name': /\b(?!\d)math\.\w+(?=[\t ]*\()/i, 'selector': /\b(?!\d)((query|variable|temp|context|math|q|v|t|c)\.\w+)|this/i, 'boolean': /\b(?:true|false)\b/i, - 'number': /(?:\b\d+(?:\.\d+)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b[%&!#]?/i, + 'number': /(?:\b\d+(?:\.\d+f?)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b/i, 'operator': /&&|\|\||[-+*/!<>]=?|[:?=]/i, 'keyword': /\b(return|loop|for_each|break|continue)\b/i, 'punctuation': /[.,;()[\]{}]/, diff --git a/lib/molang.umd.js b/lib/molang.umd.js index d515cf3c..6da5a1cc 100644 --- a/lib/molang.umd.js +++ b/lib/molang.umd.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Molang=t()}(this,(function(){"use strict";const e=e=>((e+180)%360+180)%360;var t={clamp:(e,t,r)=>(e>r&&(e=r),(ee+Math.random()*(t-e),randomInt:(e,t)=>(e=Math.ceil(e),t=Math.floor(t),e+Math.floor(Math.random()*(t-e+1))),dieRoll(e,t,r){e=this.clamp(e,0,1e9);let n=0;for(var a=0;ae+(t-e)*r,lerpRotate(t,r,n){let a=e(t),s=e(r);a>s&&([a,s]=[s,a]);var i=s-a;return i>180?e(s+n*(360-i)):a+n*i},inRange:(e,t,r)=>e<=r&&e>=t?1:0,all:(e,...t)=>-1===t.findIndex((t=>t!==e))?1:0,any:(e,...t)=>t.findIndex((t=>t==e))>=0?1:0,approxEq:(e,...t)=>-1===t.findIndex((t=>Math.abs(e-t)>1e-7))?1:0};return function(){const e=this;this.global_variables={},this.cache_enabled=!0,this.use_radians=!1,this.variables={},this.variableHandler=null;let r={},n=!1,a=0,s={};function i(e){this.lines=[];for(let t of e){if(!t)continue;let e=y(t);if(this.lines.push(e),e instanceof f)break}}function u(e,t){this.iterations=y(e),this.body=y(t)}function c(e,t,r,n){this.operator=e,this.a=y(t),void 0!==r&&(this.b=y(r)),void 0!==n&&(this.c=y(n))}function l(e,t){this.query=e,this.args=t.map((e=>y(e)))}function o(e,t){this.value=y(t),this.name=e}function f(e){this.value=y(e)}function h(){}function b(){}let d=()=>this.use_radians?1:Math.PI/180,g=/^-?\d+(\.\d+)?$/;function p(e){return g.test(e)}const w=/[^a-z0-9\.]/,m=/(temp|variable)\.\w+=/;function y(e){if(!e)return 0;if(p(e))return parseFloat(e);for(;v(e);)e=e.substr(1,e.length-2);let t=I(e,";",!0);if(t)return new i(t);if(e.startsWith("return"))return new f(e.substr(6));switch(e){case"true":return 1;case"false":return 0;case"break":return new h;case"continue":return new b}if("."===e.substring(1,2)){switch(e.substring(0,1)){case"q":e="query"+e.substring(1);break;case"v":e="variable"+e.substring(1);break;case"t":e="temp"+e.substring(1);break;case"c":e="context"+e.substring(1)}}if(w.test(e)){let t=-1!==e.indexOf("="),r=-1!==e.indexOf("?"),n=t&&e.length>4&&e.match(m);if(n&&"="!==e[n.index+n[0].length]){return new o(n[0].substring(0,n[0].length-1),e.substr(n.index+n[0].length))}let a=r&&M(e,"??",19);if(a)return a;let s=r&&I(e,"?");if(s){let e=I(s[1],":");return e&&e.length?new c(10,s[0],e[0],e[1]):new c(10,s[0],s[1],0)}if(a=M(e,"&&",11)||M(e,"||",12)||t&&M(e,"<=",14)||M(e,"<",13)||t&&M(e,">=",16)||M(e,">",15)||t&&M(e,"==",17)||t&&M(e,"!=",18)||M(e,"+",1,!0)||function(e,t,r){let n=R(e,t);if(n)return 0===n[0].length?new c(r,0,n[1]):new c(r,n[0],n[1])}(e,"-",2)||M(e,"*",3)||M(e,"/",4,!0)||function(e){if(e.startsWith("!")&&e.length>1)return new c(5,e.substr(1),0)}(e),a instanceof c)return a;if(e.startsWith("math.")){if("math.pi"===e)return Math.PI;let t=e.indexOf("("),r=e.substr(5,t-5),n=e.substr(t+1,e.length-t-2),a=I(n,",",!0);switch(a||(a=[n]),r){case"abs":return new c(100,a[0]);case"sin":return new c(101,a[0]);case"cos":return new c(102,a[0]);case"exp":return new c(103,a[0]);case"ln":return new c(104,a[0]);case"pow":return new c(105,a[0],a[1]);case"sqrt":return new c(106,a[0]);case"random":return new c(107,a[0],a[1]);case"ceil":return new c(108,a[0]);case"round":return new c(109,a[0]);case"trunc":return new c(110,a[0]);case"floor":return new c(111,a[0]);case"mod":return new c(112,a[0],a[1]);case"min":return new c(113,a[0],a[1]);case"max":return new c(114,a[0],a[1]);case"clamp":return new c(115,a[0],a[1],a[2]);case"lerp":return new c(116,a[0],a[1],a[2]);case"lerprotate":return new c(117,a[0],a[1],a[2]);case"asin":return new c(118,a[0]);case"acos":return new c(119,a[0]);case"atan":return new c(120,a[0]);case"atan2":return new c(121,a[0],a[1]);case"die_roll":return new c(122,a[0],a[1],a[2]);case"die_roll_integer":return new c(123,a[0],a[1],a[2]);case"hermite_blend":return new c(124,a[0]);case"random_integer":return new c(125,a[0],a[1],a[2])}}if(e.startsWith("loop(")){let t=I(e.substring(5,e.length-1),",",!0);if(t)return new u(...t)}}let r=e.match(/[a-z0-9._]{2,}/g);if(r&&1===r.length&&r[0].length>=e.length-2)return e;if(e.includes("(")&&")"==e[e.length-1]){let t=e.search(/\(/),r=e.substr(0,t),n=e.substr(t+1,e.length-t-2),a=I(n,",",!0);return a||(a=[n]),new l(r,a)}return 0}function v(e){if(e.startsWith(x)&&e.endsWith(q)||e.startsWith(_)&&e.endsWith(k)){let t=0;for(let r=0;r=0;){switch(e[r]){case x:case _:n++;break;case q:case k:n--;break;default:if(!(0!==n||t[0]!==e[r]||1!==t.length&&t!==e.substr(r,t.length)||"-"===t&&!1!=="+*/<>=|&?:".includes(e[r-1])))return[e.substr(0,r),e.substr(r+t.length)]}r--}}function W(e,t){return"string"==typeof e&&"'"==e[0]||(e=O(e,!0)),"string"==typeof t&&"'"==t[0]||(t=O(t,!0)),e===t}function O(s,g){if("number"==typeof s)return s;if("string"==typeof s){let t=r[s];if(void 0===t&&"function"==typeof e.variableHandler&&(t=e.variableHandler(s,r)),"number"==typeof t)return t;if("string"==typeof t&&!g)return e.parse(t,r)||0;if(void 0===t)n=!0;else if("function"==typeof t)return t()||0;return t||0}switch(s.constructor){case c:switch(s.operator){case 1:return O(s.a)+O(s.b);case 2:return O(s.a)-O(s.b);case 3:return O(s.a)*O(s.b);case 4:return O(s.a)/O(s.b);case 5:return 0==O(s.a)?1:0;case 10:return O(s.a)?O(s.b):O(s.c);case 11:return O(s.a)&&O(s.b)?1:0;case 12:return O(s.a)||O(s.b)?1:0;case 13:return O(s.a)O(s.b)?1:0;case 16:return O(s.a)>=O(s.b)?1:0;case 17:return W(s.a,s.b)?1:0;case 18:return W(s.a,s.b)?0:1;case 19:n=!1;let e=O(s.a);return n?O(s.b):e;case 100:return Math.abs(O(s.a));case 101:return Math.sin(O(s.a)*d());case 102:return Math.cos(O(s.a)*d());case 103:return Math.exp(O(s.a));case 104:return Math.log(O(s.a));case 105:return Math.pow(O(s.a),O(s.b));case 106:return Math.sqrt(O(s.a));case 107:return t.random(O(s.a),O(s.b));case 108:return Math.ceil(O(s.a));case 109:return Math.round(O(s.a));case 110:return Math.trunc(O(s.a));case 111:return Math.floor(O(s.a));case 112:return O(s.a)%O(s.b);case 113:return Math.min(O(s.a),O(s.b));case 114:return Math.max(O(s.a),O(s.b));case 115:return t.clamp(O(s.a),O(s.b),O(s.c));case 116:return t.lerp(O(s.a),O(s.b),O(s.c));case 117:return t.lerpRotate(O(s.a),O(s.b),O(s.c));case 118:return Math.asin(O(s.a))/d();case 119:return Math.acos(O(s.a))/d();case 120:return Math.atan(O(s.a))/d();case 121:return Math.atan2(O(s.a),O(s.b))/d();case 122:return t.dieRoll(O(s.a),O(s.b),O(s.c));case 123:return t.dieRollInt(O(s.a),O(s.b),O(s.c));case 124:let r=O(s.a);return 3*Math.pow(r,2)-2*Math.pow(r,3);case 125:return t.randomInt(O(s.a),O(s.b))}break;case f:return a=1,O(s.value);case o:return r[s.name]=e.variables[s.name]=O(s.value);case l:let g=s.args.map((e=>O(e)));switch(s.query){case"query.in_range":return t.inRange(...g);case"query.all":return t.all(...g);case"query.any":return t.any(...g);case"query.approx_eq":return t.approxEq(...g)}return"function"==typeof r[s.query]?r[s.query](...g):"function"==typeof e.variableHandler?e.variableHandler(s.query,r,g):0;case i:a=0;let p=0;for(let e of s.lines)if(p=O(e),a>0)break;return p;case u:let w=0,m=t.clamp(O(s.iterations),0,1024);for(let e=0;e{if("number"==typeof t)return isNaN(t)?0:t;if("string"!=typeof t||0===t.length)return 0;if(t.length<9&&p(t))return parseFloat(t);let i=this.cache_enabled&&s[t];return i||(i=function(e){return y(e=e.toLowerCase().replace(/\s/g,""))}(t),this.cache_enabled&&function(e,t){s[e]=t}(t,i)),function(t,n){for(let t in e.global_variables)r[t]=e.global_variables[t];for(let t in e.variables)r[t]=e.variables[t];if(n)for(let e in n)r[e]=n[e];let s=O(t);return r={},a=0,s}(i,n)},this.resetVariables=()=>{e.variables={}}}})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Molang=t()}(this,(function(){"use strict";const e=e=>((e+180)%360+180)%360;var t={clamp:(e,t,r)=>(e>r&&(e=r),(ee+Math.random()*(t-e),randomInt:(e,t)=>(e=Math.ceil(e),t=Math.floor(t),e+Math.floor(Math.random()*(t-e+1))),dieRoll(e,t,r){e=this.clamp(e,0,1e9);let n=0;for(var a=0;ae+(t-e)*r,lerpRotate(t,r,n){let a=e(t),s=e(r);a>s&&([a,s]=[s,a]);var i=s-a;return i>180?e(s+n*(360-i)):a+n*i},inRange:(e,t,r)=>e<=r&&e>=t?1:0,all:(e,...t)=>-1===t.findIndex((t=>t!==e))?1:0,any:(e,...t)=>t.findIndex((t=>t==e))>=0?1:0,approxEq:(e,...t)=>-1===t.findIndex((t=>Math.abs(e-t)>1e-7))?1:0};return function(){const e=this;this.global_variables={},this.cache_enabled=!0,this.use_radians=!1,this.variables={},this.variableHandler=null;let r={},n=!1,a=0,s={},i=0;function u(e){this.lines=[];for(let t of e){if(!t)continue;let e=v(t);if(this.lines.push(e),e instanceof h)break}}function c(e,t){this.iterations=v(e),this.body=v(t)}function l(e,t,r,n){this.operator=e,this.a=v(t),void 0!==r&&(this.b=v(r)),void 0!==n&&(this.c=v(n))}function o(e,t){this.query=e,this.args=t.map((e=>v(e)))}function f(e,t){this.value=v(t),this.name=e}function h(e){this.value=v(e)}function b(){}function d(){}let g=()=>this.use_radians?1:Math.PI/180,p=/^-?\d+(\.\d+f?)?$/;function w(e){return p.test(e)}const m=/[&|<>=]/,y=/^(temp|variable)\.\w+=/;function v(e){if(!e)return 0;for(e.endsWith(";")&&(e=e.substring(0,e.length-1));M(e);)e=e.substr(1,e.length-2);if(w(e))return parseFloat(e);let t=W(e,";",!0);if(t)return new u(t);if(e.startsWith("return"))return new h(e.substr(6));switch(e){case"true":return 1;case"false":return 0;case"break":return new b;case"continue":return new d}if("."===e.substring(1,2)){switch(e.substring(0,1)){case"q":e="query"+e.substring(1);break;case"v":e="variable"+e.substring(1);break;case"t":e="temp"+e.substring(1);break;case"c":e="context"+e.substring(1)}}let r=-1!==e.indexOf("="),n=r&&e.length>4&&e.match(y);if(n&&"="!==e[n.index+n[0].length]){return new f(n[0].substring(0,n[0].length-1),e.substr(n.index+n[0].length))}let a=-1!==e.indexOf("?"),s=a&&x(e,"??",19);if(s)return s;let i=a&&W(e,"?");if(i){let e=W(i[1],":");return e&&e.length?new l(10,i[0],e[0],e[1]):new l(10,i[0],i[1],0)}if(s=m.test(e)&&(x(e,"&&",11)||x(e,"||",12)||r&&x(e,"==",17)||r&&x(e,"!=",18)||r&&x(e,"<=",14)||x(e,"<",13)||r&&x(e,">=",16)||x(e,">",15))||x(e,"+",1,!0)||function(e,t,r){let n=R(e,t);if(n)return 0===n[0].length?new l(r,0,n[1]):new l(r,n[0],n[1])}(e,"-",2)||x(e,"*",3)||x(e,"/",4,!0)||function(e){if(e.startsWith("!")&&e.length>1)return new l(5,e.substr(1),0)}(e),s instanceof l)return s;if(e.startsWith("math.")){if("math.pi"===e)return Math.PI;let t=e.indexOf("("),r=e.substr(5,t-5),n=e.substr(t+1,e.length-t-2),a=W(n,",",!0);switch(a||(a=[n]),r){case"abs":return new l(100,a[0]);case"sin":return new l(101,a[0]);case"cos":return new l(102,a[0]);case"exp":return new l(103,a[0]);case"ln":return new l(104,a[0]);case"pow":return new l(105,a[0],a[1]);case"sqrt":return new l(106,a[0]);case"random":return new l(107,a[0],a[1]);case"ceil":return new l(108,a[0]);case"round":return new l(109,a[0]);case"trunc":return new l(110,a[0]);case"floor":return new l(111,a[0]);case"mod":return new l(112,a[0],a[1]);case"min":return new l(113,a[0],a[1]);case"max":return new l(114,a[0],a[1]);case"clamp":return new l(115,a[0],a[1],a[2]);case"lerp":return new l(116,a[0],a[1],a[2]);case"lerprotate":return new l(117,a[0],a[1],a[2]);case"asin":return new l(118,a[0]);case"acos":return new l(119,a[0]);case"atan":return new l(120,a[0]);case"atan2":return new l(121,a[0],a[1]);case"die_roll":return new l(122,a[0],a[1],a[2]);case"die_roll_integer":return new l(123,a[0],a[1],a[2]);case"hermite_blend":return new l(124,a[0]);case"random_integer":return new l(125,a[0],a[1],a[2])}}if(e.startsWith("loop(")){let t=W(e.substring(5,e.length-1),",",!0);if(t)return new c(...t)}if(i=e.match(/[a-z0-9._]{2,}/g),i&&1===i.length&&i[0].length>=e.length-2)return e;if(e.includes("(")&&")"==e[e.length-1]){let t=e.search(/\(/),r=e.substr(0,t),n=e.substr(t+1,e.length-t-2),a=W(n,",",!0);return a||(a=[n]),new o(r,a)}return 0}function M(e){if(e.startsWith(k)&&e.endsWith(q)||e.startsWith(_)&&e.endsWith(I)){let t=0;for(let r=0;r=0;){switch(e[r]){case k:case _:n++;break;case q:case I:n--;break;default:if(!(0!==n||t[0]!==e[r]||1!==t.length&&t!==e.substr(r,t.length)||"-"===t&&!1!=="+*/<>=|&?:".includes(e[r-1])))return[e.substr(0,r),e.substr(r+t.length)]}r--}}function O(e,t){return"string"==typeof e&&"'"==e[0]||(e=H(e,!0)),"string"==typeof t&&"'"==t[0]||(t=H(t,!0)),e===t}function H(s,i){if("number"==typeof s)return s;if("string"==typeof s){let t=r[s];if(void 0===t&&"function"==typeof e.variableHandler&&(t=e.variableHandler(s,r)),"number"==typeof t)return t;if("string"==typeof t&&!i)return e.parse(t,r)||0;if(void 0===t)n=!0;else if("function"==typeof t)return t()||0;return t||0}switch(s.constructor){case l:switch(s.operator){case 1:return H(s.a)+H(s.b);case 2:return H(s.a)-H(s.b);case 3:return H(s.a)*H(s.b);case 4:return H(s.a)/H(s.b);case 5:return 0==H(s.a)?1:0;case 10:return H(s.a)?H(s.b):H(s.c);case 11:return H(s.a)&&H(s.b)?1:0;case 12:return H(s.a)||H(s.b)?1:0;case 13:return H(s.a)H(s.b)?1:0;case 16:return H(s.a)>=H(s.b)?1:0;case 17:return O(s.a,s.b)?1:0;case 18:return O(s.a,s.b)?0:1;case 19:n=!1;let e=H(s.a);return n?H(s.b):e;case 100:return Math.abs(H(s.a));case 101:return Math.sin(H(s.a)*g());case 102:return Math.cos(H(s.a)*g());case 103:return Math.exp(H(s.a));case 104:return Math.log(H(s.a));case 105:return Math.pow(H(s.a),H(s.b));case 106:return Math.sqrt(H(s.a));case 107:return t.random(H(s.a),H(s.b));case 108:return Math.ceil(H(s.a));case 109:return Math.round(H(s.a));case 110:return Math.trunc(H(s.a));case 111:return Math.floor(H(s.a));case 112:return H(s.a)%H(s.b);case 113:return Math.min(H(s.a),H(s.b));case 114:return Math.max(H(s.a),H(s.b));case 115:return t.clamp(H(s.a),H(s.b),H(s.c));case 116:return t.lerp(H(s.a),H(s.b),H(s.c));case 117:return t.lerpRotate(H(s.a),H(s.b),H(s.c));case 118:return Math.asin(H(s.a))/g();case 119:return Math.acos(H(s.a))/g();case 120:return Math.atan(H(s.a))/g();case 121:return Math.atan2(H(s.a),H(s.b))/g();case 122:return t.dieRoll(H(s.a),H(s.b),H(s.c));case 123:return t.dieRollInt(H(s.a),H(s.b),H(s.c));case 124:let r=H(s.a);return 3*Math.pow(r,2)-2*Math.pow(r,3);case 125:return t.randomInt(H(s.a),H(s.b))}break;case h:return a=1,H(s.value);case f:return r[s.name]=e.variables[s.name]=H(s.value),0;case o:let i=s.args.map((e=>H(e)));switch(s.query){case"query.in_range":return t.inRange(...i);case"query.all":return t.all(...i);case"query.any":return t.any(...i);case"query.approx_eq":return t.approxEq(...i)}return"function"==typeof r[s.query]?r[s.query](...i):"function"==typeof e.variableHandler?e.variableHandler(s.query,r,i):0;case u:a=0;let p=0;for(let e of s.lines)if(p=H(e),a>0)break;return p;case c:let w=0,m=t.clamp(H(s.iterations),0,1024);for(let e=0;e{if("number"==typeof t)return isNaN(t)?0:t;if("string"!=typeof t||0===t.length)return 0;if(t.length<9&&w(t))return parseFloat(t);let u=this.cache_enabled&&s[t];return u||(u=function(e){return v(e=e.toLowerCase().replace(/\s/g,""))}(t),this.cache_enabled&&function(e,t){if(s[e]=t,i++,i>400){let e=Object.keys(s);for(let t=0;t<10;t++)delete s[e[t]];i-=10}}(t,u)),function(t,n){for(let t in e.global_variables)r[t]=e.global_variables[t];for(let t in e.variables)r[t]=e.variables[t];if(n)for(let e in n)r[e]=n[e];let s=H(t);return r={},a=0,s}(u,n)},this.resetVariables=()=>{e.variables={}}}})); diff --git a/manifest.webmanifest b/manifest.webmanifest index c779ca23..4a491219 100644 --- a/manifest.webmanifest +++ b/manifest.webmanifest @@ -24,5 +24,6 @@ "background_color": "#21252b", "theme_color": "#3e90ff", "display": "standalone", - "display_override": ["tabbed", "minimal-ui"] + "display_override": ["tabbed", "minimal-ui"], + "orientation": "natural" } \ No newline at end of file