Replace border control with native one.

This commit is contained in:
Tanasart 2023-05-04 20:00:56 +02:00
parent cafd224ad7
commit 13157605ac
35 changed files with 310 additions and 153 deletions

View file

@ -279,7 +279,6 @@
{"name":"node_path_reverse","order":8,"path":"scripts/node_path_reverse/node_path_reverse.yy",}, {"name":"node_path_reverse","order":8,"path":"scripts/node_path_reverse/node_path_reverse.yy",},
{"name":"fd_rectangle_get_acceleration_y","order":3,"path":"scripts/fd_rectangle_get_acceleration_y/fd_rectangle_get_acceleration_y.yy",}, {"name":"fd_rectangle_get_acceleration_y","order":3,"path":"scripts/fd_rectangle_get_acceleration_y/fd_rectangle_get_acceleration_y.yy",},
{"name":"sh_simplex","order":22,"path":"shaders/sh_simplex/sh_simplex.yy",}, {"name":"sh_simplex","order":22,"path":"shaders/sh_simplex/sh_simplex.yy",},
{"name":"libborderless","order":2,"path":"extensions/libborderless/libborderless.yy",},
{"name":"node_noise_grid_tri","order":25,"path":"scripts/node_noise_grid_tri/node_noise_grid_tri.yy",}, {"name":"node_noise_grid_tri","order":25,"path":"scripts/node_noise_grid_tri/node_noise_grid_tri.yy",},
{"name":"node_threshold","order":9,"path":"scripts/node_threshold/node_threshold.yy",}, {"name":"node_threshold","order":9,"path":"scripts/node_threshold/node_threshold.yy",},
{"name":"sh_cell_noise_edge","order":5,"path":"shaders/sh_cell_noise_edge/sh_cell_noise_edge.yy",}, {"name":"sh_cell_noise_edge","order":5,"path":"shaders/sh_cell_noise_edge/sh_cell_noise_edge.yy",},

View file

@ -187,7 +187,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",},
], ],
"IncludedFiles": [ "IncludedFiles": [
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Guides.zip","CopyToMask":-1,"filePath":"datafiles/data",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Guides.zip","CopyToMask":-1,"filePath":"datafiles/data",},
@ -768,6 +768,11 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_textbox.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/widget",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_textbox.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/widget",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_widget_highlight.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/widget",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_widget_highlight.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/widget",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"values.json","CopyToMask":-1,"filePath":"datafiles/data/themes/default",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"values.json","CopyToMask":-1,"filePath":"datafiles/data/themes/default",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Horizontal.json","CopyToMask":-1,"filePath":"datafiles/data/themes/layouts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Preview.json","CopyToMask":-1,"filePath":"datafiles/data/themes/layouts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Side menu.json","CopyToMask":-1,"filePath":"datafiles/data/themes/layouts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Vertical Ext.json","CopyToMask":-1,"filePath":"datafiles/data/themes/layouts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Vertical.json","CopyToMask":-1,"filePath":"datafiles/data/themes/layouts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"tooltip.zip","CopyToMask":3035426170322551022,"filePath":"datafiles/data",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"tooltip.zip","CopyToMask":3035426170322551022,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"0 introduction.png","CopyToMask":-1,"filePath":"datafiles/Getting started",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"0 introduction.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"0 introduction.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"0 introduction.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
@ -804,7 +809,7 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mf.dll","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mf.dll","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfcore.dll","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfcore.dll","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfplat.dll","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfplat.dll","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"README.txt","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"README.txt","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"arrowRight.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"arrowRight.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Bevel.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Bevel.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
@ -992,7 +997,6 @@
{"id":{"name":"node_path_reverse","path":"scripts/node_path_reverse/node_path_reverse.yy",},}, {"id":{"name":"node_path_reverse","path":"scripts/node_path_reverse/node_path_reverse.yy",},},
{"id":{"name":"fd_rectangle_get_acceleration_y","path":"scripts/fd_rectangle_get_acceleration_y/fd_rectangle_get_acceleration_y.yy",},}, {"id":{"name":"fd_rectangle_get_acceleration_y","path":"scripts/fd_rectangle_get_acceleration_y/fd_rectangle_get_acceleration_y.yy",},},
{"id":{"name":"sh_simplex","path":"shaders/sh_simplex/sh_simplex.yy",},}, {"id":{"name":"sh_simplex","path":"shaders/sh_simplex/sh_simplex.yy",},},
{"id":{"name":"libborderless","path":"extensions/libborderless/libborderless.yy",},},
{"id":{"name":"node_noise_grid_tri","path":"scripts/node_noise_grid_tri/node_noise_grid_tri.yy",},}, {"id":{"name":"node_noise_grid_tri","path":"scripts/node_noise_grid_tri/node_noise_grid_tri.yy",},},
{"id":{"name":"blurSurface","path":"scripts/blurSurface/blurSurface.yy",},}, {"id":{"name":"blurSurface","path":"scripts/blurSurface/blurSurface.yy",},},
{"id":{"name":"node_threshold","path":"scripts/node_threshold/node_threshold.yy",},}, {"id":{"name":"node_threshold","path":"scripts/node_threshold/node_threshold.yy",},},

View file

@ -0,0 +1,35 @@
{
"panel": {
"content": [{
"content": "Panel_Menu"
}, {
"content": [{
"content": [{
"content": [{
"content": "Panel_Preview"
}, {
"content": "Panel_Graph"
}],
"split": "v",
"width": 300
}, {
"content": "Panel_Animation"
}],
"split": "v",
"width": -48
}, {
"content": [{
"content": "Panel_Workspace"
}, {
"content": "Panel_Inspector"
}],
"split": "v",
"width": 40
}],
"split": "h",
"width": -400
}],
"split": "v",
"width": 40
}
}

View file

@ -0,0 +1,35 @@
{
"panel": {
"content": [{
"content": "Panel_Menu"
}, {
"content": [{
"content": [{
"content": "Panel_Preview"
}, {
"content": "Panel_Animation"
}],
"split": "v",
"width": -48
}, {
"content": [{
"content": "Panel_Workspace"
}, {
"content": [{
"content": "Panel_Inspector"
}, {
"content": "Panel_Graph"
}],
"split": "v",
"width": -300
}],
"split": "v",
"width": 40
}],
"split": "h",
"width": -400
}],
"split": "v",
"width": 40
}
}

View file

@ -0,0 +1,41 @@
{
"panel": {
"content": [{
"content": [{
"content": "Panel_Menu"
}, {
"content": "Panel_Animation"
}],
"split": "v",
"width": -84
}, {
"content": [{
"content": [{
"content": [{
"content": "Panel_Preview"
}, {
"content": "Panel_Preview"
}],
"split": "h",
"width": 480
}, {
"content": "Panel_Graph"
}],
"split": "v",
"width": -400
}, {
"content": [{
"content": "Panel_Workspace"
}, {
"content": "Panel_Inspector"
}],
"split": "v",
"width": 40
}],
"split": "h",
"width": -360
}],
"split": "h",
"width": 240
}
}

View file

@ -0,0 +1 @@
{"panel":{"split":"v","width":40,"content":[{"content":["Panel_Menu"]},{"split":"h","width":-400,"content":[{"split":"v","width":-300,"content":[{"split":"h","width":400,"content":[{"content":["Panel_Preview"]},{"content":["Panel_Graph"]}]},{"split":"h","width":533,"content":[{"content":["Panel_Collection","Panel_Color","Panel_Palette","Panel_Gradient"]},{"content":["Panel_Animation","Panel_Notification"]}]}]},{"split":"v","width":40,"content":[{"content":["Panel_Workspace"]},{"content":["Panel_Inspector"]}]}]}]}}

View file

@ -0,0 +1,35 @@
{
"panel": {
"content": [{
"content": "Panel_Menu"
}, {
"content": [{
"content": [{
"content": [{
"content": "Panel_Preview"
}, {
"content": "Panel_Graph"
}],
"split": "h",
"width": 400
}, {
"content": "Panel_Animation"
}],
"split": "v",
"width": -300
}, {
"content": [{
"content": "Panel_Workspace"
}, {
"content": "Panel_Inspector"
}],
"split": "v",
"width": 40
}],
"split": "h",
"width": -400
}],
"split": "v",
"width": 40
}
}

View file

@ -39,7 +39,7 @@ event_inherited();
}, THEME.star) }, THEME.star)
]; ];
menuCall("add_node_window_manu",,, menu); menuCall("add_node_window_manu",,, menu,, node_menu_selecting);
} }
function filtered(node) { function filtered(node) {

View file

@ -134,7 +134,7 @@ event_inherited();
file_delete( DIRECTORY + "Gradients/" + hovering_name); file_delete( DIRECTORY + "Gradients/" + hovering_name);
presetCollect(); presetCollect();
}) })
]) ],, { name: hovering_name })
} }
} }

