[Math] Add map operation.

This commit is contained in:
Tanasart 2025-01-14 08:25:51 +07:00
parent 73bc50bf2d
commit 18d46c497f
16 changed files with 199 additions and 149 deletions

Binary file not shown.

Binary file not shown.

View file

@ -270,7 +270,7 @@
for( var i = 0; i < paramCount; i++ ) { for( var i = 0; i < paramCount; i++ ) {
var param = parameter_string(i); var param = parameter_string(i);
print($" >>> params {i}: {param}"); printDebug($" >>> params {i}: {param}");
if(string_starts_with(param, "-")) { if(string_starts_with(param, "-")) {
switch(param) { switch(param) {

View file

@ -49,21 +49,21 @@
if(OS == os_macosx) APP_LOCATION = string_replace(APP_LOCATION, "/Contents/MacOS/", "/Contents/Resources/"); if(OS == os_macosx) APP_LOCATION = string_replace(APP_LOCATION, "/Contents/MacOS/", "/Contents/Resources/");
if(RUN_IDE) APP_LOCATION = "D:/Project/MakhamDev/LTS-PixelComposer/PixelComposer/datafiles/"; if(RUN_IDE) APP_LOCATION = "D:/Project/MakhamDev/LTS-PixelComposer/PixelComposer/datafiles/";
print($"===================== WORKING DIRECTORIES =====================\n\t{working_directory}\n\t{DIRECTORY}"); printDebug($"===================== WORKING DIRECTORIES =====================\n\t{working_directory}\n\t{DIRECTORY}");
directory_verify($"{DIRECTORY}log"); directory_verify($"{DIRECTORY}log");
#endregion #endregion
#region Set up #region Set up
var t = get_timer(); var t = get_timer();
PREF_LOAD(); log_message("SESSION", $"> init Preferences | complete in {get_timer() - t}"); t = get_timer(); PREF_LOAD(); printDebug($"> init Preferences | complete in {get_timer() - t}"); t = get_timer();
if(!IS_CMD) { __initLocale(); log_message("SESSION", $"> init Locale | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initLocale(); printDebug($"> init Locale | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { __initHotKey(); log_message("SESSION", $"> init Hotkeys | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initHotKey(); printDebug($"> init Hotkeys | complete in {get_timer() - t}"); t = get_timer(); }
log_clear(); log_clear();
log_newline(); log_newline();
log_message("SESSION", "Begin"); printDebug("Begin");
log_message("DIRECTORY", DIRECTORY); printDebug($"DIRECTORY {DIRECTORY}");
PREF_APPLY(); PREF_APPLY();
var t0 = get_timer(); var t0 = get_timer();
@ -71,34 +71,34 @@
var _lua = PROGRAM_ARGUMENTS._lua; var _lua = PROGRAM_ARGUMENTS._lua;
__initKeys() __initKeys()
__initPatreon(); log_message("SESSION", $"> init Patreon | complete in {get_timer() - t}"); t = get_timer(); __initPatreon(); printDebug($"> init Patreon | complete in {get_timer() - t}"); t = get_timer();
if(!IS_CMD) { __initTheme(); log_message("SESSION", $"> init Theme | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initTheme(); printDebug($"> init Theme | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { loadFonts(); log_message("SESSION", $"> init Font | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { loadFonts(); printDebug($"> init Font | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { __initProject(); log_message("SESSION", $"> init Project | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initProject(); printDebug($"> init Project | complete in {get_timer() - t}"); t = get_timer(); }
__fnInit(); __fnInit();
if(!IS_CMD) { __initAction(); log_message("SESSION", $"> init Action | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initAction(); printDebug($"> init Action | complete in {get_timer() - t}"); t = get_timer(); }
__initSurfaceFormat(); log_message("SESSION", $"> init SurfaceFormat | complete in {get_timer() - t}"); t = get_timer(); __initSurfaceFormat(); printDebug($"> init SurfaceFormat | complete in {get_timer() - t}"); t = get_timer();
if(!IS_CMD) { __initCollection(); log_message("SESSION", $"> init Collection | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initCollection(); printDebug($"> init Collection | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { __initAssets(); log_message("SESSION", $"> init Assets | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initAssets(); printDebug($"> init Assets | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { __initPresets(); log_message("SESSION", $"> init Presets | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initPresets(); printDebug($"> init Presets | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { __initFontFolder(); log_message("SESSION", $"> init FontFolder | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initFontFolder(); printDebug($"> init FontFolder | complete in {get_timer() - t}"); t = get_timer(); }
if(_lua) { __initLua(); log_message("SESSION", $"> init Lua | complete in {get_timer() - t}"); t = get_timer(); } if(_lua) { __initLua(); printDebug($"> init Lua | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { __initNodeData(); log_message("SESSION", $"> init NodeData | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initNodeData(); printDebug($"> init NodeData | complete in {get_timer() - t}"); t = get_timer(); }
__initNodes(); log_message("SESSION", $"> init Nodes | complete in {get_timer() - t}"); t = get_timer(); __initNodes(); printDebug($"> init Nodes | complete in {get_timer() - t}"); t = get_timer();
if(!IS_CMD) { __initSteamUGC(); log_message("SESSION", $"> init SteamUGC | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initSteamUGC(); printDebug($"> init SteamUGC | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { __initAddon(); log_message("SESSION", $"> init Addon | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initAddon(); printDebug($"> init Addon | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { __initPalette(); log_message("SESSION", $"> init Palette | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initPalette(); printDebug($"> init Palette | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { __initGradient(); log_message("SESSION", $"> init Gradient | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initGradient(); printDebug($"> init Gradient | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { __initPen(); log_message("SESSION", $"> init Pen | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { __initPen(); printDebug($"> init Pen | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { loadAddon(); log_message("SESSION", $"> init Addons | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { loadAddon(); printDebug($"> init Addons | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { LOAD_SAMPLE(); log_message("SESSION", $"> init sample | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { LOAD_SAMPLE(); printDebug($"> init sample | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { INIT_FOLDERS(); log_message("SESSION", $"> init folders | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { INIT_FOLDERS(); printDebug($"> init folders | complete in {get_timer() - t}"); t = get_timer(); }
if(!IS_CMD) { RECENT_LOAD(); log_message("SESSION", $"> init recents | complete in {get_timer() - t}"); t = get_timer(); } if(!IS_CMD) { RECENT_LOAD(); printDebug($"> init recents | complete in {get_timer() - t}"); t = get_timer(); }
log_message("SESSION", $">> Initialization complete in {get_timer() - t0}"); printDebug($">> Initialization complete in {get_timer() - t0}");
if(!IS_CMD) { if(!IS_CMD) {
__initPanel(); __initPanel();

View file

@ -1,6 +1,6 @@
function __addonDefault(root) { function __addonDefault(root) {
if(check_version($"{root}/version")) { if(check_version($"{root}/version")) {
log_message("THEME", "unzipping default addon to DIRECTORY."); printDebug("unzipping default addon to DIRECTORY.");
zip_unzip("data/Addons.zip", root); zip_unzip("data/Addons.zip", root);
} }
} }

View file

@ -1,5 +1,5 @@
function __initCollection() { function __initCollection() {
log_message("COLLECTION", "init"); printDebug("COLLECTION", "init");
globalvar COLLECTIONS; globalvar COLLECTIONS;
COLLECTIONS = -1; COLLECTIONS = -1;
@ -15,7 +15,7 @@ function __initCollection() {
} }
function refreshCollections() { function refreshCollections() {
log_message("COLLECTION", "refreshing collection base folder."); printDebug("COLLECTION", "refreshing collection base folder.");
COLLECTIONS = new DirectoryObject(DIRECTORY + "Collections"); COLLECTIONS = new DirectoryObject(DIRECTORY + "Collections");
COLLECTIONS.scan([".json", ".pxcc"]); COLLECTIONS.scan([".json", ".pxcc"]);

View file

@ -7,6 +7,7 @@
#endregion #endregion
#macro printlog if(log) show_debug_message #macro printlog if(log) show_debug_message
#macro printDebug show_debug_message
function print(str) { function print(str) {
var _s = ""; var _s = "";

View file

@ -23,6 +23,8 @@ enum MATH_OPERATOR {
snap, // 16 snap, // 16
fract, // 17 fract, // 17
map,
length, length,
} }
@ -30,16 +32,16 @@ global.node_math_keys = [ "add", "subtract", "multiply", "divide", "power",
"+", "-", "*", "/", "^", "+", "-", "*", "/", "^",
"sin", "cos", "tan", "modulo", "round", "sin", "cos", "tan", "modulo", "round",
"ceiling", "floor", "lerp", "abs", "fract", "ceiling", "floor", "lerp", "abs", "fract",
"clamp", "snap" ]; "clamp", "snap", "map" ];
global.node_math_keys_map = [ MATH_OPERATOR.add, MATH_OPERATOR.subtract, MATH_OPERATOR.multiply, MATH_OPERATOR.divide, MATH_OPERATOR.power, MATH_OPERATOR.root, global.node_math_keys_map = [ MATH_OPERATOR.add, MATH_OPERATOR.subtract, MATH_OPERATOR.multiply, MATH_OPERATOR.divide, MATH_OPERATOR.power, MATH_OPERATOR.root,
MATH_OPERATOR.add, MATH_OPERATOR.subtract, MATH_OPERATOR.multiply, MATH_OPERATOR.divide, MATH_OPERATOR.power, MATH_OPERATOR.add, MATH_OPERATOR.subtract, MATH_OPERATOR.multiply, MATH_OPERATOR.divide, MATH_OPERATOR.power,
MATH_OPERATOR.sin, MATH_OPERATOR.cos, MATH_OPERATOR.tan, MATH_OPERATOR.modulo, MATH_OPERATOR.round, MATH_OPERATOR.sin, MATH_OPERATOR.cos, MATH_OPERATOR.tan, MATH_OPERATOR.modulo, MATH_OPERATOR.round,
MATH_OPERATOR.ceiling, MATH_OPERATOR.floor, MATH_OPERATOR.lerp, MATH_OPERATOR.abs, MATH_OPERATOR.fract, MATH_OPERATOR.ceiling, MATH_OPERATOR.floor, MATH_OPERATOR.lerp, MATH_OPERATOR.abs, MATH_OPERATOR.fract,
MATH_OPERATOR.clamp, MATH_OPERATOR.snap ]; MATH_OPERATOR.clamp, MATH_OPERATOR.snap, MATH_OPERATOR.map, ];
global.node_math_names = [ /* 0 - 9*/ "Add", "Subtract", "Multiply", "Divide", "Power", "Root", "Sin", "Cos", "Tan", "Modulo", global.node_math_names = [ /* 0 - 9*/ "Add", "Subtract", "Multiply", "Divide", "Power", "Root", "Sin", "Cos", "Tan", "Modulo",
/*10 - 20*/ "Floor", "Ceil", "Round", "Lerp", "Abs", "Clamp", "Snap", "Fract" ]; /*10 - 20*/ "Floor", "Ceil", "Round", "Lerp", "Abs", "Clamp", "Snap", "Fract", "Map", ];
global.node_math_scroll = array_create_ext(array_length(global.node_math_names), function(i) /*=>*/ {return new scrollItem(global.node_math_names[i], s_node_math_operators, i)}); global.node_math_scroll = array_create_ext(array_length(global.node_math_names), function(i) /*=>*/ {return new scrollItem(global.node_math_names[i], s_node_math_operators, i)});
@ -73,9 +75,14 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
newInput(5, nodeValue_Float("Amount", self, 0)); newInput(5, nodeValue_Float("Amount", self, 0));
input_display_list = [ newInput(6, nodeValue_Vec2("From", self, [ 0, 1 ]));
0, 1, 2, 5, 3, 4,
] newInput(7, nodeValue_Vec2("To", self, [ 0, 1 ]));
input_display_list = [ 0,
["Values", false], 1, 2, 5, 6, 7,
["Settings", false], 3, 4,
];
newOutput(0, nodeValue_Output("Result", self, VALUE_TYPE.float, 0)); newOutput(0, nodeValue_Output("Result", self, VALUE_TYPE.float, 0));
@ -118,6 +125,15 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
return 0; return 0;
} }
static _evalMap = function(a, fr, to) {
var _frMin = fr[0];
var _frMax = fr[1];
var _toMin = to[0];
var _toMax = to[1];
return lerp(_toMin, _toMax, (a - _frMin) / (_frMax - _frMin));
}
function evalArray(a, b, c = 0) { function evalArray(a, b, c = 0) {
var _as = is_array(a); var _as = is_array(a);
var _bs = is_array(b); var _bs = is_array(b);
@ -157,14 +173,32 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
var a = inputs[1].getValue(); var a = inputs[1].getValue();
var b = inputs[2].getValue(); var b = inputs[2].getValue();
var c = inputs[5].getValue(); var c = inputs[5].getValue();
var val;
fr = inputs[6].getValue();
to = inputs[7].getValue();
switch(use_mod) {
case MATH_OPERATOR.map :
if(is_array(a)) val = array_map_ext(a, function(v) /*=>*/ {return _evalMap(v, fr, to)});
else val = _evalMap(a, fr, to);
break;
default :
val = evalArray(a, b, c);
break;
}
var val = evalArray(a, b, c);
outputs[0].setValue(val); outputs[0].setValue(val);
if(__mode != use_mod) { if(__mode == use_mod) return;
__mode = use_mod;
inputs[2].setVisible(false, false); inputs[2].setVisible(false, false);
inputs[3].setVisible(false, false); inputs[3].setVisible(false, false);
inputs[5].setVisible(false, false); inputs[5].setVisible(false, false);
inputs[6].setVisible(false, false);
inputs[7].setVisible(false, false);
switch(use_mod) { switch(use_mod) {
case MATH_OPERATOR.sin : case MATH_OPERATOR.sin :
@ -172,6 +206,11 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
case MATH_OPERATOR.tan : case MATH_OPERATOR.tan :
inputs[3].setVisible(true); inputs[3].setVisible(true);
break; break;
case MATH_OPERATOR.map :
inputs[6].setVisible(true, true);
inputs[7].setVisible(true, true);
break;
} }
switch(use_mod) { switch(use_mod) {
@ -184,6 +223,7 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
if(int) outputs[0].setType(VALUE_TYPE.integer); if(int) outputs[0].setType(VALUE_TYPE.integer);
else outputs[0].setType(VALUE_TYPE.float); else outputs[0].setType(VALUE_TYPE.float);
break; break;
default: default:
inputs[4].setVisible(false); inputs[4].setVisible(false);
@ -233,11 +273,7 @@ function Node_Math(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
inputs[2].setVisible(true, true); inputs[2].setVisible(true, true);
break; break;
default: return;
} }
}
__mode = use_mod;
} }

View file

@ -484,8 +484,10 @@ function __read_node_display(_list) {
for( var j = 0, m = array_length(_nodes); j < m; j++ ) { for( var j = 0, m = array_length(_nodes); j < m; j++ ) {
var _n = _nodes[j]; var _n = _nodes[j];
if(is_string(_n) && struct_has(ALL_NODES, _n)) { if(is_string(_n)) {
if(struct_has(ALL_NODES, _n)) {
var _node = ALL_NODES[$ _n]; var _node = ALL_NODES[$ _n];
if(_node.new_node) { if(_node.new_node) {
if(_currLab != _head) if(_currLab != _head)
array_push(NEW_NODES, _head); array_push(NEW_NODES, _head);
@ -494,6 +496,12 @@ function __read_node_display(_list) {
} }
array_push(_l, _node); array_push(_l, _node);
} else {
var _txt = $"Missing node data [{_n}]: Check if node folder exists in {DIRECTORY}Nodes\Internal";
// print(_txt);
noti_warning(_txt);
}
} }
if(is_struct(_n) && struct_has(_n, "label")) { if(is_struct(_n) && struct_has(_n, "label")) {

View file

@ -48,9 +48,18 @@
function noti_status(str, icon = noone, flash = false, ref = noone) { function noti_status(str, icon = noone, flash = false, ref = noone) {
str = string(str); str = string(str);
show_debug_message($"STATUS: {str}🠂"); show_debug_message($"STATUS: {str}🠂");
if(TEST_ERROR) return {}; if(TEST_ERROR) return {};
if(PANEL_MAIN == 0) return;
var noti;
if(!ds_list_empty(STATUSES) && STATUSES[| ds_list_size(STATUSES) - 1].txt == str) {
STATUSES[| ds_list_size(STATUSES) - 1].amount++;
noti = STATUSES[| ds_list_size(STATUSES) - 1];
} else {
noti = new notification(NOTI_TYPE.log, str, icon);
ds_list_add(STATUSES, noti);
}
if(flash && PANEL_MENU) { if(flash && PANEL_MENU) {
PANEL_MENU.noti_flash = 1; PANEL_MENU.noti_flash = 1;
@ -59,16 +68,8 @@
dialogCall(o_dialog_warning, mouse_mx + ui(16), mouse_my + ui(16)).setText(str); dialogCall(o_dialog_warning, mouse_mx + ui(16), mouse_my + ui(16)).setText(str);
} }
if(!ds_list_empty(STATUSES) && STATUSES[| ds_list_size(STATUSES) - 1].txt == str) {
STATUSES[| ds_list_size(STATUSES) - 1].amount++;
return STATUSES[| ds_list_size(STATUSES) - 1];
}
var noti = new notification(NOTI_TYPE.log, str, icon);
ds_list_add(STATUSES, noti);
if(ref) { if(ref) {
var onClick = function() { PANEL_GRAPH.focusNode(self.ref); }; var onClick = function() /*=>*/ { PANEL_GRAPH.focusNode(self.ref); };
noti.ref = ref; noti.ref = ref;
noti.onClick = method(noti, onClick); noti.onClick = method(noti, onClick);
} }
@ -78,7 +79,6 @@
function noti_warning(str, icon = noone, ref = noone) { function noti_warning(str, icon = noone, ref = noone) {
if(TEST_ERROR) return {}; if(TEST_ERROR) return {};
if(PANEL_MAIN == 0) return;
if(PANEL_MENU) { if(PANEL_MENU) {
PANEL_MENU.noti_flash = 1; PANEL_MENU.noti_flash = 1;
@ -104,7 +104,7 @@
dialogCall(o_dialog_warning, mouse_mx + ui(16), mouse_my + ui(16)).setText(str); dialogCall(o_dialog_warning, mouse_mx + ui(16), mouse_my + ui(16)).setText(str);
if(ref) { if(ref) {
var onClick = function() { PANEL_GRAPH.focusNode(self.ref); }; var onClick = function() /*=>*/ { PANEL_GRAPH.focusNode(self.ref); };
noti.ref = ref; noti.ref = ref;
noti.onClick = method(noti, onClick); noti.onClick = method(noti, onClick);
} }
@ -114,7 +114,6 @@
function noti_error(str, icon = noone, ref = noone) { function noti_error(str, icon = noone, ref = noone) {
if(TEST_ERROR) return {}; if(TEST_ERROR) return {};
show_debug_message($"ERROR: {str}🠂"); show_debug_message($"ERROR: {str}🠂");
if(PANEL_MAIN == 0) print(str);
var noti = new notification(NOTI_TYPE.error, str, icon, c_ui_red); var noti = new notification(NOTI_TYPE.error, str, icon, c_ui_red);
noti.txtclr = c_ui_red; noti.txtclr = c_ui_red;
@ -123,7 +122,7 @@
ds_list_add(ERRORS, noti); ds_list_add(ERRORS, noti);
if(ref) { if(ref) {
var onClick = function() { PANEL_GRAPH.focusNode(self.ref); }; var onClick = function() /*=>*/ { PANEL_GRAPH.focusNode(self.ref); };
noti.ref = ref; noti.ref = ref;
noti.onClick = method(noti, onClick); noti.onClick = method(noti, onClick);
} }

View file

@ -3,6 +3,8 @@
globalvar FULL_SCREEN_PANEL, FULL_SCREEN_CONTENT, FULL_SCREEN_PARENT; globalvar FULL_SCREEN_PANEL, FULL_SCREEN_CONTENT, FULL_SCREEN_PARENT;
PANEL_MAIN = 0; PANEL_MAIN = 0;
PANEL_MENU = 0;
FULL_SCREEN_PANEL = noone; FULL_SCREEN_PANEL = noone;
FULL_SCREEN_CONTENT = noone; FULL_SCREEN_CONTENT = noone;
FULL_SCREEN_PARENT = noone; FULL_SCREEN_PARENT = noone;

View file

@ -349,7 +349,7 @@
TESTING = struct_try_get(PREFERENCES, "test_mode", false); TESTING = struct_try_get(PREFERENCES, "test_mode", false);
if(TESTING && GM_build_type == "run") { if(TESTING && GM_build_type == "run") {
log_message("PREFERENCE", "Test mode enabled"); log_message("PREFERENCE", "Dev mode enabled");
instance_create_depth(0, 0, 0, addon_key_displayer); instance_create_depth(0, 0, 0, addon_key_displayer);
} }

View file

@ -7,11 +7,11 @@ function __initTheme() {
directory_verify(root); directory_verify(root);
if(check_version($"{root}/version")) { if(check_version($"{root}/version")) {
zip_unzip("data/Theme.zip", root); print($" > Unzip theme | complete in {get_timer() - t}"); t = get_timer(); zip_unzip("data/Theme.zip", root); printDebug($" > Unzip theme | complete in {get_timer() - t}"); t = get_timer();
} }
loadGraphic(PREFERENCES.theme); print($" > Load graphic | complete in {get_timer() - t}"); t = get_timer(); loadGraphic(PREFERENCES.theme); printDebug($" > Load graphic | complete in {get_timer() - t}"); t = get_timer();
loadColor(PREFERENCES.theme); print($" > Load color | complete in {get_timer() - t}"); t = get_timer(); loadColor(PREFERENCES.theme); printDebug($" > Load color | complete in {get_timer() - t}"); t = get_timer();
} }
function _sprite_path(rel, theme) { INLINE return $"{DIRECTORY}Themes/{theme}/graphics/{string_replace_all(rel, "./", "")}"; } function _sprite_path(rel, theme) { INLINE return $"{DIRECTORY}Themes/{theme}/graphics/{string_replace_all(rel, "./", "")}"; }
@ -67,7 +67,7 @@ function loadGraphic(theme = "default") {
noti_warning("Loading theme made for older version."); noti_warning("Loading theme made for older version.");
} }
print($"Loading theme {theme}"); printDebug($"Loading theme {theme}");
if(!file_exists_empty(path)) { print($"Theme not defined at {path}, rollback to default theme."); return; } if(!file_exists_empty(path)) { print($"Theme not defined at {path}, rollback to default theme."); return; }
var sprStr = json_load_struct(path); var sprStr = json_load_struct(path);

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

View file

@ -30,6 +30,7 @@
{"$GMSpriteFrame":"","%Name":"fe4a7f0c-db9c-4ca4-85cf-6f9854f4ce18","name":"fe4a7f0c-db9c-4ca4-85cf-6f9854f4ce18","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, {"$GMSpriteFrame":"","%Name":"fe4a7f0c-db9c-4ca4-85cf-6f9854f4ce18","name":"fe4a7f0c-db9c-4ca4-85cf-6f9854f4ce18","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"f0f202e0-76b7-436e-8ca3-7b5c24f54e24","name":"f0f202e0-76b7-436e-8ca3-7b5c24f54e24","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, {"$GMSpriteFrame":"","%Name":"f0f202e0-76b7-436e-8ca3-7b5c24f54e24","name":"f0f202e0-76b7-436e-8ca3-7b5c24f54e24","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"d2d30ca6-b7c6-4c5e-a4f0-de11a924a362","name":"d2d30ca6-b7c6-4c5e-a4f0-de11a924a362","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, {"$GMSpriteFrame":"","%Name":"d2d30ca6-b7c6-4c5e-a4f0-de11a924a362","name":"d2d30ca6-b7c6-4c5e-a4f0-de11a924a362","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"d192067d-2e75-437c-97c9-8f3af96a8e78","name":"d192067d-2e75-437c-97c9-8f3af96a8e78","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
], ],
"gridX":0, "gridX":0,
"gridY":0, "gridY":0,
@ -66,7 +67,7 @@
}, },
"eventStubScript":null, "eventStubScript":null,
"eventToFunction":{}, "eventToFunction":{},
"length":18.0, "length":19.0,
"lockOrigin":false, "lockOrigin":false,
"moments":{ "moments":{
"$KeyframeStore<MomentsEventKeyframe>":"", "$KeyframeStore<MomentsEventKeyframe>":"",
@ -139,6 +140,9 @@
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{ {"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"d2d30ca6-b7c6-4c5e-a4f0-de11a924a362","path":"sprites/s_node_math_operators/s_node_math_operators.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, "0":{"$SpriteFrameKeyframe":"","Id":{"name":"d2d30ca6-b7c6-4c5e-a4f0-de11a924a362","path":"sprites/s_node_math_operators/s_node_math_operators.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"af5f1f87-8678-4810-ab1d-f078d96ae0b6","IsCreationKey":false,"Key":17.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,}, },"Disabled":false,"id":"af5f1f87-8678-4810-ab1d-f078d96ae0b6","IsCreationKey":false,"Key":17.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"d192067d-2e75-437c-97c9-8f3af96a8e78","path":"sprites/s_node_math_operators/s_node_math_operators.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"8b062fb7-b660-4c22-bc5d-a677c437d87e","IsCreationKey":false,"Key":18.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
], ],
"visibleRange":null, "visibleRange":null,