diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 8990244e3..6278bb607 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -50,6 +50,7 @@ {"name":"string","order":4,"path":"folders/functions/string.yy",}, {"name":"surface","order":8,"path":"folders/functions/surface.yy",}, {"name":"test","order":23,"path":"folders/functions/test.yy",}, + {"name":"tween","order":33,"path":"folders/functions/tween.yy",}, {"name":"value","order":1,"path":"folders/functions/value.yy",}, {"name":"vector","order":3,"path":"folders/functions/vector.yy",}, {"name":"window","order":29,"path":"folders/functions/window.yy",}, @@ -84,6 +85,7 @@ {"name":"value","order":3,"path":"folders/nodes/data/value.yy",}, {"name":"mesh","order":7,"path":"folders/nodes/data/value/mesh.yy",}, {"name":"struct","order":6,"path":"folders/nodes/data/value/struct.yy",}, + {"name":"trigger","order":8,"path":"folders/nodes/data/value/trigger.yy",}, {"name":"VFX","order":13,"path":"folders/nodes/data/VFX.yy",}, {"name":"icons","order":6,"path":"folders/nodes/icons.yy",}, {"name":"3D","order":133,"path":"folders/nodes/icons/3D.yy",}, @@ -132,12 +134,11 @@ {"name":"misc","order":50,"path":"folders/shader/misc.yy",}, {"name":"shape seperator","order":35,"path":"folders/shader/shape seperator.yy",}, {"name":"sprites","order":20,"path":"folders/shader/sprites.yy",}, + {"name":"transition","order":52,"path":"folders/shader/transition.yy",}, {"name":"warp","order":41,"path":"folders/shader/warp.yy",}, {"name":"sprites","order":12,"path":"folders/sprites.yy",}, {"name":"gameframe","order":2,"path":"folders/sprites/gameframe.yy",}, {"name":"widgets","order":5,"path":"folders/widgets.yy",}, - {"name":"transition","order":52,"path":"folders/shader/transition.yy",}, - {"name":"tween","order":33,"path":"folders/functions/tween.yy",}, ], "ResourceOrderSettings": [ {"name":"s_node_corner","order":14,"path":"sprites/s_node_corner/s_node_corner.yy",}, @@ -649,6 +650,7 @@ {"name":"point_rect_overlap","order":2,"path":"scripts/point_rect_overlap/point_rect_overlap.yy",}, {"name":"s_node_bevel","order":4,"path":"sprites/s_node_bevel/s_node_bevel.yy",}, {"name":"color_selector","order":4,"path":"scripts/color_selector/color_selector.yy",}, + {"name":"node_trigger_bool","order":1,"path":"scripts/node_trigger_bool/node_trigger_bool.yy",}, {"name":"s_node_strandSim_gravity","order":4,"path":"sprites/s_node_strandSim_gravity/s_node_strandSim_gravity.yy",}, {"name":"node_VFX_effect_turbulence","order":11,"path":"scripts/node_VFX_effect_turbulence/node_VFX_effect_turbulence.yy",}, {"name":"node_ase_file_read","order":14,"path":"scripts/node_ase_file_read/node_ase_file_read.yy",}, @@ -809,6 +811,7 @@ {"name":"sh_fd_visualize_pixel_art_fire_glsl","order":15,"path":"shaders/sh_fd_visualize_pixel_art_fire_glsl/sh_fd_visualize_pixel_art_fire_glsl.yy",}, {"name":"struct_functions","order":4,"path":"scripts/struct_functions/struct_functions.yy",}, {"name":"sh_content_sampler","order":1,"path":"shaders/sh_content_sampler/sh_content_sampler.yy",}, + {"name":"s_node_trigger","order":3,"path":"sprites/s_node_trigger/s_node_trigger.yy",}, {"name":"fd_rectangle_get_repeat","order":19,"path":"scripts/fd_rectangle_get_repeat/fd_rectangle_get_repeat.yy",}, {"name":"s_menu_white","order":1,"path":"sprites/s_menu_white/s_menu_white.yy",}, {"name":"color_loader","order":13,"path":"scripts/color_loader/color_loader.yy",}, @@ -934,6 +937,7 @@ {"name":"sh_grid_noise","order":8,"path":"shaders/sh_grid_noise/sh_grid_noise.yy",}, {"name":"draw_set_blend_mode","order":1,"path":"scripts/draw_set_blend_mode/draw_set_blend_mode.yy",}, {"name":"gameframe_macros","order":1,"path":"scripts/gameframe_macros/gameframe_macros.yy",}, + {"name":"s_node_trigger_bool","order":4,"path":"sprites/s_node_trigger_bool/s_node_trigger_bool.yy",}, {"name":"panel_color","order":1,"path":"scripts/panel_color/panel_color.yy",}, {"name":"s_node_line","order":7,"path":"sprites/s_node_line/s_node_line.yy",}, {"name":"fd_rectangle_get_material_dissipation_value","order":9,"path":"scripts/fd_rectangle_get_material_dissipation_value/fd_rectangle_get_material_dissipation_value.yy",}, @@ -1060,6 +1064,7 @@ {"name":"o_dialog_warning","order":10,"path":"objects/o_dialog_warning/o_dialog_warning.yy",}, {"name":"s_node_group_output","order":15,"path":"sprites/s_node_group_output/s_node_group_output.yy",}, {"name":"node_path_l_system","order":10,"path":"scripts/node_path_l_system/node_path_l_system.yy",}, + {"name":"panel_gradient","order":2,"path":"scripts/panel_gradient/panel_gradient.yy",}, {"name":"sh_channel_S","order":5,"path":"shaders/sh_channel_S/sh_channel_S.yy",}, {"name":"string_scale","order":4,"path":"scripts/string_scale/string_scale.yy",}, {"name":"s_node_cache","order":27,"path":"sprites/s_node_cache/s_node_cache.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index dced12098..8da77c1d1 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -69,6 +69,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"string","folderPath":"folders/functions/string.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"surface","folderPath":"folders/functions/surface.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"test","folderPath":"folders/functions/test.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"tween","folderPath":"folders/functions/tween.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"value","folderPath":"folders/functions/value.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"vector","folderPath":"folders/functions/vector.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"window","folderPath":"folders/functions/window.yy",}, @@ -112,6 +113,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"path","folderPath":"folders/nodes/data/value/path.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"struct","folderPath":"folders/nodes/data/value/struct.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"texts","folderPath":"folders/nodes/data/value/texts.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"trigger","folderPath":"folders/nodes/data/value/trigger.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"VFX","folderPath":"folders/nodes/data/VFX.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"icons","folderPath":"folders/nodes/icons.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"3D","folderPath":"folders/nodes/icons/3D.yy",}, @@ -161,6 +163,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"misc","folderPath":"folders/shader/misc.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"shape seperator","folderPath":"folders/shader/shape seperator.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/shader/sprites.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"transition","folderPath":"folders/shader/transition.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"warp","folderPath":"folders/shader/warp.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/sprites.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"gameframe","folderPath":"folders/sprites/gameframe.yy",}, @@ -168,13 +171,12 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Steamworks","folderPath":"folders/Steamworks.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"UGC","folderPath":"folders/Steamworks/UGC.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"transition","folderPath":"folders/shader/transition.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"tween","folderPath":"folders/functions/tween.yy",}, ], "IncludedFiles": [ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","CopyToMask":-1,"filePath":"datafiles",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Guides.zip","CopyToMask":-1,"filePath":"datafiles/data",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"icon.png","CopyToMask":-1,"filePath":"datafiles/data",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"layouts.zip","CopyToMask":-1,"filePath":"datafiles/data",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Horizontal.json","CopyToMask":-1,"filePath":"datafiles/data/layouts",}, @@ -364,6 +366,7 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_frame_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_frame_title.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_glow.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junction_inspector.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junction_name_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_array_hover.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_array.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, @@ -373,6 +376,7 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_pin_active.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_pin.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_state_strip2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_trigger.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphic.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node/widget",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_checkbox_strip4.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node/widget",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_coor_pin.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node/widget",}, @@ -1019,6 +1023,7 @@ {"id":{"name":"spr_gameframe_pixel","path":"sprites/spr_gameframe_pixel/spr_gameframe_pixel.yy",},}, {"id":{"name":"s_node_radial","path":"sprites/s_node_radial/s_node_radial.yy",},}, {"id":{"name":"s_node_grid","path":"sprites/s_node_grid/s_node_grid.yy",},}, + {"id":{"name":"node_trigger","path":"scripts/node_trigger/node_trigger.yy",},}, {"id":{"name":"node_perlin","path":"scripts/node_perlin/node_perlin.yy",},}, {"id":{"name":"node_blur_simple","path":"scripts/node_blur_simple/node_blur_simple.yy",},}, {"id":{"name":"node_feedback_input","path":"scripts/node_feedback_input/node_feedback_input.yy",},}, @@ -1122,6 +1127,7 @@ {"id":{"name":"point_rect_overlap","path":"scripts/point_rect_overlap/point_rect_overlap.yy",},}, {"id":{"name":"s_node_bevel","path":"sprites/s_node_bevel/s_node_bevel.yy",},}, {"id":{"name":"color_selector","path":"scripts/color_selector/color_selector.yy",},}, + {"id":{"name":"node_trigger_bool","path":"scripts/node_trigger_bool/node_trigger_bool.yy",},}, {"id":{"name":"s_node_strandSim_gravity","path":"sprites/s_node_strandSim_gravity/s_node_strandSim_gravity.yy",},}, {"id":{"name":"node_VFX_effect_turbulence","path":"scripts/node_VFX_effect_turbulence/node_VFX_effect_turbulence.yy",},}, {"id":{"name":"node_ase_file_read","path":"scripts/node_ase_file_read/node_ase_file_read.yy",},}, @@ -1253,7 +1259,7 @@ {"id":{"name":"s_node_3d_plane","path":"sprites/s_node_3d_plane/s_node_3d_plane.yy",},}, {"id":{"name":"Regex","path":"extensions/Regex/Regex.yy",},}, {"id":{"name":"s_node_path_shift","path":"sprites/s_node_path_shift/s_node_path_shift.yy",},}, - {"id":{"name":"node_rigid_sim","path":"scripts/node_rigid_sim/node_rigid_sim.yy",},}, + {"id":{"name":"node_rigid_group","path":"scripts/node_rigid_group/node_rigid_group.yy",},}, {"id":{"name":"s_node_grid_tri","path":"sprites/s_node_grid_tri/s_node_grid_tri.yy",},}, {"id":{"name":"s_node_local_analyze","path":"sprites/s_node_local_analyze/s_node_local_analyze.yy",},}, {"id":{"name":"_f_p0b","path":"fonts/_f_p0b/_f_p0b.yy",},}, @@ -1294,6 +1300,7 @@ {"id":{"name":"sh_fd_visualize_pixel_art_fire_glsl","path":"shaders/sh_fd_visualize_pixel_art_fire_glsl/sh_fd_visualize_pixel_art_fire_glsl.yy",},}, {"id":{"name":"struct_functions","path":"scripts/struct_functions/struct_functions.yy",},}, {"id":{"name":"sh_content_sampler","path":"shaders/sh_content_sampler/sh_content_sampler.yy",},}, + {"id":{"name":"s_node_trigger","path":"sprites/s_node_trigger/s_node_trigger.yy",},}, {"id":{"name":"fd_rectangle_get_repeat","path":"scripts/fd_rectangle_get_repeat/fd_rectangle_get_repeat.yy",},}, {"id":{"name":"s_menu_white","path":"sprites/s_menu_white/s_menu_white.yy",},}, {"id":{"name":"color_loader","path":"scripts/color_loader/color_loader.yy",},}, @@ -1445,6 +1452,7 @@ {"id":{"name":"sh_grid_noise","path":"shaders/sh_grid_noise/sh_grid_noise.yy",},}, {"id":{"name":"draw_set_blend_mode","path":"scripts/draw_set_blend_mode/draw_set_blend_mode.yy",},}, {"id":{"name":"gameframe_macros","path":"scripts/gameframe_macros/gameframe_macros.yy",},}, + {"id":{"name":"s_node_trigger_bool","path":"sprites/s_node_trigger_bool/s_node_trigger_bool.yy",},}, {"id":{"name":"panel_color","path":"scripts/panel_color/panel_color.yy",},}, {"id":{"name":"s_node_line","path":"sprites/s_node_line/s_node_line.yy",},}, {"id":{"name":"fd_rectangle_get_material_dissipation_value","path":"scripts/fd_rectangle_get_material_dissipation_value/fd_rectangle_get_material_dissipation_value.yy",},}, @@ -1590,6 +1598,7 @@ {"id":{"name":"o_dialog_warning","path":"objects/o_dialog_warning/o_dialog_warning.yy",},}, {"id":{"name":"s_node_group_output","path":"sprites/s_node_group_output/s_node_group_output.yy",},}, {"id":{"name":"node_path_l_system","path":"scripts/node_path_l_system/node_path_l_system.yy",},}, + {"id":{"name":"panel_gradient","path":"scripts/panel_gradient/panel_gradient.yy",},}, {"id":{"name":"sh_channel_S","path":"shaders/sh_channel_S/sh_channel_S.yy",},}, {"id":{"name":"string_scale","path":"scripts/string_scale/string_scale.yy",},}, {"id":{"name":"s_node_cache","path":"sprites/s_node_cache/s_node_cache.yy",},}, diff --git a/datafiles/data/Guides.zip b/datafiles/data/Guides.zip new file mode 100644 index 000000000..8f40490e9 Binary files /dev/null and b/datafiles/data/Guides.zip differ diff --git a/datafiles/data/themes/default.zip b/datafiles/data/themes/default.zip index 8c616e6ae..a9236af4e 100644 Binary files a/datafiles/data/themes/default.zip and b/datafiles/data/themes/default.zip differ diff --git a/objects/_p_dialog/Create_0.gml b/objects/_p_dialog/Create_0.gml index 9c4c11d12..e07bfd881 100644 --- a/objects/_p_dialog/Create_0.gml +++ b/objects/_p_dialog/Create_0.gml @@ -154,8 +154,9 @@ if(anchor & ANCHOR.top) dialog_y = min(ystart, WIN_SH - dialog_h); if(anchor & ANCHOR.bottom) dialog_y = max(ystart - dialog_h, 0); } - dialog_x = round(dialog_x); - dialog_y = round(dialog_y); + + dialog_x = round(clamp(dialog_x, 2, WIN_SW - dialog_w - 2)); + dialog_y = round(clamp(dialog_y, 2, WIN_SH - dialog_h - 2)); } function checkMouse() { diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index 7f45cf4c0..49669c527 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -55,6 +55,8 @@ event_inherited(); var typ = node_called.type; for( var i = 0; i < array_length(ar); i++ ) { + if(!ar[i].visible) continue; + var _in = call_in? node_called.type : ar[i].type; var _ot = call_in? ar[i].type : node_called.type; @@ -69,6 +71,7 @@ event_inherited(); for( var i = 0; i < array_length(io.inputs); i++ ) { var _in = fr; var _ot = io.inputs[i].type; + if(!io.inputs[i].visible) continue; if(typeCompatible(_in, _ot, false)) return true; } @@ -91,7 +94,7 @@ event_inherited(); node_list = pageIndex == -1? noone : NODE_CATEGORY[| ADD_NODE_PAGE].list; } ADD_NODE_PAGE = 0; - setPage(ADD_NODE_PAGE); + setPage(NODE_PAGE_DEFAULT); function buildNode(_node, _param = "") { if(!_node) { @@ -109,11 +112,17 @@ event_inherited(); return; } - _inputs = _new_node.inputs; + if(array_exists(global.RECENT_NODES, _node.node)) + array_remove(global.RECENT_NODES, _node.node); + array_insert(global.RECENT_NODES, 0, _node.node); + if(array_length(global.RECENT_NODES) > 20) + array_pop(global.RECENT_NODES); + + _inputs = _new_node.inputs; _outputs = _new_node.outputs; } else { var _new_list = APPEND(_node.path); - _inputs = ds_list_create(); + _inputs = ds_list_create(); _outputs = ds_list_create(); var tx = 99999; @@ -153,6 +162,8 @@ event_inherited(); var _node_list = node_called.connect_type == JUNCTION_CONNECT.input? _outputs : _inputs; for(var i = 0; i < ds_list_size(_node_list); i++) { var _target = _node_list[| i]; + if(!_target.visible) continue; + if(_target.auto_connect && (value_bit(_target.type) & value_bit(node_called.type)) ) { if(node_called.connect_type == JUNCTION_CONNECT.input) { node_called.setFrom(_node_list[| i]); @@ -168,6 +179,7 @@ event_inherited(); for( var i = 0; i < ds_list_size(_inputs); i++ ) { var _in = _inputs[| i]; + if(_in.auto_connect && _in.isConnectable(from)) { _in.setFrom(from); break; @@ -242,7 +254,7 @@ event_inherited(); draw_clear_alpha(c_white, 0); var hh = 0; var _hover = sHOVER && content_pane.hover; - var _list = node_list; + var _list = node_list; if(ADD_NODE_PAGE == -1) { var context = PANEL_GRAPH.getCurrentContext(); @@ -259,12 +271,25 @@ event_inherited(); ds_list_add(_list, cat.list[| j]); } } - } else if(ADD_NODE_PAGE == 0) { + } else if(ADD_NODE_PAGE == NODE_PAGE_DEFAULT) { _list = ds_list_create(); + + ds_list_add(_list, "Favourites"); for( var i = 0; i < array_length(global.FAV_NODES); i++ ) { var _nodeIndex = global.FAV_NODES[i]; ds_list_add(_list, ALL_NODES[? _nodeIndex]); } + + ds_list_add(_list, "Recents"); + for( var i = 0; i < array_length(global.RECENT_NODES); i++ ) { + var _nodeIndex = global.RECENT_NODES[i]; + ds_list_add(_list, ALL_NODES[? _nodeIndex]); + } + } + + if(_list == noone) { + setPage(NODE_PAGE_DEFAULT); + return 0; } var node_count = ds_list_size(_list); diff --git a/objects/o_dialog_gradient/Create_0.gml b/objects/o_dialog_gradient/Create_0.gml index d99f8f8f3..e1aa9e60b 100644 --- a/objects/o_dialog_gradient/Create_0.gml +++ b/objects/o_dialog_gradient/Create_0.gml @@ -84,36 +84,6 @@ event_inherited(); #endregion #region preset - function loadGradient(path) { - if(path == "") return noone; - if(!file_exists(path)) return noone; - - var grad = new gradientObject(); - grad.keys = []; - - var _t = file_text_open_read(path); - while(!file_text_eof(_t)) { - var key = file_text_readln(_t); - var _col = 0, _pos = 0; - - if(string_pos(",", key)) { - var keys = string_splice(key, ","); - if(array_length(keys) != 2) continue; - - _col = toNumber(keys[0]); - _pos = toNumber(keys[1]); - } else { - _col = toNumber(key); - if(file_text_eof(_t)) break; - _pos = toNumber(file_text_readln(_t)); - } - - array_push(grad.keys, new gradientKey(_pos, _col)); - } - file_text_close(_t); - return grad; - } - presets = ds_list_create(); preset_name = ds_list_create(); diff --git a/objects/o_dialog_menubox/Create_0.gml b/objects/o_dialog_menubox/Create_0.gml index 4028be5cb..5a1e1b240 100644 --- a/objects/o_dialog_menubox/Create_0.gml +++ b/objects/o_dialog_menubox/Create_0.gml @@ -70,12 +70,12 @@ event_inherited(); if(show_icon) dialog_w += ui(32); - dialog_y = min(dialog_y, WIN_H - dialog_h); + dialog_y = min(dialog_y, WIN_H - dialog_h - 2); switch(align) { - case fa_left: dialog_x = round(min(dialog_x, WIN_W - dialog_w)); break; - case fa_center: dialog_x = round(min(dialog_x - dialog_w / 2, WIN_W - dialog_w)); break; - case fa_right: dialog_x = round(max(dialog_x - dialog_w, 0)); break; + case fa_left: dialog_x = round(min(dialog_x, WIN_W - dialog_w - 2)); break; + case fa_center: dialog_x = round(min(dialog_x - dialog_w / 2, WIN_W - dialog_w - 2)); break; + case fa_right: dialog_x = round(max(dialog_x - dialog_w, 2)); break; } ready = true; diff --git a/objects/o_dialog_menubox/Draw_64.gml b/objects/o_dialog_menubox/Draw_64.gml index e348a50ad..4bab76670 100644 --- a/objects/o_dialog_menubox/Draw_64.gml +++ b/objects/o_dialog_menubox/Draw_64.gml @@ -1,4 +1,6 @@ /// @description init +if(!ready) exit; + #region draw var yy = dialog_y; diff --git a/objects/o_dialog_panel/Draw_64.gml b/objects/o_dialog_panel/Draw_64.gml index d5b00868f..fedc7c75c 100644 --- a/objects/o_dialog_panel/Draw_64.gml +++ b/objects/o_dialog_panel/Draw_64.gml @@ -61,29 +61,31 @@ if !ready exit; if(buttonInstant(THEME.button_hide, bx, by, ss, ss, mouse_ui, sFOCUS, sHOVER, txt, THEME.pin, ind, cc,, sc) == 2) destroy_on_click_out = !destroy_on_click_out; - if(sFOCUS) + if(sFOCUS) { draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1); - if(!m_in && m_ot) { - draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, c_white, 0.4); + if(!m_in && m_ot) { + draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, c_white, 0.4); - if(DOUBLE_CLICK) { - content.dragSurface = surface_clone(panel); - o_main.panel_dragging = content; - content.in_dialog = false; + if(DOUBLE_CLICK) { + content.dragSurface = surface_clone(panel); + o_main.panel_dragging = content; + content.in_dialog = false; - instance_destroy(); - } else if(mouse_press(mb_right)) { - menuCall(,, [ - menuItem("Move", function() { - content.dragSurface = surface_clone(panel); - o_main.panel_dragging = content; - content.in_dialog = false; - panel_mouse = 1; + instance_destroy(); + } else if(mouse_press(mb_right)) { + menuCall(,, [ + menuItem("Move", function() { + content.dragSurface = surface_clone(panel); + o_main.panel_dragging = content; + content.in_dialog = false; + panel_mouse = 1; - instance_destroy(); - }), - ]); + instance_destroy(); + }), + ]); + } + } } #endregion \ No newline at end of file diff --git a/objects/o_dialog_preference/Create_0.gml b/objects/o_dialog_preference/Create_0.gml index bf91740fb..933a8bdcd 100644 --- a/objects/o_dialog_preference/Create_0.gml +++ b/objects/o_dialog_preference/Create_0.gml @@ -246,6 +246,16 @@ event_inherited(); }) ]) + ds_list_add(pref_appr, [ + get_text("pref_connection_anim", "Connection line animation"), + "connection_line_transition", + new checkBox(function() { + PREF_MAP[? "connection_line_transition"] = + !PREF_MAP[? "connection_line_transition"]; + PREF_SAVE(); + }) + ]) + ds_list_add(pref_appr, [ get_text("panel_menu_right_control", "Use Windows style window control."), "panel_menu_right_control", diff --git a/objects/o_main/Create_0.gml b/objects/o_main/Create_0.gml index 85d518022..d3d8e293f 100644 --- a/objects/o_main/Create_0.gml +++ b/objects/o_main/Create_0.gml @@ -203,6 +203,7 @@ #region parameter file_open_parameter = ""; + minimized = false; _modified = false; #endregion diff --git a/objects/o_main/Draw_64.gml b/objects/o_main/Draw_64.gml index de0a2d11a..c3cb58b54 100644 --- a/objects/o_main/Draw_64.gml +++ b/objects/o_main/Draw_64.gml @@ -1,6 +1,6 @@ /// @description init if(OS == os_windows && gameframe_is_minimized()) { - gameframe_update(); + //gameframe_update(); exit; } else if(OS == os_macosx) { mac_window_step(); diff --git a/objects/o_main/Draw_75.gml b/objects/o_main/Draw_75.gml index f3f9875fe..cd445a210 100644 --- a/objects/o_main/Draw_75.gml +++ b/objects/o_main/Draw_75.gml @@ -1,4 +1,6 @@ /// @description tooltip filedrop +if(OS == os_windows && gameframe_is_minimized()) exit; + #region tooltip if(is_array(TOOLTIP) || TOOLTIP != "") { if(is_struct(TOOLTIP) && struct_has(TOOLTIP, "drawTooltip")) { @@ -36,7 +38,7 @@ draw_tooltip_surface(content); break; case VALUE_TYPE.rigid : - draw_tooltip_text("[" + get_text("tooltip_rigid_object", "Rigidbody Object") + " (id: " + string(content[$ "object"]) + ")(]"); + draw_tooltip_text("[" + get_text("tooltip_rigid_object", "Rigidbody Object") + " (id: " + string(content[$ "object"]) + ")]"); break; case VALUE_TYPE.particle : var txt = "[" + diff --git a/objects/o_main/Other_2.gml b/objects/o_main/Other_2.gml index 506cac44e..86ecb5a9b 100644 --- a/objects/o_main/Other_2.gml +++ b/objects/o_main/Other_2.gml @@ -32,6 +32,7 @@ window_set_showborder(false); + __initSurfaceFormat(); __initLocale(); __initTheme(); __initCollection(); diff --git a/objects/o_main/Step_0.gml b/objects/o_main/Step_0.gml index d67a6d2b1..8efc79d99 100644 --- a/objects/o_main/Step_0.gml +++ b/objects/o_main/Step_0.gml @@ -1,4 +1,6 @@ /// @description init +if(OS == os_windows && gameframe_is_minimized()) exit; + //print("===== Step start ====="); #region animation if(ANIMATOR.is_playing && ANIMATOR.play_freeze == 0) { diff --git a/objects/o_main/Step_1.gml b/objects/o_main/Step_1.gml index b22b2142f..0e81efcce 100644 --- a/objects/o_main/Step_1.gml +++ b/objects/o_main/Step_1.gml @@ -1,4 +1,18 @@ /// @description init +#region minimize + if(OS == os_windows && gameframe_is_minimized()) { + if(!minimized) + game_set_speed(1, gamespeed_fps); + minimized = true; + exit; + } + + if(minimized) { + game_set_speed(PREF_MAP[? "ui_framerate"], gamespeed_fps); + minimized = false; + } +#endregion + #region window //if(keyboard_check_pressed(vk_f12)) DEBUG = !DEBUG; @@ -56,6 +70,8 @@ #endregion #region nodes + DEF_SURFACE_RESET(); + var _k = ds_map_find_first(NODE_MAP); var _a = ds_map_size(NODE_MAP); repeat(_a) { diff --git a/scripts/Tweener/Tweener.gml b/scripts/Tweener/Tweener.gml index ce1111e71..f2c02e846 100644 --- a/scripts/Tweener/Tweener.gml +++ b/scripts/Tweener/Tweener.gml @@ -8,7 +8,7 @@ enum TWEEN_VALUE { color } -function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twSpeed = 5) constructor { +function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twSpeed = 2) constructor { array_push(TWEEN_VALUES, self); realVal = value; @@ -20,7 +20,7 @@ function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twS colTrans = 0; static set = function(value) { - if(valType == VALUE_TYPE.color) { + if(valType == TWEEN_VALUE.color) { showVal = get(); colTrans = 0; } @@ -28,21 +28,21 @@ function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twS realVal = value; } static get = function(value) { - if(valType == VALUE_TYPE.color) + if(valType == TWEEN_VALUE.color) return colTrans == 1? realVal : merge_color(showVal, realVal, colTrans); else return showVal; } static step = function() { - if(valType == VALUE_TYPE.color) { + if(valType == TWEEN_VALUE.color) { if(tweenType == TWEEN_TYPE.linear) colTrans = lerp_linear(colTrans, 1, 1 / tweenSpeed); else if(tweenType == TWEEN_TYPE.log) colTrans = lerp_float(colTrans, 1, tweenSpeed); if(colTrans == 1) showVal = realVal; - } else if(valType == VALUE_TYPE.number) { + } else if(valType == TWEEN_VALUE.number) { if(tweenType == TWEEN_TYPE.linear) showVal = lerp_linear(showVal, realVal, 1 / tweenSpeed); else if(tweenType == TWEEN_TYPE.log) diff --git a/scripts/__VFX/__VFX.gml b/scripts/__VFX/__VFX.gml index af76baf92..b9013620a 100644 --- a/scripts/__VFX/__VFX.gml +++ b/scripts/__VFX/__VFX.gml @@ -15,17 +15,27 @@ function __part(_node) constructor { node = _node; active = false; surf = noone; + prevx = 0; + prevy = 0; x = 0; y = 0; - sx = 0; - sy = 0; + speedx = 0; + speedy = 0; + turning = 0; + turnSpd = 0 + ac = 0; - g = 0; wig = 0; + spVec = [ 0, 0 ]; boundary_data = -1; - gy = 0; + g = 0; + gDir = -90; + _gx = 0; + _gy = 0; + gx = 0; + gy = 0; scx = 1; scy = 1; @@ -53,21 +63,28 @@ function __part(_node) constructor { static create = function(_surf, _x, _y, _life) { active = true; surf = _surf; - x = _x; - y = _y; - gy = 0; + x = _x; + y = _y; + gx = 0; + gy = 0; life = _life; life_total = life; node.onPartCreate(self); } - static setPhysic = function(_sx, _sy, _ac, _g, _wig) { - sx = _sx; - sy = _sy; - ac = _ac; - g = _g; + static setPhysic = function(_sx, _sy, _ac, _g, _gDir, _wig, _turn, _turnSpd) { + speedx = _sx; + speedy = _sy; + ac = _ac; + g = _g; + gDir = _gDir; + _gx = lengthdir_x(g, gDir); + _gy = lengthdir_y(g, gDir); + turning = _turn; + turnSpd = _turnSpd; + wig = _wig; } @@ -96,30 +113,45 @@ function __part(_node) constructor { static step = function() { if(!active) return; - var xp = x, yp = y; - x += sx; - y += sy; + x += speedx; + y += speedy; - var dirr = point_direction(0, 0, sx, sy); - var diss = point_distance(0, 0, sx, sy); - if(diss > 0) { - diss += ac; - dirr += random_range(-wig, wig); - sx = lengthdir_x(diss, dirr); - sy = lengthdir_y(diss, dirr); + var dirr = point_direction(0, 0, speedx, speedy); + var diss = point_distance(0, 0, speedx, speedy); + diss += ac; + + if(speedx != 0 || speedy != 0) { + if(wig != 0) + dirr += random_range(-wig, wig); + + if(turning != 0) { + var trn = turnSpd? turning * diss : turning; + dirr += trn + } } - gy += g; - y += gy; + speedx = lengthdir_x(diss, dirr); + speedy = lengthdir_y(diss, dirr); - if(follow) - rot = point_direction(xp, yp, x, y); - else - rot += rot_s; + if(_gx != 0 || _gy != 0) { + gx += _gx; + gy += _gy; + x += gx; + y += gy; + } + + if(follow) rot = spVec[1]; + else rot += rot_s; if(step_int > 0 && safe_mod(life, step_int) == 0) node.onPartStep(self); if(life-- < 0) kill(); + + spVec[0] = point_distance(prevx, prevy, x, y); + spVec[1] = point_direction(prevx, prevy, x, y); + + prevx = x; + prevy = y; } static draw = function(exact, surf_w, surf_h) { @@ -201,3 +233,16 @@ function __part(_node) constructor { return [cx, cy]; } } + +#region helper + #macro UPDATE_PART_FORWARD static updateParticleForward = function() { \ + var pt = outputs[| 0]; \ + for( var i = 0; i < ds_list_size(pt.value_to); i++ ) { \ + var _n = pt.value_to[| i]; \ + if(_n.value_from != pt) continue; \ + \ + if(variable_struct_exists(_n.node, "updateParticleForward")) \ + _n.node.updateParticleForward(); \ + } \ + } +#endregion \ No newline at end of file diff --git a/scripts/_draw_defines/_draw_defines.gml b/scripts/_draw_defines/_draw_defines.gml index 0f3ffcb37..7940a0ec9 100644 --- a/scripts/_draw_defines/_draw_defines.gml +++ b/scripts/_draw_defines/_draw_defines.gml @@ -10,5 +10,7 @@ #macro BLEND_ALPHA gpu_set_blendmode_ext_sepalpha(bm_one, bm_inv_src_alpha, bm_one, bm_one) #macro BLEND_ALPHA_MULP gpu_set_blendmode_ext_sepalpha(bm_src_alpha, bm_inv_src_alpha, bm_one, bm_one) + #macro BLEND_MULTIPLY gpu_set_blendmode_ext(bm_dest_colour, bm_zero) + #macro DRAW_CLEAR draw_clear_alpha(0, 0) #endregion \ No newline at end of file diff --git a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml index 95ed20023..0862f938e 100644 --- a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml +++ b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml @@ -90,13 +90,23 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co inputs[| 32] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, irandom_range(100000, 999999)) + inputs[| 33] = nodeValue("Gravity direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, -90 ) + .setDisplay(VALUE_DISPLAY.rotation); + + inputs[| 34] = nodeValue("Turning", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ] ) + .setDisplay(VALUE_DISPLAY.range); + + inputs[| 35] = nodeValue("Turn both directions", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Apply randomized 1, -1 multiplier to the turning speed." ); + + inputs[| 36] = nodeValue("Turn scale with speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false ); + input_len = ds_list_size(inputs); input_display_list = [ 32, ["Sprite", false], 0, 22, 23, 26, ["Spawn", true], 27, 16, 1, 2, 3, 4, 30, 31, 24, 25, 5, - ["Movement", true], 29, 6, 18, 7, - ["Physics", true], 19, 20, + ["Movement", true], 29, 6, 18, + ["Physics", true], 7, 19, 33, 20, 34, 35, 36, ["Rotation", true], 15, 8, 9, ["Scale", true], 10, 17, 11, ["Color", true], 12, 28, 13, 14, @@ -145,7 +155,11 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co var _accel = current_data[ 7]; var _grav = current_data[19]; + var _gvDir = current_data[33]; var _wigg = current_data[20]; + var _turn = current_data[34]; + var _turnBi = current_data[35]; + var _turnSc = current_data[36]; var _follow = current_data[15]; var _rotation = current_data[ 8]; @@ -252,7 +266,10 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co part.anim_speed = _anim_speed; part.anim_end = _anim_end; - part.setPhysic(_vx, _vy, _acc, _grav, _wigg); + var _trn = random_range(_turn[0], _turn[1]); + if(_turnBi) _trn *= choose(-1, 1); + + part.setPhysic(_vx, _vy, _acc, _grav, _gvDir, _wigg, _trn, _turnSc); part.setTransform(_scx, _scy, _scale_time, _rot, _rot_spd, _follow); part.setDraw(_color, _bld, _alp, _fade); spawn_index = safe_mod(spawn_index + 1, attributes[? "part_amount"]); @@ -264,7 +281,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co static onSpawn = function(_time, part) {} - static updateParticleForward = function(_render = true) {} + static updateParticleForward = function() {} function reset() { spawn_index = 0; @@ -282,7 +299,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co for(var i = 0; i < ANIMATOR.frames_total; i++) { runVFX(i, false); - updateParticleForward(false); + updateParticleForward(); } seed = inputs[| 32].getValue(); diff --git a/scripts/array_functions/array_functions.gml b/scripts/array_functions/array_functions.gml index b83e62073..6dbedb933 100644 --- a/scripts/array_functions/array_functions.gml +++ b/scripts/array_functions/array_functions.gml @@ -45,6 +45,10 @@ function array_exists(arr, val) { return false; } +function array_empty(arr) { + return array_length(arr) == 0; +} + function array_find(arr, val) { for( var i = 0; i < array_length(arr); i++ ) { if(arr[i] == val) return i; diff --git a/scripts/draw_fit/draw_fit.gml b/scripts/draw_fit/draw_fit.gml index e17944fa0..acbfaf268 100644 --- a/scripts/draw_fit/draw_fit.gml +++ b/scripts/draw_fit/draw_fit.gml @@ -1,6 +1,6 @@ -function draw_sprite_fit(spr, ind, xx, yy, w, h) { +function draw_sprite_fit(spr, ind, xx, yy, w, h, color = c_white, alpha = 1) { var ss = min(w / sprite_get_width(spr), h / sprite_get_height(spr)); - draw_sprite_ext(spr, ind, xx, yy, ss, ss, 0, c_white, 1); + draw_sprite_ext(spr, ind, xx, yy, ss, ss, 0, color, alpha); } function draw_surface_fit(surf, xx, yy, w, h) { diff --git a/scripts/draw_line_curve/draw_line_curve.gml b/scripts/draw_line_curve/draw_line_curve.gml index 7a5d0439b..318c32eb0 100644 --- a/scripts/draw_line_curve/draw_line_curve.gml +++ b/scripts/draw_line_curve/draw_line_curve.gml @@ -87,6 +87,43 @@ function draw_line_curve_color(x0, y0, x1, y1, xc = noone, yc = noone, _s = 1, t } } +function draw_line_curve_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white) { + var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 16 * PREF_MAP[? "connection_line_sample"]); + sample = clamp(sample, 8, 128); + + var x2 = lerp(x0, x1, 0.9); + var x3 = x1; + var y2 = lerp(y0, y1, 0.1); + var y3 = y1; + + var c = draw_get_color(); + var ox, oy, nx, ny, t, it, oc, nc; + + for( var i = 0; i <= sample; i++ ) { + t = i / sample; + it = 1 - t; + + nx = x0 * power(t, 3) + + 3 * x2 * power(it, 1) * power(t, 2) + + 3 * x3 * power(it, 2) * power(t, 1) + + x1 * power(it, 3); + + ny = y0 * power(t, 3) + + 3 * y2 * power(it, 1) * power(t, 2) + + 3 * y3 * power(it, 2) * power(t, 1) + + y1 * power(it, 3); + + nc = merge_color(col1, col2, t); + + if(i) + draw_line_round_color(ox, oy, nx, ny, thick, oc, nc); + + ox = nx; + oy = ny; + oc = nc; + } +} + function distance_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s) { var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 16 * PREF_MAP[? "connection_line_sample"]); sample = clamp(sample, 8, 128); @@ -122,5 +159,41 @@ function distance_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s) { oy = ny; } + return dist; +} + +function distance_to_curve_corner(mx, my, x0, y0, x1, y1, _s) { + var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 16 * PREF_MAP[? "connection_line_sample"]); + sample = clamp(sample, 8, 128); + + var dist = 999999; + var ox, oy, nx, ny, t, it; + + var x2 = lerp(x0, x1, 0.9); + var x3 = x1; + var y2 = lerp(y0, y1, 0.1); + var y3 = y1; + + for( var i = 0; i <= sample; i++ ) { + t = i / sample; + it = 1 - t; + + nx = x0 * power(t, 3) + + 3 * x2 * power(it, 1) * power(t, 2) + + 3 * x3 * power(it, 2) * power(t, 1) + + x1 * power(it, 3); + + ny = y0 * power(t, 3) + + 3 * y2 * power(it, 1) * power(t, 2) + + 3 * y3 * power(it, 2) * power(t, 1) + + y1 * power(it, 3); + + if(i) + dist = min(dist, distance_to_line(mx, my, ox, oy, nx, ny)); + + ox = nx; + oy = ny; + } + return dist; } \ No newline at end of file diff --git a/scripts/draw_line_elbow/draw_line_elbow.gml b/scripts/draw_line_elbow/draw_line_elbow.gml index 18152c786..8e9e42aa3 100644 --- a/scripts/draw_line_elbow/draw_line_elbow.gml +++ b/scripts/draw_line_elbow/draw_line_elbow.gml @@ -67,6 +67,19 @@ function draw_line_elbow_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = 1, t } } +function draw_line_elbow_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 rat = abs(x0 - x1) / (abs(x0 - x1) + abs(y0 - y1)); + var colc = merge_color(col1, col2, rat); + corner = min(corner, abs(x0 - x1), abs(y0 - y1)); + + var sx = sign(x1 - x0); + var sy = sign(y1 - y0); + + draw_line_round_color(x0, y0, x1 - corner * sx, y0, thick, col1, colc); + draw_line_round_color(x1, y0 + corner * sy, x1, y1, thick, colc, col2); + draw_corner(x1 - corner * sx, y0, x1, y0, x1, y0 + corner * sy, thick, colc); +} + function distance_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, indexOut = 1) { var inv = x1 - 16 * _s * indexOut <= x0 + 16 * _s * indexIn; var xx0 = x0 + 16 * _s * indexIn; @@ -87,11 +100,9 @@ function distance_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, inde } } -function elbow_distance_center(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, indexOut = 1) { - var inv = x1 - 16 * _s * indexOut <= x0 + 16 * _s * indexIn; +function distance_to_elbow_corner(mx, my, x0, y0, x1, y1) { + var dist = distance_to_line(mx, my, x0, y0, x1, y0); + dist = min(dist, distance_to_line(mx, my, x1, y0, x1, y1)); - if(inv) - return distance_to_line(mx, my, x0, cy, x1, cy); - else - return distance_to_line(mx, my, cx, y0, cx, y1); + return dist; } \ No newline at end of file diff --git a/scripts/draw_line_elbow_diag/draw_line_elbow_diag.gml b/scripts/draw_line_elbow_diag/draw_line_elbow_diag.gml index a63030bbe..16ace9ad2 100644 --- a/scripts/draw_line_elbow_diag/draw_line_elbow_diag.gml +++ b/scripts/draw_line_elbow_diag/draw_line_elbow_diag.gml @@ -198,6 +198,27 @@ 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) { + var rat = abs(x0 - x1) / (abs(x0 - x1) + abs(y0 - y1)); + var colc = merge_color(col1, col2, rat); + + var sx = sign(x1 - x0); + var sy = sign(y1 - y0); + var diag = min(abs(x0 - x1) / 2, abs(y0 - y1) / 2); + corner = min(corner, abs(x0 - x1 - diag), abs(y0 - y1 - diag)); + var cor2 = corner / sqrt(2); + + draw_line_round_color( x0, y0, x1 - (diag + corner) * sx, y0, thick, col1, colc); + draw_line_round_color(x1 - (diag - cor2) * sx, y0 + cor2 * sy, x1 - cor2 * sx, y0 + (diag - cor2) * sy, thick, colc, colc); + draw_line_round_color( x1, y0 + (diag + corner) * sy, x1, y1, thick, colc, col2); + + draw_corner(x1 - (diag + corner) * sx, y0, x1 - diag * sx, y0, x1 - (diag - cor2) * sx, y0 + cor2 * sy, thick, colc); + draw_corner(x1 - cor2 * sx, y0 + (diag - cor2) * sy, x1, y0 + diag * sy, x1, y0 + (diag + corner) * sy, thick, colc); + + //draw_circle(x1 - diag * sx, y0, 4, false); + //draw_circle(x1, y0 + diag * sy, 4, false); +} + function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, indexOut = 1) { var iy = sign(y1 - y0); var xx0 = x0 + 16 * _s * indexIn; @@ -296,3 +317,16 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, return dist; } } + +function distance_to_elbow_diag_corner(mx, my, x0, y0, x1, y1) { + var sx = sign(x1 - x0); + var sy = sign(y1 - y0); + var diag = min(abs(x0 - x1) / 2, abs(y0 - y1) / 2); + + var dist = 99999; + dist = min(dist, distance_to_line(mx, my, x0, y0, x1 - diag * sx, y0)); + dist = min(dist, distance_to_line(mx, my, x1 - diag * sx, y0, x1, y0 + diag * sy)); + dist = min(dist, distance_to_line(mx, my, x1, y0 + diag * sy, x1, y1)); + + return dist; +} \ No newline at end of file diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index d781ba293..ba4674f64 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -33,14 +33,14 @@ globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING; VERSION = 1140; SAVEFILE_VERSION = 1400; - VERSION_STRING = "1.14.0pr5"; + VERSION_STRING = "1.14.0pr7"; globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES; NODES = ds_list_create(); NODE_INSTANCES = ds_list_create(); - NODE_MAP = ds_map_create(); - APPEND_MAP = ds_map_create(); + NODE_MAP = ds_map_create(); + APPEND_MAP = ds_map_create(); HOTKEYS = ds_map_create(); HOTKEY_CONTEXT = ds_list_create(); @@ -146,11 +146,16 @@ #endregion #region default - globalvar DEF_SURFACE; + globalvar DEF_SURFACE, USE_DEF; + DEF_SURFACE = noone; + USE_DEF = -10; + function DEF_SURFACE_RESET() { - DEF_SURFACE = surface_create_valid(1, 1); + if(is_surface(DEF_SURFACE)) return; + + DEF_SURFACE = surface_create_valid(32, 32); surface_set_target(DEF_SURFACE); - draw_clear_alpha(c_white, 0); + draw_clear(c_white); surface_reset_target(); } DEF_SURFACE_RESET(); diff --git a/scripts/gradients_function/gradients_function.gml b/scripts/gradients_function/gradients_function.gml index c5e9369ac..9944844fe 100644 --- a/scripts/gradients_function/gradients_function.gml +++ b/scripts/gradients_function/gradients_function.gml @@ -148,4 +148,34 @@ function gradientObject(color = c_black) constructor { return self; } +} + +function loadGradient(path) { + if(path == "") return noone; + if(!file_exists(path)) return noone; + + var grad = new gradientObject(); + grad.keys = []; + + var _t = file_text_open_read(path); + while(!file_text_eof(_t)) { + var key = file_text_readln(_t); + var _col = 0, _pos = 0; + + if(string_pos(",", key)) { + var keys = string_splice(key, ","); + if(array_length(keys) != 2) continue; + + _col = toNumber(keys[0]); + _pos = toNumber(keys[1]); + } else { + _col = toNumber(key); + if(file_text_eof(_t)) break; + _pos = toNumber(file_text_readln(_t)); + } + + array_push(grad.keys, new gradientKey(_pos, _col)); + } + file_text_close(_t); + return grad; } \ No newline at end of file diff --git a/scripts/node_3d_extrude/node_3d_extrude.gml b/scripts/node_3d_extrude/node_3d_extrude.gml index e8f8d704e..1bb18e472 100644 --- a/scripts/node_3d_extrude/node_3d_extrude.gml +++ b/scripts/node_3d_extrude/node_3d_extrude.gml @@ -25,10 +25,10 @@ function Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _group inputs[| 7] = nodeValue("Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ]) .setDisplay(VALUE_DISPLAY.vector); - inputs[| 8] = nodeValue("Manual generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 8] = nodeValue("Manual generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) .setDisplay(VALUE_DISPLAY.button, [ function() { generateMesh(); - update(); + doUpdate(); }, "Generate"] ); inputs[| 9] = nodeValue("Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) diff --git a/scripts/node_3d_obj/node_3D_obj.gml b/scripts/node_3d_obj/node_3D_obj.gml index 34e5cab0d..8ea93dbe4 100644 --- a/scripts/node_3d_obj/node_3D_obj.gml +++ b/scripts/node_3d_obj/node_3D_obj.gml @@ -13,7 +13,7 @@ function Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructor .setDisplay(VALUE_DISPLAY.path_load, [ "*.obj", "" ]) .rejectArray(); - inputs[| 1] = nodeValue("Generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 1] = nodeValue("Generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) .setDisplay(VALUE_DISPLAY.button, [ function() { updateObj(); doUpdate(); diff --git a/scripts/node_3d_prim_cube/node_3d_prim_cube.gml b/scripts/node_3d_prim_cube/node_3d_prim_cube.gml index 96e25ec1c..5dba5ce21 100644 --- a/scripts/node_3d_prim_cube/node_3d_prim_cube.gml +++ b/scripts/node_3d_prim_cube/node_3d_prim_cube.gml @@ -2,7 +2,7 @@ function Node_3D_Cube(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c name = "3D Cube"; dimension_index = 1; - inputs[| 0] = nodeValue("Main texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, DEF_SURFACE); + inputs[| 0] = nodeValue("Main texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, USE_DEF); inputs[| 1] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2) .setDisplay(VALUE_DISPLAY.vector); @@ -115,10 +115,10 @@ function Node_3D_Cube(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c static process_data = function(_outSurf, _data, _output_index, _array_index) { var _inSurf = _data[0]; - var _dim = _data[1]; - var _pos = _data[2]; - //var _rot = _data[3]; - var _sca = _data[4]; + var _dim = _data[1]; + var _pos = _data[2]; + //var _rot = _data[3]; + var _sca = _data[4]; var _lpos = _data[19]; var _lrot = _data[18]; diff --git a/scripts/node_VFX_effector/node_VFX_effector.gml b/scripts/node_VFX_effector/node_VFX_effector.gml index 145851caf..1f830b9a8 100644 --- a/scripts/node_VFX_effector/node_VFX_effector.gml +++ b/scripts/node_VFX_effector/node_VFX_effector.gml @@ -46,6 +46,8 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr current_data = []; + UPDATE_PART_FORWARD + static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); diff --git a/scripts/node_VFX_spawner/node_VFX_spawner.gml b/scripts/node_VFX_spawner/node_VFX_spawner.gml index 938a031a9..17f93b444 100644 --- a/scripts/node_VFX_spawner/node_VFX_spawner.gml +++ b/scripts/node_VFX_spawner/node_VFX_spawner.gml @@ -17,16 +17,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y array_insert(input_display_list, 0, ["Trigger", true], input_len + 0, input_len + 1); - static updateParticleForward = function(_render = true) { - var pt = outputs[| 0]; - for( var i = 0; i < ds_list_size(pt.value_to); i++ ) { - var _n = pt.value_to[| i]; - if(_n.value_from != pt) continue; - - if(variable_struct_exists(_n.node, "updateParticleForward")) - _n.node.updateParticleForward(); - } - } + UPDATE_PART_FORWARD static onUpdate = function() { RETURN_ON_REST diff --git a/scripts/node_ase_file_read/node_ase_file_read.gml b/scripts/node_ase_file_read/node_ase_file_read.gml index 4e356569f..1cb0802c9 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.gml +++ b/scripts/node_ase_file_read/node_ase_file_read.gml @@ -33,7 +33,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_load, ["*.ase, *.aseprite", ""]); - inputs[| 1] = nodeValue("Generate layers", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 1] = nodeValue("Generate layers", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) .setDisplay(VALUE_DISPLAY.button, [ function() { refreshLayers(); }, "Generate"] ); inputs[| 2] = nodeValue("Current tag", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, ""); @@ -247,7 +247,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const var p_arr = []; for( var k = 0; k < array_length(plt); k++ ) - array_push(p_arr, make_color_rgb(plt[i][0], plt[i][1], plt[i][2])); + array_push(p_arr, make_color_rgb(plt[k][0], plt[k][1], plt[k][2])); outputs[| 3].setValue(p_arr); break; case 0x2004: //layer @@ -276,7 +276,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const return true; } - static onInspectorUpdate = function() { + static onInspector1Update = function() { var path = inputs[| 0].getValue(); if(path == "") return; updatePaths(path); diff --git a/scripts/node_bevel/node_bevel.gml b/scripts/node_bevel/node_bevel.gml index 425395c2d..f62be20f7 100644 --- a/scripts/node_bevel/node_bevel.gml +++ b/scripts/node_bevel/node_bevel.gml @@ -43,6 +43,16 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con attribute_surface_depth(); attribute_oversample(); + static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { + var _surf = current_data[0]; + if(!is_surface(_surf)) return; + + var _pw = surface_get_width(_surf) * _s / 2; + var _ph = surface_get_height(_surf) * _s / 2; + + inputs[| 2].drawOverlay(active, _x + _pw, _y + _ph, _s, _mx, _my, _snx, _sny); + } + static process_data = function(_outSurf, _data, _output_index, _array_index) { var _hei = _data[1]; var _shf = _data[2]; diff --git a/scripts/node_blend/node_blend.gml b/scripts/node_blend/node_blend.gml index 6513f172c..1227b0c9c 100644 --- a/scripts/node_blend/node_blend.gml +++ b/scripts/node_blend/node_blend.gml @@ -6,8 +6,8 @@ function Node_create_Blend(_x, _y, _group = noone, _param = "") { function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Blend"; - inputs[| 0] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, DEF_SURFACE); - inputs[| 1] = nodeValue("Foreground", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, DEF_SURFACE); + inputs[| 0] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); + inputs[| 1] = nodeValue("Foreground", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); inputs[| 2] = nodeValue("Blend mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) .setDisplay(VALUE_DISPLAY.enum_scroll, BLEND_TYPES ); diff --git a/scripts/node_canvas/node_canvas.gml b/scripts/node_canvas/node_canvas.gml index 9cab1e8f2..8b5569d31 100644 --- a/scripts/node_canvas/node_canvas.gml +++ b/scripts/node_canvas/node_canvas.gml @@ -512,21 +512,27 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor } apply_surface(); - } else if(isUsingTool(4)) { - if(point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, _surf_w - 1, _surf_h - 1) && mouse_press(mb_left)) { - switch(_fill_type) { - case 0 : - flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, false); - break; - case 1 : - flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, true); - break; - case 2 : - canvas_fill(mouse_cur_x, mouse_cur_y, canvas_surface, _thr); - break; - } + } + + if(isUsingTool(4) || (DRAGGING && DRAGGING.type == "Color")) { + if(point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, _surf_w - 1, _surf_h - 1)) { + var fill = DRAGGING? mouse_release(mb_left) : mouse_press(mb_left); - surface_store_buffer(); + if(fill) { + if(DRAGGING) draw_set_color(DRAGGING.data); + switch(_fill_type) { + case 0 : + flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, false); + break; + case 1 : + flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, true); + break; + case 2 : + canvas_fill(mouse_cur_x, mouse_cur_y, canvas_surface, _thr); + break; + } + surface_store_buffer(); + } } } diff --git a/scripts/node_collection/node_collection.gml b/scripts/node_collection/node_collection.gml index 694d472e0..c93390122 100644 --- a/scripts/node_collection/node_collection.gml +++ b/scripts/node_collection/node_collection.gml @@ -83,17 +83,17 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc dia.node = self; }) ]); - inspUpdateTooltip = get_text("panel_inspector_execute", "Execute node contents"); - inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; + insp1UpdateTooltip = get_text("panel_inspector_execute", "Execute node contents"); + insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; - static inspectorUpdate = function() { onInspectorUpdate(); } - static onInspectorUpdate = function() { RenderListAction(nodes, group); } + static inspector1Update = function() { onInspector1Update(); } + static onInspector1Update = function() { RenderListAction(nodes, group); } - static hasInspectorUpdate = function(group = false) { + static hasInspector1Update = function(group = false) { if(!group) return false; for( var i = 0; i < ds_list_size(nodes); i++ ) { - if(nodes[| i].hasInspectorUpdate()) + if(nodes[| i].hasInspector1Update()) return true; } @@ -136,13 +136,16 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc } static getNextNodes = function() { + var nodes = []; for(var i = custom_input_index; i < ds_list_size(inputs); i++) { var _in = inputs[| i].from; if(!_in.renderActive) continue; - ds_queue_enqueue(RENDER_QUEUE, _in); + array_push(nodes, _in); printIf(global.RENDER_LOG, "Push group input " + _in.name + " to stack"); } + + return nodes; } static setRenderStatus = function(result) { @@ -252,12 +255,12 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc PATCH_STATIC - static triggerRender = function() { - for(var i = custom_input_index; i < ds_list_size(inputs); i++) { - var jun_node = inputs[| i].from; - jun_node.triggerRender(); - } - } + //static triggerRender = function() { + // for(var i = custom_input_index; i < ds_list_size(inputs); i++) { + // var jun_node = inputs[| i].from; + // jun_node.triggerRender(); + // } + //} static preConnect = function() { sortIO(); diff --git a/scripts/node_composite/node_composite.gml b/scripts/node_composite/node_composite.gml index a9c6521f8..68d3e3f7f 100644 --- a/scripts/node_composite/node_composite.gml +++ b/scripts/node_composite/node_composite.gml @@ -97,7 +97,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) if(mouse_click(mb_left, _focus) && _vis[| ind] != hold_visibility) { _vis[| ind] = hold_visibility; - update(); + doUpdate(); } } else draw_sprite_ui_uniform(THEME.junc_visible, vis, _bx, _cy + lh / 2, 1, COLORS._main_icon, 0.5 + 0.5 * vis); @@ -179,7 +179,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) ds_list_insert(inputs, targt + i, ext[i]); } - update(); + doUpdate(); } layer_dragging = noone; } @@ -204,7 +204,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) if(input_display_list[i] > idx) input_display_list[i] = input_display_list[i] - data_length; } - update(); + doUpdate(); } function createNewSurface() { diff --git a/scripts/node_csv_file_read/node_csv_file_read.gml b/scripts/node_csv_file_read/node_csv_file_read.gml index fd33bd07d..08042782e 100644 --- a/scripts/node_csv_file_read/node_csv_file_read.gml +++ b/scripts/node_csv_file_read/node_csv_file_read.gml @@ -90,7 +90,7 @@ function Node_CSV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const return true; } - static onInspectorUpdate = function() { + static onInspector1Update = function() { var path = inputs[| 0].getValue(); if(path == "") return; updatePaths(path); diff --git a/scripts/node_csv_file_write/node_csv_file_write.gml b/scripts/node_csv_file_write/node_csv_file_write.gml index 1861e2cbc..d45186310 100644 --- a/scripts/node_csv_file_write/node_csv_file_write.gml +++ b/scripts/node_csv_file_write/node_csv_file_write.gml @@ -49,7 +49,7 @@ function Node_CSV_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) cons } static update = function(frame = ANIMATOR.current_frame) { writeFile(); } - static onInspectorUpdate = function() { writeFile(); } + static onInspector1Update = function() { writeFile(); } static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { var bbox = drawGetBbox(xx, yy, _s); diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 1a371ac23..a01800d90 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -36,31 +36,36 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x draw_name = true; draggable = true; - input_display_list = -1; - output_display_list = -1; - inspector_display_list = -1; - is_dynamic_output = false; inputs = ds_list_create(); outputs = ds_list_create(); + + input_display_list = -1; + output_display_list = -1; + inspector_display_list = -1; + is_dynamic_output = false; + attributes = ds_map_create(); attributeEditors = []; - show_input_name = false; + inspectInput1 = nodeValue("Toggle execution", self, JUNCTION_CONNECT.input, VALUE_TYPE.action, false).setVisible(true, true); + inspectInput2 = nodeValue("Toggle execution", self, JUNCTION_CONNECT.input, VALUE_TYPE.action, false).setVisible(true, true); + + show_input_name = false; show_output_name = false; always_output = false; - inspecting = false; - previewing = 0; + inspecting = false; + previewing = 0; - preview_surface = noone; + preview_surface = noone; preview_amount = 0; - previewable = true; - preview_speed = 0; - preview_index = 0; + previewable = true; + preview_speed = 0; + preview_index = 0; preview_channel = 0; - preview_alpha = 1; - preview_x = 0; - preview_y = 0; + preview_alpha = 1; + preview_x = 0; + preview_y = 0; preview_surface_prev = noone; preview_trans = 1; @@ -219,18 +224,18 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x if(!LOADING) MODIFIED = true; } - inspUpdateTooltip = get_text("panel_inspector_execute", "Execute node"); - inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; + insp1UpdateTooltip = get_text("panel_inspector_execute", "Execute node"); + insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; - static inspectorUpdate = function() { + static inspector1Update = function() { if(error_update_enabled && error_noti_update != noone) noti_remove(error_noti_update); error_noti_update = noone; - onInspectorUpdate(); + onInspector1Update(); } - static onInspectorUpdate = noone; - static hasInspectorUpdate = function() { return onInspectorUpdate != noone; } + static onInspector1Update = noone; + static hasInspector1Update = function() { return onInspector1Update != noone; } insp2UpdateTooltip = get_text("panel_inspector_execute", "Execute node"); insp2UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; @@ -240,8 +245,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static hasInspector2Update = function() { return onInspector2Update != noone; } static stepBegin = function() { - if(use_cache) - cacheArrayCheck(); + if(use_cache) cacheArrayCheck(); var willUpdate = false; if(always_output) { @@ -279,6 +283,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x setHeight(); doStepBegin(); + + if(hasInspector1Update()) inspectInput1.name = insp1UpdateTooltip; + if(hasInspector2Update()) inspectInput2.name = insp2UpdateTooltip; } static doStepBegin = function() {} @@ -289,6 +296,14 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x if(SAFE_MODE) return; var sBase = surface_get_target(); + for( var i = 0; i < ds_list_size(inputs); i++ ) { + if(inputs[| i].type != VALUE_TYPE.trigger) continue; + if(inputs[| i].editWidget == noone) continue; + + var trg = inputs[| i].getValue(); + if(trg) inputs[| i].editWidget.onClick(); + } + try { var t = get_timer(); update(); @@ -302,6 +317,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x log_warning("RENDER", exception_print(exception), self); } + + if(hasInspector1Update()) { + var trigger = inspectInput1.getValue(); + if(trigger) onInspector1Update(); + } + + if(hasInspector2Update()) { + var trigger = inspectInput2.getValue(); + if(trigger) onInspector2Update(); + } } static valueUpdate = function(index) { @@ -315,35 +340,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static onValueFromUpdate = function(index) {} static triggerRender = function() { + printIf(global.RENDER_LOG, " -> Trigger render for " + name + " (" + display_name + ")"); + setRenderStatus(false); UPDATE |= RENDER_TYPE.partial; - for(var i = 0; i < ds_list_size(outputs); i++) { - var jun = outputs[| i]; - for(var j = 0; j < ds_list_size(jun.value_to); j++) { - var _to = jun.value_to[| j]; - if(_to.value_from != jun) continue; - - _to.node.triggerRender(); - } - } + var nodes = getNextNodes(); + for(var i = 0; i < array_length(nodes); i++) + nodes[i].triggerRender(); } - - //static isUpdateReady = function() { //Removed, same as isRenderable() - // for(var j = 0; j < ds_list_size(inputs); j++) { - // var _in = inputs[| j]; - // var val_from = _in.value_from; - // if(val_from == noone) continue; - // if(!val_from.node.active) continue; - // if(!val_from.node.renderActive) continue; - - // if (!val_from.node.rendered) - // return false; - // } - // return true; - //} - static isRenderable = function() { //Check if every input is ready (updated) if(!active) return false; if(!renderActive) return false; @@ -365,25 +371,24 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x } static getNextNodes = function() { + var nodes = []; + for(var i = 0; i < ds_list_size(outputs); i++) { var _ot = outputs[| i]; - //if(_ot.type == VALUE_TYPE.node) continue; for(var j = 0; j < ds_list_size(_ot.value_to); j++) { var _to = _ot.value_to[| j]; - if(!_to.node.renderActive) continue; if(!_to.node.active || _to.value_from == noone) continue; + + printIf(global.RENDER_LOG, " -> Check render " + _to.node.name + " from " + _to.value_from.node.name); if(_to.value_from.node != self) continue; - _to.node.triggerRender(); - - if(_to.node.isRenderable()) { - ds_queue_enqueue(RENDER_QUEUE, _to.node); - printIf(global.RENDER_LOG, " >| Push " + _to.node.name + " (" + _to.node.display_name + ") node to stack"); - } else - printIf(global.RENDER_LOG, " >| Node " + _to.node.name + " not ready"); + printIf(global.RENDER_LOG, " --> Check complete, push " + _to.node.name + " to stack."); + array_push(nodes, _to.node); } } + + return nodes; } static onInspect = function() {} @@ -407,6 +412,20 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var yy = y * _s + _y; var jun; + var inspCount = hasInspector1Update() + hasInspector2Update(); + var ind = 1; + if(hasInspector1Update()) { + inspectInput1.x = xx + w * _s * ind / (inspCount + 1); + inspectInput1.y = yy; + ind++; + } + + if(hasInspector2Update()) { + inspectInput2.x = xx + w * _s * ind / (inspCount + 1); + inspectInput2.y = yy; + ind++; + } + var inamo = input_display_list == -1? ds_list_size(inputs) : array_length(input_display_list); var _in = yy + ui(32) * _s; @@ -423,7 +442,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var outamo = output_display_list == -1? ds_list_size(outputs) : array_length(output_display_list); - xx = xx + w * _s; + xx = xx + w * _s; _in = yy + ui(32) * _s; for(var i = 0; i < outamo; i++) { var idx = getOutputJunctionIndex(i); @@ -476,7 +495,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x draw_set_text(f_p1, fa_left, fa_center, cc); - if(hasInspectorUpdate()) icon = THEME.refresh_s; + if(hasInspector1Update()) icon = THEME.refresh_s; var ts = clamp(power(_s, 0.5), 0.5, 1); var aa = 0.5 + 0.5 * renderActive; @@ -514,6 +533,12 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x hover = jun; } + if(hasInspector1Update() && inspectInput1.drawJunction(_s, _mx, _my)) + hover = inspectInput1; + + if(hasInspector2Update() && inspectInput2.drawJunction(_s, _mx, _my)) + hover = inspectInput2; + return hover; } @@ -553,6 +578,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x for(var i = 0; i < ds_list_size(outputs); i++) outputs[| i].drawName(_s, _mx, _my); } + + if(hasInspector1Update() && PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, inspectInput1.x, inspectInput1.y, 10)) { + inspectInput1.drawNameBG(_s); + inspectInput1.drawName(_s, _mx, _my); + } + + if(hasInspector2Update() && PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, inspectInput2.x, inspectInput2.y, 10)) { + inspectInput2.drawNameBG(_s); + inspectInput2.drawName(_s, _mx, _my); + } } static drawConnections = function(_x, _y, _s, mx, my, _active, aa = 1) { @@ -576,11 +611,19 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x } } + var st = 0; + if(hasInspector1Update()) st = -1; + if(hasInspector2Update()) st = -2; + var drawLineIndex = 1; - for(var i = 0; i < ds_list_size(inputs); i++) { - var jun = inputs[| i]; - var jx = jun.x; - var jy = jun.y; + for(var i = st; i < ds_list_size(inputs); i++) { + var jun; + if(i == -1) jun = inspectInput1; + else if(i == -2) jun = inspectInput2; + else jun = inputs[| i]; + + var jx = jun.x; + var jy = jun.y; if(jun.value_from == noone) continue; if(!jun.value_from.node.active) continue; @@ -603,24 +646,36 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var th = max(1, PREF_MAP[? "connection_line_width"] * _s); jun.draw_line_shift_hover = false; + var drawCorner = jun.type == VALUE_TYPE.action || jun.value_from.type == VALUE_TYPE.action; + if(PANEL_GRAPH.pHOVER) switch(PREF_MAP[? "curve_connection_line"]) { case 0 : hover = distance_to_line(mx, my, jx, jy, frx, fry) < max(th * 2, 6); break; case 1 : - hover = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s) < max(th * 2, 6); + if(drawCorner) + hover = distance_to_curve_corner(mx, my, jx, jy, frx, fry, _s) < max(th * 2, 6); + else + hover = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s) < max(th * 2, 6); + if(PANEL_GRAPH._junction_hovering == noone) jun.draw_line_shift_hover = hover; break; case 2 : - hover = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, jun.value_from.drawLineIndex, jun.drawLineIndex) < max(th * 2, 6); + if(drawCorner) + hover = distance_to_elbow_corner(mx, my, frx, fry, jx, jy) < max(th * 2, 6); + else + hover = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, jun.value_from.drawLineIndex, jun.drawLineIndex) < max(th * 2, 6); if(PANEL_GRAPH._junction_hovering == noone) jun.draw_line_shift_hover = hover; break; case 3 : - hover = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, jun.value_from.drawLineIndex, jun.drawLineIndex) < max(th * 2, 6); + if(drawCorner) + hover = distance_to_elbow_diag_corner(mx, my, frx, fry, jx, jy) < max(th * 2, 6); + else + hover = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, jun.value_from.drawLineIndex, jun.drawLineIndex) < max(th * 2, 6); if(PANEL_GRAPH._junction_hovering == noone) jun.draw_line_shift_hover = hover; @@ -635,8 +690,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x thicken |= _active && PANEL_GRAPH.junction_hovering == jun && PANEL_GRAPH._junction_hovering == noone; thicken |= instance_exists(o_dialog_add_node) && o_dialog_add_node.junction_hovering == jun; - if(thicken) - th *= 2; + if(PREF_MAP[? "connection_line_transition"]) { + jun.draw_line_thick.set(thicken? 2 : 1); + th *= jun.draw_line_thick.get(); + } else + th *= thicken? 2 : 1; var corner = PREF_MAP[? "connection_line_corner"] * _s; var ty = LINE_STYLE.solid; @@ -660,9 +718,24 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x else draw_line_dashed_color(jx, jy, frx, fry, th, c1, c0, 12 * ss); break; - case 1 : draw_line_curve_color(jx, jy, frx, fry, cx, cy, ss, th, c0, c1, ty); break; - case 2 : draw_line_elbow_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty); break; - case 3 : draw_line_elbow_diag_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty); break; + case 1 : + if(drawCorner) + draw_line_curve_corner(jx, jy, frx, fry, ss, th, c0, c1); + else + draw_line_curve_color(jx, jy, frx, fry, cx, cy, ss, th, c0, c1, ty); + break; + case 2 : + if(drawCorner) + draw_line_elbow_corner(frx, fry, jx, jy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty); + else + draw_line_elbow_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty); + break; + case 3 : + if(drawCorner) + draw_line_elbow_diag_corner(frx, fry, jx, jy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty); + else + draw_line_elbow_diag_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty); + break; } drawLineIndex += 0.5; @@ -831,20 +904,29 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x return drawJunctions(xx, yy, _mx, _my, _s); } + static onDrawNodeBehind = function(_x, _y, _mx, _my, _s) {} + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover = false, _focus = false) {} + badgePreview = 0; + badgeInspect = 0; static drawBadge = function(_x, _y, _s) { if(!active) return; var xx = x * _s + _x + w * _s; var yy = y * _s + _y; - if(previewing) { - draw_sprite(THEME.node_state, 0, xx, yy); - xx -= max(32 * _s, 16); + badgePreview = lerp_float(badgePreview, !!previewing, 2); + badgeInspect = lerp_float(badgeInspect, inspecting, 2); + + if(badgePreview > 0) { + draw_sprite_ext(THEME.node_state, 0, xx, yy, badgePreview, badgePreview, 0, c_white, 1); + xx -= 28 * badgePreview; } - if(inspecting) { - draw_sprite(THEME.node_state, 1, xx, yy); + + if(badgeInspect > 0) { + draw_sprite_ext(THEME.node_state, 1, xx, yy, badgeInspect, badgeInspect, 0, c_white, 1); + xx -= 28 * badgeInspect; } inspecting = false; @@ -1133,6 +1215,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x ds_list_add_map(_inputs, inputs[| i].serialize(scale, preset)); ds_map_add_list(_map, "inputs", _inputs); + var _trigger = ds_list_create(); + ds_list_add_map(_trigger, inspectInput1.serialize(scale, preset)); + ds_list_add_map(_trigger, inspectInput2.serialize(scale, preset)); + ds_map_add_list(_map, "inspectInputs", _trigger); + doSerialize(_map); processSerialize(_map); return _map; @@ -1175,10 +1262,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x doDeserialize(); processDeserialize(); - - if(!ds_map_exists(load_map, "inputs")) - return; } + static doDeserialize = function() {} static attributeDeserialize = function(attr) { @@ -1192,14 +1277,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var _inputs = load_map[? "inputs"]; var amo = min(ds_list_size(inputs), ds_list_size(_inputs)); - //printIf(TESTING, " > Applying deserialize to node " + name + " (amount: " + string(amo) + ")"); - for(var i = 0; i < amo; i++) { if(inputs[| i] == noone) continue; inputs[| i].applyDeserialize(_inputs[| i], load_scale, preset); } - //printIf(TESTING, " > Applying deserialize to node " + name + " completed"); + if(ds_map_exists(load_map, "inspectInputs")) { + var insInp = load_map[? "inspectInputs"]; + inspectInput1.applyDeserialize(insInp[| 0], load_scale, preset); + inspectInput2.applyDeserialize(insInp[| 1], load_scale, preset); + } doApplyDeserialize(); } @@ -1224,9 +1311,14 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x static connect = function(log = false) { var connected = true; - for(var i = 0; i < ds_list_size(inputs); i++) { + for(var i = 0; i < ds_list_size(inputs); i++) connected &= inputs[| i].connect(log); + + if(ds_map_exists(load_map, "inspectInputs")) { + inspectInput1.connect(log); + inspectInput2.connect(log); } + if(!connected) ds_queue_enqueue(CONNECTION_CONFLICT, self); return connected; diff --git a/scripts/node_display_image/node_display_image.gml b/scripts/node_display_image/node_display_image.gml index 19d063401..5be9d60e1 100644 --- a/scripts/node_display_image/node_display_image.gml +++ b/scripts/node_display_image/node_display_image.gml @@ -39,7 +39,7 @@ function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) const first_update = false; - static onInspectorUpdate = function() { + static onInspector1Update = function() { var path = inputs[| 0].getValue(); if(path == "") return; updatePaths(path); diff --git a/scripts/node_export/node_export.gml b/scripts/node_export/node_export.gml index c521cdfc9..e925bb771 100644 --- a/scripts/node_export/node_export.gml +++ b/scripts/node_export/node_export.gml @@ -339,13 +339,13 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor } } - inspUpdateTooltip = "Export"; - inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; + insp1UpdateTooltip = "Export"; + insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; insp2UpdateTooltip = "Export All"; insp2UpdateIcon = [ THEME.play_all, 0, COLORS._main_value_positive ]; - static onInspectorUpdate = function() { + static onInspector1Update = function() { if(isInLoop()) UPDATE |= RENDER_TYPE.full; else doInspectorAction(); } diff --git a/scripts/node_feedback/node_feedback.gml b/scripts/node_feedback/node_feedback.gml index ff33ed95f..8645eaae5 100644 --- a/scripts/node_feedback/node_feedback.gml +++ b/scripts/node_feedback/node_feedback.gml @@ -27,9 +27,9 @@ function Node_Feedback(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) allReady &= _in.isRenderable() } - if(!allReady) return; + if(!allReady) return []; - __nodeLeafList(getNodeList(), RENDER_QUEUE); + return __nodeLeafList(getNodeList()); } PATCH_STATIC diff --git a/scripts/node_fluid_domain/node_fluid_domain.gml b/scripts/node_fluid_domain/node_fluid_domain.gml index 2dcd3e875..59fbef6e7 100644 --- a/scripts/node_fluid_domain/node_fluid_domain.gml +++ b/scripts/node_fluid_domain/node_fluid_domain.gml @@ -2,6 +2,7 @@ function Node_Fluid_Domain(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group) name = "Fluid Domain"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; + update_on_frame = true; min_h = 128; diff --git a/scripts/node_group_output/node_group_output.gml b/scripts/node_group_output/node_group_output.gml index 73c48875e..7b3b68312 100644 --- a/scripts/node_group_output/node_group_output.gml +++ b/scripts/node_group_output/node_group_output.gml @@ -25,10 +25,11 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr } static getNextNodes = function() { - if(is_undefined(outParent)) return; + if(is_undefined(outParent)) return []; group.setRenderStatus(true); //printIf(global.RENDER_LOG, "Value to amount " + string(ds_list_size(outParent.value_to))); + var nodes = []; for(var j = 0; j < ds_list_size(outParent.value_to); j++) { var _to = outParent.value_to[| j]; if(!_to.node.renderActive) continue; @@ -47,34 +48,37 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr printIf(global.RENDER_LOG, "Group output ready " + string(_to.node.isRenderable())); if(_to.node.isRenderable()) { - ds_queue_enqueue(RENDER_QUEUE, _to.node); + array_push(nodes, _to.node); printIf(global.RENDER_LOG, "Push node " + _to.node.name + " to stack"); } } + + return nodes; } static createOutput = function(override_order = true) { - if(group && is_struct(group)) { - if(override_order) { - output_index = ds_list_size(group.outputs); - inputs[| 1].setValue(output_index); - } else { - output_index = inputs[| 1].getValue(); - } - - if(!is_undefined(outParent)) - ds_list_remove(group.outputs, outParent); - - outParent = nodeValue("Value", group, JUNCTION_CONNECT.output, VALUE_TYPE.any, -1) - .setVisible(true, true); - outParent.from = self; - - ds_list_add(group.outputs, outParent); - group.setHeight(); - group.sortIO(); + if(group == noone) return; + if(!is_struct(group)) return; - outParent.setFrom(inputs[| 0]); + if(override_order) { + output_index = ds_list_size(group.outputs); + inputs[| 1].setValue(output_index); + } else { + output_index = inputs[| 1].getValue(); } + + if(!is_undefined(outParent)) + ds_list_remove(group.outputs, outParent); + + outParent = nodeValue("Value", group, JUNCTION_CONNECT.output, VALUE_TYPE.any, -1) + .setVisible(true, true); + outParent.from = self; + + ds_list_add(group.outputs, outParent); + group.setHeight(); + group.sortIO(); + + outParent.setFrom(inputs[| 0]); } if(!LOADING && !APPENDING) @@ -95,14 +99,14 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr outParent.display_type = inputs[| 0].display_type; } - static triggerRender = function() { - if(is_undefined(outParent)) return; + //static triggerRender = function() { + // if(is_undefined(outParent)) return; - for(var j = 0; j < ds_list_size(outParent.value_to); j++) { - if(outParent.value_to[| j].value_from == outParent) - outParent.value_to[| j].node.triggerRender(); - } - } + // for(var j = 0; j < ds_list_size(outParent.value_to); j++) { + // if(outParent.value_to[| j].value_from == outParent) + // outParent.value_to[| j].node.triggerRender(); + // } + //} static postDeserialize = function() { createOutput(false); diff --git a/scripts/node_guide/node_guide.gml b/scripts/node_guide/node_guide.gml index 5e070933b..5e9272ec9 100644 --- a/scripts/node_guide/node_guide.gml +++ b/scripts/node_guide/node_guide.gml @@ -4,7 +4,7 @@ function __generate_node_data() { CLONING = true; - var dir = DIRECTORY + "Nodes//"; + var dir = DIRECTORY + "Nodes/Guides/"; if(!directory_exists(dir)) directory_create(dir); repeat(amo) { @@ -27,6 +27,7 @@ function __generate_node_data() { name: _b.inputs[| i].name, tooltip: _b.inputs[| i].tooltip, type: _b.inputs[| i].type, + visible: _b.inputs[| i].visible, }; } @@ -35,6 +36,7 @@ function __generate_node_data() { name: _b.outputs[| i].name, tooltip: _b.outputs[| i].tooltip, type: _b.outputs[| i].type, + visible: _b.outputs[| i].visible, }; } @@ -52,11 +54,11 @@ function __generate_node_data() { function __initNodeData() { global.NODE_GUIDE = {}; - var dir = DIRECTORY + "Nodes/Guides"; + var dir = DIRECTORY + "Nodes/Guides/"; if(!directory_exists(dir)) directory_create(dir); - var f = file_find_first(dir + "*", 0); + var f = file_find_first(dir + "*.json", 0); while(f != "") { var path = dir + f; @@ -68,16 +70,22 @@ function __initNodeData() { f = file_find_next(); } - //var _l = dir + "/version"; - //if(file_exists(_l)) { - // var res = json_load_struct(_l); - // if(res.version >= VERSION) return; - //} - //json_save_struct(_l, { version: VERSION }); + var nodeDir = DIRECTORY + "Nodes/"; + var _l = nodeDir + "/version"; + + if(file_exists(_l)) { + var res = json_load_struct(_l); + if(res.version >= VERSION) return; + } + json_save_struct(_l, { version: VERSION }); - var tooltipDir = DIRECTORY + "Nodes/"; if(file_exists("data/tooltip.zip")) - zip_unzip("data/tooltip.zip", tooltipDir); + zip_unzip("data/tooltip.zip", nodeDir); else noti_status("Tooltip image file not found.") + + if(file_exists("data/Guides.zip")) + zip_unzip("data/Guides.zip", nodeDir); + else + noti_status("Node data file not found.") } \ No newline at end of file diff --git a/scripts/node_image/node_image.gml b/scripts/node_image/node_image.gml index 989c0f954..3b477c81b 100644 --- a/scripts/node_image/node_image.gml +++ b/scripts/node_image/node_image.gml @@ -80,7 +80,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { return false; } - static onInspectorUpdate = function() { + static onInspector1Update = function() { var path = inputs[| 0].getValue(); if(path == "") return; updatePaths(path); @@ -127,7 +127,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { _splice.inputs[| 1].setValue([ww, hh]); _splice.inputs[| 2].setValue(amo); _splice.inputs[| 3].setValue([ amo, 1 ]); - _splice.inspectorUpdate(); + _splice.inspector1Update(); ds_list_add(PANEL_GRAPH.nodes_select_list, self); ds_list_add(PANEL_GRAPH.nodes_select_list, _splice); diff --git a/scripts/node_image_animated/node_image_animated.gml b/scripts/node_image_animated/node_image_animated.gml index 7762d72b6..fa2aefb19 100644 --- a/scripts/node_image_animated/node_image_animated.gml +++ b/scripts/node_image_animated/node_image_animated.gml @@ -57,7 +57,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons .setDisplay(VALUE_DISPLAY.enum_scroll, ["Loop", "Ping pong", "Hold last frame", "Hide"]) .rejectArray(); - inputs[| 5] = nodeValue("Set animation length to match", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 5] = nodeValue("Set animation length to match", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) .setDisplay(VALUE_DISPLAY.button, [ function() { if(array_length(spr) == 0) return; ANIMATOR.frames_total = array_length(spr); @@ -124,7 +124,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons return true; } - static onInspectorUpdate = function() { + static onInspector1Update = function() { var path = inputs[| 0].getValue(); if(path == "") return; updatePaths(path); diff --git a/scripts/node_image_gif/node_image_gif.gml b/scripts/node_image_gif/node_image_gif.gml index 66317d331..be4e8e1f9 100644 --- a/scripts/node_image_gif/node_image_gif.gml +++ b/scripts/node_image_gif/node_image_gif.gml @@ -34,7 +34,7 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_load, ["*.gif", ""]); - inputs[| 1] = nodeValue("Set animation length to gif", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 1] = nodeValue("Set animation length to gif", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) .setDisplay(VALUE_DISPLAY.button, [ function() { if(!spr) return; if(!sprite_exists(spr)) return; @@ -62,7 +62,7 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct return false; } - static onInspectorUpdate = function() { + static onInspector1Update = function() { var path = inputs[| 0].getValue(); if(path == "") return; updatePaths(path); diff --git a/scripts/node_image_sequence/node_image_sequence.gml b/scripts/node_image_sequence/node_image_sequence.gml index cc597aecc..a635375a5 100644 --- a/scripts/node_image_sequence/node_image_sequence.gml +++ b/scripts/node_image_sequence/node_image_sequence.gml @@ -82,7 +82,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons return false; } - static onInspectorUpdate = function() { + static onInspector1Update = function() { var path = inputs[| 0].getValue(); if(path == "") return; updatePaths(path); diff --git a/scripts/node_image_splice_sheet/node_image_splice_sheet.gml b/scripts/node_image_splice_sheet/node_image_splice_sheet.gml index 9235d9172..254d83ac1 100644 --- a/scripts/node_image_splice_sheet/node_image_splice_sheet.gml +++ b/scripts/node_image_splice_sheet/node_image_splice_sheet.gml @@ -29,7 +29,7 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru inputs[| 9] = nodeValue("Orientation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Horizontal", "Vertical"]); - inputs[| 10] = nodeValue("Auto fill", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 10] = nodeValue("Auto fill", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) .setDisplay(VALUE_DISPLAY.button, [ function() { var _sur = inputs[| 0].getValue(); if(!is_surface(_sur) || _sur == DEF_SURFACE) return; @@ -52,10 +52,10 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru else inputs[| 3].setValue([ fill_h, fill_w ]); - inspectorUpdate(); + inspector1Update(); }, "Auto fill"] ); - inputs[| 11] = nodeValue("Sync animation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 11] = nodeValue("Sync animation", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) .setDisplay(VALUE_DISPLAY.button, [ function() { var _amo = inputs[| 3].getValue(); ANIMATOR.frames_total = max(1, _amo[0] * _amo[1]); @@ -261,7 +261,7 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru inputs[| 8].setVisible(!_out); } - static onInspectorUpdate = function() { + static onInspector1Update = function() { if(isInLoop()) Render(); else doInspectorAction(); } diff --git a/scripts/node_iterate/node_iterate.gml b/scripts/node_iterate/node_iterate.gml index debc1718f..f27f2c35a 100644 --- a/scripts/node_iterate/node_iterate.gml +++ b/scripts/node_iterate/node_iterate.gml @@ -49,10 +49,10 @@ function Node_Iterate(_x, _y, _group = noone) : Node_Collection(_x, _y, _group) allReady &= _in.isRenderable() } - if(!allReady) return; + if(!allReady) return []; - __nodeLeafList(getNodeList(), RENDER_QUEUE); initLoop(); + return __nodeLeafList(getNodeList()); } static iterationStatus = function() { diff --git a/scripts/node_iterate_each/node_iterate_each.gml b/scripts/node_iterate_each/node_iterate_each.gml index 084aedb51..aa9c51891 100644 --- a/scripts/node_iterate_each/node_iterate_each.gml +++ b/scripts/node_iterate_each/node_iterate_each.gml @@ -24,8 +24,8 @@ function Node_Iterate_Each(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr } static getNextNodes = function() { - __nodeLeafList(getNodeList(), RENDER_QUEUE); initLoop(); + return __nodeLeafList(getNodeList()); } static onStep = function() { diff --git a/scripts/node_iterate_filter/node_iterate_filter.gml b/scripts/node_iterate_filter/node_iterate_filter.gml index 43037984f..51f787341 100644 --- a/scripts/node_iterate_filter/node_iterate_filter.gml +++ b/scripts/node_iterate_filter/node_iterate_filter.gml @@ -26,8 +26,8 @@ function Node_Iterate_Filter(_x, _y, _group = noone) : Node_Collection(_x, _y, _ } static getNextNodes = function() { - __nodeLeafList(getNodeList(), RENDER_QUEUE); initLoop(); + return __nodeLeafList(getNodeList()); } static onStep = function() { diff --git a/scripts/node_iterator_each_output/node_iterator_each_output.gml b/scripts/node_iterator_each_output/node_iterator_each_output.gml index 0bf22b06d..271476f69 100644 --- a/scripts/node_iterator_each_output/node_iterator_each_output.gml +++ b/scripts/node_iterator_each_output/node_iterator_each_output.gml @@ -11,12 +11,13 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group .setVisible(false); static getNextNodes = function() { - if(!struct_has(group, "iterationStatus")) return; - var _ren = group.iterationStatus(); + if(!struct_has(group, "iterationStatus")) return []; + var _ren = group.iterationStatus(); + var nodes = []; if(_ren == ITERATION_STATUS.loop) { //Go back to the beginning of the loop, reset render status for leaf node inside? printIf(global.RENDER_LOG, " > Loop restart: iteration " + string(group.iterated)); - __nodeLeafList(group.getNodeList(), RENDER_QUEUE); + nodes = array_append(nodes, __nodeLeafList(group.getNodeList())); } else if(_ren == ITERATION_STATUS.complete) { //Go out of loop printIf(global.RENDER_LOG, " > Loop completed"); group.setRenderStatus(true); @@ -28,11 +29,14 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) { _to.node.triggerRender(); - if(_to.node.isRenderable()) ds_queue_enqueue(RENDER_QUEUE, _to.node); + if(_to.node.isRenderable()) + array_push(nodes, _to.node); } } } else printIf(global.RENDER_LOG, " > Loop not ready"); + + return nodes; } static step = function() { diff --git a/scripts/node_iterator_filter_output/node_iterator_filter_output.gml b/scripts/node_iterator_filter_output/node_iterator_filter_output.gml index 06380f2a8..6e05b69c8 100644 --- a/scripts/node_iterator_filter_output/node_iterator_filter_output.gml +++ b/scripts/node_iterator_filter_output/node_iterator_filter_output.gml @@ -11,12 +11,13 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro .setVisible(true, true); static getNextNodes = function() { - if(!struct_has(group, "iterationStatus")) return; - var _ren = group.iterationStatus(); + if(!struct_has(group, "iterationStatus")) return []; + var _ren = group.iterationStatus(); + var nodes = []; if(_ren == ITERATION_STATUS.loop) { //Go back to the beginning of the loop, reset render status for leaf node inside? printIf(global.RENDER_LOG, " > Loop restart: iteration " + string(group.iterated)); - __nodeLeafList(group.getNodeList(), RENDER_QUEUE); + nodes = array_append(nodes, __nodeLeafList(group.getNodeList())); } else if(_ren == ITERATION_STATUS.complete) { //Go out of loop printIf(global.RENDER_LOG, " > Loop completed"); group.setRenderStatus(true); @@ -28,11 +29,14 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) { _to.node.triggerRender(); - if(_to.node.isRenderable()) ds_queue_enqueue(RENDER_QUEUE, _to.node); + if(_to.node.isRenderable()) + array_push(nodes, _to.node); } } } else printIf(global.RENDER_LOG, " > Loop not ready"); + + return nodes; } static step = function() { diff --git a/scripts/node_iterator_output/node_iterator_output.gml b/scripts/node_iterator_output/node_iterator_output.gml index 1595dcf5a..ac4b968e7 100644 --- a/scripts/node_iterator_output/node_iterator_output.gml +++ b/scripts/node_iterator_output/node_iterator_output.gml @@ -32,16 +32,14 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y cache_value = -1; static getNextNodes = function() { + var nodes = []; var _node_it = group; - if(!struct_has(_node_it, "iterationStatus")) return; + if(!struct_has(_node_it, "iterationStatus")) return nodes; var _ren = _node_it.iterationStatus(); if(_ren == ITERATION_STATUS.loop) { //Go back to the beginning of the loop, reset render status for leaf node inside? printIf(global.RENDER_LOG, " > Loop restart: iteration " + string(group.iterated)); - __nodeLeafList(group.getNodeList(), RENDER_QUEUE); - - //var loopEnt = inputs[| 2].value_from.node; - //ds_queue_enqueue(RENDER_QUEUE, loopEnt); + nodes = array_append(nodes, __nodeLeafList(group.getNodeList())); } else if(_ren == ITERATION_STATUS.complete) { //Go out of loop printIf(global.RENDER_LOG, " > Loop completed"); group.setRenderStatus(true); @@ -51,12 +49,14 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y if(!_to.node.renderActive) continue; if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) { - _to.node.triggerRender(); - if(_to.node.isRenderable()) ds_queue_enqueue(RENDER_QUEUE, _to.node); + if(_to.node.isRenderable()) + array_push(nodes, _to.node); } } } else printIf(global.RENDER_LOG, " > Loop not ready"); + + return nodes; } static initLoop = function() { diff --git a/scripts/node_json_file_read/node_json_file_read.gml b/scripts/node_json_file_read/node_json_file_read.gml index c64c21a0e..fcb5a303e 100644 --- a/scripts/node_json_file_read/node_json_file_read.gml +++ b/scripts/node_json_file_read/node_json_file_read.gml @@ -69,7 +69,7 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons return false; } - static onInspectorUpdate = function() { + static onInspector1Update = function() { var path = inputs[| 0].getValue(); if(path == "") return; updatePaths(path); diff --git a/scripts/node_json_file_write/node_json_file_write.gml b/scripts/node_json_file_write/node_json_file_write.gml index 687c07d0e..4a8878aab 100644 --- a/scripts/node_json_file_write/node_json_file_write.gml +++ b/scripts/node_json_file_write/node_json_file_write.gml @@ -112,7 +112,7 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con } static update = function(frame = ANIMATOR.current_frame) { writeFile(); } - static onInspectorUpdate = function() { writeFile(); } + static onInspector1Update = function() { writeFile(); } static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { var bbox = drawGetBbox(xx, yy, _s); diff --git a/scripts/node_keyframe/node_keyframe.gml b/scripts/node_keyframe/node_keyframe.gml index 0c0fcb8c7..a4eb2dd87 100644 --- a/scripts/node_keyframe/node_keyframe.gml +++ b/scripts/node_keyframe/node_keyframe.gml @@ -64,7 +64,8 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor { suffix = ""; values = ds_list_create(); sep_axis = _sep_axis; - ds_list_add(values, new valueKey(0, _val, self)); + if(_prop.type != VALUE_TYPE.trigger) + ds_list_add(values, new valueKey(0, _val, self)); //print(_prop.name + ": " + string(_val)); index = 0; @@ -126,15 +127,29 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor { static getName = function() { return prop.name + suffix; } static getValue = function(_time = ANIMATOR.current_frame) { - if(ds_list_size(values) == 0) return processTypeDefault(); - if(ds_list_size(values) == 1) { - //if(prop.name == "Position") print(values[| 0].value); - return processType(values[| 0].value); + if(prop.type == VALUE_TYPE.trigger) { + for(var i = 0; i < ds_list_size(values); i++) { //Find trigger + var _key = values[| i]; + if(_key.time == _time) + return _key.value; + } + return false; } - if(prop.display_type == VALUE_DISPLAY.gradient) return values[| 0].value; - if(prop.type == VALUE_TYPE.path) return processType(values[| 0].value); - if(!prop.is_anim) return processType(values[| 0].value); + if(ds_list_size(values) == 0) + return processTypeDefault(); + + if(ds_list_size(values) == 1) + return processType(values[| 0].value); + + if(prop.display_type == VALUE_DISPLAY.gradient) + return values[| 0].value; + + if(prop.type == VALUE_TYPE.path) + return processType(values[| 0].value); + + if(!prop.is_anim) + return processType(values[| 0].value); var _time_first = values[| 0].time; var _time_last = values[| ds_list_size(values) - 1].time; @@ -225,7 +240,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor { case VALUE_TYPE.surface : if(is_string(_val)) return get_asset(_val); - return is_surface(_val)? _val : DEF_SURFACE; + return _val; } return _val; @@ -260,6 +275,22 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor { } static setValue = function(_val = 0, _record = true, _time = ANIMATOR.current_frame, ease_in = 0, ease_out = 0) { + if(prop.type == VALUE_TYPE.trigger) { + for(var i = 0; i < ds_list_size(values); i++) { //Find trigger + var _key = values[| i]; + if(_key.time == _time) { + _key.value = _val; + return false; + } else if(_key.time > _time) { + ds_list_insert(values, i, new valueKey(_time, _val, self)); + return true; + } + } + + ds_list_add(values, new valueKey(_time, _val, self)); + return true; + } + if(!prop.is_anim) { if(isEqual(values[| 0].value, _val)) return false; diff --git a/scripts/node_level/node_level.gml b/scripts/node_level/node_level.gml index 0f91c05f0..32d6770b1 100644 --- a/scripts/node_level/node_level.gml +++ b/scripts/node_level/node_level.gml @@ -90,7 +90,7 @@ function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con static onValueFromUpdate = function(index) { if(index == 0) { - update(); + doUpdate(); if(array_length(current_data) > 0) histogramUpdate(current_data[0]); } diff --git a/scripts/node_lua_compute/node_lua_compute.gml b/scripts/node_lua_compute/node_lua_compute.gml index e8340a7c6..e7c00807a 100644 --- a/scripts/node_lua_compute/node_lua_compute.gml +++ b/scripts/node_lua_compute/node_lua_compute.gml @@ -218,14 +218,14 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru lua_add_code(getState(), lua_code); } - static onInspectorUpdate = function() { //compile + static onInspector1Update = function() { //compile var thrd = inputs[| 3].value_from; if(thrd == noone) { doCompile(); return; } - thrd.node.onInspectorUpdate(); + thrd.node.onInspector1Update(); } static doCompile = function() { diff --git a/scripts/node_lua_global/node_lua_global.gml b/scripts/node_lua_global/node_lua_global.gml index 7c2ab384f..30eb880bb 100644 --- a/scripts/node_lua_global/node_lua_global.gml +++ b/scripts/node_lua_global/node_lua_global.gml @@ -80,14 +80,14 @@ function Node_Lua_Global(_x, _y, _group = noone) : Node(_x, _y, _group) construc } } - static onInspectorUpdate = function() { //compile + static onInspector1Update = function() { //compile var thrd = inputs[| 2].value_from; if(thrd == noone) { doCompile(); return; } - thrd.node.onInspectorUpdate(); + thrd.node.onInspector1Update(); } static doCompile = function() { diff --git a/scripts/node_lua_surface/node_lua_surface.gml b/scripts/node_lua_surface/node_lua_surface.gml index ebf083610..c0a885a12 100644 --- a/scripts/node_lua_surface/node_lua_surface.gml +++ b/scripts/node_lua_surface/node_lua_surface.gml @@ -228,14 +228,14 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru lua_add_code(getState(), lua_code); } - static onInspectorUpdate = function() { //compile + static onInspector1Update = function() { //compile var thrd = inputs[| 3].value_from; if(thrd == noone) { doCompile(); return; } - thrd.node.onInspectorUpdate(); + thrd.node.onInspector1Update(); } static doCompile = function() { diff --git a/scripts/node_palette_extract/node_palette_extract.gml b/scripts/node_palette_extract/node_palette_extract.gml index 49e20c35e..d9c58f376 100644 --- a/scripts/node_palette_extract/node_palette_extract.gml +++ b/scripts/node_palette_extract/node_palette_extract.gml @@ -302,7 +302,7 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con outputs[| 0].setValue(res); } - static onInspectorUpdate = function() { extractPalettes(); } + static onInspector1Update = function() { extractPalettes(); } static onValueUpdate = function() { extractPalettes(); } static onValueFromUpdate = function() { extractPalettes(); } diff --git a/scripts/node_path_plot/node_path_plot.gml b/scripts/node_path_plot/node_path_plot.gml index 60890d9b3..6d75ad968 100644 --- a/scripts/node_path_plot/node_path_plot.gml +++ b/scripts/node_path_plot/node_path_plot.gml @@ -158,6 +158,16 @@ function Node_Path_Plot(_x, _y, _group = noone) : Node(_x, _y, _group) construct } } + function updateBoundary() { + boundary = new BoundingBox( 0, 0, 1, 1 ); + var sample = 64; + + for( var i = 0; i <= sample; i++ ) { + var p = getPointRatio(i / sample); + boundary.addPoint(p.x, p.y); + } + } + function update() { updateBoundary(); outputs[| 0].setValue(self); diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 93e8af468..26810ffc0 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -11,12 +11,12 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { if(file_exists(pth)) tooltip_spr = sprite_add(pth, 0, false, false, 0, 0); else - tooltip_spr = noone; + tooltip_spr = noone; new_node = false; if(struct_has(global.NODE_GUIDE, node)) { var _n = global.NODE_GUIDE[$ node]; - name = _n.name; + name = _n.name; if(_n.tooltip != "") tooltip = _n.tooltip; } @@ -75,17 +75,18 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { } function __initNodes() { - var path = DIRECTORY + "Nodes/fav.json"; - global.FAV_NODES = []; - if(file_exists(path)) - global.FAV_NODES = json_load_struct(path); + var favPath = DIRECTORY + "Nodes/fav.json"; + global.FAV_NODES = file_exists(favPath)? json_load_struct(favPath) : []; + + var recPath = DIRECTORY + "Nodes/recent.json"; + global.RECENT_NODES = file_exists(recPath)? json_load_struct(recPath) : []; var group = ds_list_create(); addNodeCatagory("Group", group, ["Node_Group"]); ds_list_add(group, "Groups"); addNodeObject(group, "Input", s_node_group_input, "Node_Group_Input", [1, Node_Group_Input]); addNodeObject(group, "Output", s_node_group_output,"Node_Group_Output", [1, Node_Group_Output]); - + var iter = ds_list_create(); addNodeCatagory("Loop", iter, ["Node_Iterate"]); ds_list_add(iter, "Groups"); @@ -326,7 +327,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { ds_list_add(threeD, "2D operations"); addNodeObject(threeD, "Normal", s_node_normal, "Node_Normal", [1, Node_Normal],, "Create normal map using greyscale value as height."); addNodeObject(threeD, "Normal Light", s_node_normal_light, "Node_Normal_Light", [1, Node_Normal_Light],, "Light up the image using normal mapping."); - addNodeObject(threeD, "Bevel", s_node_bevel, "Node_Bevel", [1, Node_Bevel],, "Apply 2D bevel on the image."); + addNodeObject(threeD, "Bevel", s_node_bevel, "Node_Bevel", [1, Node_Bevel], ["shade", "auto shade"], "Apply 2D bevel on the image."); addNodeObject(threeD, "Sprite Stack", s_node_stack, "Node_Sprite_Stack", [1, Node_Sprite_Stack],, "Create sprite stack either from repeating a single image or stacking different images using array."); ds_list_add(threeD, "3D generates"); @@ -474,6 +475,10 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { addNodeObject(values, "Compare", s_node_compare, "Node_Compare", [0, Node_create_Compare], ["equal", "greater", "lesser"]); addNodeObject(values, "Logic Opr", s_node_logic_opr, "Node_Logic", [0, Node_create_Logic], [ "and", "or", "not", "nand", "nor" , "xor" ]); + ds_list_add(values, "Trigger"); + addNodeObject(values, "Trigger", s_node_trigger, "Node_Trigger", [1, Node_Trigger]).setVersion(1140); + addNodeObject(values, "Boolean Trigger", s_node_trigger_bool, "Node_Trigger_Bool", [1, Node_Trigger_Bool], ["trigger boolean"]).setVersion(1140); + ds_list_add(values, "Struct"); addNodeObject(values, "Struct", s_node_struct, "Node_Struct", [1, Node_Struct]); addNodeObject(values, "Struct Get", s_node_struct_get, "Node_Struct_Get", [1, Node_Struct_Get]); @@ -607,26 +612,6 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #endregion #region attribute - global.SURFACE_FORMAT = [ - surface_rgba4unorm, - surface_rgba8unorm, - surface_rgba16float, - surface_rgba32float, - surface_r8unorm, - surface_r16float, - surface_r32float - ]; - - global.SURFACE_FORMAT_NAME = [ - "4 bit RGBA", - "8 bit RGBA", - "16 bit RGBA", - "32 bit RGBA", - "8 bit Greyscale", - "16 bit Greyscale", - "32 bit Greyscale" - ]; - global.SURFACE_INTERPOLATION = [ "No aliasing", "Linear", @@ -640,8 +625,41 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { "Repeat" ]; - global.SURFACE_FORMAT_NAME_PROCESS = [ "Input" ]; - global.SURFACE_FORMAT_NAME_PROCESS = array_append(global.SURFACE_FORMAT_NAME_PROCESS, global.SURFACE_FORMAT_NAME); + function __initSurfaceFormat() { + var surface_format = [ + surface_rgba4unorm, + surface_rgba8unorm, + surface_rgba16float, + surface_rgba32float, + surface_r8unorm, + surface_r16float, + surface_r32float + ]; + + var surface_format_name = [ + "4 bit RGBA", + "8 bit RGBA", + "16 bit RGBA", + "32 bit RGBA", + "8 bit Greyscale", + "16 bit Greyscale", + "32 bit Greyscale" + ]; + + global.SURFACE_FORMAT = []; + global.SURFACE_FORMAT_NAME = []; + + for( var i = 0; i < array_length(surface_format); i++ ) { + if(surface_format_is_supported(surface_format[i])) { + array_push(global.SURFACE_FORMAT, surface_format[i]); + array_push(global.SURFACE_FORMAT_NAME, surface_format_name[i]); + } else + log_message("WARNING", "Surface format [" + surface_format_name[i] + "] not supported in this device."); + } + + global.SURFACE_FORMAT_NAME_PROCESS = [ "Input" ]; + global.SURFACE_FORMAT_NAME_PROCESS = array_append(global.SURFACE_FORMAT_NAME_PROCESS, global.SURFACE_FORMAT_NAME); + } function attribute_surface_depth(label = true) { attributes[? "color_depth"] = inputs[| 0].type == VALUE_TYPE.surface? 0 : 1; diff --git a/scripts/node_render_sprite_sheet/node_render_sprite_sheet.gml b/scripts/node_render_sprite_sheet/node_render_sprite_sheet.gml index a86cb8a37..47ff75ff4 100644 --- a/scripts/node_render_sprite_sheet/node_render_sprite_sheet.gml +++ b/scripts/node_render_sprite_sheet/node_render_sprite_sheet.gml @@ -218,7 +218,7 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) outputs[| 1].setValue(_atl); } - static onInspectorUpdate = function(updateAll = true) { + static onInspector1Update = function(updateAll = true) { var key = ds_map_find_first(NODE_MAP); repeat(ds_map_size(NODE_MAP)) { var node = NODE_MAP[? key]; diff --git a/scripts/node_rigid_sim/node_rigid_sim.gml b/scripts/node_rigid_group/node_rigid_group.gml similarity index 52% rename from scripts/node_rigid_sim/node_rigid_sim.gml rename to scripts/node_rigid_group/node_rigid_group.gml index 95a1cb9f4..72f17a31e 100644 --- a/scripts/node_rigid_sim/node_rigid_sim.gml +++ b/scripts/node_rigid_group/node_rigid_group.gml @@ -2,10 +2,11 @@ function Node_Rigid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro name = "RigidSim"; color = COLORS.node_blend_simulation; icon = THEME.rigidSim; - - ungroupable = false; update_on_frame = true; - collIndex = irandom_range(1, 9999); + + ungroupable = false; + update_on_frame = true; + collIndex = irandom_range(1, 9999); if(!LOADING && !APPENDING && !CLONING) { var _render = nodeBuild("Node_Rigid_Render", 256, -32, self); @@ -17,23 +18,23 @@ function Node_Rigid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro //physics_world_update_iterations(30); //physics_world_update_speed(100) - static reset = function() { - instance_destroy(oRigidbody); - physics_pause_enable(true); + //static reset = function() { + // instance_destroy(oRigidbody); + // physics_pause_enable(true); - var node_list = getNodeList(); - for( var i = 0; i < ds_list_size(node_list); i++ ) { - var n = node_list[| i]; - if(variable_struct_exists(n, "reset")) - n.reset(); - } - physics_pause_enable(false); - } + // var node_list = getNodeList(); + // for( var i = 0; i < ds_list_size(node_list); i++ ) { + // var n = node_list[| i]; + // if(variable_struct_exists(n, "reset")) + // n.reset(); + // } + // physics_pause_enable(false); + //} - static update = function() { - if(ANIMATOR.current_frame == 0) - reset(); - } + //static update = function() { + // if(ANIMATOR.current_frame == 0) + // reset(); + //} PATCH_STATIC } \ No newline at end of file diff --git a/scripts/node_rigid_sim/node_rigid_sim.yy b/scripts/node_rigid_group/node_rigid_group.yy similarity index 86% rename from scripts/node_rigid_sim/node_rigid_sim.yy rename to scripts/node_rigid_group/node_rigid_group.yy index 1c6549d5c..132948e73 100644 --- a/scripts/node_rigid_sim/node_rigid_sim.yy +++ b/scripts/node_rigid_group/node_rigid_group.yy @@ -1,7 +1,7 @@ { "resourceType": "GMScript", "resourceVersion": "1.0", - "name": "node_rigid_sim", + "name": "node_rigid_group", "isCompatibility": false, "isDnD": false, "parent": { diff --git a/scripts/node_rigid_object/node_rigid_object.gml b/scripts/node_rigid_object/node_rigid_object.gml index 680c9dc42..d151abf62 100644 --- a/scripts/node_rigid_object/node_rigid_object.gml +++ b/scripts/node_rigid_object/node_rigid_object.gml @@ -2,6 +2,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr name = "Object"; color = COLORS.node_blend_simulation; icon = THEME.rigidSim; + update_on_frame = true; + w = 96; min_h = 96; @@ -36,7 +38,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr inputs[| 8] = nodeValue("Spawn", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Make object spawn when start.") .rejectArray(); - inputs[| 9] = nodeValue("Generate mesh", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 9] = nodeValue("Generate mesh", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) .setDisplay(VALUE_DISPLAY.button, [ function() { var _tex = inputs[| 6].getValue(); if(is_array(_tex)) { @@ -44,7 +46,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr generateMesh(i); } else generateMesh(); - update(); + doUpdate(); }, "Generate"] ); inputs[| 10] = nodeValue("Mesh expansion", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) @@ -517,7 +519,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr physics_fixture_set_linear_damping(fixture, _air_frc); physics_fixture_set_angular_damping(fixture, _rot_frc); physics_fixture_set_awake(fixture, true); - physics_fixture_set_collision_group(fixture, group.collIndex); + if(group != noone) + physics_fixture_set_collision_group(fixture, group.collIndex); array_push(object.fixture, physics_fixture_bind_ext(fixture, object, _spos[2], _spos[3])); physics_fixture_delete(fixture); @@ -659,7 +662,10 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr } static update = function(frame = ANIMATOR.current_frame) { - if(ANIMATOR.current_frame == 0) return; + if(ANIMATOR.current_frame == 0) { + reset(); + return; + } if(!isAnimated()) return; for( var i = 0; i < array_length(object); i++ ) diff --git a/scripts/node_rigid_render/node_rigid_render.gml b/scripts/node_rigid_render/node_rigid_render.gml index 46807e942..d375142f5 100644 --- a/scripts/node_rigid_render/node_rigid_render.gml +++ b/scripts/node_rigid_render/node_rigid_render.gml @@ -90,8 +90,8 @@ function Node_Rigid_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constr var ixs = max(0, _o.image_xscale); var iys = max(0, _o.image_yscale); - var xs = max(0, _o.xscale); - var ys = max(0, _o.yscale); + var xs = max(0, _o.xscale); + var ys = max(0, _o.yscale); var xx = lerp(_o.phy_com_x, _o.phy_position_x, xs); var yy = lerp(_o.phy_com_y, _o.phy_position_y, ys); diff --git a/scripts/node_scatter/node_scatter.gml b/scripts/node_scatter/node_scatter.gml index 6a4255f6d..9f8181d66 100644 --- a/scripts/node_scatter/node_scatter.gml +++ b/scripts/node_scatter/node_scatter.gml @@ -52,13 +52,16 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c inputs[| 17] = nodeValue("Use value", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, [ "Scale" ], "Apply the third value in each data point (if exist) on given properties.") .setDisplay(VALUE_DISPLAY.text_array, [ "Scale", "Rotation", "Color" ]); + inputs[| 18] = nodeValue("Blend mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Normal", "Add" ]); + outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); input_display_list = [ ["Surface", false], 0, 1, 15, 10, ["Scatter", false], 5, 6, 13, 14, 17, 9, 2, ["Transform", false], 3, 8, 7, 4, - ["Render", false], 11, 12, 16, + ["Render", false], 18, 11, 12, 16, ]; attribute_surface_depth(); @@ -117,6 +120,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c var alpha = _data[12]; var mulpA = _data[16]; var useV = _data[17]; + var blend = _data[18]; var _in_w, _in_h; @@ -130,8 +134,15 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c surface_set_target(_outSurf); DRAW_CLEAR - if(mulpA) BLEND_ALPHA_MULP; - else BLEND_ALPHA; + switch(blend) { + case 0 : + if(mulpA) BLEND_ALPHA_MULP; + else BLEND_ALPHA; + break; + case 1 : + BLEND_ADD; + break; + } var _sed = seed; var res_index = 0, bg = 0; diff --git a/scripts/node_seperate_shapes/node_seperate_shapes.gml b/scripts/node_seperate_shapes/node_seperate_shapes.gml index b3a0528bc..476786ace 100644 --- a/scripts/node_seperate_shapes/node_seperate_shapes.gml +++ b/scripts/node_seperate_shapes/node_seperate_shapes.gml @@ -9,13 +9,13 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons .setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]) .rejectArray(); - inputs[| 2] = nodeValue("Override color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true) + inputs[| 2] = nodeValue("Override color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false) .rejectArray(); inputs[| 3] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white) .rejectArray(); - inputs[| 4] = nodeValue("Ignore blank", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Skip empty and black shape.") + inputs[| 4] = nodeValue("Ignore blank", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Skip empty and black shape.") .rejectArray(); outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); @@ -47,7 +47,7 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons _prev_type = -1; - static onInspectorUpdate = function() { separateShape(); } + static onInspector1Update = function() { separateShape(); } static update = function() { if(attributes[? "auto_exe"]) diff --git a/scripts/node_strand_break/node_strand_break.gml b/scripts/node_strand_break/node_strand_break.gml index 55a787c2a..56a02fb47 100644 --- a/scripts/node_strand_break/node_strand_break.gml +++ b/scripts/node_strand_break/node_strand_break.gml @@ -7,6 +7,8 @@ function Node_Strand_Break(_x, _y, _group = noone) : _Node_Strand_Affector(_x, _ inputs[| input_fix_len + 0] = nodeValue("Chance", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1) .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]); + inputs[| input_fix_len + 1] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, irandom_range(100000, 999999)); + array_push(input_display_list, ["Break", false], input_fix_len + 0, input_fix_len + 1 ); diff --git a/scripts/node_strand_create/node_strand_create.gml b/scripts/node_strand_create/node_strand_create.gml index 4d9135aa8..c899906b1 100644 --- a/scripts/node_strand_create/node_strand_create.gml +++ b/scripts/node_strand_create/node_strand_create.gml @@ -1,7 +1,8 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Strand Create"; + name = "Strand Create"; color = COLORS.node_blend_strand; icon = THEME.strandSim; + update_on_frame = true; w = 96; inputs[| 0] = nodeValue("Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) @@ -43,7 +44,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const inputs[| 14] = nodeValue("Distribution", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Uniform", "Random" ]); - inputs[| 15] = nodeValue("Bake hair", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0, "Prevent strand reseting to apply manual modification. Unbaking will remove all changes.") + inputs[| 15] = nodeValue("Bake hair", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0, "Prevent strand reseting to apply manual modification. Unbaking will remove all changes.") .setDisplay(VALUE_DISPLAY.button, [ function() { attributes[? "use_groom"] = !attributes[? "use_groom"]; if(attributes[? "use_groom"]) diff --git a/scripts/node_text_file_read/node_text_file_read.gml b/scripts/node_text_file_read/node_text_file_read.gml index ce8adb414..e8a976671 100644 --- a/scripts/node_text_file_read/node_text_file_read.gml +++ b/scripts/node_text_file_read/node_text_file_read.gml @@ -52,7 +52,7 @@ function Node_Text_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons return false; } - static onInspectorUpdate = function() { + static onInspector1Update = function() { var path = inputs[| 0].getValue(); if(path == "") return; updatePaths(path); diff --git a/scripts/node_text_file_write/node_text_file_write.gml b/scripts/node_text_file_write/node_text_file_write.gml index 9a3f2f93f..3ac2720ef 100644 --- a/scripts/node_text_file_write/node_text_file_write.gml +++ b/scripts/node_text_file_write/node_text_file_write.gml @@ -26,7 +26,7 @@ function Node_Text_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con } static update = function(frame = ANIMATOR.current_frame) { writeFile(); } - static onInspectorUpdate = function() { writeFile(); } + static onInspector1Update = function() { writeFile(); } static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { var bbox = drawGetBbox(xx, yy, _s); diff --git a/scripts/node_trigger/node_trigger.gml b/scripts/node_trigger/node_trigger.gml new file mode 100644 index 000000000..3d411d379 --- /dev/null +++ b/scripts/node_trigger/node_trigger.gml @@ -0,0 +1,38 @@ +function Node_Trigger(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { + name = "Trigger"; + previewable = false; + update_on_frame = true; + + w = 96; + min_h = 32 + 24 * 1; + + inputs[| 0] = nodeValue("Trigger", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, false) + .setVisible(false, false); + + inputs[| 1] = nodeValue("Trigger", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, false) + .setVisible(true, true) + .setDisplay(VALUE_DISPLAY.button, [ function() { onInspector2Update(); }, "Trigger"]); + + outputs[| 0] = nodeValue("Trigger", self, JUNCTION_CONNECT.output, VALUE_TYPE.trigger, false); + + insp2UpdateTooltip = "Trigger"; + insp2UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; + + static onInspector2Update = function() { + inputs[| 0].setAnim(true); + inputs[| 0].setValue(true); + } + + function update() { + var trg = inputs[| 0].getValue(); + outputs[| 0].setValue(trg); + } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { + draw_set_text(f_h5, fa_center, fa_center, COLORS._main_text); + var bbox = drawGetBbox(xx, yy, _s); + var trg = outputs[| 0].getValue(); + + draw_sprite_fit(THEME.node_trigger, trg, bbox.xc, bbox.yc, bbox.w, bbox.h, trg? COLORS._main_accent : COLORS._main_icon); + } +} diff --git a/scripts/node_trigger/node_trigger.yy b/scripts/node_trigger/node_trigger.yy new file mode 100644 index 000000000..401d03260 --- /dev/null +++ b/scripts/node_trigger/node_trigger.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_trigger", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "trigger", + "path": "folders/nodes/data/value/trigger.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_trigger_bool/node_trigger_bool.gml b/scripts/node_trigger_bool/node_trigger_bool.gml new file mode 100644 index 000000000..467c3a794 --- /dev/null +++ b/scripts/node_trigger_bool/node_trigger_bool.gml @@ -0,0 +1,50 @@ +function Node_Trigger_Bool(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { + name = "Boolean Trigger"; + previewable = false; + update_on_frame = true; + + w = 96; + min_h = 32 + 24 * 1; + + inputs[| 0] = nodeValue("Boolean", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); + + inputs[| 1] = nodeValue("Trigger condition", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .setDisplay(VALUE_DISPLAY.enum_scroll, [ "True frame", "False to True", "True to False", "Value changed" ]); + + outputs[| 0] = nodeValue("Trigger", self, JUNCTION_CONNECT.output, VALUE_TYPE.trigger, false); + + prevVal = false; + preview = false; + + function update() { + var val = inputs[| 0].getValue(); + var con = inputs[| 1].getValue(); + + switch(con) { + case 0 : + outputs[| 0].setValue(val); + preview = val; + break; + case 1 : + outputs[| 0].setValue(!prevVal && val); + preview = !prevVal && val; + break; + case 2 : + outputs[| 0].setValue( prevVal && !val); + preview = prevVal && !val; + break; + case 3 : + outputs[| 0].setValue( prevVal != val); + preview = prevVal != val; + break; + } + + prevVal = val; + } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { + draw_set_text(f_h5, fa_center, fa_center, COLORS._main_text); + var bbox = drawGetBbox(xx, yy, _s); + draw_sprite_fit(THEME.node_trigger, preview, bbox.xc, bbox.yc, bbox.w, bbox.h, preview? COLORS._main_accent : COLORS._main_icon); + } +} diff --git a/scripts/node_trigger_bool/node_trigger_bool.yy b/scripts/node_trigger_bool/node_trigger_bool.yy new file mode 100644 index 000000000..11cf54543 --- /dev/null +++ b/scripts/node_trigger_bool/node_trigger_bool.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_trigger_bool", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "trigger", + "path": "folders/nodes/data/value/trigger.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_tunnel_in/node_tunnel_in.gml b/scripts/node_tunnel_in/node_tunnel_in.gml index cc962d10b..af43bf173 100644 --- a/scripts/node_tunnel_in/node_tunnel_in.gml +++ b/scripts/node_tunnel_in/node_tunnel_in.gml @@ -120,18 +120,21 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct } static getNextNodes = function() { - var _key = inputs[| 0].getValue(); - var amo = ds_map_size(TUNNELS_OUT); + var nodes = []; + var _key = inputs[| 0].getValue(); + var amo = ds_map_size(TUNNELS_OUT); var k = ds_map_find_first(TUNNELS_OUT); repeat(amo) { if(TUNNELS_OUT[? k] == _key) { NODE_MAP[? k].triggerRender(); - ds_queue_enqueue(RENDER_QUEUE, NODE_MAP[? k]); + array_push(nodes, NODE_MAP[? k]); } k = ds_map_find_next(TUNNELS_OUT, k); } + + return nodes; } static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 898f2f341..863834824 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -26,6 +26,9 @@ enum VALUE_TYPE { struct = 16, strands = 17, mesh = 18, + trigger = 19, + + action = 99, } enum VALUE_DISPLAY { @@ -95,7 +98,10 @@ function value_color(i) { $5d3f8c, //struct $6691ff, //strand $d1c2c2, //mesh + $5dde8f, //trigger ]; + + if(i == 99) return $5dde8f; return JUNCTION_COLORS[safe_mod(max(0, i), array_length(JUNCTION_COLORS))]; } @@ -121,6 +127,9 @@ function value_bit(i) { case VALUE_TYPE.node : return 1 << 32; + case VALUE_TYPE.trigger : return 1 << 22; + case VALUE_TYPE.action : return 1 << 22 | 1 << 3; + case VALUE_TYPE.any : return ~0 & ~(1 << 32); } return 0; @@ -234,10 +243,6 @@ function isGraphable(prop) { return false; } -function nodeValue(_name, _node, _connect, _type, _value, _tooltip = "") { - return new NodeValue(_name, _node, _connect, _type, _value, _tooltip); -} - function nodeValueUnit(value) constructor { self.value = value; @@ -247,7 +252,7 @@ function nodeValueUnit(value) constructor { mode = !mode; value.cache_value[0] = false; value.unitConvert(mode); - value.node.update(); + value.node.doUpdate(); }); triggerButton.icon_blend = COLORS._main_icon_light; triggerButton.icon = THEME.unit_ref; @@ -318,6 +323,10 @@ global.displaySuffix_Padding = [ "right", "top", "left", "bottom" ]; global.displaySuffix_VecRange = [ "x min", "x max", "y min", "y max" ]; global.displaySuffix_Axis = [ "x", "y", "z", "w"]; +function nodeValue(_name, _node, _connect, _type, _value, _tooltip = "") { + return new NodeValue(_name, _node, _connect, _type, _value, _tooltip); +} + function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constructor { name = _name; node = _node; @@ -355,8 +364,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru extra_data = ds_list_create(); dyna_depo = ds_list_create(); - draw_line_shift_x = 0; - draw_line_shift_y = 0; + draw_line_shift_x = 0; + draw_line_shift_y = 0; + draw_line_thick = new Tween(1,,, 1.5); draw_line_shift_hover = false; drawLineIndex = 1; @@ -534,7 +544,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } for( var i = 0; i < array_length(animators); i++ ) - animators[i].suffix = " " + array_safe_get(global.displaySuffix_Axis, i); + animators[i].suffix = " " + string(array_safe_get(global.displaySuffix_Axis, i)); break; case VALUE_DISPLAY.vector_range : @@ -557,7 +567,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru extract_node = "Node_Vector4"; for( var i = 0; i < array_length(animators); i++ ) - animators[i].suffix = " " + array_safe_get(global.displaySuffix_VecRange, i); + animators[i].suffix = " " + string(array_safe_get(global.displaySuffix_VecRange, i)); break; case VALUE_DISPLAY.rotation : @@ -798,7 +808,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru case VALUE_DISPLAY.text_array : editWidget = new textArrayBox(function() { MODIFIED = true; - return animator.values[| 0].value; }, display_data, function() { node.update(); + return animator.values[| 0].value; }, display_data, function() { node.doUpdate(); }); break; } @@ -946,7 +956,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(applyUnit) return unit.apply(value, arrIndex); } - + + if(type == VALUE_TYPE.surface && connect_type == JUNCTION_CONNECT.input && !is_surface(value) && def_val == USE_DEF) + return DEF_SURFACE; + return value; } @@ -1046,6 +1059,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru static setAnim = function(anim) { is_anim = anim; + PANEL_ANIMATION.updatePropertyList(); } static __anim = function() { @@ -1167,6 +1181,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } if(_valueFrom == value_from) { + print("whaT") return false; } @@ -1218,11 +1233,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru static setFrom = function(_valueFrom, _update = true, checkRecur = true) { if(_valueFrom == noone) return removeFrom(); - - if(!isConnectable(_valueFrom, checkRecur, true)) + + if(!isConnectable(_valueFrom, checkRecur, true)) return false; - if(setFrom_condition != -1 && !setFrom_condition(_valueFrom)) + if(setFrom_condition != -1 && !setFrom_condition(_valueFrom)) return false; if(value_from != noone) @@ -1248,6 +1263,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru draw_line_shift_y = 0; if(!LOADING) MODIFIED = true; + return true; } @@ -1375,9 +1391,16 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, x, y, 10 * _s * sca)) { is_hover = true; - draw_sprite_ext(isArray()? THEME.node_junctions_array_hover : THEME.node_junctions_single_hover, type, x, y, ss, ss, 0, c_white, 1); - } else - draw_sprite_ext(isArray()? THEME.node_junctions_array : THEME.node_junctions_single, type, x, y, ss, ss, 0, c_white, 1); + if(type == VALUE_TYPE.action) + draw_sprite_ext(THEME.node_junction_inspector, 1, x, y, ss, ss, 0, c_white, 1); + else + draw_sprite_ext(isArray()? THEME.node_junctions_array_hover : THEME.node_junctions_single_hover, type, x, y, ss, ss, 0, c_white, 1); + } else { + if(type == VALUE_TYPE.action) + draw_sprite_ext(THEME.node_junction_inspector, 0, x, y, ss, ss, 0, c_white, 1); + else + draw_sprite_ext(isArray()? THEME.node_junctions_array : THEME.node_junctions_single, type, x, y, ss, ss, 0, c_white, 1); + } return is_hover; } @@ -1387,15 +1410,18 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru draw_set_text(f_p1, fa_left, fa_center); - var tw = string_width(name) + 16; + var tw = string_width(name) + 32; var th = string_height(name) + 16; - if(connect_type == JUNCTION_CONNECT.input) { + if(type == VALUE_TYPE.action) { + var tx = x; + draw_sprite_stretched_ext(THEME.node_junction_name_bg, 0, tx - tw / 2, y - th, tw, th, c_white, 0.5); + } else if(connect_type == JUNCTION_CONNECT.input) { var tx = x - 12 * _s; - draw_sprite_stretched_ext(THEME.node_junction_name_bg, 0, tx - tw, y - th / 2, tw + 16, th, c_white, 0.5); + draw_sprite_stretched_ext(THEME.node_junction_name_bg, 0, tx - tw + 16, y - th / 2, tw, th, c_white, 0.5); } else { var tx = x + 12 * _s; - draw_sprite_stretched_ext(THEME.node_junction_name_bg, 0, tx - 16, y - th / 2, tw + 16, th, c_white, 0.5); + draw_sprite_stretched_ext(THEME.node_junction_name_bg, 0, tx - 16, y - th / 2, tw, th, c_white, 0.5); } } static drawName = function(_s, _mx, _my) { @@ -1405,7 +1431,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var _draw_cc = _hover? COLORS._main_text : COLORS._main_text_sub; draw_set_text(f_p1, fa_left, fa_center, _draw_cc); - if(connect_type == JUNCTION_CONNECT.input) { + if(type == VALUE_TYPE.action) { + var tx = x; + draw_set_text(f_p1, fa_center, fa_center, _draw_cc); + draw_text(tx, y - (line_height() + 16) / 2, name); + } else if(connect_type == JUNCTION_CONNECT.input) { var tx = x - 12 * _s; draw_set_halign(fa_right); draw_text(tx, y, name); @@ -1474,7 +1504,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; } - ext.update(); + ext.doUpdate(); PANEL_ANIMATION.updatePropertyList(); } diff --git a/scripts/node_vector/node_vector.gml b/scripts/node_vector/node_vector.gml index 4bd98dd16..b801bce57 100644 --- a/scripts/node_vector/node_vector.gml +++ b/scripts/node_vector/node_vector.gml @@ -147,7 +147,7 @@ function Node_Vector2(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c inputs[| 3] = nodeValue("Display", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) .setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "Coordinate" ]); - inputs[| 4] = nodeValue("Reset to center", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 4] = nodeValue("Reset to center", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) .setDisplay(VALUE_DISPLAY.button, [ function () { wd_minx = -1; wd_miny = -1; diff --git a/scripts/node_wrap_mesh/node_wrap_mesh.gml b/scripts/node_wrap_mesh/node_wrap_mesh.gml index febbef407..be6f7e6d4 100644 --- a/scripts/node_wrap_mesh/node_wrap_mesh.gml +++ b/scripts/node_wrap_mesh/node_wrap_mesh.gml @@ -15,7 +15,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) inputs[| 2] = nodeValue("Spring force", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5) .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ] ); - inputs[| 3] = nodeValue("Mesh", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + inputs[| 3] = nodeValue("Mesh", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0) .setDisplay(VALUE_DISPLAY.button, [ function() { setTriangle(); doUpdate(); }, "Generate"] ); inputs[| 4] = nodeValue("Diagonal link", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Include diagonal link to prevent drastic grid deformation."); @@ -30,7 +30,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) function createControl() { var index = ds_list_size(inputs); - inputs[| index] = nodeValue("Control point", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ PUPPET_FORCE_MODE.move, 16, 16, 8, 0, 8, 8]) + inputs[| index] = nodeValue("Control point", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ PUPPET_FORCE_MODE.move, 16, 16, 8, 0, 8, 8 ]) .setDisplay(VALUE_DISPLAY.puppet_control) array_push(input_display_list, index); @@ -51,6 +51,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) attribute_interpolation(); input_display_index = array_length(input_display_list); + points = []; attributes[? "iteration"] = 4; array_push(attributeEditors, ["Iteration", "iteration", @@ -61,12 +62,9 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) new NodeTool( "Pin / unpin (+ Shift) mesh", THEME.control_pin ) ]; - attributes[? "pin"] = ds_map_create(); - static onValueFromUpdate = function(index) { - if(index == 0 && ds_list_empty(data.tris)) { + if(index == 0 && array_empty(data.tris)) setTriangle(); - } } static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { @@ -91,7 +89,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) if(mouse_press(mb_left)) { if(hover == -1) { var i = createControl(); - i.setValue( [PUPPET_FORCE_MODE.move, value_snap(_mx - _x, _snx) / _s, value_snap(_my - _y, _sny) / _s, 0, 0, 8, 8] ); + i.setValue( [ PUPPET_FORCE_MODE.move, value_snap(_mx - _x, _snx) / _s, value_snap(_my - _y, _sny) / _s, 0, 0, 8, 8 ] ); i.drag_type = 2; i.drag_sx = 0; i.drag_sy = 0; @@ -132,17 +130,19 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) function _Point(node, index, _x, _y) constructor { self.index = index; self.node = node; - x = _x; - y = _y; + x = _x; + y = _y; xp = x; yp = y; + node.points[index] = self; + ndx = 0; ndy = 0; - sx = x; - sy = y; - pin = ds_map_exists(node.attributes[? "pin"], index); + sx = x; + sy = y; + pin = false; static reset = function() { x = sx; @@ -196,11 +196,6 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) } static setPin = function(pin) { - if(!pin && ds_map_exists(node.attributes[? "pin"], index)) - ds_map_delete(node.attributes[? "pin"], index); - if(pin && !ds_map_exists(node.attributes[? "pin"], index)) - ds_map_add(node.attributes[? "pin"], index, 1); - self.pin = pin; } } @@ -301,9 +296,10 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) surface_reset_target(); } + points = []; data.points = [[]]; - ds_list_clear(data.tris); - ds_list_clear(data.links); + data.tris = []; + data.links = []; var ind = 0; for(var i = 0; i <= sample; i++) @@ -324,9 +320,9 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) if(i == 0) continue; if(j && data.points[i - 1][j] != 0 && data.points[i][j - 1] != 0) - ds_list_add(data.tris, new _Triangle(data.points[i - 1][j], data.points[i][j - 1], data.points[i][j])); + array_push(data.tris, new _Triangle(data.points[i - 1][j], data.points[i][j - 1], data.points[i][j])); if(j < sample && data.points[i - 1][j] != 0 && data.points[i - 1][j + 1] != 0) - ds_list_add(data.tris, new _Triangle(data.points[i - 1][j], data.points[i - 1][j + 1], data.points[i][j])); + array_push(data.tris, new _Triangle(data.points[i - 1][j], data.points[i - 1][j + 1], data.points[i][j])); } else data.points[i][j] = 0; } @@ -336,22 +332,22 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) if(data.points[i][j] == 0) continue; if(i && data.points[i - 1][j] != 0) { - ds_list_add(data.links, new link(data.points[i][j], data.points[i - 1][j])); + array_push(data.links, new link(data.points[i][j], data.points[i - 1][j])); } if(j && data.points[i][j - 1] != 0) { - ds_list_add(data.links, new link(data.points[i][j], data.points[i][j - 1])); + array_push(data.links, new link(data.points[i][j], data.points[i][j - 1])); } if(diagon) { if(i && j && data.points[i - 1][j - 1] != 0) { var l = new link(data.points[i][j], data.points[i - 1][j - 1]); l.k = spring; - ds_list_add(data.links, l); + array_push(data.links, l); } if(i && j < sample && data.points[i - 1][j + 1] != 0) { var l = new link(data.points[i][j], data.points[i - 1][j + 1]); l.k = spring; - ds_list_add(data.links, l); + array_push(data.links, l); } } } @@ -464,19 +460,43 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _inputs = load_map[? "inputs"]; for(var i = control_index; i < ds_list_size(_inputs); i++) { - createControl(); - inputs[| i].deserialize(_inputs[| i]); + var inp = createControl(); + print(instanceof(inp)) + inp.applyDeserialize(_inputs[| i]); } } static attributeSerialize = function() { var att = ds_map_create(); - ds_map_add_map(att, "pin", attributes[? "pin"]); + + var pinList = ds_list_create(); + for( var j = 0; j < array_length(data.points); j++ ) + for( var k = 0; k < array_length(data.points[j]); k++ ) { + var p = data.points[j][k]; + if(p == 0) continue; + if(p.pin) ds_list_add(pinList, p.index); + } + + ds_map_add_list(att, "pin", pinList); return att; } + loadPin = noone; static attributeDeserialize = function(attr) { - if(ds_map_exists(attr, "pin")) - attributes[? "pin"] = ds_map_clone(attr[? "pin"]); + if(ds_map_exists(attr, "pin")) + loadPin = attr[? "pin"]; + } + + static postConnect = function() { + setTriangle(); + + if(loadPin != noone) { + for( var i = 0; i < ds_list_size(loadPin); i++ ) { + var ind = loadPin[| i]; + if(ind < array_length(points)) + points[ind].pin = true; + } + loadPin = noone; + } } } \ No newline at end of file diff --git a/scripts/panel_animation/panel_animation.gml b/scripts/panel_animation/panel_animation.gml index b130d6bd2..883db1a51 100644 --- a/scripts/panel_animation/panel_animation.gml +++ b/scripts/panel_animation/panel_animation.gml @@ -1076,10 +1076,16 @@ function Panel_Animation() : PanelContent() constructor { if(stagger_mode == 1 && ds_list_exist(keyframe_selecting, keyframe)) cc = key_hover == keyframe? COLORS.panel_animation_keyframe_selected : COLORS._main_accent; - - draw_sprite_ui_uniform(THEME.timeline_keyframe, keyframe.ease_in_type == CURVE_TYPE.cut? 4 : 1, t, prop_y, 1, cc); + + var ind = 1; + if(keyframe.ease_in_type == CURVE_TYPE.cut) + ind = 4; + if(keyframe.anim.prop.type == VALUE_TYPE.trigger) + ind = 4; + + draw_sprite_ui_uniform(THEME.timeline_keyframe, ind, t, prop_y, 1, cc); if(ds_list_exist(keyframe_selecting, keyframe)) - draw_sprite_ui_uniform(THEME.timeline_keyframe_selecting, keyframe.ease_in_type == CURVE_TYPE.cut, t, prop_y, 1, COLORS._main_accent); + draw_sprite_ui_uniform(THEME.timeline_keyframe_selecting, ind != 1, t, prop_y, 1, COLORS._main_accent); if(keyframe_boxing) { var box_x0 = min(keyframe_box_sx, msx); diff --git a/scripts/panel_data/panel_data.gml b/scripts/panel_data/panel_data.gml index 6167db138..d29ec98d8 100644 --- a/scripts/panel_data/panel_data.gml +++ b/scripts/panel_data/panel_data.gml @@ -522,6 +522,10 @@ function Panel(_parent, _x, _y, _w, _h) constructor { menuCall(,, menu); } + + if(DRAGGING) { + content_index = i; + } } var cc = foc? COLORS.panel_bg_clear_inner : COLORS._main_text_sub; @@ -820,6 +824,7 @@ function PanelContent() constructor { showHeader = true; function refresh() { + setPanelSize(panel); onResize(); } @@ -829,6 +834,7 @@ function PanelContent() constructor { function onFocusEnd() {} function initSize() {} + function setPanelSize(panel) { x = panel.tx; y = panel.ty; diff --git a/scripts/panel_function/panel_function.gml b/scripts/panel_function/panel_function.gml index 207641cc7..2874505e3 100644 --- a/scripts/panel_function/panel_function.gml +++ b/scripts/panel_function/panel_function.gml @@ -60,7 +60,8 @@ case "Panel_Globalvar" : return new Panel_Globalvar(); case "Panel_Color" : return new Panel_Color(); - case "Panel_Palette" : return new Panel_Palette(); + case "Panel_Palette" : return new Panel_Palette(); + case "Panel_Gradient" : return new Panel_Gradient(); } return noone; diff --git a/scripts/panel_gradient/panel_gradient.gml b/scripts/panel_gradient/panel_gradient.gml new file mode 100644 index 000000000..b03baf7d9 --- /dev/null +++ b/scripts/panel_gradient/panel_gradient.gml @@ -0,0 +1,101 @@ +function Panel_Gradient() : PanelContent() constructor { + title = "Gradient"; + showHeader = false; + title_height = 64; + padding = 24; + + w = ui(320); + h = ui(480); + + presets = []; + + function presetCollect() { + presets = []; + + var path = DIRECTORY + "Gradients/" + var file = file_find_first(path + "*", 0); + while(file != "") { + array_push(presets, { + name: filename_name(file), + gradient: loadGradient(path + file) + }); + + file = file_find_next(); + } + file_find_close(); + } + presetCollect(); + + function onResize() { + PANEL_PADDING + + sp_gradient.resize(w - ui(padding + padding), h - ui(title_height + padding)); + } + + sp_gradient = new scrollPane(w - ui(padding + padding), h - ui(title_height + padding), function(_y, _m) { + draw_clear_alpha(COLORS.panel_bg_clear, 0); + var ww = sp_gradient.surface_w; + var hh = 0; + + var amo = array_length(presets); + var col = floor(ww / ui(160)); + var row = ceil(amo / col); + + var gw = (ww + ui(8)) / col; + var gh = ui(16); + + var hg = ui(24 + 8) + gh; + var yy = _y; + + for(var i = 0; i < row; i++) { + for(var j = 0; j < col; j++) { + var ind = i * col + j; + if(ind >= amo) break; + + var xx = j * gw; + var preset = presets[ind]; + var isHover = pHOVER && point_in_rectangle(_m[0], _m[1], xx, max(0, yy), xx + gw - ui(8), min(sp_gradient.h, yy + hg)); + + draw_sprite_stretched(THEME.ui_panel_bg, in_dialog, xx, yy, gw - ui(8), hg); + if(isHover) + draw_sprite_stretched_ext(THEME.node_active, 1, xx, yy, gw - ui(8), hg, COLORS._main_accent, 1); + + draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub); + draw_text(xx + ui(10), yy + ui(2), preset.name); + preset.gradient.draw(xx + ui(10), yy + ui(24), gw - ui(28), gh); + + if(isHover && mouse_press(mb_left, pFOCUS)) { + DRAGGING = { + type: "Gradient", + data: preset.gradient + } + } + } + yy += hg + ui(8); + hh += hg + ui(8); + } + + return hh; + }); + + function drawContent(panel) { + PANEL_PADDING + PANEL_TITLE + + var px = ui(padding); + var py = ui(title_height); + var pw = w - ui(padding + padding); + var ph = h - ui(title_height + padding); + + draw_sprite_stretched(THEME.ui_panel_bg, !in_dialog, px - ui(8), py - ui(8), pw + ui(16), ph + ui(16)); + + sp_gradient.setActiveFocus(pFOCUS, pHOVER); + sp_gradient.draw(px, py, mx - px, my - py); + + var bx = w - ui(32 + 16); + var by = title_height / 2 - ui(16 + !in_dialog * 2); + + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Refresh", THEME.refresh, 1, COLORS._main_icon) == 2) + presetCollect(); + } +} \ No newline at end of file diff --git a/scripts/panel_gradient/panel_gradient.yy b/scripts/panel_gradient/panel_gradient.yy new file mode 100644 index 000000000..025165514 --- /dev/null +++ b/scripts/panel_gradient/panel_gradient.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "panel_gradient", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "colors", + "path": "folders/panels/colors.yy", + }, +} \ No newline at end of file diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 8077b111e..8d77e468b 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -614,9 +614,6 @@ function Panel_Graph() : PanelContent() constructor { } //print("Node selection time: " + string(current_time - t)); t = current_time; - if(node_hovering && node_hovering.on_dragdrop_file != -1) - node_hovering.drawActive(gr_x, gr_y, graph_s, 1); - if(node_focus) node_focus.drawActive(gr_x, gr_y, graph_s); @@ -1328,9 +1325,12 @@ function Panel_Graph() : PanelContent() constructor { } } + var drawCorner = value_dragging.type == VALUE_TYPE.action; if(target != noone) { _mx = target.x; _my = target.y; + + drawCorner |= target.type == VALUE_TYPE.action; } var col = value_color(value_dragging.type); @@ -1338,24 +1338,47 @@ function Panel_Graph() : PanelContent() constructor { draw_set_color(col); var th = PREF_MAP[? "connection_line_width"] * graph_s; switch(PREF_MAP[? "curve_connection_line"]) { - case 0 : draw_line_width(xx, yy, _mx, _my, th); break; + case 0 : + draw_line_width(xx, yy, _mx, _my, th); + break; case 1 : - if(value_dragging.connect_type == JUNCTION_CONNECT.output) - draw_line_curve_color(_mx, _my, xx, yy,,, graph_s, th, col, col); - else - draw_line_curve_color(xx, yy, _mx, _my,,, graph_s, th, col, col); + if(drawCorner) { + if(value_dragging.type == VALUE_TYPE.action) + draw_line_curve_corner(_mx, _my, xx, yy, graph_s, th, col, col); + else + draw_line_curve_corner(xx, yy, _mx, _my, graph_s, th, col, col); + } else { + if(value_dragging.connect_type == JUNCTION_CONNECT.output) + draw_line_curve_color(_mx, _my, xx, yy,,, graph_s, th, col, col); + else + draw_line_curve_color(xx, yy, _mx, _my,,, graph_s, th, col, col); + } break; case 2 : - if(value_dragging.connect_type == JUNCTION_CONNECT.output) - draw_line_elbow_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner); - else - draw_line_elbow_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner); + if(drawCorner) { + if(value_dragging.type == VALUE_TYPE.action) + draw_line_elbow_corner(_mx, _my, xx, yy, graph_s, th, col, col, corner); + else + draw_line_elbow_corner(xx, yy, _mx, _my, graph_s, th, col, col, corner); + } else { + if(value_dragging.connect_type == JUNCTION_CONNECT.output) + draw_line_elbow_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner); + else + draw_line_elbow_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner); + } break; case 3 : - if(value_dragging.connect_type == JUNCTION_CONNECT.output) - draw_line_elbow_diag_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner); - else - draw_line_elbow_diag_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner); + if(drawCorner) { + if(value_dragging.type == VALUE_TYPE.action) + draw_line_elbow_diag_corner(_mx, _my, xx, yy, graph_s, th, col, col, corner); + else + draw_line_elbow_diag_corner(xx, yy, _mx, _my, graph_s, th, col, col, corner); + } else { + if(value_dragging.connect_type == JUNCTION_CONNECT.output) + draw_line_elbow_diag_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner); + else + draw_line_elbow_diag_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner); + } break; } @@ -1366,7 +1389,7 @@ function Panel_Graph() : PanelContent() constructor { if(mouse_release(mb_left)) { if(value_focus && value_focus != value_dragging) { if(value_focus.connect_type == JUNCTION_CONNECT.input) - value_focus.setFrom(value_dragging); + var res = value_focus.setFrom(value_dragging); else value_dragging.setFrom(value_focus); } else if(target != noone && value_dragging.connect_type == JUNCTION_CONNECT.input) { diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index b69cf8b69..1896bbac7 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -554,10 +554,10 @@ function Panel_Inspector() : PanelContent() constructor { var bx = w - ui(44); var by = ui(12); - if(inspecting.hasInspectorUpdate(true)) { - var icon = inspecting.inspUpdateIcon; - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, inspecting.inspUpdateTooltip, icon[0], icon[1], icon[2]) == 2) - inspecting.inspectorUpdate(); + if(inspecting.hasInspector1Update(true)) { + var icon = inspecting.insp1UpdateIcon; + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, inspecting.insp1UpdateTooltip, icon[0], icon[1], icon[2]) == 2) + inspecting.inspector1Update(); } else draw_sprite_ui(THEME.sequence_control, 1, bx + ui(16), by + ui(16),,,, COLORS._main_icon_dark); diff --git a/scripts/panel_menu/panel_menu.gml b/scripts/panel_menu/panel_menu.gml index 70de8d1f1..7b60c2d4b 100644 --- a/scripts/panel_menu/panel_menu.gml +++ b/scripts/panel_menu/panel_menu.gml @@ -188,8 +188,9 @@ function Panel_Menu() : PanelContent() constructor { menuItem(get_text("panel_menu_color", "Color"), function(_x, _y, _depth) { return submenuCall(_x, _y, _depth, [ - menuItem(get_text("panel_menu_color", "Color"), function() { panelAdd("Panel_Color", true) },,, function() { return findPanel("Panel_Color") != noone; } ), - menuItem(get_text("panel_menu_palette", "Palette"), function() { panelAdd("Panel_Palette", true) },,, function() { return findPanel("Panel_Palette") != noone; } ), + menuItem(get_text("panel_menu_color", "Color"), function() { panelAdd("Panel_Color", true) },,, function() { return findPanel("Panel_Color") != noone; } ), + menuItem(get_text("panel_menu_palette", "Palette"), function() { panelAdd("Panel_Palette", true) },,, function() { return findPanel("Panel_Palette") != noone; } ), + menuItem(get_text("panel_menu_gradient", "Gradient"),function() { panelAdd("Panel_Gradient", true) },,, function() { return findPanel("Panel_Gradient") != noone; } ), ]); } ).setIsShelf(), ]], diff --git a/scripts/panel_nodes/panel_nodes.gml b/scripts/panel_nodes/panel_nodes.gml index 347beb3c1..104016cd6 100644 --- a/scripts/panel_nodes/panel_nodes.gml +++ b/scripts/panel_nodes/panel_nodes.gml @@ -117,7 +117,7 @@ function Panel_Nodes() : PanelContent() constructor { sc_nodes.draw(px, py + ui(40), mx - px, my - (py + ui(40))); //var bx = w - ui(32 + 16); - //var by = title_height / 2 - ui(14); + //var by = title_height / 2 - ui(16 + !in_dialog * 2); //if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Create tunnel", THEME.tunnel, 1, c_white) == 2) { // nodeBuild("Node_Tunnel_In", build_x, build_y); diff --git a/scripts/panel_notification/panel_notification.gml b/scripts/panel_notification/panel_notification.gml index fd6513e12..525b469a1 100644 --- a/scripts/panel_notification/panel_notification.gml +++ b/scripts/panel_notification/panel_notification.gml @@ -139,14 +139,12 @@ function Panel_Notification() : PanelContent() constructor { function drawContent(panel) { PANEL_PADDING - - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_title); - draw_text_over(in_dialog? ui(56) : ui(24), title_height / 2, title); + PANEL_TITLE var ww = ui(28); var hh = ui(28); var bx = w - ui(in_dialog? padding - 8 : padding) - ww; - var by = title_height / 2 - ui(14); + var by = title_height / 2 - ui(16 + !in_dialog * 2); var error = !!(filter & NOTI_TYPE.error); var toolt = error? get_text("noti_hide_error", "Hide error") : get_text("noti_show_error", "Show error"); diff --git a/scripts/panel_workspace/panel_workspace.gml b/scripts/panel_workspace/panel_workspace.gml index e7cd36961..3b137c78c 100644 --- a/scripts/panel_workspace/panel_workspace.gml +++ b/scripts/panel_workspace/panel_workspace.gml @@ -8,6 +8,8 @@ function Panel_Workspace() : PanelContent() constructor { scroll_max = 0; hori = false; + layout_selecting = ""; + function refreshContent() { workspaces = []; @@ -33,12 +35,14 @@ function Panel_Workspace() : PanelContent() constructor { var y0 = hori? ui(6) : ui(6) + scroll, y1; var ww = 0; var hh = 0; + var amo = array_length(workspaces); draw_set_text(f_p1, hori? fa_left : fa_center, fa_top, COLORS._main_text_sub); - for( var i = 0; i < array_length(workspaces); i++ ) { - var tw = hori? string_width(workspaces[i]) + ui(16) : w - ui(16); - var th = string_height(workspaces[i]) + ui(8); + for( var i = 0; i <= amo; i++ ) { + var str = i == amo? "+" : workspaces[i]; + var tw = hori? string_width(str) + ui(16) : w - ui(16); + var th = string_height(str) + ui(8); x1 = x0 + tw; y1 = y0 + th; @@ -47,14 +51,47 @@ function Panel_Workspace() : PanelContent() constructor { draw_sprite_stretched(THEME.button_hide_fill, 1, x0, y0, x1 - x0, y1 - y0); if(mouse_press(mb_left, pFOCUS)) { - PREF_MAP[? "panel_layout_file"] = workspaces[i]; - PREF_SAVE(); - setPanel(); + if(i == amo) { + var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8)); + dia.name = PREF_MAP[? "panel_layout_file"]; + dia.onModify = function(name) { + var cont = panelSerialize(); + json_save_struct(DIRECTORY + "layouts/" + name + ".json", cont); + + PREF_MAP[? "panel_layout_file"] = name; + PREF_SAVE(); + refreshContent(); + }; + } else { + PREF_MAP[? "panel_layout_file"] = str; + PREF_SAVE(); + setPanel(); + } + } + + if(mouse_press(mb_right, pFOCUS)) { + layout_selecting = str; + menuCall(,, [ + menuItem("Select", function() { + PREF_MAP[? "panel_layout_file"] = layout_selecting; + PREF_SAVE(); + setPanel(); + }), + menuItem("Replace with current", function() { + var cont = panelSerialize(); + json_save_struct(DIRECTORY + "layouts/" + layout_selecting + ".json", cont); + + }), + menuItem("Delete", function() { + file_delete(DIRECTORY + "layouts/" + layout_selecting + ".json"); + refreshContent(); + }, THEME.cross), + ]); } } - draw_set_color(PREF_MAP[? "panel_layout_file"] == workspaces[i]? COLORS._main_text : COLORS._main_text_sub) - draw_text_add(hori? x0 + ui(8) : (x0 + x1) / 2, y0 + ui(4), workspaces[i]); + draw_set_color(PREF_MAP[? "panel_layout_file"] == str? COLORS._main_text : COLORS._main_text_sub) + draw_text_add(hori? x0 + ui(8) : (x0 + x1) / 2, y0 + ui(4), str); if(hori) { x0 += tw + ui(4); diff --git a/scripts/preferences/preferences.gml b/scripts/preferences/preferences.gml index 14f1d1498..5acf0dae8 100644 --- a/scripts/preferences/preferences.gml +++ b/scripts/preferences/preferences.gml @@ -25,6 +25,7 @@ PREF_MAP[? "connection_line_sample"] = 1; PREF_MAP[? "connection_line_corner"] = 8; PREF_MAP[? "connection_line_aa"] = 2; + PREF_MAP[? "connection_line_transition"] = true; PREF_MAP[? "curve_connection_line"] = 1; PREF_MAP[? "default_surface_side"] = 32; @@ -204,8 +205,8 @@ file_text_write_all(path, json_encode_minify(map)); ds_map_destroy(map); - var path = DIRECTORY + "Nodes/fav.json"; - json_save_struct(path, global.FAV_NODES); + json_save_struct(DIRECTORY + "Nodes/fav.json", global.FAV_NODES); + json_save_struct(DIRECTORY + "Nodes/recent.json", global.RECENT_NODES); } function PREF_LOAD() { diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index 58a02bb10..6fbea437e 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -4,10 +4,16 @@ enum RENDER_TYPE { full = 2 } -global.RENDER_LOG = false; -global.group_inputs = [ "Node_Group_Input", "Node_Feedback_Input", "Node_Iterator_Input", "Node_Iterator_Each_Input" ]; +#region globalvar + global.RENDER_DEBUG = false; + + global.RENDER_LOG = false; + global.group_inputs = [ "Node_Group_Input", "Node_Feedback_Input", "Node_Iterator_Input", "Node_Iterator_Each_Input" ]; +#endregion -function __nodeLeafList(_list, _queue) { +function __nodeLeafList(_list) { + var nodes = []; + for( var i = 0; i < ds_list_size(_list); i++ ) { var _node = _list[| i]; if(!_node.active) continue; @@ -16,10 +22,12 @@ function __nodeLeafList(_list, _queue) { _node.triggerRender(); var _startNode = _node.isRenderable(); if(_startNode) { - ds_queue_enqueue(_queue, _node); + array_push(nodes, _node); printIf(global.RENDER_LOG, "Push node " + _node.name + " to stack"); } } + + return nodes; } function __nodeIsLoop(_node) { @@ -43,12 +51,13 @@ function __nodeInLoop(_node) { } function Render(partial = false, runAction = false) { + var t = current_time; + printIf(global.RENDER_LOG, "=== RENDER START [frame " + string(ANIMATOR.current_frame) + "] ==="); + try { var rendering = noone; var error = 0; - var t = current_time; - printIf(global.RENDER_LOG, "=== RENDER START [frame " + string(ANIMATOR.current_frame) + "] ==="); - + if(!partial || ALWAYS_FULL) { var _key = ds_map_find_first(NODE_MAP); var amo = ds_map_size(NODE_MAP); @@ -78,10 +87,12 @@ function Render(partial = false, runAction = false) { if(__nodeInLoop(_node)) continue; var _startNode = _node.isRenderable(); - printIf(global.RENDER_LOG, " > Check leaf " + _node.name + " (" + _node.display_name + "): " + string(_startNode)); - - if(_startNode) + if(_startNode) { + printIf(global.RENDER_LOG, " > Found leaf " + _node.name + " (" + _node.display_name + ")"); + + _node.triggerRender(); ds_queue_enqueue(RENDER_QUEUE, _node); + } } // render forward @@ -90,20 +101,23 @@ function Render(partial = false, runAction = false) { if(!rendering.rendered) { rendering.doUpdate(); - rendering.setRenderStatus(true); printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "] (Update)"); - rendering.getNextNodes(); + var nextNodes = rendering.getNextNodes(); + for( var i = 0; i < array_length(nextNodes); i++ ) { + if(!nextNodes[i].isRenderable()) continue; + ds_queue_enqueue(RENDER_QUEUE, nextNodes[i]); + } - if(runAction && rendering.hasInspectorUpdate()) - rendering.inspectorUpdate(); + if(runAction && rendering.hasInspector1Update()) + rendering.inspector1Update(); } else printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "] (Skip)"); } - - printIf(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n"); } catch(e) noti_warning(exception_print(e)); + + printIf(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n"); } function __renderListReset(list) { @@ -151,13 +165,16 @@ function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) { var txt = rendering.rendered? " [Skip]" : " [Update]"; if(!rendering.rendered) { rendering.doUpdate(); - if(rendering.hasInspectorUpdate()) { - rendering.inspectorUpdate(); + if(rendering.hasInspector1Update()) { + rendering.inspector1Update(); printIf(global.RENDER_LOG, " > Toggle manual execution " + rendering.name + " (" + rendering.display_name + ")"); } - - rendering.setRenderStatus(true); - rendering.getNextNodes(); + + var nextNodes = rendering.getNextNodes(); + for( var i = 0; i < array_length(nextNodes); i++ ) { + if(!nextNodes[i].isRenderable()) continue; + ds_queue_enqueue(RENDER_QUEUE, nextNodes[i]); + } } printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "]" + txt); } diff --git a/shaders/sh_bevel/sh_bevel.fsh b/shaders/sh_bevel/sh_bevel.fsh index c52017456..be10f752f 100644 --- a/shaders/sh_bevel/sh_bevel.fsh +++ b/shaders/sh_bevel/sh_bevel.fsh @@ -39,9 +39,10 @@ void main() { gl_FragColor = col; bool done = false; + vec2 shiftPx = -shift / dimension; float b0 = bright(col); - float shift_angle = atan(shift.y, shift.x); - float shift_distance = length(shift); + float shift_angle = atan(shiftPx.y, shiftPx.x); + float shift_distance = length(shiftPx); float slope_distance = height * b0; float max_distance = height; diff --git a/shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.fsh b/shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.fsh index b22146ea0..b424e4250 100644 --- a/shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.fsh +++ b/shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.fsh @@ -9,11 +9,11 @@ uniform float threshold; uniform int ignore; uniform sampler2D map; -float sampVal(vec4 col) { return length(col.rgb) * col.a; } +vec3 sampVal(vec4 col) { return col.rgb * col.a; } void main() { vec4 zero = vec4(0.); - float baseCol = sampVal(texture2D( map, v_vTexcoord )); + vec3 baseCol = sampVal(texture2D( map, v_vTexcoord )); if(ignore == 1 && baseCol == 0.) { gl_FragColor = vec4(0.); @@ -26,12 +26,12 @@ void main() { for(float i = -1.; i <= 1.; i++) for(float j = -1.; j <= 1.; j++) { vec2 pos = clamp(v_vTexcoord + vec2(i, j) / dimension, 0., 1.); - float samCl = sampVal(texture2D( map, pos )); + vec3 samCl = sampVal(texture2D( map, pos )); if(ignore == 1 && samCl == 0.) continue; - if(abs(samCl - baseCol) <= threshold) { + if(distance(samCl, baseCol) <= threshold) { vec4 _col = texture2D( gm_BaseTexture, pos ); _index_min.x = min(_index_min.x, _col.r); _index_min.y = min(_index_min.y, _col.g); diff --git a/sprites/s_node_trigger/010da870-4b54-4156-b98d-e127d20c9455.png b/sprites/s_node_trigger/010da870-4b54-4156-b98d-e127d20c9455.png new file mode 100644 index 000000000..ee03c200e Binary files /dev/null and b/sprites/s_node_trigger/010da870-4b54-4156-b98d-e127d20c9455.png differ diff --git a/sprites/s_node_trigger/layers/010da870-4b54-4156-b98d-e127d20c9455/d6016746-4f2f-45a2-9249-514db32f87e7.png b/sprites/s_node_trigger/layers/010da870-4b54-4156-b98d-e127d20c9455/d6016746-4f2f-45a2-9249-514db32f87e7.png new file mode 100644 index 000000000..ee03c200e Binary files /dev/null and b/sprites/s_node_trigger/layers/010da870-4b54-4156-b98d-e127d20c9455/d6016746-4f2f-45a2-9249-514db32f87e7.png differ diff --git a/sprites/s_node_trigger/s_node_trigger.yy b/sprites/s_node_trigger/s_node_trigger.yy new file mode 100644 index 000000000..12f175160 --- /dev/null +++ b/sprites/s_node_trigger/s_node_trigger.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "s_node_trigger", + "bbox_bottom": 59, + "bbox_left": 4, + "bbox_right": 59, + "bbox_top": 4, + "bboxMode": 0, + "collisionKind": 1, + "collisionTolerance": 0, + "DynamicTexturePage": false, + "edgeFiltering": false, + "For3D": false, + "frames": [ + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"010da870-4b54-4156-b98d-e127d20c9455",}, + ], + "gridX": 0, + "gridY": 0, + "height": 64, + "HTile": false, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"d6016746-4f2f-45a2-9249-514db32f87e7","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,}, + ], + "nineSlice": null, + "origin": 4, + "parent": { + "name": "bool", + "path": "folders/nodes/icons/value/bool.yy", + }, + "preMultiplyAlpha": false, + "sequence": { + "resourceType": "GMSequence", + "resourceVersion": "1.4", + "name": "s_node_trigger", + "autoRecord": true, + "backdropHeight": 768, + "backdropImageOpacity": 0.5, + "backdropImagePath": "", + "backdropWidth": 1366, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "events": {"resourceType":"KeyframeStore","resourceVersion":"1.0","Keyframes":[],}, + "eventStubScript": null, + "eventToFunction": {}, + "length": 1.0, + "lockOrigin": false, + "moments": {"resourceType":"KeyframeStore","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","resourceVersion":"1.0","Keyframes":[ + {"resourceType":"Keyframe","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"010da870-4b54-4156-b98d-e127d20c9455","path":"sprites/s_node_trigger/s_node_trigger.yy",},},},"Disabled":false,"id":"0a775248-1638-4153-a499-1f7c3b03ac79","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, +} \ No newline at end of file diff --git a/sprites/s_node_trigger_bool/4cd6c5ed-3717-446b-8720-76ab1615f810.png b/sprites/s_node_trigger_bool/4cd6c5ed-3717-446b-8720-76ab1615f810.png new file mode 100644 index 000000000..6dcc63939 Binary files /dev/null and b/sprites/s_node_trigger_bool/4cd6c5ed-3717-446b-8720-76ab1615f810.png differ diff --git a/sprites/s_node_trigger_bool/layers/4cd6c5ed-3717-446b-8720-76ab1615f810/058da886-5d34-4c86-a351-a42965cb62bd.png b/sprites/s_node_trigger_bool/layers/4cd6c5ed-3717-446b-8720-76ab1615f810/058da886-5d34-4c86-a351-a42965cb62bd.png new file mode 100644 index 000000000..6dcc63939 Binary files /dev/null and b/sprites/s_node_trigger_bool/layers/4cd6c5ed-3717-446b-8720-76ab1615f810/058da886-5d34-4c86-a351-a42965cb62bd.png differ diff --git a/sprites/s_node_trigger_bool/s_node_trigger_bool.yy b/sprites/s_node_trigger_bool/s_node_trigger_bool.yy new file mode 100644 index 000000000..566bfef5f --- /dev/null +++ b/sprites/s_node_trigger_bool/s_node_trigger_bool.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "s_node_trigger_bool", + "bbox_bottom": 60, + "bbox_left": 1, + "bbox_right": 62, + "bbox_top": 5, + "bboxMode": 0, + "collisionKind": 1, + "collisionTolerance": 0, + "DynamicTexturePage": false, + "edgeFiltering": false, + "For3D": false, + "frames": [ + {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"4cd6c5ed-3717-446b-8720-76ab1615f810",}, + ], + "gridX": 0, + "gridY": 0, + "height": 64, + "HTile": false, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"058da886-5d34-4c86-a351-a42965cb62bd","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,}, + ], + "nineSlice": null, + "origin": 4, + "parent": { + "name": "bool", + "path": "folders/nodes/icons/value/bool.yy", + }, + "preMultiplyAlpha": false, + "sequence": { + "resourceType": "GMSequence", + "resourceVersion": "1.4", + "name": "s_node_trigger_bool", + "autoRecord": true, + "backdropHeight": 768, + "backdropImageOpacity": 0.5, + "backdropImagePath": "", + "backdropWidth": 1366, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "events": {"resourceType":"KeyframeStore","resourceVersion":"1.0","Keyframes":[],}, + "eventStubScript": null, + "eventToFunction": {}, + "length": 1.0, + "lockOrigin": false, + "moments": {"resourceType":"KeyframeStore","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","resourceVersion":"1.0","Keyframes":[ + {"resourceType":"Keyframe","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"4cd6c5ed-3717-446b-8720-76ab1615f810","path":"sprites/s_node_trigger_bool/s_node_trigger_bool.yy",},},},"Disabled":false,"id":"70f53e0b-30fe-4f39-b20f-881abef7412d","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, +} \ No newline at end of file