View file

@ -102,7 +102,7 @@ if !ready exit;
menuItem(get_text("gradient_editor_blend_RGB", "RGB blend"), function() { gradient.type = 0; onApply(gradient); }), menuItem(get_text("gradient_editor_blend_RGB", "RGB blend"), function() { gradient.type = 0; onApply(gradient); }),
menuItem(get_text("gradient_editor_blend_HSV", "HSV blend"), function() { gradient.type = 2; onApply(gradient); }), menuItem(get_text("gradient_editor_blend_HSV", "HSV blend"), function() { gradient.type = 2; onApply(gradient); }),
menuItem(get_text("gradient_editor_blend_hard", "Hard blend"), function() { gradient.type = 1; onApply(gradient); }), menuItem(get_text("gradient_editor_blend_hard", "Hard blend"), function() { gradient.type = 1; onApply(gradient); }),
]); ],, gradient);
} }
bx -= ui(32); bx -= ui(32);
#endregion #endregion

View file

@ -116,7 +116,7 @@ event_inherited();
array_delete(arr, menuOn, 1); array_delete(arr, menuOn, 1);
target.inputs[| 0].setValue(arr); target.inputs[| 0].setValue(arr);
}) })
] ); ],, target );
} }
return _h; return _h;

View file

@ -14,6 +14,7 @@ event_inherited();
tooltips = []; tooltips = [];
show_icon = false; show_icon = false;
context = noone;
function setMenu(_menu, align = fa_left) { function setMenu(_menu, align = fa_left) {
menu = _menu; menu = _menu;

View file

@ -44,8 +44,17 @@ if(!ready) exit;
draw_sprite_stretched_ext(THEME.textbox, 3, dialog_x, yy, dialog_w, _h, cc, 0.8); draw_sprite_stretched_ext(THEME.textbox, 3, dialog_x, yy, dialog_w, _h, cc, 0.8);
if(instanceof(_menuItem) == "MenuItem" && sFOCUS && (mouse_release(mb_left) || keyboard_check_released(vk_enter))) { if(instanceof(_menuItem) == "MenuItem" && sFOCUS && (mouse_release(mb_left) || keyboard_check_released(vk_enter))) {
var res = _menuItem.func(dialog_x + dialog_w, yy, depth, _menuItem.name, i); var _dat = {
if(_menuItem.isShelf) ds_list_add(children, res); x: dialog_x + dialog_w,
y: yy,
depth: depth,
name: _menuItem.name,
index: i,
context: context,
};
var _res = _menuItem.func(_dat);
if(_menuItem.isShelf) ds_list_add(children, _res);
else instance_destroy(o_dialog_menubox); else instance_destroy(o_dialog_menubox);
} }
} else if(cc != c_white) } else if(cc != c_white)

View file

@ -78,7 +78,7 @@ event_inherited();
menuItem(get_text("noti_delete_message", "Delete notification"), function() { menuItem(get_text("noti_delete_message", "Delete notification"), function() {
ds_list_remove(STATUSES, o_dialog_menubox.noti); ds_list_remove(STATUSES, o_dialog_menubox.noti);
}), }),
]); ],, noti);
dia.noti = noti; dia.noti = noti;
} }
} }

View file

@ -106,7 +106,7 @@ event_inherited();
file_delete( DIRECTORY + "Palettes/" + hovering_name); file_delete( DIRECTORY + "Palettes/" + hovering_name);
presetCollect(); presetCollect();
}) })
]) ],, { name : hovering_name })
} }
} }

View file

@ -102,7 +102,7 @@ if palette == 0 exit;
menuItem(get_text("palette_editor_sort_hue", "Hue"), function() { sortPalette(__sortHue); }), menuItem(get_text("palette_editor_sort_hue", "Hue"), function() { sortPalette(__sortHue); }),
menuItem(get_text("palette_editor_sort_sat", "Saturation"), function() { sortPalette(__sortSat); }), menuItem(get_text("palette_editor_sort_sat", "Saturation"), function() { sortPalette(__sortSat); }),
menuItem(get_text("palette_editor_sort_val", "Value"), function() { sortPalette(__sortVal); }), menuItem(get_text("palette_editor_sort_val", "Value"), function() { sortPalette(__sortVal); }),
]); ],, palette);
} }
bx -= ui(32); bx -= ui(32);

View file

@ -87,7 +87,7 @@ if !ready exit;
instance_destroy(); instance_destroy();
}), }),
]); ],, content);
} }
} }

View file

@ -41,7 +41,7 @@ event_inherited();
file_delete(o_dialog_menubox.path); file_delete(o_dialog_menubox.path);
__initPresets(); __initPresets();
}), }),
]); ],, preset);
dia.path = preset.path; dia.path = preset.path;
} }
} }

View file

@ -107,7 +107,7 @@ if(node_target == noone) {
var o = node_target.outputs[| i]; var o = node_target.outputs[| i];
if(o.type != VALUE_TYPE.surface) continue; if(o.type != VALUE_TYPE.surface) continue;
array_push(_menu, menuItem(o.name, function(_x, _y, _d, _n, index) { changeChannel(index); })); array_push(_menu, menuItem(o.name, function(_dat) { changeChannel(_dat.index); }));
} }
menuCall("preview_window_menu",,, _menu); menuCall("preview_window_menu",,, _menu);
} }

View file

