mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 19:38:05 +01:00
Convolute node, preference section, loop freeze fix, frame, pin, 3d material order fix.
This commit is contained in:
parent
d32fc6130a
commit
16e0819389
51 changed files with 1034 additions and 481 deletions
|
@ -1183,6 +1183,7 @@
|
||||||
{"name":"fd_rectangle_set_material_dissipation_type","order":4,"path":"scripts/fd_rectangle_set_material_dissipation_type/fd_rectangle_set_material_dissipation_type.yy",},
|
{"name":"fd_rectangle_set_material_dissipation_type","order":4,"path":"scripts/fd_rectangle_set_material_dissipation_type/fd_rectangle_set_material_dissipation_type.yy",},
|
||||||
{"name":"s_node_gradient_shift","order":15,"path":"sprites/s_node_gradient_shift/s_node_gradient_shift.yy",},
|
{"name":"s_node_gradient_shift","order":15,"path":"sprites/s_node_gradient_shift/s_node_gradient_shift.yy",},
|
||||||
{"name":"node_cache_array","order":8,"path":"scripts/node_cache_array/node_cache_array.yy",},
|
{"name":"node_cache_array","order":8,"path":"scripts/node_cache_array/node_cache_array.yy",},
|
||||||
|
{"name":"node_array_convolute","order":16,"path":"scripts/node_array_convolute/node_array_convolute.yy",},
|
||||||
{"name":"sh_channel_A_grey","order":10,"path":"shaders/sh_channel_A_grey/sh_channel_A_grey.yy",},
|
{"name":"sh_channel_A_grey","order":10,"path":"shaders/sh_channel_A_grey/sh_channel_A_grey.yy",},
|
||||||
{"name":"draw_rect_border","order":6,"path":"scripts/draw_rect_border/draw_rect_border.yy",},
|
{"name":"draw_rect_border","order":6,"path":"scripts/draw_rect_border/draw_rect_border.yy",},
|
||||||
{"name":"node_composite","order":1,"path":"scripts/node_composite/node_composite.yy",},
|
{"name":"node_composite","order":1,"path":"scripts/node_composite/node_composite.yy",},
|
||||||
|
@ -1493,6 +1494,7 @@
|
||||||
{"name":"mac_window_step","order":1,"path":"scripts/mac_window_step/mac_window_step.yy",},
|
{"name":"mac_window_step","order":1,"path":"scripts/mac_window_step/mac_window_step.yy",},
|
||||||
{"name":"s_node_image","order":1,"path":"sprites/s_node_image/s_node_image.yy",},
|
{"name":"s_node_image","order":1,"path":"sprites/s_node_image/s_node_image.yy",},
|
||||||
{"name":"__node_value_processor","order":6,"path":"scripts/__node_value_processor/__node_value_processor.yy",},
|
{"name":"__node_value_processor","order":6,"path":"scripts/__node_value_processor/__node_value_processor.yy",},
|
||||||
|
{"name":"hotkey_data","order":16,"path":"scripts/hotkey_data/hotkey_data.yy",},
|
||||||
{"name":"s_node_group_input","order":16,"path":"sprites/s_node_group_input/s_node_group_input.yy",},
|
{"name":"s_node_group_input","order":16,"path":"sprites/s_node_group_input/s_node_group_input.yy",},
|
||||||
{"name":"sample_projects","order":6,"path":"scripts/sample_projects/sample_projects.yy",},
|
{"name":"sample_projects","order":6,"path":"scripts/sample_projects/sample_projects.yy",},
|
||||||
{"name":"__matrix3","order":5,"path":"scripts/__matrix3/__matrix3.yy",},
|
{"name":"__matrix3","order":5,"path":"scripts/__matrix3/__matrix3.yy",},
|
||||||
|
@ -1508,6 +1510,7 @@
|
||||||
{"name":"__node_3d_extrude","order":3,"path":"scripts/__node_3d_extrude/__node_3d_extrude.yy",},
|
{"name":"__node_3d_extrude","order":3,"path":"scripts/__node_3d_extrude/__node_3d_extrude.yy",},
|
||||||
{"name":"node_path_array","order":11,"path":"scripts/node_path_array/node_path_array.yy",},
|
{"name":"node_path_array","order":11,"path":"scripts/node_path_array/node_path_array.yy",},
|
||||||
{"name":"node_scale","order":8,"path":"scripts/node_scale/node_scale.yy",},
|
{"name":"node_scale","order":8,"path":"scripts/node_scale/node_scale.yy",},
|
||||||
|
{"name":"o_dialog_run_shell","order":13,"path":"objects/o_dialog_run_shell/o_dialog_run_shell.yy",},
|
||||||
{"name":"panel_array_sequence","order":3,"path":"scripts/panel_array_sequence/panel_array_sequence.yy",},
|
{"name":"panel_array_sequence","order":3,"path":"scripts/panel_array_sequence/panel_array_sequence.yy",},
|
||||||
{"name":"sh_displace","order":5,"path":"shaders/sh_displace/sh_displace.yy",},
|
{"name":"sh_displace","order":5,"path":"shaders/sh_displace/sh_displace.yy",},
|
||||||
{"name":"fd_rectangle_get_material_height","order":10,"path":"scripts/fd_rectangle_get_material_height/fd_rectangle_get_material_height.yy",},
|
{"name":"fd_rectangle_get_material_height","order":10,"path":"scripts/fd_rectangle_get_material_height/fd_rectangle_get_material_height.yy",},
|
||||||
|
@ -1597,6 +1600,7 @@
|
||||||
{"name":"panel_node_data_gen","order":9,"path":"scripts/panel_node_data_gen/panel_node_data_gen.yy",},
|
{"name":"panel_node_data_gen","order":9,"path":"scripts/panel_node_data_gen/panel_node_data_gen.yy",},
|
||||||
{"name":"node_dynamic_surface_out","order":1,"path":"scripts/node_dynamic_surface_out/node_dynamic_surface_out.yy",},
|
{"name":"node_dynamic_surface_out","order":1,"path":"scripts/node_dynamic_surface_out/node_dynamic_surface_out.yy",},
|
||||||
{"name":"fd_rectangle_update_material","order":21,"path":"scripts/fd_rectangle_update_material/fd_rectangle_update_material.yy",},
|
{"name":"fd_rectangle_update_material","order":21,"path":"scripts/fd_rectangle_update_material/fd_rectangle_update_material.yy",},
|
||||||
|
{"name":"s_node_array_convolute","order":16,"path":"sprites/s_node_array_convolute/s_node_array_convolute.yy",},
|
||||||
{"name":"sh_perlin_tiled","order":6,"path":"shaders/sh_perlin_tiled/sh_perlin_tiled.yy",},
|
{"name":"sh_perlin_tiled","order":6,"path":"shaders/sh_perlin_tiled/sh_perlin_tiled.yy",},
|
||||||
{"name":"sh_time_remap","order":2,"path":"shaders/sh_time_remap/sh_time_remap.yy",},
|
{"name":"sh_time_remap","order":2,"path":"shaders/sh_time_remap/sh_time_remap.yy",},
|
||||||
],
|
],
|
||||||
|
|
|
@ -623,6 +623,7 @@
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_active.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_active.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_fg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_fg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_inner_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_tab.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_panel_tab.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_scroll_bar.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_scroll_bar.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_selection.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_ui_selection.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||||
|
@ -1840,6 +1841,7 @@
|
||||||
{"id":{"name":"fd_rectangle_set_material_dissipation_type","path":"scripts/fd_rectangle_set_material_dissipation_type/fd_rectangle_set_material_dissipation_type.yy",},},
|
{"id":{"name":"fd_rectangle_set_material_dissipation_type","path":"scripts/fd_rectangle_set_material_dissipation_type/fd_rectangle_set_material_dissipation_type.yy",},},
|
||||||
{"id":{"name":"s_node_gradient_shift","path":"sprites/s_node_gradient_shift/s_node_gradient_shift.yy",},},
|
{"id":{"name":"s_node_gradient_shift","path":"sprites/s_node_gradient_shift/s_node_gradient_shift.yy",},},
|
||||||
{"id":{"name":"node_cache_array","path":"scripts/node_cache_array/node_cache_array.yy",},},
|
{"id":{"name":"node_cache_array","path":"scripts/node_cache_array/node_cache_array.yy",},},
|
||||||
|
{"id":{"name":"node_array_convolute","path":"scripts/node_array_convolute/node_array_convolute.yy",},},
|
||||||
{"id":{"name":"sh_channel_A_grey","path":"shaders/sh_channel_A_grey/sh_channel_A_grey.yy",},},
|
{"id":{"name":"sh_channel_A_grey","path":"shaders/sh_channel_A_grey/sh_channel_A_grey.yy",},},
|
||||||
{"id":{"name":"draw_rect_border","path":"scripts/draw_rect_border/draw_rect_border.yy",},},
|
{"id":{"name":"draw_rect_border","path":"scripts/draw_rect_border/draw_rect_border.yy",},},
|
||||||
{"id":{"name":"node_composite","path":"scripts/node_composite/node_composite.yy",},},
|
{"id":{"name":"node_composite","path":"scripts/node_composite/node_composite.yy",},},
|
||||||
|
@ -2207,6 +2209,7 @@
|
||||||
{"id":{"name":"mac_window_step","path":"scripts/mac_window_step/mac_window_step.yy",},},
|
{"id":{"name":"mac_window_step","path":"scripts/mac_window_step/mac_window_step.yy",},},
|
||||||
{"id":{"name":"s_node_image","path":"sprites/s_node_image/s_node_image.yy",},},
|
{"id":{"name":"s_node_image","path":"sprites/s_node_image/s_node_image.yy",},},
|
||||||
{"id":{"name":"__node_value_processor","path":"scripts/__node_value_processor/__node_value_processor.yy",},},
|
{"id":{"name":"__node_value_processor","path":"scripts/__node_value_processor/__node_value_processor.yy",},},
|
||||||
|
{"id":{"name":"hotkey_data","path":"scripts/hotkey_data/hotkey_data.yy",},},
|
||||||
{"id":{"name":"s_node_group_input","path":"sprites/s_node_group_input/s_node_group_input.yy",},},
|
{"id":{"name":"s_node_group_input","path":"sprites/s_node_group_input/s_node_group_input.yy",},},
|
||||||
{"id":{"name":"sample_projects","path":"scripts/sample_projects/sample_projects.yy",},},
|
{"id":{"name":"sample_projects","path":"scripts/sample_projects/sample_projects.yy",},},
|
||||||
{"id":{"name":"load_function","path":"scripts/load_function/load_function.yy",},},
|
{"id":{"name":"load_function","path":"scripts/load_function/load_function.yy",},},
|
||||||
|
@ -2224,6 +2227,7 @@
|
||||||
{"id":{"name":"__node_3d_extrude","path":"scripts/__node_3d_extrude/__node_3d_extrude.yy",},},
|
{"id":{"name":"__node_3d_extrude","path":"scripts/__node_3d_extrude/__node_3d_extrude.yy",},},
|
||||||
{"id":{"name":"node_path_array","path":"scripts/node_path_array/node_path_array.yy",},},
|
{"id":{"name":"node_path_array","path":"scripts/node_path_array/node_path_array.yy",},},
|
||||||
{"id":{"name":"node_scale","path":"scripts/node_scale/node_scale.yy",},},
|
{"id":{"name":"node_scale","path":"scripts/node_scale/node_scale.yy",},},
|
||||||
|
{"id":{"name":"o_dialog_run_shell","path":"objects/o_dialog_run_shell/o_dialog_run_shell.yy",},},
|
||||||
{"id":{"name":"node_array_insert","path":"scripts/node_array_insert/node_array_insert.yy",},},
|
{"id":{"name":"node_array_insert","path":"scripts/node_array_insert/node_array_insert.yy",},},
|
||||||
{"id":{"name":"panel_array_sequence","path":"scripts/panel_array_sequence/panel_array_sequence.yy",},},
|
{"id":{"name":"panel_array_sequence","path":"scripts/panel_array_sequence/panel_array_sequence.yy",},},
|
||||||
{"id":{"name":"sh_displace","path":"shaders/sh_displace/sh_displace.yy",},},
|
{"id":{"name":"sh_displace","path":"shaders/sh_displace/sh_displace.yy",},},
|
||||||
|
@ -2331,6 +2335,7 @@
|
||||||
{"id":{"name":"panel_node_data_gen","path":"scripts/panel_node_data_gen/panel_node_data_gen.yy",},},
|
{"id":{"name":"panel_node_data_gen","path":"scripts/panel_node_data_gen/panel_node_data_gen.yy",},},
|
||||||
{"id":{"name":"node_dynamic_surface_out","path":"scripts/node_dynamic_surface_out/node_dynamic_surface_out.yy",},},
|
{"id":{"name":"node_dynamic_surface_out","path":"scripts/node_dynamic_surface_out/node_dynamic_surface_out.yy",},},
|
||||||
{"id":{"name":"fd_rectangle_update_material","path":"scripts/fd_rectangle_update_material/fd_rectangle_update_material.yy",},},
|
{"id":{"name":"fd_rectangle_update_material","path":"scripts/fd_rectangle_update_material/fd_rectangle_update_material.yy",},},
|
||||||
|
{"id":{"name":"s_node_array_convolute","path":"sprites/s_node_array_convolute/s_node_array_convolute.yy",},},
|
||||||
{"id":{"name":"sh_perlin_tiled","path":"shaders/sh_perlin_tiled/sh_perlin_tiled.yy",},},
|
{"id":{"name":"sh_perlin_tiled","path":"shaders/sh_perlin_tiled/sh_perlin_tiled.yy",},},
|
||||||
{"id":{"name":"sh_time_remap","path":"shaders/sh_time_remap/sh_time_remap.yy",},},
|
{"id":{"name":"sh_time_remap","path":"shaders/sh_time_remap/sh_time_remap.yy",},},
|
||||||
{"id":{"name":"rm_main","path":"rooms/rm_main/rm_main.yy",},},
|
{"id":{"name":"rm_main","path":"rooms/rm_main/rm_main.yy",},},
|
||||||
|
|
Binary file not shown.
|
@ -45,11 +45,7 @@ gameframe_button_array = [];
|
||||||
log_y = 0;
|
log_y = 0;
|
||||||
log_y_to = 0;
|
log_y_to = 0;
|
||||||
|
|
||||||
LOCALE = {
|
LOCALE = { config: { per_character_line_break: true } }
|
||||||
config: {
|
|
||||||
per_character_line_break: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
win_w = 640;
|
win_w = 640;
|
||||||
win_h = 480;
|
win_h = 480;
|
||||||
|
|
|
@ -12,7 +12,7 @@ if(win_w != w || win_h != h) {
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_set_text(_f_p1, fa_left, fa_center, c_white);
|
draw_set_text(_f_p1, fa_left, fa_center, c_white);
|
||||||
draw_text(34, 18, __txt("Pixel Composer crashed"));
|
draw_text(34, 18, "Pixel Composer crashed");
|
||||||
draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
|
draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
|
||||||
|
|
||||||
#region display
|
#region display
|
||||||
|
@ -75,7 +75,7 @@ draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_sprite_ext(s_copy, 0, bx0 + 16, by0 + 16, 0.5, 0.5, 0, #8fde5d, 1);
|
draw_sprite_ext(s_copy, 0, bx0 + 16, by0 + 16, 0.5, 0.5, 0, #8fde5d, 1);
|
||||||
draw_text(bx0 + 32, by0 + 16, __txt("Copy") + " ");
|
draw_text(bx0 + 32, by0 + 16, "Copy" + " ");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region close
|
#region close
|
||||||
|
@ -95,7 +95,7 @@ draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
|
||||||
draw_sprite_stretched(s_button, 1, bx0, by0, bw, bh);
|
draw_sprite_stretched(s_button, 1, bx0, by0, bw, bh);
|
||||||
} else
|
} else
|
||||||
draw_sprite_stretched(s_button, 0, bx0, by0, bw, bh);
|
draw_sprite_stretched(s_button, 0, bx0, by0, bw, bh);
|
||||||
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Close"));
|
draw_text(bx0 + bw / 2, by0 + bh / 2, "Close");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region open log
|
#region open log
|
||||||
|
@ -115,7 +115,7 @@ draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
|
||||||
draw_sprite_stretched(s_button, 1, bx0, by0, bw, bh);
|
draw_sprite_stretched(s_button, 1, bx0, by0, bw, bh);
|
||||||
} else
|
} else
|
||||||
draw_sprite_stretched(s_button, 0, bx0, by0, bw, bh);
|
draw_sprite_stretched(s_button, 0, bx0, by0, bw, bh);
|
||||||
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Open log folder"));
|
draw_text(bx0 + bw / 2, by0 + bh / 2, "Open log folder");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region restart
|
#region restart
|
||||||
|
@ -137,7 +137,7 @@ draw_sprite_ext(s_noti_icon_error, 0, 18, 18, 0.5, 0.5, 0, c_white, 1);
|
||||||
draw_sprite_stretched(s_button, 1, bx0, by0, bw, bh);
|
draw_sprite_stretched(s_button, 1, bx0, by0, bw, bh);
|
||||||
} else
|
} else
|
||||||
draw_sprite_stretched(s_button, 0, bx0, by0, bw, bh);
|
draw_sprite_stretched(s_button, 0, bx0, by0, bw, bh);
|
||||||
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Restart application"));
|
draw_text(bx0 + bw / 2, by0 + bh / 2, "Restart application");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region discord
|
#region discord
|
||||||
|
|
|
@ -41,17 +41,18 @@ event_inherited();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region surface
|
#region surface
|
||||||
folderW = ui(200);
|
folderW = ui(204);
|
||||||
folderW_dragging = false;
|
folderW_dragging = false;
|
||||||
folderW_drag_mx = 0;
|
folderW_drag_mx = 0;
|
||||||
folderW_drag_sx = 0;
|
folderW_drag_sx = 0;
|
||||||
|
|
||||||
content_w = dialog_w - ui(36) - folderW;
|
content_w = dialog_w - ui(34) - folderW;
|
||||||
content_h = dialog_h - ui(32);
|
content_h = dialog_h - ui(32);
|
||||||
|
|
||||||
function onResize() {
|
function onResize() {
|
||||||
content_w = dialog_w - ui(36) - folderW;
|
content_w = dialog_w - ui(34) - folderW;
|
||||||
content_h = dialog_h - ui(32);
|
content_h = dialog_h - ui(32);
|
||||||
|
|
||||||
contentPane.resize(content_w, content_h);
|
contentPane.resize(content_w, content_h);
|
||||||
folderPane.resize(folderW - ui(12), content_h - ui(32));
|
folderPane.resize(folderW - ui(12), content_h - ui(32));
|
||||||
}
|
}
|
||||||
|
@ -61,14 +62,20 @@ event_inherited();
|
||||||
var hh = 8;
|
var hh = 8;
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(global.ASSETS.subDir); i++) {
|
for(var i = 0; i < ds_list_size(global.ASSETS.subDir); i++) {
|
||||||
var hg = global.ASSETS.subDir[| i].draw(self, ui(8), _y + 8, _m, folderPane.surface_w - ui(16),
|
var _w = folderPane.surface_w - ui(16);
|
||||||
sHOVER && folderPane.hover, sFOCUS, global.ASSETS);
|
var _hover = sHOVER && folderPane.hover;
|
||||||
|
var _clr = {
|
||||||
|
selecting : COLORS.assetbox_current_bg
|
||||||
|
}
|
||||||
|
|
||||||
|
var hg = global.ASSETS.subDir[| i].draw(self, ui(8), _y + 8, _m, _w, _hover, sFOCUS, global.ASSETS, _clr);
|
||||||
hh += hg;
|
hh += hg;
|
||||||
_y += hg;
|
_y += hg;
|
||||||
}
|
}
|
||||||
|
|
||||||
return hh + 8;
|
return hh + 8;
|
||||||
});
|
});
|
||||||
|
folderPane.always_scroll = true;
|
||||||
|
|
||||||
contentPane = new scrollPane(content_w, content_h, function(_y, _m) {
|
contentPane = new scrollPane(content_w, content_h, function(_y, _m) {
|
||||||
draw_clear_alpha(c_white, 0);
|
draw_clear_alpha(c_white, 0);
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text);
|
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text);
|
||||||
draw_text(dialog_x + ui(16), dialog_y + ui(16), __txt("Assets"));
|
draw_text(dialog_x + ui(16), dialog_y + ui(16), __txt("Assets"));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.ui_panel_bg, 0, dialog_x + ui(16), dialog_y + ui(48), folderW - ui(8), dialog_h - ui(64));
|
draw_sprite_stretched(THEME.ui_panel_inner_bg, 0, dialog_x + ui(16), dialog_y + ui(48), folderW - ui(24), dialog_h - ui(64));
|
||||||
draw_sprite_stretched(THEME.ui_panel_bg, 0, dialog_x + ui(16) + folderW, dialog_y + ui(16), dialog_w - ui(32) - folderW, dialog_h - ui(32));
|
draw_sprite_stretched(THEME.ui_panel_inner_bg, 0, dialog_x + ui(12) + folderW, dialog_y + ui(16), dialog_w - ui(28) - folderW, dialog_h - ui(32));
|
||||||
|
|
||||||
var dx0 = dialog_x + ui(16) + folderW - ui(8);
|
var dx0 = dialog_x + ui(16) + folderW - ui(8);
|
||||||
var dx1 = dialog_x + ui(16) + folderW;
|
var dx1 = dialog_x + ui(16) + folderW;
|
||||||
|
@ -41,5 +41,5 @@
|
||||||
folderPane.draw(dialog_x + ui(16), dialog_y + ui(48));
|
folderPane.draw(dialog_x + ui(16), dialog_y + ui(48));
|
||||||
|
|
||||||
contentPane.setFocusHover(sFOCUS, sHOVER);
|
contentPane.setFocusHover(sFOCUS, sHOVER);
|
||||||
contentPane.draw(dialog_x + ui(20) + folderW, dialog_y + ui(16));
|
contentPane.draw(dialog_x + ui(12) + folderW, dialog_y + ui(16));
|
||||||
#endregion
|
#endregion
|
|
@ -29,6 +29,11 @@ event_inherited();
|
||||||
page[2] = __txt("Theme");
|
page[2] = __txt("Theme");
|
||||||
page[3] = __txt("Hotkeys");
|
page[3] = __txt("Hotkeys");
|
||||||
|
|
||||||
|
section_current = "";
|
||||||
|
sections = array_create(array_length(page));
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region general
|
||||||
pref_global = ds_list_create();
|
pref_global = ds_list_create();
|
||||||
|
|
||||||
ds_list_add(pref_global, [
|
ds_list_add(pref_global, [
|
||||||
|
@ -351,6 +356,8 @@ event_inherited();
|
||||||
var cx = x1 - cw - ui(8);
|
var cx = x1 - cw - ui(8);
|
||||||
var category = "";
|
var category = "";
|
||||||
|
|
||||||
|
var sect = [];
|
||||||
|
|
||||||
for( var i = 0, n = array_length(COLOR_KEYS); i < n; i++ ) {
|
for( var i = 0, n = array_length(COLOR_KEYS); i < n; i++ ) {
|
||||||
var key = COLOR_KEYS[i];
|
var key = COLOR_KEYS[i];
|
||||||
var val = variable_struct_get(COLORS, key);
|
var val = variable_struct_get(COLORS, key);
|
||||||
|
@ -363,8 +370,15 @@ event_inherited();
|
||||||
var cat = spl[0] == ""? spl[1] : spl[0];
|
var cat = spl[0] == ""? spl[1] : spl[0];
|
||||||
if(cat != category) {
|
if(cat != category) {
|
||||||
category = cat;
|
category = cat;
|
||||||
|
var _sect = string_title(category);
|
||||||
|
|
||||||
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_sub);
|
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_sub);
|
||||||
draw_text(ui(16), yy, string_title(category));
|
draw_text(ui(16), yy, _sect);
|
||||||
|
|
||||||
|
array_push(sect, [ _sect, sp_colors, hh ]);
|
||||||
|
if(yy > 0 && section_current == "")
|
||||||
|
section_current = _sect;
|
||||||
|
|
||||||
yy += string_height(category) + ui(8);
|
yy += string_height(category) + ui(8);
|
||||||
hh += string_height(category) + ui(8);
|
hh += string_height(category) + ui(8);
|
||||||
ind = 0;
|
ind = 0;
|
||||||
|
@ -401,6 +415,8 @@ event_inherited();
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sections[2] = sect;
|
||||||
|
|
||||||
return hh;
|
return hh;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -410,92 +426,6 @@ event_inherited();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region draw
|
|
||||||
current_list = pref_global;
|
|
||||||
|
|
||||||
sp_pref = new scrollPane(dialog_w - ui(padding + padding + page_width), dialog_h - ui(title_height + padding), function(_y, _m, _r) {
|
|
||||||
draw_clear_alpha(COLORS.panel_bg_clear, 0);
|
|
||||||
var hh = 0;
|
|
||||||
var th = TEXTBOX_HEIGHT;
|
|
||||||
var x1 = sp_pref.surface_w;
|
|
||||||
var yy = _y + ui(8);
|
|
||||||
var padd = ui(6);
|
|
||||||
var ind = 0;
|
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(current_list); i++) {
|
|
||||||
var _pref = current_list[| i];
|
|
||||||
if(is_string(_pref)) continue;
|
|
||||||
|
|
||||||
var name = _pref[0];
|
|
||||||
if(search_text != "" && string_pos(string_lower(search_text), string_lower(name)) == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
_pref[2].register(sp_pref);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(current_list); i++) {
|
|
||||||
var _pref = current_list[| i];
|
|
||||||
var th = TEXTBOX_HEIGHT;
|
|
||||||
|
|
||||||
if(is_string(_pref)) {
|
|
||||||
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_sub);
|
|
||||||
draw_text(ui(16), yy, _pref);
|
|
||||||
yy += string_height(_pref) + ui(8);
|
|
||||||
hh += string_height(_pref) + ui(8);
|
|
||||||
ind = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
var name = _pref[0];
|
|
||||||
var txt = _pref[1];
|
|
||||||
if(is_method(txt))
|
|
||||||
txt = txt();
|
|
||||||
else
|
|
||||||
txt = PREF_MAP[? txt];
|
|
||||||
|
|
||||||
if(search_text != "" && string_pos(string_lower(search_text), string_lower(name)) == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(ind % 2 == 0)
|
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy - padd, sp_pref.surface_w, th + padd * 2, COLORS.dialog_preference_prop_bg, 1);
|
|
||||||
|
|
||||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
|
||||||
draw_text(ui(8), yy + th / 2, _pref[0]);
|
|
||||||
_pref[2].setFocusHover(sFOCUS, sHOVER && sp_pref.hover);
|
|
||||||
|
|
||||||
var widget_w = ui(240);
|
|
||||||
var widget_h = th;
|
|
||||||
|
|
||||||
if(instanceof(_pref[2]) == "textBox")
|
|
||||||
widget_w = _pref[2].input == TEXTBOX_INPUT.text? ui(400) : widget_w;
|
|
||||||
|
|
||||||
var widget_x = x1 - ui(4) - widget_w;
|
|
||||||
var widget_y = yy;
|
|
||||||
|
|
||||||
var params = new widgetParam(widget_x, widget_y, widget_w, widget_h, txt, {}, _m, _r[0], _r[1]);
|
|
||||||
if(instanceof(_pref[2]) == "checkBox")
|
|
||||||
params.halign = fa_center;
|
|
||||||
|
|
||||||
var th = _pref[2].drawParam(params) ?? 0;
|
|
||||||
|
|
||||||
yy += th + padd + ui(8);
|
|
||||||
hh += th + padd + ui(8);
|
|
||||||
ind++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hh;
|
|
||||||
});
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region search
|
|
||||||
tb_search = new textBox(TEXTBOX_INPUT.text, function(str) {
|
|
||||||
search_text = str;
|
|
||||||
});
|
|
||||||
tb_search.align = fa_left;
|
|
||||||
|
|
||||||
search_text = "";
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region hotkey
|
#region hotkey
|
||||||
pref_hot = ds_list_create();
|
pref_hot = ds_list_create();
|
||||||
ds_list_add(pref_hot, [
|
ds_list_add(pref_hot, [
|
||||||
|
@ -527,6 +457,7 @@ event_inherited();
|
||||||
|
|
||||||
var yy = _y + ui(8);
|
var yy = _y + ui(8);
|
||||||
var ind = 0;
|
var ind = 0;
|
||||||
|
var sect = [];
|
||||||
|
|
||||||
for( var i = 0, n = ds_list_size(pref_hot); i < n; i++ ) {
|
for( var i = 0, n = ds_list_size(pref_hot); i < n; i++ ) {
|
||||||
var _pref = pref_hot[| i];
|
var _pref = pref_hot[| i];
|
||||||
|
@ -579,8 +510,14 @@ event_inherited();
|
||||||
|
|
||||||
if(group != currGroup) {
|
if(group != currGroup) {
|
||||||
if(group != "") hh += ui(12);
|
if(group != "") hh += ui(12);
|
||||||
|
|
||||||
|
var _grp = group == ""? __txt("Global") : group;
|
||||||
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_sub);
|
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_sub);
|
||||||
draw_text(ui(16), yy + hh, group == ""? __txt("Global") : group);
|
draw_text(ui(16), yy + hh, _grp);
|
||||||
|
|
||||||
|
array_push(sect, [ _grp, sp_hotkey, hh ]);
|
||||||
|
if(yy > 0 && section_current == "")
|
||||||
|
section_current = _grp;
|
||||||
|
|
||||||
hh += string_height("l") + ui(16);
|
hh += string_height("l") + ui(16);
|
||||||
currGroup = group;
|
currGroup = group;
|
||||||
|
@ -685,7 +622,96 @@ event_inherited();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
sections[3] = sect;
|
||||||
|
|
||||||
return hh;
|
return hh;
|
||||||
})
|
})
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region draw
|
||||||
|
current_list = pref_global;
|
||||||
|
|
||||||
|
sp_pref = new scrollPane(dialog_w - ui(padding + padding + page_width), dialog_h - ui(title_height + padding), function(_y, _m, _r) {
|
||||||
|
draw_clear_alpha(COLORS.panel_bg_clear, 0);
|
||||||
|
var hh = 0;
|
||||||
|
var th = TEXTBOX_HEIGHT;
|
||||||
|
var x1 = sp_pref.surface_w;
|
||||||
|
var yy = _y + ui(8);
|
||||||
|
var padd = ui(6);
|
||||||
|
var ind = 0;
|
||||||
|
|
||||||
|
for(var i = 0; i < ds_list_size(current_list); i++) {
|
||||||
|
var _pref = current_list[| i];
|
||||||
|
if(is_string(_pref)) continue;
|
||||||
|
|
||||||
|
var name = _pref[0];
|
||||||
|
if(search_text != "" && string_pos(string_lower(search_text), string_lower(name)) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
_pref[2].register(sp_pref);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i = 0; i < ds_list_size(current_list); i++) {
|
||||||
|
var _pref = current_list[| i];
|
||||||
|
var th = TEXTBOX_HEIGHT;
|
||||||
|
|
||||||
|
if(is_string(_pref)) {
|
||||||
|
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_sub);
|
||||||
|
draw_text(ui(16), yy, _pref);
|
||||||
|
yy += string_height(_pref) + ui(8);
|
||||||
|
hh += string_height(_pref) + ui(8);
|
||||||
|
ind = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var name = _pref[0];
|
||||||
|
var txt = _pref[1];
|
||||||
|
if(is_method(txt))
|
||||||
|
txt = txt();
|
||||||
|
else
|
||||||
|
txt = PREF_MAP[? txt];
|
||||||
|
|
||||||
|
if(search_text != "" && string_pos(string_lower(search_text), string_lower(name)) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(ind % 2 == 0)
|
||||||
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy - padd, sp_pref.surface_w, th + padd * 2, COLORS.dialog_preference_prop_bg, 1);
|
||||||
|
|
||||||
|
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
||||||
|
draw_text(ui(8), yy + th / 2, _pref[0]);
|
||||||
|
_pref[2].setFocusHover(sFOCUS, sHOVER && sp_pref.hover);
|
||||||
|
|
||||||
|
var widget_w = ui(240);
|
||||||
|
var widget_h = th;
|
||||||
|
|
||||||
|
if(instanceof(_pref[2]) == "textBox")
|
||||||
|
widget_w = _pref[2].input == TEXTBOX_INPUT.text? ui(400) : widget_w;
|
||||||
|
|
||||||
|
var widget_x = x1 - ui(4) - widget_w;
|
||||||
|
var widget_y = yy;
|
||||||
|
|
||||||
|
var params = new widgetParam(widget_x, widget_y, widget_w, widget_h, txt, {}, _m, _r[0], _r[1]);
|
||||||
|
if(instanceof(_pref[2]) == "checkBox")
|
||||||
|
params.halign = fa_center;
|
||||||
|
|
||||||
|
var th = _pref[2].drawParam(params) ?? 0;
|
||||||
|
|
||||||
|
yy += th + padd + ui(8);
|
||||||
|
hh += th + padd + ui(8);
|
||||||
|
ind++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hh;
|
||||||
|
});
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region search
|
||||||
|
tb_search = new textBox(TEXTBOX_INPUT.text, function(str) {
|
||||||
|
search_text = str;
|
||||||
|
});
|
||||||
|
tb_search.align = fa_left;
|
||||||
|
|
||||||
|
search_text = "";
|
||||||
|
#endregion
|
||||||
|
|
|
@ -17,9 +17,11 @@ if !ready exit;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region page
|
#region page
|
||||||
|
var xx = dialog_x + ui(padding + 8);
|
||||||
var yy = dialog_y + ui(title_height);
|
var yy = dialog_y + ui(title_height);
|
||||||
var yl = yy - ui(8);
|
var yl = yy - ui(8);
|
||||||
var hg = line_get_height(f_p0, 16);
|
var hg = line_get_height(f_p0, 16);
|
||||||
|
var hs = line_get_height(f_p1, 8);
|
||||||
|
|
||||||
for(var i = 0; i < array_length(page); i++) {
|
for(var i = 0; i < array_length(page); i++) {
|
||||||
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
|
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
|
||||||
|
@ -31,12 +33,32 @@ if !ready exit;
|
||||||
page_current = i;
|
page_current = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_text(dialog_x + ui(padding + 8), yl + hg / 2, page[i]);
|
draw_text(xx, yl + hg / 2, page[i]);
|
||||||
yl += hg;
|
yl += hg;
|
||||||
|
|
||||||
|
if(i == page_current && sections[i] != 0) {
|
||||||
|
for( var j = 0, m = array_length(sections[i]); j < m; j++ ) {
|
||||||
|
var sect = sections[i][j];
|
||||||
|
|
||||||
|
draw_set_text(f_p1, fa_left, fa_center, section_current == sect[0]? COLORS._main_text : COLORS._main_text_sub);
|
||||||
|
|
||||||
|
if(sHOVER && point_in_rectangle(mouse_mx, mouse_my, dialog_x, yl, dialog_x + page_width + ui(padding + 8), yl + hs - 1)) {
|
||||||
|
if(mouse_press(mb_left, sFOCUS))
|
||||||
|
sect[1].scroll_y_to = -sect[2];
|
||||||
|
|
||||||
|
draw_set_color(COLORS._main_text);
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_text(xx + ui(16), yl + hs / 2, sect[0]);
|
||||||
|
|
||||||
|
yl += hs;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region draw
|
#region draw
|
||||||
|
section_current = "";
|
||||||
var px = dialog_x + ui(padding + page_width);
|
var px = dialog_x + ui(padding + page_width);
|
||||||
var py = dialog_y + ui(title_height);
|
var py = dialog_y + ui(title_height);
|
||||||
var pw = dialog_w - ui(padding + page_width + padding);
|
var pw = dialog_w - ui(padding + page_width + padding);
|
||||||
|
|
35
objects/o_dialog_run_shell/Create_0.gml
Normal file
35
objects/o_dialog_run_shell/Create_0.gml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/// @description init
|
||||||
|
event_inherited();
|
||||||
|
|
||||||
|
#region data
|
||||||
|
dialog_w = ui(640);
|
||||||
|
dialog_h = ui(140);
|
||||||
|
|
||||||
|
node = noone;
|
||||||
|
prog = "";
|
||||||
|
cmd = "";
|
||||||
|
|
||||||
|
ctxt = [];
|
||||||
|
|
||||||
|
function setData(_node, _prog, _cmd) {
|
||||||
|
node = _node;
|
||||||
|
prog = _prog;
|
||||||
|
cmd = _cmd;
|
||||||
|
|
||||||
|
ctxt[0] = $"Do you want {node.name} node to run";
|
||||||
|
ctxt[1] = $"{prog} {cmd}";
|
||||||
|
ctxt[2] = $"Running unknown shell script can cause damage to your computer. Make sure you trust the author of the node before running it.";
|
||||||
|
|
||||||
|
draw_set_font(f_p0);
|
||||||
|
var _hh = string_height_ext(ctxt[0], -1, dialog_w - ui(48)) + ui(16);
|
||||||
|
|
||||||
|
draw_set_font(f_code);
|
||||||
|
_hh += string_height_ext(ctxt[1], -1, dialog_w - ui(64)) + ui(16);
|
||||||
|
|
||||||
|
draw_set_font(f_p0);
|
||||||
|
_hh += string_height_ext(ctxt[2], -1, dialog_w - ui(48));
|
||||||
|
|
||||||
|
dialog_h = _hh + ui(120);
|
||||||
|
dialog_y = WIN_H / 2 - dialog_h / 2;
|
||||||
|
}
|
||||||
|
#endregion
|
61
objects/o_dialog_run_shell/Draw_64.gml
Normal file
61
objects/o_dialog_run_shell/Draw_64.gml
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
/// @description init
|
||||||
|
if !ready exit;
|
||||||
|
|
||||||
|
#region dim BG
|
||||||
|
var lowest = true;
|
||||||
|
|
||||||
|
draw_set_color(c_black);
|
||||||
|
draw_set_alpha(0.5);
|
||||||
|
draw_rectangle(0, 0, WIN_W, WIN_H, false);
|
||||||
|
draw_set_alpha(1);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region base UI
|
||||||
|
draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h);
|
||||||
|
if(sFOCUS)
|
||||||
|
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region text
|
||||||
|
var py = dialog_y + ui(16);
|
||||||
|
var txt = __txt($"Running shell script");
|
||||||
|
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text);
|
||||||
|
draw_text(dialog_x + ui(24), py, txt);
|
||||||
|
py += line_get_height(, 8);
|
||||||
|
|
||||||
|
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
|
||||||
|
draw_text_ext(dialog_x + ui(24), py, ctxt[0], -1, dialog_w - ui(48));
|
||||||
|
py += string_height_ext(ctxt[0], -1, dialog_w - ui(48)) + ui(16);
|
||||||
|
|
||||||
|
draw_set_text(f_code, fa_left, fa_top, COLORS._main_text);
|
||||||
|
var _hh = string_height_ext(ctxt[1], -1, dialog_w - ui(64));
|
||||||
|
draw_sprite_stretched(THEME.ui_panel_inner_bg, 0, dialog_x + ui(24), py - ui(8), dialog_w - ui(48), _hh + ui(16));
|
||||||
|
draw_text_ext(dialog_x + ui(32), py, ctxt[1], -1, dialog_w - ui(64));
|
||||||
|
py += _hh + ui(16);
|
||||||
|
|
||||||
|
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
|
||||||
|
draw_text_ext(dialog_x + ui(24), py, ctxt[2], -1, dialog_w - ui(48));
|
||||||
|
py += string_height_ext(ctxt[2], -1, dialog_w - ui(48));
|
||||||
|
|
||||||
|
var bw = ui(96), bh = BUTTON_HEIGHT;
|
||||||
|
var bx1 = dialog_x + dialog_w - ui(16);
|
||||||
|
var by1 = dialog_y + dialog_h - ui(16);
|
||||||
|
var bx0 = bx1 - bw;
|
||||||
|
var by0 = by1 - bh;
|
||||||
|
|
||||||
|
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
|
||||||
|
var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
|
||||||
|
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Cancel"));
|
||||||
|
if(b == 2)
|
||||||
|
instance_destroy();
|
||||||
|
|
||||||
|
bx0 -= bw + ui(12);
|
||||||
|
var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
|
||||||
|
draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("run", "Run"));
|
||||||
|
if(b == 2) {
|
||||||
|
shell_execute(prog, cmd);
|
||||||
|
node.trusted = true;
|
||||||
|
|
||||||
|
instance_destroy();
|
||||||
|
}
|
||||||
|
#endregion
|
37
objects/o_dialog_run_shell/o_dialog_run_shell.yy
Normal file
37
objects/o_dialog_run_shell/o_dialog_run_shell.yy
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMObject",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "o_dialog_run_shell",
|
||||||
|
"eventList": [
|
||||||
|
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,},
|
||||||
|
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,},
|
||||||
|
],
|
||||||
|
"managed": true,
|
||||||
|
"overriddenProperties": [],
|
||||||
|
"parent": {
|
||||||
|
"name": "menu",
|
||||||
|
"path": "folders/dialog/menu.yy",
|
||||||
|
},
|
||||||
|
"parentObjectId": {
|
||||||
|
"name": "_p_dialog",
|
||||||
|
"path": "objects/_p_dialog/_p_dialog.yy",
|
||||||
|
},
|
||||||
|
"persistent": false,
|
||||||
|
"physicsAngularDamping": 0.1,
|
||||||
|
"physicsDensity": 0.5,
|
||||||
|
"physicsFriction": 0.2,
|
||||||
|
"physicsGroup": 1,
|
||||||
|
"physicsKinematic": false,
|
||||||
|
"physicsLinearDamping": 0.1,
|
||||||
|
"physicsObject": false,
|
||||||
|
"physicsRestitution": 0.1,
|
||||||
|
"physicsSensor": false,
|
||||||
|
"physicsShape": 1,
|
||||||
|
"physicsShapePoints": [],
|
||||||
|
"physicsStartAwake": true,
|
||||||
|
"properties": [],
|
||||||
|
"solid": false,
|
||||||
|
"spriteId": null,
|
||||||
|
"spriteMaskId": null,
|
||||||
|
"visible": true,
|
||||||
|
}
|
|
@ -73,10 +73,14 @@ function Node_Iterator(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
|
||||||
}
|
}
|
||||||
|
|
||||||
static iterationUpdate = function() {
|
static iterationUpdate = function() {
|
||||||
for( var i = 0; i < ds_list_size(nodes); i++ ) // check if every node is updated
|
|
||||||
if(!nodes[| i].rendered) return;
|
|
||||||
|
|
||||||
var maxIter = getIterationCount();
|
var maxIter = getIterationCount();
|
||||||
|
|
||||||
|
for( var i = 0; i < ds_list_size(nodes); i++ ) // check if every node is updated
|
||||||
|
if(!nodes[| i].rendered) {
|
||||||
|
LOG_LINE_IF(global.FLAG.render, $"------------------< Iteration update: {iterated} / {maxIter} [RENDER FAILED] >------------------");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
iterated++;
|
iterated++;
|
||||||
|
|
||||||
for( var i = 0; i < ds_list_size(nodes); i++ )
|
for( var i = 0; i < ds_list_size(nodes); i++ )
|
||||||
|
|
|
@ -30,7 +30,7 @@ function __3dObject() constructor {
|
||||||
size = new __vec3(1);
|
size = new __vec3(1);
|
||||||
|
|
||||||
materials = [];
|
materials = [];
|
||||||
matrial_index = [];
|
material_index = [];
|
||||||
texture_flip = false;
|
texture_flip = false;
|
||||||
|
|
||||||
static checkParameter = function(params = {}, forceUpdate = false) { #region
|
static checkParameter = function(params = {}, forceUpdate = false) { #region
|
||||||
|
@ -143,7 +143,7 @@ function __3dObject() constructor {
|
||||||
gpu_set_tex_repeat(true);
|
gpu_set_tex_repeat(true);
|
||||||
|
|
||||||
for( var i = 0, n = array_length(VB); i < n; i++ ) {
|
for( var i = 0, n = array_length(VB); i < n; i++ ) {
|
||||||
var _ind = array_safe_get(matrial_index, i, i);
|
var _ind = array_safe_get(material_index, i, i);
|
||||||
var _mat = array_safe_get(materials, _ind, noone);
|
var _mat = array_safe_get(materials, _ind, noone);
|
||||||
|
|
||||||
if(_shader == sh_d3d_default) {
|
if(_shader == sh_d3d_default) {
|
||||||
|
|
|
@ -184,21 +184,23 @@ function DirectoryObject(name, path) constructor {
|
||||||
ds_list_destroy(_temp_name);
|
ds_list_destroy(_temp_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static draw = function(parent, _x, _y, _m, _w, _hover, _focus, _homedir) {
|
static draw = function(parent, _x, _y, _m, _w, _hover, _focus, _homedir, _colors = {}) {
|
||||||
var hg = ui(28);
|
var hg = ui(28);
|
||||||
var hh = 0;
|
var hh = 0;
|
||||||
|
|
||||||
|
var color_selecting = struct_try_get(_colors, "selecting", COLORS.collection_path_current_bg);
|
||||||
|
|
||||||
if(path == parent.context.path)
|
if(path == parent.context.path)
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _x + ui(28), _y, _w - ui(36), hg, COLORS.collection_path_current_bg, 1);
|
draw_sprite_stretched_ext(THEME.group_label, 1, _x + ui(28), _y, _w - ui(36), hg, color_selecting, 1);
|
||||||
|
|
||||||
if(!ds_list_empty(subDir) && _hover && point_in_rectangle(_m[0], _m[1], _x, _y, ui(32), _y + hg - 1)) {
|
if(!ds_list_empty(subDir) && _hover && point_in_rectangle(_m[0], _m[1], _x, _y, ui(32), _y + hg - 1)) {
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _x, _y, ui(32), hg, COLORS.collection_path_current_bg, 1);
|
draw_sprite_stretched_ext(THEME.group_label, 1, _x, _y, ui(32), hg, color_selecting, 1);
|
||||||
if(mouse_press(mb_left, _focus))
|
if(mouse_press(mb_left, _focus))
|
||||||
open = !open;
|
open = !open;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_hover && point_in_rectangle(_m[0], _m[1], _x + ui(32), _y, _w, _y + hg - 1)) {
|
if(_hover && point_in_rectangle(_m[0], _m[1], _x + ui(32), _y, _w, _y + hg - 1)) {
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _x + ui(28), _y, _w - ui(36), hg, COLORS.collection_path_current_bg, 1);
|
draw_sprite_stretched_ext(THEME.group_label, 1, _x + ui(28), _y, _w - ui(36), hg, color_selecting, 1);
|
||||||
if(mouse_press(mb_left, _focus)) {
|
if(mouse_press(mb_left, _focus)) {
|
||||||
if(!ds_list_empty(subDir))
|
if(!ds_list_empty(subDir))
|
||||||
open = !open;
|
open = !open;
|
||||||
|
@ -224,7 +226,7 @@ function DirectoryObject(name, path) constructor {
|
||||||
if(open && !ds_list_empty(subDir)) {
|
if(open && !ds_list_empty(subDir)) {
|
||||||
var l_y = _y;
|
var l_y = _y;
|
||||||
for(var i = 0; i < ds_list_size(subDir); i++) {
|
for(var i = 0; i < ds_list_size(subDir); i++) {
|
||||||
var _hg = subDir[| i].draw(parent, _x + ui(16), _y, _m, _w - ui(16), _hover, _focus, _homedir);
|
var _hg = subDir[| i].draw(parent, _x + ui(16), _y, _m, _w - ui(16), _hover, _focus, _homedir, _colors);
|
||||||
draw_set_color(COLORS.collection_tree_line);
|
draw_set_color(COLORS.collection_tree_line);
|
||||||
draw_line(_x + ui(12), _y + hg / 2, _x + ui(16), _y + hg / 2);
|
draw_line(_x + ui(12), _y + hg / 2, _x + ui(16), _y + hg / 2);
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,9 @@ function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s =
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var sample = corner / 4;
|
var sample = floor(corner / 8);
|
||||||
sample = clamp(sample, 1, 8);
|
sample = clamp(sample, 0, 8);
|
||||||
|
if(sample == 0) corner = 0;
|
||||||
|
|
||||||
if(cx == noone) cx = (x0 + x1) / 2;
|
if(cx == noone) cx = (x0 + x1) / 2;
|
||||||
if(cy == noone) cy = (y0 + y1) / 2;
|
if(cy == noone) cy = (y0 + y1) / 2;
|
||||||
|
@ -210,8 +211,9 @@ function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s =
|
||||||
}
|
}
|
||||||
|
|
||||||
function draw_line_elbow_diag_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white, corner = 0, indexIn = 1, indexOut = 1, type = LINE_STYLE.solid) {
|
function draw_line_elbow_diag_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white, corner = 0, indexIn = 1, indexOut = 1, type = LINE_STYLE.solid) {
|
||||||
var sample = corner / 4;
|
var sample = floor(corner / 8);
|
||||||
sample = clamp(sample, 1, 8);
|
sample = clamp(sample, 0, 8);
|
||||||
|
if(sample == 0) corner = 0;
|
||||||
|
|
||||||
var rat = abs(x0 - x1) / (abs(x0 - x1) + abs(y0 - y1));
|
var rat = abs(x0 - x1) / (abs(x0 - x1) + abs(y0 - y1));
|
||||||
var colc = merge_color(col1, col2, rat);
|
var colc = merge_color(col1, col2, rat);
|
||||||
|
|
84
scripts/hotkey_data/hotkey_data.gml
Normal file
84
scripts/hotkey_data/hotkey_data.gml
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
#region
|
||||||
|
globalvar HOTKEYS_CUSTOM;
|
||||||
|
HOTKEYS_CUSTOM = {
|
||||||
|
"Node_Canvas": {
|
||||||
|
"Selection": new hotkeySimple("S"),
|
||||||
|
"Pencil": new hotkeySimple("B"),
|
||||||
|
"Eraser": new hotkeySimple("E"),
|
||||||
|
"Rectangle": new hotkeySimple("N"),
|
||||||
|
"Ellipse": new hotkeySimple("M"),
|
||||||
|
"Fill": new hotkeySimple("F"),
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region hotkeys
|
||||||
|
function hotkeySimple(_key) constructor {
|
||||||
|
self.key = _key;
|
||||||
|
}
|
||||||
|
|
||||||
|
function hotkeyObject(_context, _name, _key, _mod = MOD_KEY.none, _action = noone) constructor {
|
||||||
|
context = _context;
|
||||||
|
name = _name;
|
||||||
|
key = _key;
|
||||||
|
modi = _mod;
|
||||||
|
action = _action;
|
||||||
|
|
||||||
|
dKey = _key;
|
||||||
|
dModi = _mod;
|
||||||
|
|
||||||
|
static serialize = function() {
|
||||||
|
var ll = ds_list_create();
|
||||||
|
ll[| 0] = context;
|
||||||
|
ll[| 1] = name;
|
||||||
|
ll[| 2] = key;
|
||||||
|
ll[| 3] = modi;
|
||||||
|
return ll;
|
||||||
|
}
|
||||||
|
|
||||||
|
static deserialize = function(ll) {
|
||||||
|
key = ll[| 2];
|
||||||
|
modi = ll[| 3];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addHotkey(_context, _name, _key, _mod, _action) {
|
||||||
|
if(is_string(_key)) {
|
||||||
|
var ind = key_get_index(_key);
|
||||||
|
_key = ind? ind : ord(_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
var key = new hotkeyObject(_context, _name, _key, _mod, _action);
|
||||||
|
|
||||||
|
if(!ds_map_exists(HOTKEYS, _context)) {
|
||||||
|
HOTKEYS[? _context] = ds_list_create();
|
||||||
|
if(!ds_list_exist(HOTKEY_CONTEXT, _context))
|
||||||
|
ds_list_add(HOTKEY_CONTEXT, _context);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i = 0; i < ds_list_size(HOTKEYS[? _context]); i++) {
|
||||||
|
var hotkey = HOTKEYS[? _context][| i];
|
||||||
|
if(hotkey.name == key.name) {
|
||||||
|
delete HOTKEYS[? _context][| i];
|
||||||
|
HOTKEYS[? _context][| i] = key;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_context == "")
|
||||||
|
ds_list_insert(HOTKEYS[? _context], 0, key);
|
||||||
|
else
|
||||||
|
ds_list_add(HOTKEYS[? _context], key);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region functions
|
||||||
|
function getHotkey(_group, _key, _def = "") {
|
||||||
|
gml_pragma("forceinline");
|
||||||
|
|
||||||
|
if(!struct_has(HOTKEYS_CUSTOM, _group)) return def;
|
||||||
|
|
||||||
|
var _grp = HOTKEYS_CUSTOM[$ _group];
|
||||||
|
return struct_try_get(_grp, _key, _def);
|
||||||
|
}
|
||||||
|
#endregion
|
11
scripts/hotkey_data/hotkey_data.yy
Normal file
11
scripts/hotkey_data/hotkey_data.yy
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "hotkey_data",
|
||||||
|
"isCompatibility": false,
|
||||||
|
"isDnD": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "startup scripts",
|
||||||
|
"path": "folders/main/startup scripts.yy",
|
||||||
|
},
|
||||||
|
}
|
|
@ -25,7 +25,7 @@ function readMtl(path) {
|
||||||
var file = file_text_open_read(path);
|
var file = file_text_open_read(path);
|
||||||
while(!file_text_eof(file)) {
|
while(!file_text_eof(file)) {
|
||||||
var l = file_text_readln(file);
|
var l = file_text_readln(file);
|
||||||
l = string_replace_all(l, "\n", "");
|
l = string_trim(l);
|
||||||
|
|
||||||
var sep = string_splice(l, " ");
|
var sep = string_splice(l, " ");
|
||||||
if(array_length(sep) == 0 || sep[0] == "") continue;
|
if(array_length(sep) == 0 || sep[0] == "") continue;
|
||||||
|
@ -44,5 +44,7 @@ function readMtl(path) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file_text_close(file);
|
||||||
|
|
||||||
return mat;
|
return mat;
|
||||||
}
|
}
|
|
@ -41,6 +41,12 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
||||||
|
|
||||||
setIsDynamicInput(1);
|
setIsDynamicInput(1);
|
||||||
|
|
||||||
|
obj_reading = false;
|
||||||
|
obj_raw = noone;
|
||||||
|
obj_read_progress = 0;
|
||||||
|
obj_read_prog_sub = 0;
|
||||||
|
obj_read_prog_tot = 3;
|
||||||
|
|
||||||
current_path = "";
|
current_path = "";
|
||||||
materials = [];
|
materials = [];
|
||||||
materialNames = [];
|
materialNames = [];
|
||||||
|
@ -50,15 +56,9 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
||||||
insp1UpdateTooltip = __txt("Refresh");
|
insp1UpdateTooltip = __txt("Refresh");
|
||||||
insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ];
|
insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
static onInspector1Update = function() {
|
static onInspector1Update = function() { current_path = ""; }
|
||||||
var _path = getInputData(in_mesh + 0);
|
|
||||||
updateObj(_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
function setPath(path) {
|
function setPath(path) { inputs[| in_mesh + 0].setValue(path); }
|
||||||
inputs[| in_mesh + 0].setValue(path);
|
|
||||||
updateObj(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
static createNewInput = function(index = -1) { #region
|
static createNewInput = function(index = -1) { #region
|
||||||
if(index == -1) index = ds_list_size(inputs);
|
if(index == -1) index = ds_list_size(inputs);
|
||||||
|
@ -99,31 +99,62 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
||||||
if(!file_exists(_path)) return;
|
if(!file_exists(_path)) return;
|
||||||
current_path = _path;
|
current_path = _path;
|
||||||
|
|
||||||
var _dir = filename_dir(_path);
|
readObj_init();
|
||||||
var _pathMtl = string_copy(_path, 1, string_length(_path) - 4) + ".mtl";
|
|
||||||
|
|
||||||
var _v = readObj(_path);
|
obj_read_file = file_text_open_read(current_path);
|
||||||
if(_v == noone) return;
|
}
|
||||||
|
|
||||||
|
static updateObjProcess = function() {
|
||||||
|
switch(obj_read_progress) {
|
||||||
|
case 0 : readObj_file(); break;
|
||||||
|
case 1 : readObj_cent(); break;
|
||||||
|
case 2 : readObj_buff(); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static updateObjComplete = function() { #region
|
||||||
|
if(obj_raw == noone) return;
|
||||||
|
|
||||||
|
var txt = $"========== OBJ import ==========\n";
|
||||||
|
txt += $"Vertex counts: {obj_raw.vertex_count}\n";
|
||||||
|
txt += $"Object counts: {obj_raw.object_counts}\n";
|
||||||
|
txt += $"Material counts: {array_length(obj_raw.materials)}\n";
|
||||||
|
txt += $"Model BBOX: {obj_raw.model_size}\n";
|
||||||
|
print(txt);
|
||||||
|
|
||||||
|
var span = max(abs(obj_raw.model_size.x), abs(obj_raw.model_size.y), abs(obj_raw.model_size.z));
|
||||||
|
if(span > 10) noti_warning($"The model is tool large to display properly ({span}u). Scale the model down to preview.");
|
||||||
|
|
||||||
if(object != noone) object.destroy();
|
if(object != noone) object.destroy();
|
||||||
object = new __3dObject();
|
object = new __3dObject();
|
||||||
object.VB = _v.vertex_groups;
|
object.VB = obj_raw.vertex_groups;
|
||||||
object.vertex = _v.vertex;
|
object.vertex = obj_raw.vertex;
|
||||||
object.object_counts = _v.object_counts;
|
object.object_counts = obj_raw.object_counts;
|
||||||
|
object.size = obj_raw.model_size;
|
||||||
|
use_normal = obj_raw.use_normal;
|
||||||
|
|
||||||
object.size = _v.model_size;
|
|
||||||
materialNames = _v.materials;
|
|
||||||
materialIndex = _v.material_index;
|
|
||||||
use_normal = _v.use_normal;
|
|
||||||
if(_v.mtl_path != "")
|
|
||||||
_pathMtl = _dir + "/" + _v.mtl_path;
|
|
||||||
|
|
||||||
if(array_length(materialNames))
|
|
||||||
materials = readMtl(_pathMtl);
|
|
||||||
else {
|
|
||||||
materialNames = [ "Material" ];
|
materialNames = [ "Material" ];
|
||||||
materialIndex = [ 0 ];
|
materialIndex = [ 0 ];
|
||||||
materials = [ new MTLmaterial("Material") ];
|
materials = [ new MTLmaterial("Material") ];
|
||||||
|
|
||||||
|
if(array_length(materialNames)) {
|
||||||
|
var _dir = filename_dir(current_path);
|
||||||
|
var _pathMtl = string_copy(current_path, 1, string_length(current_path) - 4) + ".mtl";
|
||||||
|
if(obj_raw.mtl_path != "") _pathMtl = _dir + "/" + obj_raw.mtl_path;
|
||||||
|
materials = readMtl(_pathMtl);
|
||||||
|
|
||||||
|
if(array_length(materials) == array_length(obj_raw.materials)) {
|
||||||
|
materialNames = array_create(array_length(materials));
|
||||||
|
for( var i = 0, n = array_length(materials); i < n; i++ )
|
||||||
|
materialNames[i] = materials[i].name;
|
||||||
|
|
||||||
|
for( var i = 0, n = array_length(materials); i < n; i++ ) {
|
||||||
|
var _mat = obj_raw.materials[i];
|
||||||
|
var _ord = array_find(materialNames, _mat);
|
||||||
|
materialIndex[i] = _ord;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
noti_warning("Load mtl error: Material amount defined in .mtl file not match the .obj file.")
|
||||||
}
|
}
|
||||||
|
|
||||||
array_resize(input_display_list, input_display_len);
|
array_resize(input_display_list, input_display_len);
|
||||||
|
@ -139,15 +170,26 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() { #region
|
||||||
|
if(obj_reading) {
|
||||||
|
updateObjProcess();
|
||||||
|
|
||||||
|
if(obj_read_progress == obj_read_prog_tot) {
|
||||||
|
updateObjComplete();
|
||||||
|
obj_reading = false;
|
||||||
|
|
||||||
|
triggerRender();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var _path = getInputData(in_mesh + 0);
|
||||||
|
if(_path != current_path) updateObj(_path);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
||||||
var _path = _data[in_mesh + 0];
|
if(obj_reading) return noone;
|
||||||
var _flip = _data[in_mesh + 1];
|
|
||||||
|
|
||||||
if(_path != current_path)
|
var _flip = _data[in_mesh + 1];
|
||||||
updateObj(_path);
|
|
||||||
|
|
||||||
if(object == noone) return noone;
|
if(object == noone) return noone;
|
||||||
var materials = [];
|
var materials = [];
|
||||||
|
@ -161,7 +203,7 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
||||||
_object.vertex = object.vertex;
|
_object.vertex = object.vertex;
|
||||||
_object.object_counts = object.object_counts;
|
_object.object_counts = object.object_counts;
|
||||||
_object.materials = materials;
|
_object.materials = materials;
|
||||||
_object.matrial_index = materialIndex;
|
_object.material_index = materialIndex;
|
||||||
_object.texture_flip = _flip;
|
_object.texture_flip = _flip;
|
||||||
|
|
||||||
setTransform(_object, _data);
|
setTransform(_object, _data);
|
||||||
|
@ -169,4 +211,16 @@ function Node_3D_Mesh_Obj(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group)
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getPreviewValues = function() { return array_safe_get(all_inputs, in_mesh + 2, noone); }
|
static getPreviewValues = function() { return array_safe_get(all_inputs, in_mesh + 2, noone); }
|
||||||
|
|
||||||
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||||
|
if(!obj_reading) return;
|
||||||
|
|
||||||
|
var cx = xx + w * _s / 2;
|
||||||
|
var cy = yy + h * _s / 2;
|
||||||
|
var rr = min(w - 32, h - 32) * _s / 2;
|
||||||
|
|
||||||
|
draw_set_color(COLORS._main_icon);
|
||||||
|
//draw_arc(cx, cy, rr, 90, 90 - 360 * (obj_read_progress + obj_read_prog_sub) / obj_read_prog_tot, 4 * _s, 180);
|
||||||
|
draw_arc(cx, cy, rr, current_time / 5, current_time / 5 + 90, 4 * _s, 90);
|
||||||
|
}
|
||||||
}
|
}
|
63
scripts/node_array_convolute/node_array_convolute.gml
Normal file
63
scripts/node_array_convolute/node_array_convolute.gml
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
function Node_Array_Convolute(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
name = "Array Convulute";
|
||||||
|
previewable = false;
|
||||||
|
|
||||||
|
w = 96;
|
||||||
|
h = 32 + 24;
|
||||||
|
min_h = h;
|
||||||
|
|
||||||
|
inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||||
|
.setArrayDepth(1)
|
||||||
|
.setVisible(true, true);
|
||||||
|
|
||||||
|
inputs[| 1] = nodeValue("Kernel", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [])
|
||||||
|
.setArrayDepth(1)
|
||||||
|
.setVisible(true, true);
|
||||||
|
|
||||||
|
outputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0)
|
||||||
|
.setArrayDepth(1);
|
||||||
|
|
||||||
|
static convolute = function(arr, ker) {
|
||||||
|
__tmp_ker = ker;
|
||||||
|
__tmp_arr = arr;
|
||||||
|
__tmp_len = array_length(ker);
|
||||||
|
__tmp_arn = array_length(arr);
|
||||||
|
__tmp_st = floor((__tmp_len - 1) / 2);
|
||||||
|
|
||||||
|
return array_map(arr, function(val, ind) {
|
||||||
|
var ret = 0;
|
||||||
|
|
||||||
|
for(var i = 0; i < __tmp_len; i++) {
|
||||||
|
var _ind = ind + i - __tmp_st;
|
||||||
|
if(_ind < 0) continue;
|
||||||
|
if(_ind >= __tmp_arn) continue;
|
||||||
|
|
||||||
|
ret += __tmp_arr[_ind] * __tmp_ker[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static update = function(frame = PROJECT.animator.current_frame) {
|
||||||
|
var _arr = getInputData(0);
|
||||||
|
var _ker = getInputData(1);
|
||||||
|
|
||||||
|
if(array_empty(_arr) || array_empty(_ker)) return;
|
||||||
|
|
||||||
|
var res;
|
||||||
|
|
||||||
|
if(is_array(_arr[0])) {
|
||||||
|
for( var i = 0, n = array_length(_arr); i < n; i++ )
|
||||||
|
res[i] = convolute(_arr[i], _ker);
|
||||||
|
} else
|
||||||
|
res = convolute(_arr, _ker);
|
||||||
|
|
||||||
|
outputs[| 0].setValue(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||||
|
var bbox = drawGetBbox(xx, yy, _s);
|
||||||
|
draw_sprite_fit(s_node_array_convolute, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
|
||||||
|
}
|
||||||
|
}
|
11
scripts/node_array_convolute/node_array_convolute.yy
Normal file
11
scripts/node_array_convolute/node_array_convolute.yy
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "node_array_convolute",
|
||||||
|
"isCompatibility": false,
|
||||||
|
"isDnD": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "array",
|
||||||
|
"path": "folders/nodes/data/value/array.yy",
|
||||||
|
},
|
||||||
|
}
|
12
scripts/node_array_convolute/node_counter.yy
Normal file
12
scripts/node_array_convolute/node_counter.yy
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"isDnD": false,
|
||||||
|
"isCompatibility": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "variable",
|
||||||
|
"path": "folders/nodes/data/variable.yy",
|
||||||
|
},
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "node_counter",
|
||||||
|
"tags": [],
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
}
|
|
@ -9,7 +9,7 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
inputs[| 0] = nodeValue("Audio data", self, JUNCTION_CONNECT.input, VALUE_TYPE.audioBit, noone)
|
inputs[| 0] = nodeValue("Audio data", self, JUNCTION_CONNECT.input, VALUE_TYPE.audioBit, noone)
|
||||||
.setVisible(true, true);
|
.setVisible(true, true);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("Width", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 64, "Amount of bits to extract.");
|
inputs[| 1] = nodeValue("Width", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 4096, "Amount of bits to extract.");
|
||||||
|
|
||||||
inputs[| 2] = nodeValue("Location", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
inputs[| 2] = nodeValue("Location", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||||
.setDisplay(VALUE_DISPLAY._default, { unit: 0, side_button: button(function() {
|
.setDisplay(VALUE_DISPLAY._default, { unit: 0, side_button: button(function() {
|
||||||
|
@ -21,12 +21,12 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
inputs[| 3] = nodeValue("Cursor location", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
inputs[| 3] = nodeValue("Cursor location", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1)
|
||||||
.setDisplay(VALUE_DISPLAY.enum_button, [ "Start", "Middle", "End" ]);
|
.setDisplay(VALUE_DISPLAY.enum_button, [ "Start", "Middle", "End" ]);
|
||||||
|
|
||||||
inputs[| 4] = nodeValue("Step", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1);
|
inputs[| 4] = nodeValue("Step", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 16);
|
||||||
|
|
||||||
inputs[| 5] = nodeValue("Match animation", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Set window cursor to match animation timeline.");
|
inputs[| 5] = nodeValue("Match timeline", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Set window cursor to match animation timeline.");
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Bit Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, [])
|
outputs[| 0] = nodeValue("Bit Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, [])
|
||||||
.setArrayDepth(1);
|
.setArrayDepth(1);
|
||||||
|
@ -43,6 +43,7 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
var _anim = getInputData(5);
|
var _anim = getInputData(5);
|
||||||
|
|
||||||
inputs[| 2].setVisible(!_anim);
|
inputs[| 2].setVisible(!_anim);
|
||||||
|
update_on_frame = _anim;
|
||||||
}
|
}
|
||||||
|
|
||||||
static update = function(frame = PROJECT.animator.current_frame) {
|
static update = function(frame = PROJECT.animator.current_frame) {
|
||||||
|
@ -74,9 +75,10 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
case 2 : st = off - _wid; break;
|
case 2 : st = off - _wid; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ed = st + _wid;
|
|
||||||
st = clamp(st, 0, _aud.packet - 1);
|
st = clamp(st, 0, _aud.packet - 1);
|
||||||
ed = clamp(ed, 0, _aud.packet - 1);
|
|
||||||
|
ed = clamp(st + _wid, 0, _aud.packet - 1);
|
||||||
|
st = clamp(ed - _wid, 0, _aud.packet - 1);
|
||||||
len = (ed - st) / _stp;
|
len = (ed - st) / _stp;
|
||||||
|
|
||||||
preview_cr = off / _aud.packet;
|
preview_cr = off / _aud.packet;
|
||||||
|
|
|
@ -180,7 +180,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getNextNodesExternal = function() { #region //get node connected to the parent object
|
static getNextNodesExternal = function() { #region //get node connected to the parent object
|
||||||
LOG_IF(global.FLAG.render, $"Checking next node external for {internalName}");
|
LOG_IF(global.FLAG.render, $"Checking next node external for {INAME}");
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
|
|
||||||
var nodes = [];
|
var nodes = [];
|
||||||
|
@ -205,7 +205,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
|
|
||||||
static setRenderStatus = function(result) { #region
|
static setRenderStatus = function(result) { #region
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
LOG_IF(global.FLAG.render, $"Set render status for {internalName} : {result}");
|
LOG_IF(global.FLAG.render, $"Set render status for {INAME} : {result}");
|
||||||
rendered = result;
|
rendered = result;
|
||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
|
@ -444,7 +444,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
|
|
||||||
static resetRender = function() { #region
|
static resetRender = function() { #region
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
LOG_IF(global.FLAG.render, $"Reset Render for {internalName}");
|
LOG_IF(global.FLAG.render, $"Reset Render for {INAME}");
|
||||||
|
|
||||||
for( var i = 0; i < ds_list_size(nodes); i++ ) {
|
for( var i = 0; i < ds_list_size(nodes); i++ ) {
|
||||||
LOG_IF(global.FLAG.render, $"Reseting {nodes[| i].internalName}");
|
LOG_IF(global.FLAG.render, $"Reseting {nodes[| i].internalName}");
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
global.loop_nodes = [ "Node_Iterate", "Node_Iterate_Each" ];
|
global.loop_nodes = [ "Node_Iterate", "Node_Iterate_Each" ];
|
||||||
|
|
||||||
|
#macro INAME internalName == ""? name : internalName
|
||||||
|
|
||||||
enum CACHE_USE {
|
enum CACHE_USE {
|
||||||
none,
|
none,
|
||||||
manual,
|
manual,
|
||||||
|
@ -413,11 +415,12 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static getInputs = function() { #region
|
static getInputs = function() { #region
|
||||||
input_hash_raw = "";
|
|
||||||
inputs_data = array_create(ds_list_size(inputs), undefined);
|
inputs_data = array_create(ds_list_size(inputs), undefined);
|
||||||
|
//input_hash_raw = "";
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(inputs); i++) {
|
for(var i = 0; i < ds_list_size(inputs); i++) {
|
||||||
inputs_data[i] = inputs[| i].getValue(,,, true);
|
inputs_data[i] = inputs[| i].getValue(,,, true);
|
||||||
input_hash_raw += string_copy(string(inputs_data[i]), 1, 256);
|
//input_hash_raw += string_copy(string(inputs_data[i]), 1, 256);
|
||||||
}
|
}
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
@ -434,19 +437,23 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
|
|
||||||
if(cached_manual || (use_cache == CACHE_USE.auto && recoverCache())) {
|
if(cached_manual || (use_cache == CACHE_USE.auto && recoverCache())) {
|
||||||
render_cached = true;
|
render_cached = true;
|
||||||
|
|
||||||
|
if(!is_instanceof(self, Node_Collection)) setRenderStatus(true);
|
||||||
} else {
|
} else {
|
||||||
render_cached = false;
|
render_cached = false;
|
||||||
var sBase = surface_get_target();
|
var sBase = surface_get_target();
|
||||||
var _hash = input_hash;
|
//var _hash = input_hash;
|
||||||
getInputs();
|
getInputs();
|
||||||
input_hash = md5_string_unicode(input_hash_raw);
|
//input_hash = md5_string_unicode(input_hash_raw);
|
||||||
anim_last_step = isAnimated() || _hash != input_hash || !rendered;
|
anim_last_step = isAnimated() || /*_hash != input_hash || */!rendered;
|
||||||
|
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
LOG_IF(global.FLAG.render, $">>>>>>>>>> DoUpdate called from {internalName} [{anim_last_step}] [{update_on_frame}, {isAnimated()}, {_hash != input_hash}, {!rendered}] <<<<<<<<<<");
|
LOG_IF(global.FLAG.render, $">>>>>>>>>> DoUpdate called from {INAME} [{anim_last_step}] <<<<<<<<<<");
|
||||||
|
|
||||||
|
if(!is_instanceof(self, Node_Collection)) setRenderStatus(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(anim_last_step) update(); ///Update only if input hash differs from previous.
|
if(anim_last_step) update(); // Update only if input hash differs from previous.
|
||||||
} catch(exception) {
|
} catch(exception) {
|
||||||
var sCurr = surface_get_target();
|
var sCurr = surface_get_target();
|
||||||
while(surface_get_target() != sBase)
|
while(surface_get_target() != sBase)
|
||||||
|
@ -478,10 +485,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
|
|
||||||
if(autoUpdatedTrigger) updatedTrigger.setValue(true);
|
if(autoUpdatedTrigger) updatedTrigger.setValue(true);
|
||||||
|
|
||||||
if(!is_instanceof(self, Node_Collection)) {
|
if(!is_instanceof(self, Node_Collection))
|
||||||
setRenderStatus(true);
|
|
||||||
render_time = get_timer() - render_timer;
|
render_time = get_timer() - render_timer;
|
||||||
}
|
|
||||||
|
|
||||||
LOG_BLOCK_END();
|
LOG_BLOCK_END();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
@ -498,7 +503,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
|
|
||||||
static triggerRender = function() { #region
|
static triggerRender = function() { #region
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
LOG_IF(global.FLAG.render, $"Trigger render for {internalName}");
|
LOG_IF(global.FLAG.render, $"Trigger render for {INAME}");
|
||||||
|
|
||||||
setRenderStatus(false);
|
setRenderStatus(false);
|
||||||
UPDATE |= RENDER_TYPE.partial;
|
UPDATE |= RENDER_TYPE.partial;
|
||||||
|
@ -534,7 +539,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
if(!val_from.node.active) continue;
|
if(!val_from.node.active) continue;
|
||||||
if(!val_from.node.isRenderActive()) continue;
|
if(!val_from.node.isRenderActive()) continue;
|
||||||
if!(val_from.node.rendered || val_from.node.update_on_frame) {
|
if!(val_from.node.rendered || val_from.node.update_on_frame) {
|
||||||
LOG_LINE_IF(global.FLAG.render, $"Node {internalName} is not renderable because input {val_from.node.internalName} is not rendered ({val_from.node.rendered})");
|
LOG_LINE_IF(global.FLAG.render, $"Node {INAME} is not renderable because input {val_from.node.internalName} is not rendered ({val_from.node.rendered})");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -549,7 +554,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
var nodeNames = [];
|
var nodeNames = [];
|
||||||
|
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
LOG_IF(global.FLAG.render, $"→→→→→ Call get next node from: {internalName}");
|
LOG_IF(global.FLAG.render, $"→→→→→ Call get next node from: {INAME}");
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(outputs); i++) {
|
for(var i = 0; i < ds_list_size(outputs); i++) {
|
||||||
|
@ -587,7 +592,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
||||||
static onInspect = function() {}
|
static onInspect = function() {}
|
||||||
|
|
||||||
static setRenderStatus = function(result) { #region
|
static setRenderStatus = function(result) { #region
|
||||||
LOG_LINE_IF(global.FLAG.render, $"Set render status for {internalName} : {result}");
|
LOG_LINE_IF(global.FLAG.render, $"Set render status for {INAME} : {result}");
|
||||||
|
|
||||||
rendered = result;
|
rendered = result;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
global.__FRAME_LABEL_SCALE = 1;
|
||||||
|
|
||||||
function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
name = "Frame";
|
name = "Frame";
|
||||||
w = 240;
|
w = 240;
|
||||||
|
@ -13,6 +15,12 @@ function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
|
||||||
auto_height = false;
|
auto_height = false;
|
||||||
name_hover = false;
|
name_hover = false;
|
||||||
|
hover_progress = 0;
|
||||||
|
|
||||||
|
color = c_white;
|
||||||
|
alpha = 1;
|
||||||
|
scale = 1;
|
||||||
|
label_color = false;
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 240, 160 ] )
|
inputs[| 0] = nodeValue("Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 240, 160 ] )
|
||||||
.setDisplay(VALUE_DISPLAY.vector)
|
.setDisplay(VALUE_DISPLAY.vector)
|
||||||
|
@ -25,6 +33,18 @@ function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
.setDisplay(VALUE_DISPLAY.slider)
|
.setDisplay(VALUE_DISPLAY.slider)
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
|
|
||||||
|
inputs[| 3] = nodeValue("Label size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, global.__FRAME_LABEL_SCALE )
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider)
|
||||||
|
.rejectArray();
|
||||||
|
|
||||||
|
inputs[| 4] = nodeValue("Blend label", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 )
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider)
|
||||||
|
.rejectArray();
|
||||||
|
|
||||||
|
static onValueUpdate = function(index = 3) {
|
||||||
|
global.__FRAME_LABEL_SCALE = getInputData(3);
|
||||||
|
}
|
||||||
|
|
||||||
static step = function() {
|
static step = function() {
|
||||||
var si = getInputData(0);
|
var si = getInputData(0);
|
||||||
w = si[0];
|
w = si[0];
|
||||||
|
@ -32,22 +52,25 @@ function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
|
||||||
color = getInputData(1);
|
color = getInputData(1);
|
||||||
alpha = getInputData(2);
|
alpha = getInputData(2);
|
||||||
|
scale = getInputData(3);
|
||||||
|
label_color = getInputData(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static drawNodeBase = function(xx, yy, _s) {
|
static drawNodeBase = function(xx, yy, _s) {
|
||||||
draw_sprite_stretched_ext(bg_spr, 0, xx, yy, w * _s, h * _s, color, alpha);
|
draw_sprite_stretched_ext(bg_spr, 0, xx, yy, w * _s, h * _s, color, alpha);
|
||||||
var txt = display_name == ""? name : display_name;
|
var txt = display_name == ""? name : display_name;
|
||||||
|
|
||||||
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text);
|
hover_progress = lerp_float(hover_progress, name_hover, 2);
|
||||||
|
|
||||||
|
draw_set_text(f_h5, fa_left, fa_top, merge_color(COLORS._main_text, color, label_color));
|
||||||
draw_set_alpha(clamp(alpha + name_hover * 0.5, 0, 1));
|
draw_set_alpha(clamp(alpha + name_hover * 0.5, 0, 1));
|
||||||
draw_text_cut(xx + 24, yy + 4 * _s, txt, (w - 8) * _s - 24);
|
draw_text_cut(xx + 8 + 16 * hover_progress, yy + 4 * _s, txt, (w - 8) * _s - 24, scale);
|
||||||
draw_set_alpha(1);
|
draw_set_alpha(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_scale = 1;
|
draw_scale = 1;
|
||||||
static drawNode = function(_x, _y, _mx, _my, _s) {
|
static drawNode = function(_x, _y, _mx, _my, _s) {
|
||||||
draw_scale = _s;
|
draw_scale = _s;
|
||||||
//if(group != PANEL_GRAPH.getCurrentContext()) return;
|
|
||||||
|
|
||||||
if(size_dragging) {
|
if(size_dragging) {
|
||||||
w = size_dragging_w + (mouse_mx - size_dragging_mx) / _s;
|
w = size_dragging_w + (mouse_mx - size_dragging_mx) / _s;
|
||||||
|
@ -78,7 +101,7 @@ function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
var y0 = y1 - 16;
|
var y0 = y1 - 16;
|
||||||
var ics = 0.5;
|
var ics = 0.5;
|
||||||
|
|
||||||
draw_sprite_ext(THEME.node_move, 0, xx + 4, yy + 4 * _s, ics, ics, 0, c_white, 0.25 + 0.35 * name_hover);
|
if(name_hover) draw_sprite_ext(THEME.node_move, 0, xx + 4, yy + 4 * _s, ics, ics * scale, 0, color, 0.4);
|
||||||
|
|
||||||
if(point_in_rectangle(_mx, _my, xx, yy, x1, y1) || size_dragging)
|
if(point_in_rectangle(_mx, _my, xx, yy, x1, y1) || size_dragging)
|
||||||
draw_sprite_ext(THEME.node_resize, 0, x1 - 4, y1 - 4, ics, ics, 0, c_white, 0.5);
|
draw_sprite_ext(THEME.node_resize, 0, x1 - 4, y1 - 4, ics, ics, 0, c_white, 0.5);
|
||||||
|
|
|
@ -35,7 +35,7 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
}
|
}
|
||||||
|
|
||||||
static setRenderStatus = function(result) {
|
static setRenderStatus = function(result) {
|
||||||
LOG_LINE_IF(global.FLAG.render, $"Set render status for {internalName} : {result}");
|
LOG_LINE_IF(global.FLAG.render, $"Set render status for {INAME} : {result}");
|
||||||
|
|
||||||
rendered = result;
|
rendered = result;
|
||||||
if(group) group.setRenderStatus(result);
|
if(group) group.setRenderStatus(result);
|
||||||
|
|
|
@ -38,9 +38,6 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group
|
||||||
}
|
}
|
||||||
|
|
||||||
static update = function(frame = PROJECT.animator.current_frame) {
|
static update = function(frame = PROJECT.animator.current_frame) {
|
||||||
if(!variable_struct_exists(group, "iterated"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(inputs[| 0].value_from == noone) {
|
if(inputs[| 0].value_from == noone) {
|
||||||
group.iterationUpdate();
|
group.iterationUpdate();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -24,9 +24,6 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro
|
||||||
}
|
}
|
||||||
|
|
||||||
static update = function(frame = PROJECT.animator.current_frame) {
|
static update = function(frame = PROJECT.animator.current_frame) {
|
||||||
if(!variable_struct_exists(group, "iterated"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(inputs[| 0].value_from == noone) {
|
if(inputs[| 0].value_from == noone) {
|
||||||
group.iterationUpdate();
|
group.iterationUpdate();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -446,7 +446,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var base = getValue();
|
var base = prop.def_val;
|
||||||
|
|
||||||
for(var i = 0; i < array_length(_data); i++) {
|
for(var i = 0; i < array_length(_data); i++) {
|
||||||
var _keyframe = _data[i];
|
var _keyframe = _data[i];
|
||||||
|
@ -478,10 +478,11 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
||||||
if(is_array(value)) {
|
if(is_array(value)) {
|
||||||
for(var j = 0; j < array_length(value); j++)
|
for(var j = 0; j < array_length(value); j++)
|
||||||
_val[j] = processValue(value[j]);
|
_val[j] = processValue(value[j]);
|
||||||
} else if(is_array(base))
|
} else if(is_array(base)) {
|
||||||
for(var j = 0; j < array_length(base); j++)
|
for(var j = 0; j < array_length(base); j++)
|
||||||
_val[j] = processValue(value);
|
_val[j] = processValue(value);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//print($"Deserialize {prop.node.name}:{prop.name} = {_val} ");
|
//print($"Deserialize {prop.node.name}:{prop.name} = {_val} ");
|
||||||
var vk = new valueKey(_time, _val, self, ease_in, ease_out);
|
var vk = new valueKey(_time, _val, self, ease_in, ease_out);
|
||||||
|
|
|
@ -8,7 +8,9 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
previewable = false;
|
previewable = false;
|
||||||
|
|
||||||
isHovering = false;
|
isHovering = false;
|
||||||
hoverExpand = 0;
|
hover_scale = 0;
|
||||||
|
hover_scale_to = 0;
|
||||||
|
hover_alpha = 0;
|
||||||
|
|
||||||
bg_spr = THEME.node_pin_bg;
|
bg_spr = THEME.node_pin_bg;
|
||||||
bg_sel_spr = THEME.node_pin_bg_active;
|
bg_sel_spr = THEME.node_pin_bg_active;
|
||||||
|
@ -35,13 +37,15 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
var xx = x * _s + _x;
|
var xx = x * _s + _x;
|
||||||
var yy = y * _s + _y;
|
var yy = y * _s + _y;
|
||||||
|
|
||||||
inputs[| 0].x = xx - hoverExpand * 12 * _s;
|
inputs[| 0].x = xx;
|
||||||
inputs[| 0].y = yy;
|
inputs[| 0].y = yy;
|
||||||
|
|
||||||
outputs[| 0].x = xx + hoverExpand * 12 * _s;
|
outputs[| 0].x = xx;
|
||||||
outputs[| 0].y = yy;
|
outputs[| 0].y = yy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static drawJunctionNames = function(_x, _y, _mx, _my, _s) {}
|
||||||
|
|
||||||
static drawJunctions = function(_x, _y, _mx, _my, _s) {
|
static drawJunctions = function(_x, _y, _mx, _my, _s) {
|
||||||
isHovering = false;
|
isHovering = false;
|
||||||
var hover = noone;
|
var hover = noone;
|
||||||
|
@ -49,27 +53,13 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
var yy = y * _s + _y;
|
var yy = y * _s + _y;
|
||||||
var hov = PANEL_GRAPH.value_dragging;
|
var hov = PANEL_GRAPH.value_dragging;
|
||||||
|
|
||||||
if(hov == noone && point_in_rectangle(_mx, _my, xx - 16 * _s, yy - 12 * _s, xx + 16 * _s, yy + 12 * _s)) {
|
if(hov == noone && point_in_circle(_mx, _my, xx, yy, _s * 24)) {
|
||||||
isHovering = true;
|
isHovering = true;
|
||||||
|
hover_scale_to = 1;
|
||||||
draw_sprite_stretched(THEME.node_bg, 0, xx - 12 * _s, yy - 12 * _s, 24 * _s, 24 * _s);
|
|
||||||
if(inputs[| 0].drawJunction(_s, _mx, _my))
|
|
||||||
hover = inputs[| 0];
|
|
||||||
if(outputs[| 0].drawJunction(_s, _mx, _my))
|
|
||||||
hover = outputs[| 0];
|
|
||||||
} else if(hoverExpand > 0) {
|
|
||||||
inputs[| 0].drawJunction(_s, _mx, _my)
|
|
||||||
outputs[| 0].drawJunction(_s, _mx, _my)
|
|
||||||
} else {
|
|
||||||
var jun;
|
|
||||||
if(hov != noone) jun = hov.connect_type == JUNCTION_CONNECT.input? outputs[| 0] : inputs[| 0];
|
|
||||||
else jun = inputs[| 0].value_from == noone? inputs[| 0] : outputs[| 0];
|
|
||||||
|
|
||||||
if(jun.drawJunction(_s, _mx, _my))
|
|
||||||
hover = jun;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hoverExpand = lerp(hoverExpand, isHovering, 1 / 5);
|
if(outputs[| 0].drawJunction(_s, _mx, _my))
|
||||||
|
hover = outputs[| 0];
|
||||||
|
|
||||||
return hover;
|
return hover;
|
||||||
}
|
}
|
||||||
|
@ -80,11 +70,18 @@ function Node_Pin(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
var xx = x * _s + _x;
|
var xx = x * _s + _x;
|
||||||
var yy = y * _s + _y;
|
var yy = y * _s + _y;
|
||||||
|
|
||||||
|
hover_alpha = 0.5;
|
||||||
if(active_draw_index > -1) {
|
if(active_draw_index > -1) {
|
||||||
draw_sprite_ext(bg_sel_spr, 0, xx, yy, _s, _s, 0, COLORS._main_accent, 1);
|
hover_alpha = 1;
|
||||||
|
hover_scale_to = 1;
|
||||||
active_draw_index = -1;
|
active_draw_index = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(hover_scale > 0)
|
||||||
|
draw_sprite_ext(THEME.node_pin_bg_active, 0, xx, yy, _s * hover_scale, _s * hover_scale, 0, COLORS._main_accent, hover_alpha);
|
||||||
|
hover_scale = lerp_float(hover_scale, hover_scale_to, 3);
|
||||||
|
hover_scale_to = 0;
|
||||||
|
|
||||||
if(renamed && display_name != "" && display_name != "Pin") {
|
if(renamed && display_name != "" && display_name != "Pin") {
|
||||||
draw_set_text(f_p0, fa_center, fa_bottom, COLORS._main_text);
|
draw_set_text(f_p0, fa_center, fa_bottom, COLORS._main_text);
|
||||||
draw_text_transformed(xx, yy - 12, display_name, _s, _s, 0);
|
draw_text_transformed(xx, yy - 12, display_name, _s, _s, 0);
|
||||||
|
|
|
@ -22,9 +22,9 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
inputs[| 7] = nodeValue("Graph Thickness", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1);
|
inputs[| 7] = nodeValue("Graph Thickness", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1);
|
||||||
|
|
||||||
inputs[| 8] = nodeValue("Use Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
inputs[| 8] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||||
|
|
||||||
inputs[| 9] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_black);
|
inputs[| 9] = nodeValue("Background color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_black);
|
||||||
|
|
||||||
inputs[| 10] = nodeValue("Direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
inputs[| 10] = nodeValue("Direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
.setDisplay(VALUE_DISPLAY.rotation);
|
.setDisplay(VALUE_DISPLAY.rotation);
|
||||||
|
@ -59,12 +59,17 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
inputs[| 23] = nodeValue("Smooth", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
inputs[| 23] = nodeValue("Smooth", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||||
.setDisplay(VALUE_DISPLAY.slider);
|
.setDisplay(VALUE_DISPLAY.slider);
|
||||||
|
|
||||||
|
inputs[| 24] = nodeValue("Color Over Value", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(c_white));
|
||||||
|
|
||||||
|
inputs[| 25] = nodeValue("Value range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ] )
|
||||||
|
.setDisplay(VALUE_DISPLAY.range);
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
input_display_list = [ 0,
|
input_display_list = [ 0,
|
||||||
["Data", true], 1, 12, 21, 14, 2, 3, 15, 16,
|
["Data", true], 1, 12, 21, 14, 2, 3, 15, 16,
|
||||||
["Plot", false], 11, 4, 10, 20, 5, 17, 22, 23,
|
["Plot", false], 11, 4, 10, 20, 5, 22, 23,
|
||||||
["Render", false], 6, 13, 7, 18, 19, 8, 9,
|
["Render", false], 6, 13, 24, 25, 7, 17, 18, 19, 8, 9,
|
||||||
];
|
];
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
@ -105,14 +110,12 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
var _sam = _data[ 3]; _sam = max(1, _sam);
|
var _sam = _data[ 3]; _sam = max(1, _sam);
|
||||||
var _ori = _data[ 4];
|
var _ori = _data[ 4];
|
||||||
var _amp = _data[ 5];
|
var _amp = _data[ 5];
|
||||||
var _lcl = _data[ 6];
|
|
||||||
var _lth = _data[ 7];
|
var _lth = _data[ 7];
|
||||||
var _ubg = _data[ 8];
|
var _ubg = _data[ 8];
|
||||||
var _bgc = _data[ 9];
|
var _bgc = _data[ 9];
|
||||||
var _ang = _data[10];
|
var _ang = _data[10];
|
||||||
var _typ = _data[11];
|
var _typ = _data[11];
|
||||||
var _off = _data[12];
|
var _off = _data[12];
|
||||||
var _grd = _data[13];
|
|
||||||
|
|
||||||
var _trim_mode = _data[14];
|
var _trim_mode = _data[14];
|
||||||
var _win_size = _data[15];
|
var _win_size = _data[15];
|
||||||
|
@ -128,6 +131,11 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
var _loop = _data[22];
|
var _loop = _data[22];
|
||||||
var _smt = _data[23];
|
var _smt = _data[23];
|
||||||
|
|
||||||
|
var _lcl = _data[ 6];
|
||||||
|
var _cls = _data[13];
|
||||||
|
var _clv = _data[24];
|
||||||
|
var _clv_r = _data[25];
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_target(_outSurf);
|
||||||
|
@ -165,9 +173,10 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
}
|
}
|
||||||
|
|
||||||
var amo = array_length(_smp_data);
|
var amo = array_length(_smp_data);
|
||||||
var _px, _py, _ang_nor, _val, _grd_col;
|
var _px, _py, _ang_nor, _val, _col_sam, _col_val;
|
||||||
var _pnt, _ppnt = undefined;
|
var _pnt, _ppnt = undefined;
|
||||||
var _bar_spc = _typ == 1? _pnt_spac : _pnt_spac + _bar_wid;
|
var _bar_spc = _typ == 1? _pnt_spac + 1 : _pnt_spac + _bar_wid;
|
||||||
|
var _oc;
|
||||||
|
|
||||||
for( var i = 0; i < amo; i++ ) {
|
for( var i = 0; i < amo; i++ ) {
|
||||||
if(_path == noone) {
|
if(_path == noone) {
|
||||||
|
@ -175,8 +184,7 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
_py = _ori[1] + lengthdir_y(i * _bar_spc, _ang);
|
_py = _ori[1] + lengthdir_y(i * _bar_spc, _ang);
|
||||||
} else {
|
} else {
|
||||||
_pnt = _path.getPointRatio(i / amo);
|
_pnt = _path.getPointRatio(i / amo);
|
||||||
if(_ppnt == undefined)
|
_ppnt ??= _path.getPointRatio(i / amo - 0.001);
|
||||||
_ppnt = _path.getPointRatio(i / amo - 0.001);
|
|
||||||
|
|
||||||
_px = _pnt.x;
|
_px = _pnt.x;
|
||||||
_py = _pnt.y;
|
_py = _pnt.y;
|
||||||
|
@ -186,11 +194,15 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
}
|
}
|
||||||
|
|
||||||
_ang_nor = _ang + 90;
|
_ang_nor = _ang + 90;
|
||||||
|
|
||||||
_val = _smp_data[i] + _off;
|
_val = _smp_data[i] + _off;
|
||||||
|
_col_sam = _cls.eval(i / amo);
|
||||||
|
_col_val = _clv.eval((_val - _clv_r[0]) - (_clv_r[1] - _clv_r[0]));
|
||||||
|
|
||||||
_grd_col = _grd.eval(i / amo);
|
var _c1 = colorMultiply(_lcl, _col_sam);
|
||||||
draw_set_color(colorMultiply(_lcl, _grd_col));
|
var _c2 = _col_val;
|
||||||
|
var _col_final = colorMultiply(_c1, _c2);
|
||||||
|
|
||||||
|
draw_set_color(_col_final);
|
||||||
|
|
||||||
nx = _px + lengthdir_x(_amp * _val, _ang_nor);
|
nx = _px + lengthdir_x(_amp * _val, _ang_nor);
|
||||||
ny = _py + lengthdir_y(_amp * _val, _ang_nor);
|
ny = _py + lengthdir_y(_amp * _val, _ang_nor);
|
||||||
|
@ -209,10 +221,6 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
var _b1x = nx + lengthdir_x(dist * _smt, _ang + 180);
|
var _b1x = nx + lengthdir_x(dist * _smt, _ang + 180);
|
||||||
var _b1y = ny + lengthdir_y(dist * _smt, _ang + 180);
|
var _b1y = ny + lengthdir_y(dist * _smt, _ang + 180);
|
||||||
|
|
||||||
//draw_line(ox, oy, _b0x, _b0y);
|
|
||||||
//draw_line(_b0x, _b0y, _b1x, _b1y);
|
|
||||||
//draw_line(_b1x, _b1y, nx, ny);
|
|
||||||
|
|
||||||
var _ox = ox, _oy = oy, _nx, _ny;
|
var _ox = ox, _oy = oy, _nx, _ny;
|
||||||
|
|
||||||
for( var j = 1; j <= 8; j++ ) {
|
for( var j = 1; j <= 8; j++ ) {
|
||||||
|
@ -227,8 +235,8 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
_oy = _ny;
|
_oy = _ny;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(_lth > 1) draw_line_round(ox, oy, nx, ny, _lth);
|
if(_lth > 1) draw_line_round_color(ox, oy, nx, ny, _lth, _oc, _col_final);
|
||||||
else draw_line(ox, oy, nx, ny);
|
else draw_line_color(ox, oy, nx, ny, _oc, _col_final);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -236,6 +244,7 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
ox = nx;
|
ox = nx;
|
||||||
oy = ny;
|
oy = ny;
|
||||||
|
_oc = _col_final;
|
||||||
|
|
||||||
if(i == 0) {
|
if(i == 0) {
|
||||||
fx = nx;
|
fx = nx;
|
||||||
|
|
|
@ -548,6 +548,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
|
||||||
addNodeObject(values, "Array Shift", s_node_array_shift, "Node_Array_Shift", [1, Node_Array_Shift]).setVersion(1137);
|
addNodeObject(values, "Array Shift", s_node_array_shift, "Node_Array_Shift", [1, Node_Array_Shift]).setVersion(1137);
|
||||||
addNodeObject(values, "Array Zip", s_node_array_zip, "Node_Array_Zip", [1, Node_Array_Zip]).setVersion(1138);
|
addNodeObject(values, "Array Zip", s_node_array_zip, "Node_Array_Zip", [1, Node_Array_Zip]).setVersion(1138);
|
||||||
addNodeObject(values, "Array Copy", s_node_array_copy, "Node_Array_Copy", [1, Node_Array_Copy]).setVersion(1144);
|
addNodeObject(values, "Array Copy", s_node_array_copy, "Node_Array_Copy", [1, Node_Array_Copy]).setVersion(1144);
|
||||||
|
addNodeObject(values, "Array Convolute",s_node_array_convolute, "Node_Array_Convolute", [1, Node_Array_Convolute]).setVersion(11540);
|
||||||
addNodeObject(values, "Sort Number", s_node_array_sort, "Node_Array_Sort", [1, Node_Array_Sort], ["array sort"]).setVersion(1120);
|
addNodeObject(values, "Sort Number", s_node_array_sort, "Node_Array_Sort", [1, Node_Array_Sort], ["array sort"]).setVersion(1120);
|
||||||
addNodeObject(values, "Shuffle Array", s_node_array_shuffle, "Node_Array_Shuffle", [1, Node_Array_Shuffle], ["array shuffle"]).setVersion(1120);
|
addNodeObject(values, "Shuffle Array", s_node_array_shuffle, "Node_Array_Shuffle", [1, Node_Array_Shuffle], ["array shuffle"]).setVersion(1120);
|
||||||
addNodeObject(values, "Loop Array", s_node_loop_array, "Node_Iterate_Each", [1, Node_Iterate_Each], ["iterate each", "for each", "array loop"], "Create group that iterate to each member in an array.");
|
addNodeObject(values, "Loop Array", s_node_loop_array, "Node_Iterate_Each", [1, Node_Iterate_Each], ["iterate each", "for each", "array loop"], "Create group that iterate to each member in an array.");
|
||||||
|
|
|
@ -8,6 +8,8 @@ function Node_Rigid_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
.setDisplay(VALUE_DISPLAY.vector)
|
.setDisplay(VALUE_DISPLAY.vector)
|
||||||
.rejectArray();
|
.rejectArray();
|
||||||
|
|
||||||
|
inputs[| 1] = nodeValue("Round position", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
setIsDynamicInput(1);
|
setIsDynamicInput(1);
|
||||||
|
@ -64,6 +66,7 @@ function Node_Rigid_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var _dim = getInputData(0);
|
var _dim = getInputData(0);
|
||||||
|
var _rnd = getInputData(1);
|
||||||
var _outSurf = outputs[| 0].getValue();
|
var _outSurf = outputs[| 0].getValue();
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
@ -95,8 +98,8 @@ function Node_Rigid_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
||||||
var ixs = max(0, _o.xscale);
|
var ixs = max(0, _o.xscale);
|
||||||
var iys = max(0, _o.yscale);
|
var iys = max(0, _o.yscale);
|
||||||
|
|
||||||
var xx = _o.phy_position_x;
|
var xx = _rnd? round(_o.phy_position_x) : _o.phy_position_x;
|
||||||
var yy = _o.phy_position_y;
|
var yy = _rnd? round(_o.phy_position_y) : _o.phy_position_y;
|
||||||
|
|
||||||
draw_surface_ext_safe(_o.surface, xx, yy, ixs, iys, _o.image_angle, _o.image_blend, _o.image_alpha);
|
draw_surface_ext_safe(_o.surface, xx, yy, ixs, iys, _o.image_angle, _o.image_blend, _o.image_alpha);
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
outputs[| 1] = nodeValue("Boundary data", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, []);
|
outputs[| 1] = nodeValue("Atlas", self, JUNCTION_CONNECT.output, VALUE_TYPE.atlas, []);
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Shape", false], 0, 1, 4,
|
["Shape", false], 0, 1, 4,
|
||||||
|
@ -35,7 +35,7 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
surface_w = 1;
|
surface_w = 1;
|
||||||
surface_h = 1;
|
surface_h = 1;
|
||||||
|
|
||||||
attributes.max_shape = 32;
|
attributes.max_shape = 64;
|
||||||
array_push(attributeEditors, ["Maximum shapes", function() { return attributes.max_shape; },
|
array_push(attributeEditors, ["Maximum shapes", function() { return attributes.max_shape; },
|
||||||
new textBox(TEXTBOX_INPUT.number, function(val) {
|
new textBox(TEXTBOX_INPUT.number, function(val) {
|
||||||
attributes.max_shape = val;
|
attributes.max_shape = val;
|
||||||
|
@ -80,60 +80,53 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
}
|
}
|
||||||
|
|
||||||
shader_set(sh_seperate_shape_index);
|
#region region indexing
|
||||||
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_index, "ignore"), _ignore);
|
surface_set_shader(temp_surface[1], sh_seperate_shape_index);
|
||||||
surface_set_target(temp_surface[1]);
|
shader_set_i("ignore", _ignore);
|
||||||
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, ww, hh);
|
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, ww, hh);
|
||||||
surface_reset_target();
|
surface_reset_shader();
|
||||||
shader_reset();
|
|
||||||
|
|
||||||
shader_set(sh_seperate_shape_ite);
|
shader_set(sh_seperate_shape_ite);
|
||||||
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_ite, "ignore"), _ignore);
|
shader_set_i("ignore", _ignore);
|
||||||
shader_set_uniform_f(shader_get_uniform(sh_seperate_shape_ite, "dimension"), ww, hh);
|
shader_set_f("dimension", ww, hh);
|
||||||
shader_set_uniform_f(shader_get_uniform(sh_seperate_shape_ite, "threshold"), _thres);
|
shader_set_f("threshold", _thres);
|
||||||
if(is_surface(_inSurf))
|
shader_set_surface("map", _inSurf);
|
||||||
texture_set_stage(shader_get_sampler_index(sh_seperate_shape_ite, "map"), surface_get_texture(_inSurf));
|
shader_reset();
|
||||||
|
|
||||||
var res_index = 0, iteration = ww + hh;
|
var res_index = 0, iteration = ww + hh;
|
||||||
for(var i = 0; i <= iteration; i++) {
|
for(var i = 0; i <= iteration; i++) {
|
||||||
var bg = i % 2;
|
var bg = i % 2;
|
||||||
var fg = !bg;
|
var fg = !bg;
|
||||||
|
|
||||||
surface_set_target(temp_surface[bg]);
|
surface_set_shader(temp_surface[bg], sh_seperate_shape_ite,, BLEND.over);
|
||||||
DRAW_CLEAR
|
|
||||||
BLEND_OVERRIDE;
|
|
||||||
draw_surface_safe(temp_surface[fg], 0, 0);
|
draw_surface_safe(temp_surface[fg], 0, 0);
|
||||||
BLEND_NORMAL;
|
surface_reset_shader();
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
res_index = bg;
|
res_index = bg;
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
shader_reset();
|
#region count and match color
|
||||||
|
|
||||||
var _pixel_surface = surface_create_valid(attributes.max_shape, 1);
|
var _pixel_surface = surface_create_valid(attributes.max_shape, 1);
|
||||||
surface_set_target(_pixel_surface);
|
surface_set_shader(_pixel_surface, sh_seperate_shape_counter);
|
||||||
DRAW_CLEAR
|
shader_set_surface("surface", temp_surface[res_index]);
|
||||||
BLEND_OVERRIDE;
|
shader_set_f("dimension", [ ww, hh ]);
|
||||||
shader_set(sh_seperate_shape_counter);
|
shader_set_i("maxShape", attributes.max_shape);
|
||||||
texture_set_stage(shader_get_sampler_index(sh_seperate_shape_counter, "surface"), surface_get_texture(temp_surface[res_index]));
|
shader_set_i("ignore", _ignore);
|
||||||
shader_set_uniform_f_array_safe(shader_get_uniform(sh_seperate_shape_counter, "dimension"), [ ww, hh ]);
|
|
||||||
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_counter, "maxShape"), attributes.max_shape);
|
|
||||||
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_counter, "ignore"), _ignore);
|
|
||||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, attributes.max_shape, 1, 0, c_white, 1);
|
draw_sprite_ext(s_fx_pixel, 0, 0, 0, attributes.max_shape, 1, 0, c_white, 1);
|
||||||
shader_reset();
|
surface_reset_shader();
|
||||||
BLEND_NORMAL;
|
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
var px = surface_get_pixel(_pixel_surface, 0, 0);
|
var px = surface_get_pixel(_pixel_surface, 0, 0);
|
||||||
|
|
||||||
if(px == 0) return;
|
if(px == 0) return;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region extract region
|
||||||
var _outSurf, _val;
|
var _outSurf, _val;
|
||||||
_val = array_create(px);
|
_val = array_create(px);
|
||||||
outputs[| 0].setValue(_val);
|
outputs[| 0].setValue(_val);
|
||||||
|
|
||||||
var _boundary = array_create(px);
|
var _atlas = array_create(px);
|
||||||
|
|
||||||
buffer_delete(surface_buffer);
|
buffer_delete(surface_buffer);
|
||||||
surface_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2);
|
surface_buffer = buffer_create(ww * hh * 4, buffer_fixed, 2);
|
||||||
|
@ -143,10 +136,7 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
_outSurf = surface_create_valid(ww, hh);
|
_outSurf = surface_create_valid(ww, hh);
|
||||||
_val[i] = _outSurf;
|
_val[i] = _outSurf;
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_seperate_shape_sep);
|
||||||
DRAW_CLEAR
|
|
||||||
BLEND_OVERRIDE;
|
|
||||||
shader_set(sh_seperate_shape_sep);
|
|
||||||
var ccx = surface_get_pixel_ext(_pixel_surface, 1 + i, 0);
|
var ccx = surface_get_pixel_ext(_pixel_surface, 1 + i, 0);
|
||||||
var alpha = (ccx >> 24) & 255;
|
var alpha = (ccx >> 24) & 255;
|
||||||
var blue = (ccx >> 16) & 255;
|
var blue = (ccx >> 16) & 255;
|
||||||
|
@ -173,19 +163,19 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
r = max(r, j);
|
r = max(r, j);
|
||||||
}
|
}
|
||||||
|
|
||||||
_boundary[i] = [l, t, r, b];
|
_atlas[i] = [l, t, r, b];
|
||||||
|
_atlas[i] = new SurfaceAtlas(_outSurf, [ r.x + _spac, r.y + _spac ]);
|
||||||
|
|
||||||
|
shader_set_surface("original", _inSurf);
|
||||||
|
shader_set_f("color", red, green, blue, alpha);
|
||||||
|
shader_set_i("override", _ovr);
|
||||||
|
shader_set_f("overColor", colToVec4(_ovrclr));
|
||||||
|
|
||||||
if(is_surface(_inSurf))
|
|
||||||
texture_set_stage(shader_get_sampler_index(sh_seperate_shape_sep, "original"), surface_get_texture(_inSurf));
|
|
||||||
shader_set_uniform_f(shader_get_uniform(sh_seperate_shape_sep, "color"), red, green, blue, alpha);
|
|
||||||
shader_set_uniform_i(shader_get_uniform(sh_seperate_shape_sep, "override"), _ovr);
|
|
||||||
shader_set_uniform_f_array_safe(shader_get_uniform(sh_seperate_shape_sep, "overColor"), colToVec4(_ovrclr));
|
|
||||||
draw_surface_safe(temp_surface[res_index], 0, 0);
|
draw_surface_safe(temp_surface[res_index], 0, 0);
|
||||||
shader_reset();
|
surface_reset_shader();
|
||||||
BLEND_NORMAL;
|
|
||||||
surface_reset_target();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
outputs[| 1].setValue(_boundary,,, false);
|
outputs[| 1].setValue(_atlas);
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -12,14 +12,25 @@ function Node_Shell(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
insp1UpdateTooltip = "Run";
|
insp1UpdateTooltip = "Run";
|
||||||
insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
|
trusted = false;
|
||||||
|
|
||||||
|
static onValueUpdate = function() {
|
||||||
|
trusted = false;
|
||||||
|
}
|
||||||
|
|
||||||
static onInspector1Update = function() { update(); }
|
static onInspector1Update = function() { update(); }
|
||||||
|
|
||||||
static update = function() {
|
static update = function() {
|
||||||
var _pro = getInputData(0);
|
var _pro = getInputData(0);
|
||||||
var _scr = getInputData(1);
|
var _scr = getInputData(1);
|
||||||
if(_pro == "") return;
|
if(_pro == "" || _scr == "") return;
|
||||||
|
|
||||||
|
if(trusted) {
|
||||||
shell_execute(_pro, _scr);
|
shell_execute(_pro, _scr);
|
||||||
|
} else {
|
||||||
|
var dia = dialogCall(o_dialog_run_shell);
|
||||||
|
dia.setData(self, _pro, _scr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
function NodeTool(name, spr) constructor {
|
function NodeTool(name, spr) constructor {
|
||||||
|
node = other;
|
||||||
self.name = name;
|
self.name = name;
|
||||||
self.spr = spr;
|
self.spr = spr;
|
||||||
|
|
||||||
|
@ -7,9 +8,19 @@ function NodeTool(name, spr) constructor {
|
||||||
settings = [];
|
settings = [];
|
||||||
attribute = {};
|
attribute = {};
|
||||||
|
|
||||||
|
static checkHotkey = function() {
|
||||||
|
gml_pragma("forceinline");
|
||||||
|
|
||||||
|
return getHotkey(instanceof(node), name);
|
||||||
|
}
|
||||||
|
|
||||||
static getName = function(index = 0) {
|
static getName = function(index = 0) {
|
||||||
if(is_array(name)) return array_safe_get(name, index, "");
|
var _key = checkHotkey();
|
||||||
return name;
|
|
||||||
|
var _nme = is_array(name)? array_safe_get(name, index, "") : name;
|
||||||
|
if(_key != "") _nme += $" ({_key})";
|
||||||
|
|
||||||
|
return _nme;
|
||||||
}
|
}
|
||||||
|
|
||||||
static addSetting = function(name, type, onEdit, keyAttr, val) {
|
static addSetting = function(name, type, onEdit, keyAttr, val) {
|
||||||
|
@ -48,5 +59,21 @@ function NodeTool(name, spr) constructor {
|
||||||
onToggle();
|
onToggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static toggleKeyboard = function() {
|
||||||
|
if(subtools == 0) {
|
||||||
|
PANEL_PREVIEW.tool_current = PANEL_PREVIEW.tool_current == self? noone : self;
|
||||||
|
} else if(PANEL_PREVIEW.tool_current != self) {
|
||||||
|
PANEL_PREVIEW.tool_current = self;
|
||||||
|
selecting = 0;
|
||||||
|
} else if(selecting == subtools - 1) {
|
||||||
|
PANEL_PREVIEW.tool_current = noone;
|
||||||
|
selecting = 0;
|
||||||
|
} else
|
||||||
|
selecting++;
|
||||||
|
|
||||||
|
if(PANEL_PREVIEW.tool_current == self)
|
||||||
|
onToggle();
|
||||||
|
}
|
||||||
|
|
||||||
static onToggle = function() {}
|
static onToggle = function() {}
|
||||||
}
|
}
|
|
@ -127,7 +127,7 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
var k = ds_map_find_first(TUNNELS_OUT);
|
var k = ds_map_find_first(TUNNELS_OUT);
|
||||||
|
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
LOG_IF(global.FLAG.render, $"→→→→→ Call get next node from: {internalName}");
|
LOG_IF(global.FLAG.render, $"→→→→→ Call get next node from: {INAME}");
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
|
|
||||||
repeat(amo) {
|
repeat(amo) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
global.junctionEndName = [ "Hold", "Loop", "Ping pong", "Wrap" ];
|
global.junctionEndName = [ "Hold", "Loop", "Ping pong", "Wrap" ];
|
||||||
|
|
||||||
global.displaySuffix_Range = [ "min", "max" ];
|
global.displaySuffix_Range = [ "min", "max" ];
|
||||||
global.displaySuffix_Area = [ "x", "y", "w", "h" ];
|
global.displaySuffix_Area = [ "x", "y", "w", "h", "shape" ];
|
||||||
global.displaySuffix_Padding = [ "right", "top", "left", "bottom" ];
|
global.displaySuffix_Padding = [ "right", "top", "left", "bottom" ];
|
||||||
global.displaySuffix_VecRange = [ "x min", "x max", "y min", "y max" ];
|
global.displaySuffix_VecRange = [ "x min", "x max", "y min", "y max" ];
|
||||||
global.displaySuffix_Axis = [ "x", "y", "z", "w" ];
|
global.displaySuffix_Axis = [ "x", "y", "z", "w" ];
|
||||||
|
@ -1012,28 +1012,28 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
editWidget = new pathArrayBox(node, display_data.filter, function(path) { setValueDirect(path); } );
|
editWidget = new pathArrayBox(node, display_data.filter, function(path) { setValueDirect(path); } );
|
||||||
break;
|
break;
|
||||||
case VALUE_DISPLAY.path_load :
|
case VALUE_DISPLAY.path_load :
|
||||||
editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { setValueDirect(str); },
|
editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { setValueDirect(str); } );
|
||||||
button(function() {
|
|
||||||
|
editWidget.align = fa_left;
|
||||||
|
editWidget.side_button = button(function() {
|
||||||
var path = get_open_filename(display_data.filter, "");
|
var path = get_open_filename(display_data.filter, "");
|
||||||
key_release();
|
key_release();
|
||||||
if(path == "") return noone;
|
if(path == "") return noone;
|
||||||
return setValueDirect(path);
|
return setValueDirect(path);
|
||||||
}, THEME.button_path_icon)
|
}, THEME.button_path_icon);
|
||||||
);
|
|
||||||
editWidget.align = fa_left;
|
|
||||||
|
|
||||||
extract_node = "Node_String";
|
extract_node = "Node_String";
|
||||||
break;
|
break;
|
||||||
case VALUE_DISPLAY.path_save :
|
case VALUE_DISPLAY.path_save :
|
||||||
editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { setValueDirect(str); },
|
editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { setValueDirect(str); } );
|
||||||
button(function() {
|
|
||||||
|
editWidget.align = fa_left;
|
||||||
|
editWidget.side_button = button(function() {
|
||||||
var path = get_save_filename(display_data.filter, "");
|
var path = get_save_filename(display_data.filter, "");
|
||||||
key_release();
|
key_release();
|
||||||
if(path == "") return noone;
|
if(path == "") return noone;
|
||||||
return setValueDirect(path);
|
return setValueDirect(path);
|
||||||
}, THEME.button_path_icon)
|
}, THEME.button_path_icon);
|
||||||
);
|
|
||||||
editWidget.align = fa_left;
|
|
||||||
|
|
||||||
extract_node = "Node_String";
|
extract_node = "Node_String";
|
||||||
break;
|
break;
|
||||||
|
@ -1124,6 +1124,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
|
|
||||||
static expressionUpdate = function() { #region
|
static expressionUpdate = function() { #region
|
||||||
expTree = evaluateFunctionList(expression);
|
expTree = evaluateFunctionList(expression);
|
||||||
|
resetCache();
|
||||||
node.triggerRender();
|
node.triggerRender();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
|
|
@ -177,7 +177,7 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
||||||
inputs[| 1].editWidget.text = $"Sync ({frm} frames)";
|
inputs[| 1].editWidget.text = $"Sync ({frm} frames)";
|
||||||
}
|
}
|
||||||
|
|
||||||
RENDER_ALL
|
RENDER_ALL_REORDER
|
||||||
}
|
}
|
||||||
|
|
||||||
insp2UpdateIcon[1] = attributes.play;
|
insp2UpdateIcon[1] = attributes.play;
|
||||||
|
|
|
@ -1,25 +1,32 @@
|
||||||
function readObj(path) {
|
function readObj_init() {
|
||||||
if(!file_exists(path)) return noone;
|
obj_reading = true;
|
||||||
|
obj_read_progress = 0;
|
||||||
|
obj_read_prog_sub = 0;
|
||||||
|
obj_read_prog_tot = 3;
|
||||||
|
obj_raw = noone;
|
||||||
|
|
||||||
var _VB = [];
|
_VB = [];
|
||||||
var _VBT = [];
|
_VBT = [];
|
||||||
var _VBN = [];
|
_VBN = [];
|
||||||
var mats = [];
|
mats = [];
|
||||||
var matIndex = [];
|
matIndex = [];
|
||||||
var tris = [];
|
tris = [];
|
||||||
var mtlPath = "";
|
mtlPath = "";
|
||||||
var use_normal = true;
|
use_normal = true;
|
||||||
var v = ds_list_create();
|
v = ds_list_create();
|
||||||
var vt = ds_list_create();
|
vt = ds_list_create();
|
||||||
var vn = ds_list_create();
|
vn = ds_list_create();
|
||||||
var f = ds_list_create();
|
f = ds_list_create();
|
||||||
var ft = ds_list_create();
|
ft = ds_list_create();
|
||||||
var fn = ds_list_create();
|
fn = ds_list_create();
|
||||||
var tri = 0;
|
tri = 0;
|
||||||
|
}
|
||||||
|
|
||||||
var file = file_text_open_read(path);
|
function readObj_file() {
|
||||||
while(!file_text_eof(file)) { #region reading file
|
var _time = current_time;
|
||||||
var l = file_text_readln(file);
|
|
||||||
|
while(!file_text_eof(obj_read_file)) { #region reading file
|
||||||
|
var l = file_text_readln(obj_read_file);
|
||||||
l = string_trim(l);
|
l = string_trim(l);
|
||||||
|
|
||||||
var sep = string_split(l, " ");
|
var sep = string_split(l, " ");
|
||||||
|
@ -100,7 +107,9 @@ function readObj(path) {
|
||||||
//print("Reading vertex group: " + sep[1])
|
//print("Reading vertex group: " + sep[1])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if(current_time - _time > 30) return;
|
||||||
|
} #endregion
|
||||||
|
|
||||||
if(!ds_list_empty(f)) {
|
if(!ds_list_empty(f)) {
|
||||||
array_push(_VB, f);
|
array_push(_VB, f);
|
||||||
|
@ -108,11 +117,13 @@ function readObj(path) {
|
||||||
array_push(_VBN, fn);
|
array_push(_VBN, fn);
|
||||||
array_push(tris, tri);
|
array_push(tris, tri);
|
||||||
}
|
}
|
||||||
file_text_close(file);
|
file_text_close(obj_read_file);
|
||||||
#endregion
|
|
||||||
|
|
||||||
if(use_normal) vn[| 0] = [ 0, 0, 0 ];
|
if(use_normal) vn[| 0] = [ 0, 0, 0 ];
|
||||||
|
|
||||||
|
obj_read_progress = 1;
|
||||||
|
obj_read_prog_sub = 0;
|
||||||
|
|
||||||
//var txt = "OBJ summary";
|
//var txt = "OBJ summary";
|
||||||
//txt += $"\n\tVerticies : {ds_list_size(v)}";
|
//txt += $"\n\tVerticies : {ds_list_size(v)}";
|
||||||
//txt += $"\n\tTexture Verticies : {ds_list_size(vt)}";
|
//txt += $"\n\tTexture Verticies : {ds_list_size(vt)}";
|
||||||
|
@ -120,12 +131,14 @@ function readObj(path) {
|
||||||
//txt += $"\n\tVertex groups : {array_length(_VB)}";
|
//txt += $"\n\tVertex groups : {array_length(_VB)}";
|
||||||
//txt += $"\n\tTriangles : {tris}";
|
//txt += $"\n\tTriangles : {tris}";
|
||||||
//print(txt);
|
//print(txt);
|
||||||
|
}
|
||||||
|
|
||||||
|
function readObj_cent() {
|
||||||
#region centralize vertex
|
#region centralize vertex
|
||||||
var _bmin = v[| 0];
|
_bmin = v[| 0];
|
||||||
var _bmax = v[| 0];
|
_bmax = v[| 0];
|
||||||
var cv = [0, 0, 0];
|
cv = [0, 0, 0];
|
||||||
var vertex = ds_list_size(v);
|
vertex = ds_list_size(v);
|
||||||
|
|
||||||
for( var i = 0; i < vertex; i++ ) {
|
for( var i = 0; i < vertex; i++ ) {
|
||||||
var _v = v[| i];
|
var _v = v[| i];
|
||||||
|
@ -149,19 +162,28 @@ function readObj(path) {
|
||||||
cv[1] /= vertex;
|
cv[1] /= vertex;
|
||||||
cv[2] /= vertex;
|
cv[2] /= vertex;
|
||||||
|
|
||||||
for( var i = 0, n = ds_list_size(v); i < n; i++ ) {
|
obj_size = new __vec3(
|
||||||
v[| i][0] -= cv[0];
|
|
||||||
v[| i][1] -= cv[1];
|
|
||||||
v[| i][2] -= cv[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
var _size = new __vec3(
|
|
||||||
_bmax[0] - _bmin[0],
|
_bmax[0] - _bmin[0],
|
||||||
_bmax[1] - _bmin[1],
|
_bmax[1] - _bmin[1],
|
||||||
_bmax[2] - _bmin[2],
|
_bmax[2] - _bmin[2],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
var sc = 1;
|
||||||
|
//var span = max(abs(_size.x), abs(_size.y), abs(_size.z));
|
||||||
|
//if(span > 10) sc = span / 10;
|
||||||
|
|
||||||
|
for( var i = 0, n = ds_list_size(v); i < n; i++ ) {
|
||||||
|
v[| i][0] = (v[| i][0] - cv[0]) / sc;
|
||||||
|
v[| i][1] = (v[| i][1] - cv[1]) / sc;
|
||||||
|
v[| i][2] = (v[| i][2] - cv[2]) / sc;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
obj_read_progress = 2;
|
||||||
|
obj_read_prog_sub = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function readObj_buff() {
|
||||||
#region vertex buffer creation
|
#region vertex buffer creation
|
||||||
var _vblen = array_length(_VB);
|
var _vblen = array_length(_VB);
|
||||||
var VBS = array_create(_vblen);
|
var VBS = array_create(_vblen);
|
||||||
|
@ -173,7 +195,6 @@ function readObj(path) {
|
||||||
var face = _VB[i];
|
var face = _VB[i];
|
||||||
var facet = _VBT[i];
|
var facet = _VBT[i];
|
||||||
var facen = _VBN[i];
|
var facen = _VBN[i];
|
||||||
var tri = tris[i];
|
|
||||||
|
|
||||||
var _flen = ds_list_size(face);
|
var _flen = ds_list_size(face);
|
||||||
var _v = ds_list_create();
|
var _v = ds_list_create();
|
||||||
|
@ -239,8 +260,12 @@ function readObj(path) {
|
||||||
ds_list_destroy(vt);
|
ds_list_destroy(vt);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
return {
|
obj_read_progress = 3;
|
||||||
|
obj_read_prog_sub = 0;
|
||||||
|
|
||||||
|
obj_raw = {
|
||||||
vertex: V,
|
vertex: V,
|
||||||
|
vertex_count: vertex,
|
||||||
vertex_groups: VBS,
|
vertex_groups: VBS,
|
||||||
object_counts: _vblen,
|
object_counts: _vblen,
|
||||||
|
|
||||||
|
@ -248,6 +273,6 @@ function readObj(path) {
|
||||||
material_index: matIndex,
|
material_index: matIndex,
|
||||||
use_normal: use_normal,
|
use_normal: use_normal,
|
||||||
mtl_path: mtlPath,
|
mtl_path: mtlPath,
|
||||||
model_size: _size,
|
model_size: obj_size,
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -1179,8 +1179,12 @@ function Panel_Preview() : PanelContent() constructor {
|
||||||
tool.toggle();
|
tool.toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pFOCUS && WIDGET_CURRENT == noone && keyboard_check_pressed(ord(string(i + 1))))
|
if(pFOCUS && WIDGET_CURRENT == noone) {
|
||||||
tool.toggle();
|
var _key = tool.checkHotkey();
|
||||||
|
|
||||||
|
if(keyboard_check_pressed(ord(string(i + 1))) || (_key != "" && keyboard_check_pressed(ord(_key))))
|
||||||
|
tool.toggleKeyboard();
|
||||||
|
}
|
||||||
|
|
||||||
if(tool_current == tool) {
|
if(tool_current == tool) {
|
||||||
draw_sprite_stretched_ext(THEME.button_hide, 2, _x0 + pd, _y0 + pd, tool_size - pd * 2, tool_size - pd * 2, COLORS.panel_preview_grid, 1);
|
draw_sprite_stretched_ext(THEME.button_hide, 2, _x0 + pd, _y0 + pd, tool_size - pd * 2, tool_size - pd * 2, COLORS.panel_preview_grid, 1);
|
||||||
|
|
|
@ -77,62 +77,6 @@
|
||||||
PREF_MAP[? "clear_temp_on_close"] = true;
|
PREF_MAP[? "clear_temp_on_close"] = true;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region hotkeys
|
|
||||||
function hotkeyObject(_context, _name, _key, _mod, _action) constructor {
|
|
||||||
context = _context;
|
|
||||||
name = _name;
|
|
||||||
key = _key;
|
|
||||||
modi = _mod;
|
|
||||||
action = _action;
|
|
||||||
|
|
||||||
dKey = _key;
|
|
||||||
dModi = _mod;
|
|
||||||
|
|
||||||
static serialize = function() {
|
|
||||||
var ll = ds_list_create();
|
|
||||||
ll[| 0] = context;
|
|
||||||
ll[| 1] = name;
|
|
||||||
ll[| 2] = key;
|
|
||||||
ll[| 3] = modi;
|
|
||||||
return ll;
|
|
||||||
}
|
|
||||||
|
|
||||||
static deserialize = function(ll) {
|
|
||||||
key = ll[| 2];
|
|
||||||
modi = ll[| 3];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function addHotkey(_context, _name, _key, _mod, _action) {
|
|
||||||
if(is_string(_key)) {
|
|
||||||
var ind = key_get_index(_key);
|
|
||||||
_key = ind? ind : ord(_key);
|
|
||||||
}
|
|
||||||
|
|
||||||
var key = new hotkeyObject(_context, _name, _key, _mod, _action);
|
|
||||||
|
|
||||||
if(!ds_map_exists(HOTKEYS, _context)) {
|
|
||||||
HOTKEYS[? _context] = ds_list_create();
|
|
||||||
if(!ds_list_exist(HOTKEY_CONTEXT, _context))
|
|
||||||
ds_list_add(HOTKEY_CONTEXT, _context);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(HOTKEYS[? _context]); i++) {
|
|
||||||
var hotkey = HOTKEYS[? _context][| i];
|
|
||||||
if(hotkey.name == key.name) {
|
|
||||||
delete HOTKEYS[? _context][| i];
|
|
||||||
HOTKEYS[? _context][| i] = key;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_context == "")
|
|
||||||
ds_list_insert(HOTKEYS[? _context], 0, key);
|
|
||||||
else
|
|
||||||
ds_list_add(HOTKEYS[? _context], key);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region recent files
|
#region recent files
|
||||||
globalvar RECENT_FILES, RECENT_FILE_DATA;
|
globalvar RECENT_FILES, RECENT_FILE_DATA;
|
||||||
RECENT_FILES = ds_list_create();
|
RECENT_FILES = ds_list_create();
|
||||||
|
|
|
@ -64,6 +64,10 @@ function ResetAllNodesRender() { #region
|
||||||
repeat(amo) {
|
repeat(amo) {
|
||||||
var _node = PROJECT.nodeMap[? _key];
|
var _node = PROJECT.nodeMap[? _key];
|
||||||
_node.setRenderStatus(false);
|
_node.setRenderStatus(false);
|
||||||
|
|
||||||
|
for( var i = 0, n = ds_list_size(_node.inputs); i < n; i++ )
|
||||||
|
_node.inputs[| i].resetCache();
|
||||||
|
|
||||||
_key = ds_map_find_next(PROJECT.nodeMap, _key);
|
_key = ds_map_find_next(PROJECT.nodeMap, _key);
|
||||||
}
|
}
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
|
@ -58,7 +58,7 @@ function scrollPane(_w, _h, ondraw) : widget() constructor {
|
||||||
if(mouse_wheel_up()) scroll_y_to += scroll_step * SCROLL_SPEED;
|
if(mouse_wheel_up()) scroll_y_to += scroll_step * SCROLL_SPEED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(abs(content_h) > 0) {
|
if(abs(content_h) > 0 || always_scroll) {
|
||||||
var scr_w = sprite_get_width(THEME.ui_scrollbar);
|
var scr_w = sprite_get_width(THEME.ui_scrollbar);
|
||||||
draw_scroll(x + w - scr_w, y + ui(6), true, surface_h - ui(12), -scroll_y / content_h, surface_h / (surface_h + content_h),
|
draw_scroll(x + w - scr_w, y + ui(6), true, surface_h - ui(12), -scroll_y / content_h, surface_h / (surface_h + content_h),
|
||||||
COLORS.scrollbar_bg, COLORS.scrollbar_idle, COLORS.scrollbar_hover, x + _mx, y + _my);
|
COLORS.scrollbar_bg, COLORS.scrollbar_idle, COLORS.scrollbar_hover, x + _mx, y + _my);
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
74
sprites/s_node_array_convolute/s_node_array_convolute.yy
Normal file
74
sprites/s_node_array_convolute/s_node_array_convolute.yy
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMSprite",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "s_node_array_convolute",
|
||||||
|
"bbox_bottom": 61,
|
||||||
|
"bbox_left": 0,
|
||||||
|
"bbox_right": 63,
|
||||||
|
"bbox_top": 2,
|
||||||
|
"bboxMode": 0,
|
||||||
|
"collisionKind": 1,
|
||||||
|
"collisionTolerance": 0,
|
||||||
|
"DynamicTexturePage": false,
|
||||||
|
"edgeFiltering": false,
|
||||||
|
"For3D": false,
|
||||||
|
"frames": [
|
||||||
|
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"d4f846ac-8f81-4d21-a4ae-aaff8ca044bc",},
|
||||||
|
],
|
||||||
|
"gridX": 0,
|
||||||
|
"gridY": 0,
|
||||||
|
"height": 64,
|
||||||
|
"HTile": false,
|
||||||
|
"layers": [
|
||||||
|
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"284cafea-7057-469b-9abc-10a34804d93a","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
|
||||||
|
],
|
||||||
|
"nineSlice": null,
|
||||||
|
"origin": 4,
|
||||||
|
"parent": {
|
||||||
|
"name": "array",
|
||||||
|
"path": "folders/nodes/icons/value/array.yy",
|
||||||
|
},
|
||||||
|
"preMultiplyAlpha": false,
|
||||||
|
"sequence": {
|
||||||
|
"resourceType": "GMSequence",
|
||||||
|
"resourceVersion": "1.4",
|
||||||
|
"name": "s_node_array_convolute",
|
||||||
|
"autoRecord": true,
|
||||||
|
"backdropHeight": 768,
|
||||||
|
"backdropImageOpacity": 0.5,
|
||||||
|
"backdropImagePath": "",
|
||||||
|
"backdropWidth": 1366,
|
||||||
|
"backdropXOffset": 0.0,
|
||||||
|
"backdropYOffset": 0.0,
|
||||||
|
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
|
||||||
|
"eventStubScript": null,
|
||||||
|
"eventToFunction": {},
|
||||||
|
"length": 1.0,
|
||||||
|
"lockOrigin": false,
|
||||||
|
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
|
||||||
|
"playback": 1,
|
||||||
|
"playbackSpeed": 30.0,
|
||||||
|
"playbackSpeedType": 0,
|
||||||
|
"showBackdrop": true,
|
||||||
|
"showBackdropImage": false,
|
||||||
|
"timeUnits": 1,
|
||||||
|
"tracks": [
|
||||||
|
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
|
||||||
|
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"d4f846ac-8f81-4d21-a4ae-aaff8ca044bc","path":"sprites/s_node_array_convolute/s_node_array_convolute.yy",},},},"Disabled":false,"id":"298a68fe-1e37-455e-a0a0-950092c9f10c","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
|
||||||
|
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
|
||||||
|
],
|
||||||
|
"visibleRange": null,
|
||||||
|
"volume": 1.0,
|
||||||
|
"xorigin": 32,
|
||||||
|
"yorigin": 32,
|
||||||
|
},
|
||||||
|
"swatchColours": null,
|
||||||
|
"swfPrecision": 2.525,
|
||||||
|
"textureGroupId": {
|
||||||
|
"name": "Default",
|
||||||
|
"path": "texturegroups/Default",
|
||||||
|
},
|
||||||
|
"type": 0,
|
||||||
|
"VTile": false,
|
||||||
|
"width": 64,
|
||||||
|
}
|
Loading…
Reference in a new issue