@ -58,20 +58,20 @@
log_message("SESSION", "Begin"); log_message("SESSION", "Begin");
log_message("DIRECTORY", DIRECTORY); log_message("DIRECTORY", DIRECTORY);
window_set_showborder(false); //window_set_showborder(false);
__initSurfaceFormat(); log_message("SESSION", "SurfaceFormat"); __initSurfaceFormat();
__initLocale(); log_message("SESSION", "Locale"); __initLocale();
__initTheme(); log_message("SESSION", "Theme"); __initTheme();
__initCollection(); log_message("SESSION", "Collection"); __initCollection();
__initAssets(); log_message("SESSION", "Assets"); __initAssets();
__initPresets(); log_message("SESSION", "Presets"); __initPresets();
__initFontFolder(); log_message("SESSION", "FontFolder"); __initFontFolder();
__initLua(); log_message("SESSION", "Lua"); __initLua();
__initNodeData(); log_message("SESSION", "NodeData"); __initNodeData();
__initNodes(); log_message("SESSION", "Nodes"); __initNodes();
__initSteamUGC(); log_message("SESSION", "SteamUGC"); __initSteamUGC();
__initAddon(); log_message("SESSION", "Addon"); __initAddon();
PREF_APPLY(); PREF_APPLY();
loadFonts(); loadFonts();

View file

@ -2,7 +2,7 @@
globalvar CONTEXT_MENU_CALLBACK; globalvar CONTEXT_MENU_CALLBACK;
CONTEXT_MENU_CALLBACK = ds_map_create(); CONTEXT_MENU_CALLBACK = ds_map_create();
function menuCall(menu_id = "", _x = mouse_mx + ui(4), _y = mouse_my + ui(4), menu = [], align = fa_left) { function menuCall(menu_id = "", _x = mouse_mx + ui(4), _y = mouse_my + ui(4), menu = [], align = fa_left, context = noone) {
var dia = dialogCall(o_dialog_menubox, _x, _y); var dia = dialogCall(o_dialog_menubox, _x, _y);
if(menu_id != "" && ds_map_exists(CONTEXT_MENU_CALLBACK, menu_id)) { if(menu_id != "" && ds_map_exists(CONTEXT_MENU_CALLBACK, menu_id)) {
var callbacks = CONTEXT_MENU_CALLBACK[? menu_id]; var callbacks = CONTEXT_MENU_CALLBACK[? menu_id];
@ -11,12 +11,13 @@
array_append(menu, callbacks[i].populate()); array_append(menu, callbacks[i].populate());
} }
dia.context = context;
dia.setMenu(menu, align); dia.setMenu(menu, align);
return dia; return dia;
} }
function submenuCall(_x, _y, _depth, menu = []) { function submenuCall(_data, menu = []) {
var dia = instance_create_depth(_x - ui(4), _y, _depth - 1, o_dialog_menubox); var dia = instance_create_depth(_data.x - ui(4), _data.y, _data.depth - 1, o_dialog_menubox);
dia.setMenu(menu); dia.setMenu(menu);
return dia; return dia;
} }
@ -24,6 +25,7 @@
function menuItem(name, func, spr = noone, hotkey = noone, toggle = noone) { function menuItem(name, func, spr = noone, hotkey = noone, toggle = noone) {
return new MenuItem(name, func, spr, hotkey, toggle); return new MenuItem(name, func, spr, hotkey, toggle);
} }
function MenuItem(name, func, spr = noone, hotkey = noone, toggle = noone) constructor { function MenuItem(name, func, spr = noone, hotkey = noone, toggle = noone) constructor {
active = true; active = true;
self.name = name; self.name = name;

View file

@ -12,16 +12,14 @@
#endregion #endregion
function _log_template() { function _log_template() {
return string(current_year) + "/" + string(current_month) + "/" + string(current_day) return $"{string(current_year)}/{string(current_month)}/{string(current_day)} {string_lead_zero(current_hour, 2)}:{string_lead_zero(current_minute, 2)}:{string_lead_zero(current_second, 2)} > ";
+ " " + string(current_hour) + ":" + string(current_minute) + ":" + string(current_second)
+ " > ";
} }
function __log(title, str, fname = "log.txt") { function __log(title, str, fname = "log.txt") {
var path = DIRECTORY + fname; var path = DIRECTORY + fname;
var f = file_text_open_append(path); var f = file_text_open_append(path);
var t = _log_template(); var t = _log_template();
file_text_write_string(f, string(title) + t + string(str) + "\n"); file_text_write_string(f, $"{title}{t}{str}\n");
file_text_close(f); file_text_close(f);
} }

View file

@ -37,7 +37,7 @@
SAVEFILE_VERSION = 1420; SAVEFILE_VERSION = 1420;
COLLECTION_VERSION = 1140.090; COLLECTION_VERSION = 1140.090;
THEME_VERSION = 1140.090; THEME_VERSION = 1140.090;
VERSION_STRING = "1.14.3"; VERSION_STRING = "1.14.3.1";
globalvar NODES, NODE_MAP, APPEND_MAP, NODE_NAME_MAP; globalvar NODES, NODE_MAP, APPEND_MAP, NODE_NAME_MAP;
globalvar HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES; globalvar HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES;

View file

@ -48,7 +48,7 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false) {
//room_restart(); //room_restart();
ds_list_clear(ERRORS); ds_list_clear(ERRORS);
var temp_path = DIRECTORY + "\_temp"; var temp_path = DIRECTORY + "_temp";
if(file_exists(temp_path)) file_delete(temp_path); if(file_exists(temp_path)) file_delete(temp_path);
file_copy(path, temp_path); file_copy(path, temp_path);

View file

@ -63,7 +63,7 @@ function Panel_Animation() : PanelContent() constructor {
keyframe_dragout = false; keyframe_dragout = false;
keyframe_drag_mx = 0; keyframe_drag_mx = 0;
keyframe_drag_my = 0; keyframe_drag_my = 0;
keyframe_selecting = ds_list_create(); keyframe_selecting = [];
keyframe_boxing = false; keyframe_boxing = false;
keyframe_box_sx = -1; keyframe_box_sx = -1;
keyframe_box_sy = -1; keyframe_box_sy = -1;
@ -144,46 +144,46 @@ function Panel_Animation() : PanelContent() constructor {
addHotkey("Animation", "Paste", "V", MOD_KEY.ctrl, function() { PANEL_ANIMATION.doPaste(PANEL_ANIMATION.value_focusing); }); addHotkey("Animation", "Paste", "V", MOD_KEY.ctrl, function() { PANEL_ANIMATION.doPaste(PANEL_ANIMATION.value_focusing); });
function deleteKeys() { function deleteKeys() {
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.anim.removeKey(k); k.anim.removeKey(k);
} }
ds_list_clear(keyframe_selecting); keyframe_selecting = [];
updatePropertyList(); updatePropertyList();
} }
function alignKeys(halign = fa_left) { function alignKeys(halign = fa_left) {
if(ds_list_empty(keyframe_selecting)) return; if(array_empty(keyframe_selecting)) return;
var tt = 0; var tt = 0;
switch(halign) { switch(halign) {
case fa_left : case fa_left :
tt = 9999; tt = 9999;
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) for( var i = 0; i < array_length(keyframe_selecting); i++ )
tt = min(tt, keyframe_selecting[| i].time); tt = min(tt, keyframe_selecting[i].time);
break; break;
case fa_center : case fa_center :
tt = 0; tt = 0;
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) for( var i = 0; i < array_length(keyframe_selecting); i++ )
tt += keyframe_selecting[| i].time; tt += keyframe_selecting[i].time;
tt = round(tt / ds_list_size(keyframe_selecting)); tt = round(tt / array_length(keyframe_selecting));
break; break;
case fa_right : case fa_right :
tt = -9999; tt = -9999;
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) for( var i = 0; i < array_length(keyframe_selecting); i++ )
tt = max(tt, keyframe_selecting[| i].time); tt = max(tt, keyframe_selecting[i].time);
break; break;
} }
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.anim.setKeyTime(k, tt); k.anim.setKeyTime(k, tt);
} }
} }
function arrangeKeys() { function arrangeKeys() {
var l = ds_list_create(); var l = [];
for( var i = 0; i < ds_list_size(anim_properties); i++ ) { for( var i = 0; i < ds_list_size(anim_properties); i++ ) {
var node = anim_properties[| i]; var node = anim_properties[| i];
if(!show_node_outside_context && node.group != PANEL_GRAPH.getCurrentContext()) continue; if(!show_node_outside_context && node.group != PANEL_GRAPH.getCurrentContext()) continue;
@ -197,28 +197,27 @@ function Panel_Animation() : PanelContent() constructor {
for(var m = 0; m < ds_list_size(prop.animators[k].values); m++) { for(var m = 0; m < ds_list_size(prop.animators[k].values); m++) {
var keyframe = prop.animators[k].values[| m]; var keyframe = prop.animators[k].values[| m];
if(ds_list_exist(keyframe_selecting, keyframe)) if(array_exists(keyframe_selecting, keyframe))
ds_list_add(l, keyframe); array_append(l, keyframe);
} }
} else { } else {
for(var k = 0; k < ds_list_size(prop.animator.values); k++) { for(var k = 0; k < ds_list_size(prop.animator.values); k++) {
var keyframe = prop.animator.values[| k]; var keyframe = prop.animator.values[| k];
if(ds_list_exist(keyframe_selecting, keyframe)) if(array_exists(keyframe_selecting, keyframe))
ds_list_add(l, keyframe); array_append(l, keyframe);
} }
} }
} }
} }
ds_list_copy(keyframe_selecting, l); keyframe_selecting = l;
ds_list_destroy(l);
} }
function staggerKeys(_index, _stag) { function staggerKeys(_index, _stag) {
var t = keyframe_selecting[| _index].time; var t = keyframe_selecting[_index].time;
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
var _t = t + abs(i - _index) * _stag; var _t = t + abs(i - _index) * _stag;
k.anim.setKeyTime(k, _t); k.anim.setKeyTime(k, _t);
@ -228,36 +227,36 @@ function Panel_Animation() : PanelContent() constructor {
keyframe_menu = [ keyframe_menu = [
menuItemGroup(get_text("panel_animation_ease_in", "Ease in"), [ menuItemGroup(get_text("panel_animation_ease_in", "Ease in"), [
[ [THEME.timeline_ease, 0], function() { [ [THEME.timeline_ease, 0], function() {
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_in_type = CURVE_TYPE.none; k.ease_in_type = CURVE_TYPE.none;
k.ease_in = [0, 1]; k.ease_in = [0, 1];
} }
}, get_text("panel_animation_ease_linear", "Linear") ], }, get_text("panel_animation_ease_linear", "Linear") ],
[ [THEME.timeline_ease, 1], function() { [ [THEME.timeline_ease, 1], function() {
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_in_type = CURVE_TYPE.bezier; k.ease_in_type = CURVE_TYPE.bezier;
k.ease_in = [1, 1]; k.ease_in = [1, 1];
} }
}, get_text("panel_animation_ease_smooth", "Smooth") ], }, get_text("panel_animation_ease_smooth", "Smooth") ],
[ [THEME.timeline_ease, 2], function() { [ [THEME.timeline_ease, 2], function() {
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_in_type = CURVE_TYPE.bezier; k.ease_in_type = CURVE_TYPE.bezier;
k.ease_in = [1, 2]; k.ease_in = [1, 2];
} }
}, get_text("panel_animation_ease_overshoot", "Overshoot") ], }, get_text("panel_animation_ease_overshoot", "Overshoot") ],
[ [THEME.timeline_ease, 3], function() { [ [THEME.timeline_ease, 3], function() {
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_in_type = CURVE_TYPE.bezier; k.ease_in_type = CURVE_TYPE.bezier;
k.ease_in = [0, 0]; k.ease_in = [0, 0];
} }
}, get_text("panel_animation_ease_sharp", "Sharp") ], }, get_text("panel_animation_ease_sharp", "Sharp") ],
[ [THEME.timeline_ease, 4], function() { [ [THEME.timeline_ease, 4], function() {
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_in_type = CURVE_TYPE.cut; k.ease_in_type = CURVE_TYPE.cut;
k.ease_in = [0, 0]; k.ease_in = [0, 0];
} }
@ -265,29 +264,29 @@ function Panel_Animation() : PanelContent() constructor {
]), ]),
menuItemGroup(get_text("panel_animation_ease_out", "Ease out"), [ menuItemGroup(get_text("panel_animation_ease_out", "Ease out"), [
[ [THEME.timeline_ease, 0], function() { [ [THEME.timeline_ease, 0], function() {
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_out_type = CURVE_TYPE.none; k.ease_out_type = CURVE_TYPE.none;
k.ease_out = [0, 0]; k.ease_out = [0, 0];
} }
}, get_text("panel_animation_ease_linear", "Linear") ], }, get_text("panel_animation_ease_linear", "Linear") ],
[ [THEME.timeline_ease, 1], function() { [ [THEME.timeline_ease, 1], function() {
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_out_type = CURVE_TYPE.bezier; k.ease_out_type = CURVE_TYPE.bezier;
k.ease_out = [1, 0]; k.ease_out = [1, 0];
} }
}, get_text("panel_animation_ease_smooth", "Smooth") ], }, get_text("panel_animation_ease_smooth", "Smooth") ],
[ [THEME.timeline_ease, 2], function() { [ [THEME.timeline_ease, 2], function() {
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_out_type = CURVE_TYPE.bezier; k.ease_out_type = CURVE_TYPE.bezier;
k.ease_out = [1, -1]; k.ease_out = [1, -1];
} }
}, get_text("panel_animation_ease_overshoot", "Overshoot") ], }, get_text("panel_animation_ease_overshoot", "Overshoot") ],
[ [THEME.timeline_ease, 3], function() { [ [THEME.timeline_ease, 3], function() {
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_out_type = CURVE_TYPE.bezier; k.ease_out_type = CURVE_TYPE.bezier;
k.ease_out = [0, 1]; k.ease_out = [0, 1];
} }
@ -1112,7 +1111,7 @@ function Panel_Animation() : PanelContent() constructor {
} }
} }
if(stagger_mode == 1 && ds_list_exist(keyframe_selecting, keyframe)) if(stagger_mode == 1 && array_exists(keyframe_selecting, keyframe))
cc = key_hover == keyframe? COLORS.panel_animation_keyframe_selected : COLORS._main_accent; cc = key_hover == keyframe? COLORS.panel_animation_keyframe_selected : COLORS._main_accent;
var ind = 1; var ind = 1;
@ -1122,7 +1121,7 @@ function Panel_Animation() : PanelContent() constructor {
ind = 4; ind = 4;
draw_sprite_ui_uniform(THEME.timeline_keyframe, ind, t, prop_y, 1, cc); draw_sprite_ui_uniform(THEME.timeline_keyframe, ind, t, prop_y, 1, cc);
if(ds_list_exist(keyframe_selecting, keyframe)) if(array_exists(keyframe_selecting, keyframe))
draw_sprite_ui_uniform(THEME.timeline_keyframe_selecting, ind != 1, t, prop_y, 1, COLORS._main_accent); draw_sprite_ui_uniform(THEME.timeline_keyframe_selecting, ind != 1, t, prop_y, 1, COLORS._main_accent);
if(keyframe_boxing) { if(keyframe_boxing) {
@ -1131,10 +1130,10 @@ function Panel_Animation() : PanelContent() constructor {
var box_y0 = min(keyframe_box_sy, msy); var box_y0 = min(keyframe_box_sy, msy);
var box_y1 = max(keyframe_box_sy, msy); var box_y1 = max(keyframe_box_sy, msy);
if(pHOVER && !point_in_rectangle(t, prop_y, box_x0, box_y0, box_x1, box_y1) && ds_list_exist(keyframe_selecting, keyframe)) if(pHOVER && !point_in_rectangle(t, prop_y, box_x0, box_y0, box_x1, box_y1) && array_exists(keyframe_selecting, keyframe))
ds_list_remove(keyframe_selecting, keyframe); array_remove(keyframe_selecting, keyframe);
if(pHOVER && point_in_rectangle(t, prop_y, box_x0, box_y0, box_x1, box_y1) && !ds_list_exist(keyframe_selecting, keyframe)) if(pHOVER && point_in_rectangle(t, prop_y, box_x0, box_y0, box_x1, box_y1) && !array_exists(keyframe_selecting, keyframe))
ds_list_add(keyframe_selecting, keyframe); array_push(keyframe_selecting, keyframe);
} }
} }
@ -1347,8 +1346,8 @@ function Panel_Animation() : PanelContent() constructor {
tt = max(tt, 0); tt = max(tt, 0);
var sh = tt - keyframe_dragging.time; var sh = tt - keyframe_dragging.time;
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
var kt = k.time + sh; var kt = k.time + sh;
k.anim.setKeyTime(k, kt, false); k.anim.setKeyTime(k, kt, false);
@ -1359,8 +1358,8 @@ function Panel_Animation() : PanelContent() constructor {
if(mouse_release(mb_left) || mouse_press(mb_left)) { if(mouse_release(mb_left) || mouse_press(mb_left)) {
keyframe_dragging = noone; keyframe_dragging = noone;
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.anim.setKeyTime(k, k.time); k.anim.setKeyTime(k, k.time);
} }
} }
@ -1376,23 +1375,23 @@ function Panel_Animation() : PanelContent() constructor {
switch(keyframe_drag_type) { switch(keyframe_drag_type) {
case KEYFRAME_DRAG_TYPE.ease_in : case KEYFRAME_DRAG_TYPE.ease_in :
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_in_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none; k.ease_in_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
k.ease_in[0] = dx; k.ease_in[0] = dx;
} }
break; break;
case KEYFRAME_DRAG_TYPE.ease_out : case KEYFRAME_DRAG_TYPE.ease_out :
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_out_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none; k.ease_out_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
k.ease_out[0] = dx; k.ease_out[0] = dx;
} }
break; break;
case KEYFRAME_DRAG_TYPE.ease_both : case KEYFRAME_DRAG_TYPE.ease_both :
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var k = keyframe_selecting[| i]; var k = keyframe_selecting[i];
k.ease_in_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none; k.ease_in_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
k.ease_out_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none; k.ease_out_type = keyframe_dragout? CURVE_TYPE.bezier : CURVE_TYPE.none;
@ -1482,29 +1481,27 @@ function Panel_Animation() : PanelContent() constructor {
if(pHOVER && point_in_rectangle(msx, msy, 0, ui(18), dope_sheet_w, dope_sheet_h)) { if(pHOVER && point_in_rectangle(msx, msy, 0, ui(18), dope_sheet_w, dope_sheet_h)) {
if(mouse_press(mb_left, pFOCUS) || mouse_press(mb_right, pFOCUS)) { if(mouse_press(mb_left, pFOCUS) || mouse_press(mb_right, pFOCUS)) {
if(key_hover == noone) { if(key_hover == noone) {
ds_list_clear(keyframe_selecting); keyframe_selecting = [];
} else { } else {
if(key_mod_press(SHIFT)) { if(key_mod_press(SHIFT)) {
if(ds_list_exist(keyframe_selecting, key_hover)) if(array_exists(keyframe_selecting, key_hover))
ds_list_remove(keyframe_selecting, key_hover); array_remove(keyframe_selecting, key_hover);
else else
ds_list_add(keyframe_selecting, key_hover) array_push(keyframe_selecting, key_hover)
} else { } else {
if(!ds_list_exist(keyframe_selecting, key_hover)) { if(!array_exists(keyframe_selecting, key_hover))
ds_list_clear(keyframe_selecting); keyframe_selecting = [ key_hover ];
ds_list_add(keyframe_selecting, key_hover);
}
} }
} }
} }
if(mouse_press(mb_left, pFOCUS)) { if(mouse_press(mb_left, pFOCUS)) {
if(stagger_mode == 1) { if(stagger_mode == 1) {
if(key_hover == noone || !ds_list_exist(keyframe_selecting, key_hover)) if(key_hover == noone || !array_exists(keyframe_selecting, key_hover))
stagger_mode = 0; stagger_mode = 0;
else { else {
arrangeKeys(); arrangeKeys();
stagger_index = ds_list_find_index(keyframe_selecting, key_hover); stagger_index = array_find(keyframe_selecting, key_hover);
stagger_mode = 2; stagger_mode = 2;
} }
} else if(stagger_mode == 2) { } else if(stagger_mode == 2) {
@ -1518,14 +1515,14 @@ function Panel_Animation() : PanelContent() constructor {
} }
if(mouse_press(mb_right, pFOCUS)) { if(mouse_press(mb_right, pFOCUS)) {
if(ds_list_empty(keyframe_selecting)) if(array_empty(keyframe_selecting))
menuCall("animation_keyframe_empty_menu",,, keyframe_menu_empty); menuCall("animation_keyframe_empty_menu",,, keyframe_menu_empty);
else else
menuCall("animation_keyframe_menu",,, keyframe_menu); menuCall("animation_keyframe_menu",,, keyframe_menu,, keyframe_selecting);
} }
if(stagger_mode == 2) { if(stagger_mode == 2) {
var ts = keyframe_selecting[| stagger_index].time; var ts = keyframe_selecting[stagger_index].time;
var tm = round((mx - bar_x - timeline_shift) / ui(timeline_scale)) - 1; var tm = round((mx - bar_x - timeline_shift) / ui(timeline_scale)) - 1;
tm = max(tm, 0); tm = max(tm, 0);
@ -1690,19 +1687,17 @@ function Panel_Animation() : PanelContent() constructor {
} }
function doDuplicate() { function doDuplicate() {
if(ds_list_empty(keyframe_selecting)) return; if(array_empty(keyframe_selecting)) return;
var clones = ds_list_create(); var clones = [];
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) { for( var i = 0; i < array_length(keyframe_selecting); i++ ) {
var cl = keyframe_selecting[| i].cloneAnimator(,, false); var cl = keyframe_selecting[i].cloneAnimator(,, false);
if(cl == noone) continue; if(cl == noone) continue;
ds_list_add(clones, cl); array_append(clones, cl);
} }
ds_list_destroy(keyframe_selecting);
keyframe_selecting = clones; keyframe_selecting = clones;
keyframe_dragging = keyframe_selecting[0];
keyframe_dragging = keyframe_selecting[| 0];
keyframe_drag_type = KEYFRAME_DRAG_TYPE.move; keyframe_drag_type = KEYFRAME_DRAG_TYPE.move;
keyframe_drag_mx = mx; keyframe_drag_mx = mx;
keyframe_drag_my = my; keyframe_drag_my = my;
@ -1711,8 +1706,8 @@ function Panel_Animation() : PanelContent() constructor {
copy_clipboard = ds_list_create(); copy_clipboard = ds_list_create();
function doCopy() { function doCopy() {
ds_list_clear(copy_clipboard); ds_list_clear(copy_clipboard);
for( var i = 0; i < ds_list_size(keyframe_selecting); i++ ) for( var i = 0; i < array_length(keyframe_selecting); i++ )
ds_list_add(copy_clipboard, keyframe_selecting[| i]); ds_list_add(copy_clipboard, keyframe_selecting[i]);
} }
function doPaste(val = noone) { function doPaste(val = noone) {

View file

@ -179,7 +179,7 @@ function Panel_Collection() : PanelContent() constructor {
if(!DEMO && mouse_press(mb_right, pFOCUS)) { if(!DEMO && mouse_press(mb_right, pFOCUS)) {
_menu_node = _node; _menu_node = _node;
initMenu(); initMenu();
menuCall("collection_menu",,, contentMenu); menuCall("collection_menu",,, contentMenu,, _menu_node);
} }
if(!instance_exists(o_dialog_menubox) && meta != noone && meta != undefined) { if(!instance_exists(o_dialog_menubox) && meta != noone && meta != undefined) {
@ -253,7 +253,7 @@ function Panel_Collection() : PanelContent() constructor {
if(!DEMO && mouse_press(mb_right, pFOCUS)) { if(!DEMO && mouse_press(mb_right, pFOCUS)) {
_menu_node = _node; _menu_node = _node;
initMenu(); initMenu();
menuCall("collection_menu",,, contentMenu); menuCall("collection_menu",,, contentMenu,, _menu_node);
} }
} }

View file

@ -126,9 +126,9 @@
//if(!directory_exists(DIRECTORY + "layouts")) //if(!directory_exists(DIRECTORY + "layouts"))
zip_unzip("data/Layouts.zip", DIRECTORY); zip_unzip("data/Layouts.zip", DIRECTORY);
var file = DIRECTORY + "Layouts/" + PREF_MAP[? "panel_layout_file"] + ".json"; var file = DIRECTORY + "layouts/" + PREF_MAP[? "panel_layout_file"] + ".json";
if(!file_exists(file)) if(!file_exists(file))
file = DIRECTORY + "Layouts/Horizontal.json"; file = DIRECTORY + "layouts/Horizontal.json";
loadPanel(file, PANEL_MAIN); loadPanel(file, PANEL_MAIN);
PANEL_ANIMATION.updatePropertyList(); PANEL_ANIMATION.updatePropertyList();

View file

@ -561,8 +561,8 @@ function Panel_Graph() : PanelContent() constructor {
array_push(menu, -1); array_push(menu, -1);
array_push(menu, menuItem(get_text("panel_graph_add_transform", "Add transform"), addNodeTransform, noone, ["Graph", "Transform node"])); array_push(menu, menuItem(get_text("panel_graph_add_transform", "Add transform"), addNodeTransform, noone, ["Graph", "Transform node"]));
array_push(menu, menuItem(get_text("panel_graph_canvas", "Canvas"), array_push(menu, menuItem(get_text("panel_graph_canvas", "Canvas"),
function(_x, _y, _depth) { function(_dat) {
return submenuCall(_x, _y, _depth, [ return submenuCall(_dat, [
menuItem(get_text("panel_graph_copy_to_canvas", "Copy to canvas"), function() { menuItem(get_text("panel_graph_copy_to_canvas", "Copy to canvas"), function() {
setCurrentCanvas(node_hover); setCurrentCanvas(node_hover);
}, noone, ["Graph", "Canvas"]), }, noone, ["Graph", "Canvas"]),

View file

@ -358,7 +358,7 @@ function Panel_Inspector() : PanelContent() constructor {
if(mouse_press(mb_left, pFOCUS)) if(mouse_press(mb_left, pFOCUS))
jun_disp[@ 1] = !coll; jun_disp[@ 1] = !coll;
if(mouse_press(mb_right, pFOCUS)) if(mouse_press(mb_right, pFOCUS))
menuCall("inspector_group_menu",,, group_menu); menuCall("inspector_group_menu",,, group_menu,, inspecting);
} else } else
draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy, con_w, ui(32), COLORS.panel_inspector_group_bg, 1); draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy, con_w, ui(32), COLORS.panel_inspector_group_bg, 1);
@ -503,7 +503,7 @@ function Panel_Inspector() : PanelContent() constructor {
})); }));
} }
var dia = menuCall("inspector_value_menu",,, _menuItem); var dia = menuCall("inspector_value_menu",,, _menuItem,, jun);
__dialog_junction = jun; __dialog_junction = jun;
} }
} }

View file

@ -17,21 +17,21 @@ function Panel_Menu() : PanelContent() constructor {
menuItem(get_text("panel_menu_open", "Open") + "...", function() { LOAD(); }, THEME.noti_icon_file_load, ["", "Open"]), menuItem(get_text("panel_menu_open", "Open") + "...", function() { LOAD(); }, THEME.noti_icon_file_load, ["", "Open"]),
menuItem(get_text("panel_menu_save", "Save"), function() { SAVE(); }, THEME.save, ["", "Save"]), menuItem(get_text("panel_menu_save", "Save"), function() { SAVE(); }, THEME.save, ["", "Save"]),
menuItem(get_text("panel_menu_save_as", "Save as..."), function() { SAVE_AS(); }, THEME.save, ["", "Save as"]), menuItem(get_text("panel_menu_save_as", "Save as..."), function() { SAVE_AS(); }, THEME.save, ["", "Save as"]),
menuItem(get_text("panel_menu_recent_files", "Recent files"), function(_x, _y, _depth) { menuItem(get_text("panel_menu_recent_files", "Recent files"), function(_dat) {
var arr = []; var arr = [];
for(var i = 0; i < min(10, ds_list_size(RECENT_FILES)); i++) { for(var i = 0; i < min(10, ds_list_size(RECENT_FILES)); i++) {
var _rec = RECENT_FILES[| i]; var _rec = RECENT_FILES[| i];
array_push(arr, menuItem(_rec, function(_x, _y, _depth, _path) { LOAD_PATH(_path); })); array_push(arr, menuItem(_rec, function(_dat) { LOAD_PATH(_dat.name); }));
} }
return submenuCall(_x, _y, _depth, arr); return submenuCall(_dat, arr);
}).setIsShelf(), }).setIsShelf(),
menuItem(get_text("panel_menu_auto_save_folder", "Open autosave folder"), function() { shellOpenExplorer(DIRECTORY + "autosave"); }, THEME.save_auto), menuItem(get_text("panel_menu_auto_save_folder", "Open autosave folder"), function() { shellOpenExplorer(DIRECTORY + "autosave"); }, THEME.save_auto),
-1, -1,
menuItem(get_text("preferences", "Preferences") + "...", function() { dialogCall(o_dialog_preference); }, THEME.gear), menuItem(get_text("preferences", "Preferences") + "...", function() { dialogCall(o_dialog_preference); }, THEME.gear),
menuItem(get_text("panel_menu_splash_screen", "Splash screen"), function() { dialogCall(o_dialog_splash); }), menuItem(get_text("panel_menu_splash_screen", "Splash screen"), function() { dialogCall(o_dialog_splash); }),
-1, -1,
menuItem(get_text("panel_menu_addons", "Addons"), function(_x, _y, _depth) { menuItem(get_text("panel_menu_addons", "Addons"), function(_dat) {
var arr = [ var arr = [
menuItem(get_text("panel_menu_addons_menu", "Addons..."), function() { dialogPanelCall(new Panel_Addon()); }), menuItem(get_text("panel_menu_addons_menu", "Addons..."), function() { dialogPanelCall(new Panel_Addon()); }),
menuItem(get_text("panel_menu_addons_key", "Key displayer"), function() { menuItem(get_text("panel_menu_addons_key", "Key displayer"), function() {
@ -47,10 +47,10 @@ function Panel_Menu() : PanelContent() constructor {
for( var i = 0; i < array_length(ADDONS); i++ ) { for( var i = 0; i < array_length(ADDONS); i++ ) {
var _dir = ADDONS[i].name; var _dir = ADDONS[i].name;
array_push(arr, menuItem(_dir, function(_x, _y, _depth, _path) { addonTrigger(_path); } )); array_push(arr, menuItem(_dir, function(_dat) { addonTrigger(_dat.name); } ));
} }
return submenuCall(_x, _y, _depth, arr); return submenuCall(_dat, arr);
}, THEME.addon ).setIsShelf(), }, THEME.addon ).setIsShelf(),
-1, -1,
menuItem(get_text("fullscreen", "Toggle fullscreen"), function() { menuItem(get_text("fullscreen", "Toggle fullscreen"), function() {
@ -149,9 +149,9 @@ function Panel_Menu() : PanelContent() constructor {
}), }),
]], ]],
[ get_text("panel_menu_panels", "Panels"), [ [ get_text("panel_menu_panels", "Panels"), [
menuItem(get_text("panel_menu_workspace", "Workspace"), function(_x, _y, _depth) { menuItem(get_text("panel_menu_workspace", "Workspace"), function(_dat) {
var arr = [], lays = []; var arr = [], lays = [];
var f = file_find_first(DIRECTORY + "Layouts/*", 0); var f = file_find_first(DIRECTORY + "layouts/*", 0);
while(f != "") { while(f != "") {
array_push(lays, filename_name_only(f)); array_push(lays, filename_name_only(f));
f = file_find_next(); f = file_find_next();
@ -162,21 +162,21 @@ function Panel_Menu() : PanelContent() constructor {
dia.name = PREF_MAP[? "panel_layout_file"]; dia.name = PREF_MAP[? "panel_layout_file"];
dia.onModify = function(name) { dia.onModify = function(name) {
var cont = panelSerialize(); var cont = panelSerialize();
json_save_struct(DIRECTORY + "Layouts/" + name + ".json", cont); json_save_struct(DIRECTORY + "layouts/" + name + ".json", cont);
}; };
})); }));
array_push(arr, -1); array_push(arr, -1);
for(var i = 0; i < array_length(lays); i++) { for(var i = 0; i < array_length(lays); i++) {
array_push(arr, menuItem(lays[i], array_push(arr, menuItem(lays[i],
function(_x, _y, _depth, _path) { function(_dat) {
PREF_MAP[? "panel_layout_file"] = _path; PREF_MAP[? "panel_layout_file"] = _dat.name;
PREF_SAVE(); PREF_SAVE();
setPanel(); setPanel();
},,, function(item) { return item.name == PREF_MAP[? "panel_layout_file"]; } )); },,, function(item) { return item.name == PREF_MAP[? "panel_layout_file"]; } ));
} }
return submenuCall(_x, _y, _depth, arr); return submenuCall(_dat, arr);
}).setIsShelf(), }).setIsShelf(),
-1, -1,
menuItem(get_text("panel_menu_collections", "Collections"), function() { panelAdd("Panel_Collection", true) },,, function() { return findPanel("Panel_Collection") != noone; } ), menuItem(get_text("panel_menu_collections", "Collections"), function() { panelAdd("Panel_Collection", true) },,, function() { return findPanel("Panel_Collection") != noone; } ),
@ -188,15 +188,15 @@ function Panel_Menu() : PanelContent() constructor {
menuItem(get_text("panel_menu_notification", "Notification"), function() { panelAdd("Panel_Notification", true) },,, function() { return findPanel("Panel_Notification") != noone; } ), menuItem(get_text("panel_menu_notification", "Notification"), function() { panelAdd("Panel_Notification", true) },,, function() { return findPanel("Panel_Notification") != noone; } ),
menuItem(get_text("panel_menu_globalvar", "Global Variables"), function() { panelAdd("Panel_Globalvar", true) },,, function() { return findPanel("Panel_Globalvar") != noone; } ), menuItem(get_text("panel_menu_globalvar", "Global Variables"), function() { panelAdd("Panel_Globalvar", true) },,, function() { return findPanel("Panel_Globalvar") != noone; } ),
menuItem(get_text("panel_menu_nodes", "Nodes"), function(_x, _y, _depth) { menuItem(get_text("panel_menu_nodes", "Nodes"), function(_dat) {
return submenuCall(_x, _y, _depth, [ return submenuCall(_dat, [
menuItem(get_text("panel_menu_nodes", "Nodes"), function() { panelAdd("Panel_Nodes", true) },,, function() { return findPanel("Panel_Nodes") != noone; } ), menuItem(get_text("panel_menu_nodes", "Nodes"), function() { panelAdd("Panel_Nodes", true) },,, function() { return findPanel("Panel_Nodes") != noone; } ),
menuItem(get_text("tunnels", "Tunnels"), function() { panelAdd("Panel_Tunnels", true) },,, function() { return findPanel("Panel_Tunnels") != noone; } ), menuItem(get_text("tunnels", "Tunnels"), function() { panelAdd("Panel_Tunnels", true) },,, function() { return findPanel("Panel_Tunnels") != noone; } ),
]); ]);
} ).setIsShelf(), } ).setIsShelf(),
menuItem(get_text("panel_menu_color", "Color"), function(_x, _y, _depth) { menuItem(get_text("panel_menu_color", "Color"), function(_dat) {
return submenuCall(_x, _y, _depth, [ return submenuCall(_dat, [
menuItem(get_text("panel_menu_color", "Color"), function() { panelAdd("Panel_Color", true) },,, function() { return findPanel("Panel_Color") != noone; } ), menuItem(get_text("panel_menu_color", "Color"), function() { panelAdd("Panel_Color", true) },,, function() { return findPanel("Panel_Color") != noone; } ),
menuItem(get_text("panel_menu_palette", "Palette"), function() { panelAdd("Panel_Palette", true) },,, function() { return findPanel("Panel_Palette") != noone; } ), menuItem(get_text("panel_menu_palette", "Palette"), function() { panelAdd("Panel_Palette", true) },,, function() { return findPanel("Panel_Palette") != noone; } ),
menuItem(get_text("panel_menu_gradient", "Gradient"),function() { panelAdd("Panel_Gradient", true) },,, function() { return findPanel("Panel_Gradient") != noone; } ), menuItem(get_text("panel_menu_gradient", "Gradient"),function() { panelAdd("Panel_Gradient", true) },,, function() { return findPanel("Panel_Gradient") != noone; } ),
@ -656,7 +656,7 @@ function Panel_Menu() : PanelContent() constructor {
for(var i = 0; i < min(10, ds_list_size(RECENT_FILES)); i++) { for(var i = 0; i < min(10, ds_list_size(RECENT_FILES)); i++) {
var _rec = RECENT_FILES[| i]; var _rec = RECENT_FILES[| i];
var _dat = RECENT_FILE_DATA[| i]; var _dat = RECENT_FILE_DATA[| i];
array_push(arr, menuItem(_rec, function(_x, _y, _depth, _path) { LOAD_PATH(_path); })); array_push(arr, menuItem(_rec, function(_dat) { LOAD_PATH(_dat.name); }));
array_push(tip, [ method(_dat, _dat.getThumbnail), VALUE_TYPE.surface ]); array_push(tip, [ method(_dat, _dat.getThumbnail), VALUE_TYPE.surface ]);
} }

View file

@ -79,7 +79,7 @@ function Panel_Notification() : PanelContent() constructor {
menuItem(get_text("noti_delete_message", "Delete notification"), function() { menuItem(get_text("noti_delete_message", "Delete notification"), function() {
ds_list_remove(STATUSES, o_dialog_menubox.noti); ds_list_remove(STATUSES, o_dialog_menubox.noti);
}), }),
]); ],, o_dialog_menubox.noti);
dia.noti = noti; dia.noti = noti;
} }
} }

View file

@ -886,7 +886,7 @@ function Panel_Preview() : PanelContent() constructor {
menuItem(get_text("panel_preview_copy_color", "Copy image"), function() { copyCurrentFrame(); }, THEME.copy), menuItem(get_text("panel_preview_copy_color", "Copy image"), function() { copyCurrentFrame(); }, THEME.copy),
menuItem(get_text("panel_preview_copy_color", "Copy color [") + string(sample_color) + "]", function() { clipboard_set_text(sample_color); }), menuItem(get_text("panel_preview_copy_color", "Copy color [") + string(sample_color) + "]", function() { clipboard_set_text(sample_color); }),
menuItem(get_text("panel_preview_copy_color", "Copy hex [") + string(color_get_hex(sample_color)) + "]", function() { clipboard_set_text(color_get_hex(sample_color)); }), menuItem(get_text("panel_preview_copy_color", "Copy hex [") + string(color_get_hex(sample_color)) + "]", function() { clipboard_set_text(color_get_hex(sample_color)); }),
]); ],, getNodePreview());
} }
drawSplitView(); drawSplitView();

View file

@ -134,9 +134,9 @@ function Panel_Preview_Window() : PanelContent() constructor {
var o = node_target.outputs[| i]; var o = node_target.outputs[| i];
if(o.type != VALUE_TYPE.surface) continue; if(o.type != VALUE_TYPE.surface) continue;
array_push(_menu, menuItem(o.name, function(_x, _y, _d, _n, index) { changeChannel(index); })); array_push(_menu, menuItem(o.name, function(_dat) { changeChannel(_dat.index); }));
} }
menuCall("preview_window_menu",,, _menu); menuCall("preview_window_menu",,, _menu,, node_target);
} }
} }
} }

View file

@ -13,7 +13,7 @@ function Panel_Workspace() : PanelContent() constructor {
function refreshContent() { function refreshContent() {
workspaces = []; workspaces = [];
var f = file_find_first(DIRECTORY + "Layouts/*", 0); var f = file_find_first(DIRECTORY + "layouts/*", 0);
while(f != "") { while(f != "") {
array_push(workspaces, filename_name_only(f)); array_push(workspaces, filename_name_only(f));
f = file_find_next(); f = file_find_next();
@ -56,7 +56,7 @@ function Panel_Workspace() : PanelContent() constructor {
dia.name = PREF_MAP[? "panel_layout_file"]; dia.name = PREF_MAP[? "panel_layout_file"];
dia.onModify = function(name) { dia.onModify = function(name) {
var cont = panelSerialize(); var cont = panelSerialize();
json_save_struct(DIRECTORY + "Layouts/" + name + ".json", cont); json_save_struct(DIRECTORY + "layouts/" + name + ".json", cont);
PREF_MAP[? "panel_layout_file"] = name; PREF_MAP[? "panel_layout_file"] = name;
PREF_SAVE(); PREF_SAVE();
@ -79,11 +79,11 @@ function Panel_Workspace() : PanelContent() constructor {
}), }),
menuItem("Replace with current", function() { menuItem("Replace with current", function() {
var cont = panelSerialize(); var cont = panelSerialize();
json_save_struct(DIRECTORY + "Layouts/" + layout_selecting + ".json", cont); json_save_struct(DIRECTORY + "layouts/" + layout_selecting + ".json", cont);
}), }),
menuItem("Delete", function() { menuItem("Delete", function() {
file_delete(DIRECTORY + "Layouts/" + layout_selecting + ".json"); file_delete(DIRECTORY + "layouts/" + layout_selecting + ".json");
refreshContent(); refreshContent();
}, THEME.cross), }, THEME.cross),
]); ]);

View file

@ -88,6 +88,8 @@
//print("v2 : " + string(v2)); //print("v2 : " + string(v2));
//print("===================="); //print("====================");
print($"{string(v1)} {symbol} {string(v2)}");
switch(symbol) { switch(symbol) {
case "+": return v1 + v2; case "+": return v1 + v2;
case "-": return v1 - v2; case "-": return v1 - v2;