This commit is contained in:
Tanasart 2023-03-28 11:58:28 +07:00
parent c1d13aec4d
commit 4b37dfb82e
109 changed files with 1526 additions and 540 deletions

View file

@ -50,6 +50,7 @@
{"name":"string","order":4,"path":"folders/functions/string.yy",}, {"name":"string","order":4,"path":"folders/functions/string.yy",},
{"name":"surface","order":8,"path":"folders/functions/surface.yy",}, {"name":"surface","order":8,"path":"folders/functions/surface.yy",},
{"name":"test","order":23,"path":"folders/functions/test.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":"value","order":1,"path":"folders/functions/value.yy",},
{"name":"vector","order":3,"path":"folders/functions/vector.yy",}, {"name":"vector","order":3,"path":"folders/functions/vector.yy",},
{"name":"window","order":29,"path":"folders/functions/window.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":"value","order":3,"path":"folders/nodes/data/value.yy",},
{"name":"mesh","order":7,"path":"folders/nodes/data/value/mesh.yy",}, {"name":"mesh","order":7,"path":"folders/nodes/data/value/mesh.yy",},
{"name":"struct","order":6,"path":"folders/nodes/data/value/struct.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":"VFX","order":13,"path":"folders/nodes/data/VFX.yy",},
{"name":"icons","order":6,"path":"folders/nodes/icons.yy",}, {"name":"icons","order":6,"path":"folders/nodes/icons.yy",},
{"name":"3D","order":133,"path":"folders/nodes/icons/3D.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":"misc","order":50,"path":"folders/shader/misc.yy",},
{"name":"shape seperator","order":35,"path":"folders/shader/shape seperator.yy",}, {"name":"shape seperator","order":35,"path":"folders/shader/shape seperator.yy",},
{"name":"sprites","order":20,"path":"folders/shader/sprites.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":"warp","order":41,"path":"folders/shader/warp.yy",},
{"name":"sprites","order":12,"path":"folders/sprites.yy",}, {"name":"sprites","order":12,"path":"folders/sprites.yy",},
{"name":"gameframe","order":2,"path":"folders/sprites/gameframe.yy",}, {"name":"gameframe","order":2,"path":"folders/sprites/gameframe.yy",},
{"name":"widgets","order":5,"path":"folders/widgets.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": [ "ResourceOrderSettings": [
{"name":"s_node_corner","order":14,"path":"sprites/s_node_corner/s_node_corner.yy",}, {"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":"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":"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":"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":"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_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",}, {"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":"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":"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":"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":"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":"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",}, {"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":"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":"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":"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":"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":"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",}, {"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":"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":"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":"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":"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":"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",}, {"name":"s_node_cache","order":27,"path":"sprites/s_node_cache/s_node_cache.yy",},

View file

@ -69,6 +69,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"string","folderPath":"folders/functions/string.yy",}, {"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":"surface","folderPath":"folders/functions/surface.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"test","folderPath":"folders/functions/test.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":"value","folderPath":"folders/functions/value.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"vector","folderPath":"folders/functions/vector.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",}, {"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":"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":"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":"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":"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":"icons","folderPath":"folders/nodes/icons.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"3D","folderPath":"folders/nodes/icons/3D.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":"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":"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":"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":"warp","folderPath":"folders/shader/warp.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/sprites.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/sprites.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"gameframe","folderPath":"folders/sprites/gameframe.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":"Steamworks","folderPath":"folders/Steamworks.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"UGC","folderPath":"folders/Steamworks/UGC.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":"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": [ "IncludedFiles": [
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","CopyToMask":-1,"filePath":"datafiles",}, {"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":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Guides.zip","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"icon.png","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":"layouts.zip","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Horizontal.json","CopyToMask":-1,"filePath":"datafiles/data/layouts",}, {"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_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_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_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_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_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",}, {"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_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_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_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":"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_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",}, {"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":"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_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":"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_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_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",},}, {"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":"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":"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":"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":"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_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",},}, {"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":"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":"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":"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_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":"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",},}, {"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":"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":"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":"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":"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":"s_menu_white","path":"sprites/s_menu_white/s_menu_white.yy",},},
{"id":{"name":"color_loader","path":"scripts/color_loader/color_loader.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":"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":"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":"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":"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":"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",},}, {"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":"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":"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":"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":"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":"string_scale","path":"scripts/string_scale/string_scale.yy",},},
{"id":{"name":"s_node_cache","path":"sprites/s_node_cache/s_node_cache.yy",},}, {"id":{"name":"s_node_cache","path":"sprites/s_node_cache/s_node_cache.yy",},},

BIN
datafiles/data/Guides.zip Normal file

Binary file not shown.

Binary file not shown.

View file

@ -154,8 +154,9 @@
if(anchor & ANCHOR.top) dialog_y = min(ystart, WIN_SH - dialog_h); if(anchor & ANCHOR.top) dialog_y = min(ystart, WIN_SH - dialog_h);
if(anchor & ANCHOR.bottom) dialog_y = max(ystart - dialog_h, 0); 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() { function checkMouse() {

View file

@ -55,6 +55,8 @@ event_inherited();
var typ = node_called.type; var typ = node_called.type;
for( var i = 0; i < array_length(ar); i++ ) { 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 _in = call_in? node_called.type : ar[i].type;
var _ot = call_in? ar[i].type : node_called.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++ ) { for( var i = 0; i < array_length(io.inputs); i++ ) {
var _in = fr; var _in = fr;
var _ot = io.inputs[i].type; var _ot = io.inputs[i].type;
if(!io.inputs[i].visible) continue;
if(typeCompatible(_in, _ot, false)) return true; if(typeCompatible(_in, _ot, false)) return true;
} }
@ -91,7 +94,7 @@ event_inherited();
node_list = pageIndex == -1? noone : NODE_CATEGORY[| ADD_NODE_PAGE].list; node_list = pageIndex == -1? noone : NODE_CATEGORY[| ADD_NODE_PAGE].list;
} }
ADD_NODE_PAGE = 0; ADD_NODE_PAGE = 0;
setPage(ADD_NODE_PAGE); setPage(NODE_PAGE_DEFAULT);
function buildNode(_node, _param = "") { function buildNode(_node, _param = "") {
if(!_node) { if(!_node) {
@ -109,6 +112,12 @@ event_inherited();
return; return;
} }
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; _inputs = _new_node.inputs;
_outputs = _new_node.outputs; _outputs = _new_node.outputs;
} else { } else {
@ -153,6 +162,8 @@ event_inherited();
var _node_list = node_called.connect_type == JUNCTION_CONNECT.input? _outputs : _inputs; var _node_list = node_called.connect_type == JUNCTION_CONNECT.input? _outputs : _inputs;
for(var i = 0; i < ds_list_size(_node_list); i++) { for(var i = 0; i < ds_list_size(_node_list); i++) {
var _target = _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(_target.auto_connect && (value_bit(_target.type) & value_bit(node_called.type)) ) {
if(node_called.connect_type == JUNCTION_CONNECT.input) { if(node_called.connect_type == JUNCTION_CONNECT.input) {
node_called.setFrom(_node_list[| i]); node_called.setFrom(_node_list[| i]);
@ -168,6 +179,7 @@ event_inherited();
for( var i = 0; i < ds_list_size(_inputs); i++ ) { for( var i = 0; i < ds_list_size(_inputs); i++ ) {
var _in = _inputs[| i]; var _in = _inputs[| i];
if(_in.auto_connect && _in.isConnectable(from)) { if(_in.auto_connect && _in.isConnectable(from)) {
_in.setFrom(from); _in.setFrom(from);
break; break;
@ -259,12 +271,25 @@ event_inherited();
ds_list_add(_list, cat.list[| j]); 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(); _list = ds_list_create();
ds_list_add(_list, "Favourites");
for( var i = 0; i < array_length(global.FAV_NODES); i++ ) { for( var i = 0; i < array_length(global.FAV_NODES); i++ ) {
var _nodeIndex = global.FAV_NODES[i]; var _nodeIndex = global.FAV_NODES[i];
ds_list_add(_list, ALL_NODES[? _nodeIndex]); 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); var node_count = ds_list_size(_list);

View file

@ -84,36 +84,6 @@ event_inherited();
#endregion #endregion
#region preset #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(); presets = ds_list_create();
preset_name = ds_list_create(); preset_name = ds_list_create();

View file

@ -70,12 +70,12 @@ event_inherited();
if(show_icon) if(show_icon)
dialog_w += ui(32); 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) { switch(align) {
case fa_left: dialog_x = round(min(dialog_x, WIN_W - dialog_w)); 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)); 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, 0)); break; case fa_right: dialog_x = round(max(dialog_x - dialog_w, 2)); break;
} }
ready = true; ready = true;

View file

@ -1,4 +1,6 @@
/// @description init /// @description init
if(!ready) exit;
#region draw #region draw
var yy = dialog_y; var yy = dialog_y;

View file

@ -61,7 +61,7 @@ if !ready exit;
if(buttonInstant(THEME.button_hide, bx, by, ss, ss, mouse_ui, sFOCUS, sHOVER, txt, THEME.pin, ind, cc,, sc) == 2) 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; 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); 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) { if(!m_in && m_ot) {
@ -85,5 +85,7 @@ if !ready exit;
}), }),
]); ]);
} }
}
} }
#endregion #endregion

View file

@ -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, [ ds_list_add(pref_appr, [
get_text("panel_menu_right_control", "Use Windows style window control."), get_text("panel_menu_right_control", "Use Windows style window control."),
"panel_menu_right_control", "panel_menu_right_control",

View file

@ -203,6 +203,7 @@
#region parameter #region parameter
file_open_parameter = ""; file_open_parameter = "";
minimized = false;
_modified = false; _modified = false;
#endregion #endregion

View file

@ -1,6 +1,6 @@
/// @description init /// @description init
if(OS == os_windows && gameframe_is_minimized()) { if(OS == os_windows && gameframe_is_minimized()) {
gameframe_update(); //gameframe_update();
exit; exit;
} else if(OS == os_macosx) { } else if(OS == os_macosx) {
mac_window_step(); mac_window_step();

View file

@ -1,4 +1,6 @@
/// @description tooltip filedrop /// @description tooltip filedrop
if(OS == os_windows && gameframe_is_minimized()) exit;
#region tooltip #region tooltip
if(is_array(TOOLTIP) || TOOLTIP != "") { if(is_array(TOOLTIP) || TOOLTIP != "") {
if(is_struct(TOOLTIP) && struct_has(TOOLTIP, "drawTooltip")) { if(is_struct(TOOLTIP) && struct_has(TOOLTIP, "drawTooltip")) {
@ -36,7 +38,7 @@
draw_tooltip_surface(content); draw_tooltip_surface(content);
break; break;
case VALUE_TYPE.rigid : 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; break;
case VALUE_TYPE.particle : case VALUE_TYPE.particle :
var txt = "[" + var txt = "[" +

View file

@ -32,6 +32,7 @@
window_set_showborder(false); window_set_showborder(false);
__initSurfaceFormat();
__initLocale(); __initLocale();
__initTheme(); __initTheme();
__initCollection(); __initCollection();

View file

@ -1,4 +1,6 @@
/// @description init /// @description init
if(OS == os_windows && gameframe_is_minimized()) exit;
//print("===== Step start ====="); //print("===== Step start =====");
#region animation #region animation
if(ANIMATOR.is_playing && ANIMATOR.play_freeze == 0) { if(ANIMATOR.is_playing && ANIMATOR.play_freeze == 0) {

View file

@ -1,4 +1,18 @@
/// @description init /// @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 #region window
//if(keyboard_check_pressed(vk_f12)) DEBUG = !DEBUG; //if(keyboard_check_pressed(vk_f12)) DEBUG = !DEBUG;
@ -56,6 +70,8 @@
#endregion #endregion
#region nodes #region nodes
DEF_SURFACE_RESET();
var _k = ds_map_find_first(NODE_MAP); var _k = ds_map_find_first(NODE_MAP);
var _a = ds_map_size(NODE_MAP); var _a = ds_map_size(NODE_MAP);
repeat(_a) { repeat(_a) {

View file

@ -8,7 +8,7 @@ enum TWEEN_VALUE {
color 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); array_push(TWEEN_VALUES, self);
realVal = value; realVal = value;
@ -20,7 +20,7 @@ function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twS
colTrans = 0; colTrans = 0;
static set = function(value) { static set = function(value) {
if(valType == VALUE_TYPE.color) { if(valType == TWEEN_VALUE.color) {
showVal = get(); showVal = get();
colTrans = 0; colTrans = 0;
} }
@ -28,21 +28,21 @@ function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twS
realVal = value; realVal = value;
} }
static get = function(value) { static get = function(value) {
if(valType == VALUE_TYPE.color) if(valType == TWEEN_VALUE.color)
return colTrans == 1? realVal : merge_color(showVal, realVal, colTrans); return colTrans == 1? realVal : merge_color(showVal, realVal, colTrans);
else else
return showVal; return showVal;
} }
static step = function() { static step = function() {
if(valType == VALUE_TYPE.color) { if(valType == TWEEN_VALUE.color) {
if(tweenType == TWEEN_TYPE.linear) if(tweenType == TWEEN_TYPE.linear)
colTrans = lerp_linear(colTrans, 1, 1 / tweenSpeed); colTrans = lerp_linear(colTrans, 1, 1 / tweenSpeed);
else if(tweenType == TWEEN_TYPE.log) else if(tweenType == TWEEN_TYPE.log)
colTrans = lerp_float(colTrans, 1, tweenSpeed); colTrans = lerp_float(colTrans, 1, tweenSpeed);
if(colTrans == 1) if(colTrans == 1)
showVal = realVal; showVal = realVal;
} else if(valType == VALUE_TYPE.number) { } else if(valType == TWEEN_VALUE.number) {
if(tweenType == TWEEN_TYPE.linear) if(tweenType == TWEEN_TYPE.linear)
showVal = lerp_linear(showVal, realVal, 1 / tweenSpeed); showVal = lerp_linear(showVal, realVal, 1 / tweenSpeed);
else if(tweenType == TWEEN_TYPE.log) else if(tweenType == TWEEN_TYPE.log)

View file

@ -15,16 +15,26 @@ function __part(_node) constructor {
node = _node; node = _node;
active = false; active = false;
surf = noone; surf = noone;
prevx = 0;
prevy = 0;
x = 0; x = 0;
y = 0; y = 0;
sx = 0; speedx = 0;
sy = 0; speedy = 0;
turning = 0;
turnSpd = 0
ac = 0; ac = 0;
g = 0;
wig = 0; wig = 0;
spVec = [ 0, 0 ];
boundary_data = -1; boundary_data = -1;
g = 0;
gDir = -90;
_gx = 0;
_gy = 0;
gx = 0;
gy = 0; gy = 0;
scx = 1; scx = 1;
@ -55,6 +65,7 @@ function __part(_node) constructor {
surf = _surf; surf = _surf;
x = _x; x = _x;
y = _y; y = _y;
gx = 0;
gy = 0; gy = 0;
life = _life; life = _life;
@ -62,11 +73,17 @@ function __part(_node) constructor {
node.onPartCreate(self); node.onPartCreate(self);
} }
static setPhysic = function(_sx, _sy, _ac, _g, _wig) { static setPhysic = function(_sx, _sy, _ac, _g, _gDir, _wig, _turn, _turnSpd) {
sx = _sx; speedx = _sx;
sy = _sy; speedy = _sy;
ac = _ac; ac = _ac;
g = _g; g = _g;
gDir = _gDir;
_gx = lengthdir_x(g, gDir);
_gy = lengthdir_y(g, gDir);
turning = _turn;
turnSpd = _turnSpd;
wig = _wig; wig = _wig;
} }
@ -96,30 +113,45 @@ function __part(_node) constructor {
static step = function() { static step = function() {
if(!active) return; if(!active) return;
var xp = x, yp = y; x += speedx;
x += sx; y += speedy;
y += sy;
var dirr = point_direction(0, 0, sx, sy); var dirr = point_direction(0, 0, speedx, speedy);
var diss = point_distance(0, 0, sx, sy); var diss = point_distance(0, 0, speedx, speedy);
if(diss > 0) {
diss += ac; diss += ac;
if(speedx != 0 || speedy != 0) {
if(wig != 0)
dirr += random_range(-wig, wig); dirr += random_range(-wig, wig);
sx = lengthdir_x(diss, dirr);
sy = lengthdir_y(diss, dirr); if(turning != 0) {
var trn = turnSpd? turning * diss : turning;
dirr += trn
}
} }
gy += g; speedx = lengthdir_x(diss, dirr);
y += gy; speedy = lengthdir_y(diss, dirr);
if(follow) if(_gx != 0 || _gy != 0) {
rot = point_direction(xp, yp, x, y); gx += _gx;
else gy += _gy;
rot += rot_s; x += gx;
y += gy;
}
if(follow) rot = spVec[1];
else rot += rot_s;
if(step_int > 0 && safe_mod(life, step_int) == 0) if(step_int > 0 && safe_mod(life, step_int) == 0)
node.onPartStep(self); node.onPartStep(self);
if(life-- < 0) kill(); 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) { static draw = function(exact, surf_w, surf_h) {
@ -201,3 +233,16 @@ function __part(_node) constructor {
return [cx, cy]; 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

View file

@ -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 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_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) #macro DRAW_CLEAR draw_clear_alpha(0, 0)
#endregion #endregion

View file

@ -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[| 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_len = ds_list_size(inputs);
input_display_list = [ 32, input_display_list = [ 32,
["Sprite", false], 0, 22, 23, 26, ["Sprite", false], 0, 22, 23, 26,
["Spawn", true], 27, 16, 1, 2, 3, 4, 30, 31, 24, 25, 5, ["Spawn", true], 27, 16, 1, 2, 3, 4, 30, 31, 24, 25, 5,
["Movement", true], 29, 6, 18, 7, ["Movement", true], 29, 6, 18,
["Physics", true], 19, 20, ["Physics", true], 7, 19, 33, 20, 34, 35, 36,
["Rotation", true], 15, 8, 9, ["Rotation", true], 15, 8, 9,
["Scale", true], 10, 17, 11, ["Scale", true], 10, 17, 11,
["Color", true], 12, 28, 13, 14, ["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 _accel = current_data[ 7];
var _grav = current_data[19]; var _grav = current_data[19];
var _gvDir = current_data[33];
var _wigg = current_data[20]; 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 _follow = current_data[15];
var _rotation = current_data[ 8]; 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_speed = _anim_speed;
part.anim_end = _anim_end; 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.setTransform(_scx, _scy, _scale_time, _rot, _rot_spd, _follow);
part.setDraw(_color, _bld, _alp, _fade); part.setDraw(_color, _bld, _alp, _fade);
spawn_index = safe_mod(spawn_index + 1, attributes[? "part_amount"]); 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 onSpawn = function(_time, part) {}
static updateParticleForward = function(_render = true) {} static updateParticleForward = function() {}
function reset() { function reset() {
spawn_index = 0; 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++) { for(var i = 0; i < ANIMATOR.frames_total; i++) {
runVFX(i, false); runVFX(i, false);
updateParticleForward(false); updateParticleForward();
} }
seed = inputs[| 32].getValue(); seed = inputs[| 32].getValue();

View file

@ -45,6 +45,10 @@ function array_exists(arr, val) {
return false; return false;
} }
function array_empty(arr) {
return array_length(arr) == 0;
}
function array_find(arr, val) { function array_find(arr, val) {
for( var i = 0; i < array_length(arr); i++ ) { for( var i = 0; i < array_length(arr); i++ ) {
if(arr[i] == val) return i; if(arr[i] == val) return i;

View file

@ -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)); 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) { function draw_surface_fit(surf, xx, yy, w, h) {

View file

@ -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) { 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"]); var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 16 * PREF_MAP[? "connection_line_sample"]);
sample = clamp(sample, 8, 128); sample = clamp(sample, 8, 128);
@ -124,3 +161,39 @@ function distance_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s) {
return dist; 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;
}

View file

@ -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) { 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 inv = x1 - 16 * _s * indexOut <= x0 + 16 * _s * indexIn;
var xx0 = 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) { function distance_to_elbow_corner(mx, my, x0, y0, x1, y1) {
var inv = x1 - 16 * _s * indexOut <= x0 + 16 * _s * indexIn; 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 dist;
return distance_to_line(mx, my, x0, cy, x1, cy);
else
return distance_to_line(mx, my, cx, y0, cx, y1);
} }

View file

@ -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) { function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, indexOut = 1) {
var iy = sign(y1 - y0); var iy = sign(y1 - y0);
var xx0 = x0 + 16 * _s * indexIn; 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; 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;
}

View file

@ -33,7 +33,7 @@
globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING; globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING;
VERSION = 1140; VERSION = 1140;
SAVEFILE_VERSION = 1400; SAVEFILE_VERSION = 1400;
VERSION_STRING = "1.14.0pr5"; VERSION_STRING = "1.14.0pr7";
globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES; globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES;
@ -146,11 +146,16 @@
#endregion #endregion
#region default #region default
globalvar DEF_SURFACE; globalvar DEF_SURFACE, USE_DEF;
DEF_SURFACE = noone;
USE_DEF = -10;
function DEF_SURFACE_RESET() { 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); surface_set_target(DEF_SURFACE);
draw_clear_alpha(c_white, 0); draw_clear(c_white);
surface_reset_target(); surface_reset_target();
} }
DEF_SURFACE_RESET(); DEF_SURFACE_RESET();

View file

@ -149,3 +149,33 @@ function gradientObject(color = c_black) constructor {
return self; 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;
}

View file

@ -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 ]) inputs[| 7] = nodeValue("Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
.setDisplay(VALUE_DISPLAY.vector); .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() { .setDisplay(VALUE_DISPLAY.button, [ function() {
generateMesh(); generateMesh();
update(); doUpdate();
}, "Generate"] ); }, "Generate"] );
inputs[| 9] = nodeValue("Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) inputs[| 9] = nodeValue("Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)

View file

@ -13,7 +13,7 @@ function Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
.setDisplay(VALUE_DISPLAY.path_load, [ "*.obj", "" ]) .setDisplay(VALUE_DISPLAY.path_load, [ "*.obj", "" ])
.rejectArray(); .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() { .setDisplay(VALUE_DISPLAY.button, [ function() {
updateObj(); updateObj();
doUpdate(); doUpdate();

View file

@ -2,7 +2,7 @@ function Node_3D_Cube(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
name = "3D Cube"; name = "3D Cube";
dimension_index = 1; 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) inputs[| 1] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
.setDisplay(VALUE_DISPLAY.vector); .setDisplay(VALUE_DISPLAY.vector);

View file

@ -46,6 +46,8 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr
current_data = []; current_data = [];
UPDATE_PART_FORWARD
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);

View file

@ -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); array_insert(input_display_list, 0, ["Trigger", true], input_len + 0, input_len + 1);
static updateParticleForward = function(_render = true) { UPDATE_PART_FORWARD
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();
}
}
static onUpdate = function() { static onUpdate = function() {
RETURN_ON_REST RETURN_ON_REST

View file

@ -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, "") inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
.setDisplay(VALUE_DISPLAY.path_load, ["*.ase, *.aseprite", ""]); .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"] ); .setDisplay(VALUE_DISPLAY.button, [ function() { refreshLayers(); }, "Generate"] );
inputs[| 2] = nodeValue("Current tag", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, ""); 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 = []; var p_arr = [];
for( var k = 0; k < array_length(plt); k++ ) 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); outputs[| 3].setValue(p_arr);
break; break;
case 0x2004: //layer case 0x2004: //layer
@ -276,7 +276,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
return true; return true;
} }
static onInspectorUpdate = function() { static onInspector1Update = function() {
var path = inputs[| 0].getValue(); var path = inputs[| 0].getValue();
if(path == "") return; if(path == "") return;
updatePaths(path); updatePaths(path);

View file

@ -43,6 +43,16 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
attribute_surface_depth(); attribute_surface_depth();
attribute_oversample(); 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) { static process_data = function(_outSurf, _data, _output_index, _array_index) {
var _hei = _data[1]; var _hei = _data[1];
var _shf = _data[2]; var _shf = _data[2];

View file

@ -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 { function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "Blend"; name = "Blend";
inputs[| 0] = nodeValue("Background", 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, DEF_SURFACE); 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) inputs[| 2] = nodeValue("Blend mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, BLEND_TYPES ); .setDisplay(VALUE_DISPLAY.enum_scroll, BLEND_TYPES );

View file

@ -512,8 +512,14 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
} }
apply_surface(); 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)) {
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);
if(fill) {
if(DRAGGING) draw_set_color(DRAGGING.data);
switch(_fill_type) { switch(_fill_type) {
case 0 : case 0 :
flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, false); flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, false);
@ -525,10 +531,10 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
canvas_fill(mouse_cur_x, mouse_cur_y, canvas_surface, _thr); canvas_fill(mouse_cur_x, mouse_cur_y, canvas_surface, _thr);
break; break;
} }
surface_store_buffer(); surface_store_buffer();
} }
} }
}
draw_set_alpha(1); draw_set_alpha(1);
gpu_set_colorwriteenable(true, true, true, true); gpu_set_colorwriteenable(true, true, true, true);

View file

@ -83,17 +83,17 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
dia.node = self; dia.node = self;
}) ]); }) ]);
inspUpdateTooltip = get_text("panel_inspector_execute", "Execute node contents"); insp1UpdateTooltip = get_text("panel_inspector_execute", "Execute node contents");
inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
static inspectorUpdate = function() { onInspectorUpdate(); } static inspector1Update = function() { onInspector1Update(); }
static onInspectorUpdate = function() { RenderListAction(nodes, group); } static onInspector1Update = function() { RenderListAction(nodes, group); }
static hasInspectorUpdate = function(group = false) { static hasInspector1Update = function(group = false) {
if(!group) return false; if(!group) return false;
for( var i = 0; i < ds_list_size(nodes); i++ ) { for( var i = 0; i < ds_list_size(nodes); i++ ) {
if(nodes[| i].hasInspectorUpdate()) if(nodes[| i].hasInspector1Update())
return true; return true;
} }
@ -136,13 +136,16 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
} }
static getNextNodes = function() { static getNextNodes = function() {
var nodes = [];
for(var i = custom_input_index; i < ds_list_size(inputs); i++) { for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
var _in = inputs[| i].from; var _in = inputs[| i].from;
if(!_in.renderActive) continue; 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"); printIf(global.RENDER_LOG, "Push group input " + _in.name + " to stack");
} }
return nodes;
} }
static setRenderStatus = function(result) { static setRenderStatus = function(result) {
@ -252,12 +255,12 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
PATCH_STATIC PATCH_STATIC
static triggerRender = function() { //static triggerRender = function() {
for(var i = custom_input_index; i < ds_list_size(inputs); i++) { // for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
var jun_node = inputs[| i].from; // var jun_node = inputs[| i].from;
jun_node.triggerRender(); // jun_node.triggerRender();
} // }
} //}
static preConnect = function() { static preConnect = function() {
sortIO(); sortIO();

View file

@ -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) { if(mouse_click(mb_left, _focus) && _vis[| ind] != hold_visibility) {
_vis[| ind] = hold_visibility; _vis[| ind] = hold_visibility;
update(); doUpdate();
} }
} else } else
draw_sprite_ui_uniform(THEME.junc_visible, vis, _bx, _cy + lh / 2, 1, COLORS._main_icon, 0.5 + 0.5 * vis); 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]); ds_list_insert(inputs, targt + i, ext[i]);
} }
update(); doUpdate();
} }
layer_dragging = noone; 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) if(input_display_list[i] > idx)
input_display_list[i] = input_display_list[i] - data_length; input_display_list[i] = input_display_list[i] - data_length;
} }
update(); doUpdate();
} }
function createNewSurface() { function createNewSurface() {

View file

@ -90,7 +90,7 @@ function Node_CSV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
return true; return true;
} }
static onInspectorUpdate = function() { static onInspector1Update = function() {
var path = inputs[| 0].getValue(); var path = inputs[| 0].getValue();
if(path == "") return; if(path == "") return;
updatePaths(path); updatePaths(path);

View file

@ -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 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) { static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
var bbox = drawGetBbox(xx, yy, _s); var bbox = drawGetBbox(xx, yy, _s);

View file

@ -36,15 +36,20 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
draw_name = true; draw_name = true;
draggable = true; draggable = true;
inputs = ds_list_create();
outputs = ds_list_create();
input_display_list = -1; input_display_list = -1;
output_display_list = -1; output_display_list = -1;
inspector_display_list = -1; inspector_display_list = -1;
is_dynamic_output = false; is_dynamic_output = false;
inputs = ds_list_create();
outputs = ds_list_create();
attributes = ds_map_create(); attributes = ds_map_create();
attributeEditors = []; attributeEditors = [];
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_input_name = false;
show_output_name = false; show_output_name = false;
@ -219,18 +224,18 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
if(!LOADING) MODIFIED = true; if(!LOADING) MODIFIED = true;
} }
inspUpdateTooltip = get_text("panel_inspector_execute", "Execute node"); insp1UpdateTooltip = get_text("panel_inspector_execute", "Execute node");
inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
static inspectorUpdate = function() { static inspector1Update = function() {
if(error_update_enabled && error_noti_update != noone) if(error_update_enabled && error_noti_update != noone)
noti_remove(error_noti_update); noti_remove(error_noti_update);
error_noti_update = noone; error_noti_update = noone;
onInspectorUpdate(); onInspector1Update();
} }
static onInspectorUpdate = noone; static onInspector1Update = noone;
static hasInspectorUpdate = function() { return onInspectorUpdate != noone; } static hasInspector1Update = function() { return onInspector1Update != noone; }
insp2UpdateTooltip = get_text("panel_inspector_execute", "Execute node"); insp2UpdateTooltip = get_text("panel_inspector_execute", "Execute node");
insp2UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; 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 hasInspector2Update = function() { return onInspector2Update != noone; }
static stepBegin = function() { static stepBegin = function() {
if(use_cache) if(use_cache) cacheArrayCheck();
cacheArrayCheck();
var willUpdate = false; var willUpdate = false;
if(always_output) { if(always_output) {
@ -279,6 +283,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
setHeight(); setHeight();
doStepBegin(); doStepBegin();
if(hasInspector1Update()) inspectInput1.name = insp1UpdateTooltip;
if(hasInspector2Update()) inspectInput2.name = insp2UpdateTooltip;
} }
static doStepBegin = function() {} static doStepBegin = function() {}
@ -289,6 +296,14 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
if(SAFE_MODE) return; if(SAFE_MODE) return;
var sBase = surface_get_target(); 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 { try {
var t = get_timer(); var t = get_timer();
update(); update();
@ -302,6 +317,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
log_warning("RENDER", exception_print(exception), self); 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) { static valueUpdate = function(index) {
@ -315,34 +340,15 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
static onValueFromUpdate = function(index) {} static onValueFromUpdate = function(index) {}
static triggerRender = function() { static triggerRender = function() {
printIf(global.RENDER_LOG, " -> Trigger render for " + name + " (" + display_name + ")");
setRenderStatus(false); setRenderStatus(false);
UPDATE |= RENDER_TYPE.partial; UPDATE |= RENDER_TYPE.partial;
for(var i = 0; i < ds_list_size(outputs); i++) { var nodes = getNextNodes();
var jun = outputs[| i]; for(var i = 0; i < array_length(nodes); i++)
for(var j = 0; j < ds_list_size(jun.value_to); j++) { nodes[i].triggerRender();
var _to = jun.value_to[| j];
if(_to.value_from != jun) continue;
_to.node.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) static isRenderable = function() { //Check if every input is ready (updated)
if(!active) return false; if(!active) return false;
@ -365,25 +371,24 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
} }
static getNextNodes = function() { static getNextNodes = function() {
var nodes = [];
for(var i = 0; i < ds_list_size(outputs); i++) { for(var i = 0; i < ds_list_size(outputs); i++) {
var _ot = 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++) { for(var j = 0; j < ds_list_size(_ot.value_to); j++) {
var _to = _ot.value_to[| j]; var _to = _ot.value_to[| j];
if(!_to.node.renderActive) continue;
if(!_to.node.active || _to.value_from == noone) 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; if(_to.value_from.node != self) continue;
_to.node.triggerRender(); printIf(global.RENDER_LOG, " --> Check complete, push " + _to.node.name + " to stack.");
array_push(nodes, _to.node);
}
}
if(_to.node.isRenderable()) { return nodes;
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");
}
}
} }
static onInspect = function() {} static onInspect = function() {}
@ -407,6 +412,20 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
var yy = y * _s + _y; var yy = y * _s + _y;
var jun; 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 inamo = input_display_list == -1? ds_list_size(inputs) : array_length(input_display_list);
var _in = yy + ui(32) * _s; var _in = yy + ui(32) * _s;
@ -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); 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 ts = clamp(power(_s, 0.5), 0.5, 1);
var aa = 0.5 + 0.5 * renderActive; var aa = 0.5 + 0.5 * renderActive;
@ -514,6 +533,12 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
hover = jun; hover = jun;
} }
if(hasInspector1Update() && inspectInput1.drawJunction(_s, _mx, _my))
hover = inspectInput1;
if(hasInspector2Update() && inspectInput2.drawJunction(_s, _mx, _my))
hover = inspectInput2;
return hover; 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++) for(var i = 0; i < ds_list_size(outputs); i++)
outputs[| i].drawName(_s, _mx, _my); 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) { static drawConnections = function(_x, _y, _s, mx, my, _active, aa = 1) {
@ -576,9 +611,17 @@ 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; var drawLineIndex = 1;
for(var i = 0; i < ds_list_size(inputs); i++) { for(var i = st; i < ds_list_size(inputs); i++) {
var jun = inputs[| i]; var jun;
if(i == -1) jun = inspectInput1;
else if(i == -2) jun = inspectInput2;
else jun = inputs[| i];
var jx = jun.x; var jx = jun.x;
var jy = jun.y; var jy = jun.y;
@ -603,23 +646,35 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
var th = max(1, PREF_MAP[? "connection_line_width"] * _s); var th = max(1, PREF_MAP[? "connection_line_width"] * _s);
jun.draw_line_shift_hover = false; jun.draw_line_shift_hover = false;
var drawCorner = jun.type == VALUE_TYPE.action || jun.value_from.type == VALUE_TYPE.action;
if(PANEL_GRAPH.pHOVER) if(PANEL_GRAPH.pHOVER)
switch(PREF_MAP[? "curve_connection_line"]) { switch(PREF_MAP[? "curve_connection_line"]) {
case 0 : case 0 :
hover = distance_to_line(mx, my, jx, jy, frx, fry) < max(th * 2, 6); hover = distance_to_line(mx, my, jx, jy, frx, fry) < max(th * 2, 6);
break; break;
case 1 : case 1 :
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); hover = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s) < max(th * 2, 6);
if(PANEL_GRAPH._junction_hovering == noone) if(PANEL_GRAPH._junction_hovering == noone)
jun.draw_line_shift_hover = hover; jun.draw_line_shift_hover = hover;
break; break;
case 2 : case 2 :
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); 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) if(PANEL_GRAPH._junction_hovering == noone)
jun.draw_line_shift_hover = hover; jun.draw_line_shift_hover = hover;
break; break;
case 3 : case 3 :
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); 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) if(PANEL_GRAPH._junction_hovering == noone)
@ -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 |= _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; thicken |= instance_exists(o_dialog_add_node) && o_dialog_add_node.junction_hovering == jun;
if(thicken) if(PREF_MAP[? "connection_line_transition"]) {
th *= 2; 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 corner = PREF_MAP[? "connection_line_corner"] * _s;
var ty = LINE_STYLE.solid; var ty = LINE_STYLE.solid;
@ -660,9 +718,24 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
else else
draw_line_dashed_color(jx, jy, frx, fry, th, c1, c0, 12 * ss); draw_line_dashed_color(jx, jy, frx, fry, th, c1, c0, 12 * ss);
break; break;
case 1 : draw_line_curve_color(jx, jy, frx, fry, cx, cy, ss, th, c0, c1, ty); break; case 1 :
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; if(drawCorner)
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; 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; 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); return drawJunctions(xx, yy, _mx, _my, _s);
} }
static onDrawNodeBehind = function(_x, _y, _mx, _my, _s) {} static onDrawNodeBehind = function(_x, _y, _mx, _my, _s) {}
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover = false, _focus = false) {} static onDrawNode = function(xx, yy, _mx, _my, _s, _hover = false, _focus = false) {}
badgePreview = 0;
badgeInspect = 0;
static drawBadge = function(_x, _y, _s) { static drawBadge = function(_x, _y, _s) {
if(!active) return; if(!active) return;
var xx = x * _s + _x + w * _s; var xx = x * _s + _x + w * _s;
var yy = y * _s + _y; var yy = y * _s + _y;
if(previewing) { badgePreview = lerp_float(badgePreview, !!previewing, 2);
draw_sprite(THEME.node_state, 0, xx, yy); badgeInspect = lerp_float(badgeInspect, inspecting, 2);
xx -= max(32 * _s, 16);
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; 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_list_add_map(_inputs, inputs[| i].serialize(scale, preset));
ds_map_add_list(_map, "inputs", _inputs); 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); doSerialize(_map);
processSerialize(_map); processSerialize(_map);
return _map; return _map;
@ -1175,10 +1262,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
doDeserialize(); doDeserialize();
processDeserialize(); processDeserialize();
if(!ds_map_exists(load_map, "inputs"))
return;
} }
static doDeserialize = function() {} static doDeserialize = function() {}
static attributeDeserialize = function(attr) { 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 _inputs = load_map[? "inputs"];
var amo = min(ds_list_size(inputs), ds_list_size(_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++) { for(var i = 0; i < amo; i++) {
if(inputs[| i] == noone) continue; if(inputs[| i] == noone) continue;
inputs[| i].applyDeserialize(_inputs[| i], load_scale, preset); 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(); doApplyDeserialize();
} }
@ -1224,9 +1311,14 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
static connect = function(log = false) { static connect = function(log = false) {
var connected = true; 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); 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); if(!connected) ds_queue_enqueue(CONNECTION_CONFLICT, self);
return connected; return connected;

View file

@ -39,7 +39,7 @@ function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) const
first_update = false; first_update = false;
static onInspectorUpdate = function() { static onInspector1Update = function() {
var path = inputs[| 0].getValue(); var path = inputs[| 0].getValue();
if(path == "") return; if(path == "") return;
updatePaths(path); updatePaths(path);

View file

@ -339,13 +339,13 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
} }
} }
inspUpdateTooltip = "Export"; insp1UpdateTooltip = "Export";
inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ]; insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
insp2UpdateTooltip = "Export All"; insp2UpdateTooltip = "Export All";
insp2UpdateIcon = [ THEME.play_all, 0, COLORS._main_value_positive ]; insp2UpdateIcon = [ THEME.play_all, 0, COLORS._main_value_positive ];
static onInspectorUpdate = function() { static onInspector1Update = function() {
if(isInLoop()) UPDATE |= RENDER_TYPE.full; if(isInLoop()) UPDATE |= RENDER_TYPE.full;
else doInspectorAction(); else doInspectorAction();
} }

View file

@ -27,9 +27,9 @@ function Node_Feedback(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
allReady &= _in.isRenderable() allReady &= _in.isRenderable()
} }
if(!allReady) return; if(!allReady) return [];
__nodeLeafList(getNodeList(), RENDER_QUEUE); return __nodeLeafList(getNodeList());
} }
PATCH_STATIC PATCH_STATIC

View file

@ -2,6 +2,7 @@ function Node_Fluid_Domain(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
name = "Fluid Domain"; name = "Fluid Domain";
color = COLORS.node_blend_fluid; color = COLORS.node_blend_fluid;
icon = THEME.fluid_sim; icon = THEME.fluid_sim;
update_on_frame = true;
min_h = 128; min_h = 128;

View file

@ -25,10 +25,11 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
} }
static getNextNodes = function() { static getNextNodes = function() {
if(is_undefined(outParent)) return; if(is_undefined(outParent)) return [];
group.setRenderStatus(true); group.setRenderStatus(true);
//printIf(global.RENDER_LOG, "Value to amount " + string(ds_list_size(outParent.value_to))); //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++) { for(var j = 0; j < ds_list_size(outParent.value_to); j++) {
var _to = outParent.value_to[| j]; var _to = outParent.value_to[| j];
if(!_to.node.renderActive) continue; if(!_to.node.renderActive) continue;
@ -47,14 +48,18 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
printIf(global.RENDER_LOG, "Group output ready " + string(_to.node.isRenderable())); printIf(global.RENDER_LOG, "Group output ready " + string(_to.node.isRenderable()));
if(_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"); printIf(global.RENDER_LOG, "Push node " + _to.node.name + " to stack");
} }
} }
return nodes;
} }
static createOutput = function(override_order = true) { static createOutput = function(override_order = true) {
if(group && is_struct(group)) { if(group == noone) return;
if(!is_struct(group)) return;
if(override_order) { if(override_order) {
output_index = ds_list_size(group.outputs); output_index = ds_list_size(group.outputs);
inputs[| 1].setValue(output_index); inputs[| 1].setValue(output_index);
@ -75,7 +80,6 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
outParent.setFrom(inputs[| 0]); outParent.setFrom(inputs[| 0]);
} }
}
if(!LOADING && !APPENDING) if(!LOADING && !APPENDING)
createOutput(); createOutput();
@ -95,14 +99,14 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
outParent.display_type = inputs[| 0].display_type; outParent.display_type = inputs[| 0].display_type;
} }
static triggerRender = function() { //static triggerRender = function() {
if(is_undefined(outParent)) return; // if(is_undefined(outParent)) return;
for(var j = 0; j < ds_list_size(outParent.value_to); j++) { // for(var j = 0; j < ds_list_size(outParent.value_to); j++) {
if(outParent.value_to[| j].value_from == outParent) // if(outParent.value_to[| j].value_from == outParent)
outParent.value_to[| j].node.triggerRender(); // outParent.value_to[| j].node.triggerRender();
} // }
} //}
static postDeserialize = function() { static postDeserialize = function() {
createOutput(false); createOutput(false);

View file

@ -4,7 +4,7 @@ function __generate_node_data() {
CLONING = true; CLONING = true;
var dir = DIRECTORY + "Nodes//"; var dir = DIRECTORY + "Nodes/Guides/";
if(!directory_exists(dir)) directory_create(dir); if(!directory_exists(dir)) directory_create(dir);
repeat(amo) { repeat(amo) {
@ -27,6 +27,7 @@ function __generate_node_data() {
name: _b.inputs[| i].name, name: _b.inputs[| i].name,
tooltip: _b.inputs[| i].tooltip, tooltip: _b.inputs[| i].tooltip,
type: _b.inputs[| i].type, type: _b.inputs[| i].type,
visible: _b.inputs[| i].visible,
}; };
} }
@ -35,6 +36,7 @@ function __generate_node_data() {
name: _b.outputs[| i].name, name: _b.outputs[| i].name,
tooltip: _b.outputs[| i].tooltip, tooltip: _b.outputs[| i].tooltip,
type: _b.outputs[| i].type, type: _b.outputs[| i].type,
visible: _b.outputs[| i].visible,
}; };
} }
@ -52,11 +54,11 @@ function __generate_node_data() {
function __initNodeData() { function __initNodeData() {
global.NODE_GUIDE = {}; global.NODE_GUIDE = {};
var dir = DIRECTORY + "Nodes/Guides"; var dir = DIRECTORY + "Nodes/Guides/";
if(!directory_exists(dir)) if(!directory_exists(dir))
directory_create(dir); directory_create(dir);
var f = file_find_first(dir + "*", 0); var f = file_find_first(dir + "*.json", 0);
while(f != "") { while(f != "") {
var path = dir + f; var path = dir + f;
@ -68,16 +70,22 @@ function __initNodeData() {
f = file_find_next(); f = file_find_next();
} }
//var _l = dir + "/version"; var nodeDir = DIRECTORY + "Nodes/";
//if(file_exists(_l)) { var _l = nodeDir + "/version";
// var res = json_load_struct(_l);
// if(res.version >= VERSION) return; if(file_exists(_l)) {
//} var res = json_load_struct(_l);
//json_save_struct(_l, { version: VERSION }); if(res.version >= VERSION) return;
}
json_save_struct(_l, { version: VERSION });
var tooltipDir = DIRECTORY + "Nodes/";
if(file_exists("data/tooltip.zip")) if(file_exists("data/tooltip.zip"))
zip_unzip("data/tooltip.zip", tooltipDir); zip_unzip("data/tooltip.zip", nodeDir);
else else
noti_status("Tooltip image file not found.") 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.")
} }

View file

@ -80,7 +80,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
return false; return false;
} }
static onInspectorUpdate = function() { static onInspector1Update = function() {
var path = inputs[| 0].getValue(); var path = inputs[| 0].getValue();
if(path == "") return; if(path == "") return;
updatePaths(path); 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[| 1].setValue([ww, hh]);
_splice.inputs[| 2].setValue(amo); _splice.inputs[| 2].setValue(amo);
_splice.inputs[| 3].setValue([ amo, 1 ]); _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, self);
ds_list_add(PANEL_GRAPH.nodes_select_list, _splice); ds_list_add(PANEL_GRAPH.nodes_select_list, _splice);

View file

@ -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"]) .setDisplay(VALUE_DISPLAY.enum_scroll, ["Loop", "Ping pong", "Hold last frame", "Hide"])
.rejectArray(); .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() { .setDisplay(VALUE_DISPLAY.button, [ function() {
if(array_length(spr) == 0) return; if(array_length(spr) == 0) return;
ANIMATOR.frames_total = array_length(spr); 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; return true;
} }
static onInspectorUpdate = function() { static onInspector1Update = function() {
var path = inputs[| 0].getValue(); var path = inputs[| 0].getValue();
if(path == "") return; if(path == "") return;
updatePaths(path); updatePaths(path);

View file

@ -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, "") inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
.setDisplay(VALUE_DISPLAY.path_load, ["*.gif", ""]); .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() { .setDisplay(VALUE_DISPLAY.button, [ function() {
if(!spr) return; if(!spr) return;
if(!sprite_exists(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; return false;
} }
static onInspectorUpdate = function() { static onInspector1Update = function() {
var path = inputs[| 0].getValue(); var path = inputs[| 0].getValue();
if(path == "") return; if(path == "") return;
updatePaths(path); updatePaths(path);

View file

@ -82,7 +82,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
return false; return false;
} }
static onInspectorUpdate = function() { static onInspector1Update = function() {
var path = inputs[| 0].getValue(); var path = inputs[| 0].getValue();
if(path == "") return; if(path == "") return;
updatePaths(path); updatePaths(path);

View file

@ -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) inputs[| 9] = nodeValue("Orientation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Horizontal", "Vertical"]); .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() { .setDisplay(VALUE_DISPLAY.button, [ function() {
var _sur = inputs[| 0].getValue(); var _sur = inputs[| 0].getValue();
if(!is_surface(_sur) || _sur == DEF_SURFACE) return; 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 else
inputs[| 3].setValue([ fill_h, fill_w ]); inputs[| 3].setValue([ fill_h, fill_w ]);
inspectorUpdate(); inspector1Update();
}, "Auto fill"] ); }, "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() { .setDisplay(VALUE_DISPLAY.button, [ function() {
var _amo = inputs[| 3].getValue(); var _amo = inputs[| 3].getValue();
ANIMATOR.frames_total = max(1, _amo[0] * _amo[1]); 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); inputs[| 8].setVisible(!_out);
} }
static onInspectorUpdate = function() { static onInspector1Update = function() {
if(isInLoop()) Render(); if(isInLoop()) Render();
else doInspectorAction(); else doInspectorAction();
} }

View file

@ -49,10 +49,10 @@ function Node_Iterate(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
allReady &= _in.isRenderable() allReady &= _in.isRenderable()
} }
if(!allReady) return; if(!allReady) return [];
__nodeLeafList(getNodeList(), RENDER_QUEUE);
initLoop(); initLoop();
return __nodeLeafList(getNodeList());
} }
static iterationStatus = function() { static iterationStatus = function() {

View file

@ -24,8 +24,8 @@ function Node_Iterate_Each(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr
} }
static getNextNodes = function() { static getNextNodes = function() {
__nodeLeafList(getNodeList(), RENDER_QUEUE);
initLoop(); initLoop();
return __nodeLeafList(getNodeList());
} }
static onStep = function() { static onStep = function() {

View file

@ -26,8 +26,8 @@ function Node_Iterate_Filter(_x, _y, _group = noone) : Node_Collection(_x, _y, _
} }
static getNextNodes = function() { static getNextNodes = function() {
__nodeLeafList(getNodeList(), RENDER_QUEUE);
initLoop(); initLoop();
return __nodeLeafList(getNodeList());
} }
static onStep = function() { static onStep = function() {

View file

@ -11,12 +11,13 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group
.setVisible(false); .setVisible(false);
static getNextNodes = function() { static getNextNodes = function() {
if(!struct_has(group, "iterationStatus")) return; if(!struct_has(group, "iterationStatus")) return [];
var _ren = group.iterationStatus(); 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? 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)); 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 } else if(_ren == ITERATION_STATUS.complete) { //Go out of loop
printIf(global.RENDER_LOG, " > Loop completed"); printIf(global.RENDER_LOG, " > Loop completed");
group.setRenderStatus(true); 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) { if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) {
_to.node.triggerRender(); _to.node.triggerRender();
if(_to.node.isRenderable()) ds_queue_enqueue(RENDER_QUEUE, _to.node); if(_to.node.isRenderable())
array_push(nodes, _to.node);
} }
} }
} else } else
printIf(global.RENDER_LOG, " > Loop not ready"); printIf(global.RENDER_LOG, " > Loop not ready");
return nodes;
} }
static step = function() { static step = function() {

View file

@ -11,12 +11,13 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro
.setVisible(true, true); .setVisible(true, true);
static getNextNodes = function() { static getNextNodes = function() {
if(!struct_has(group, "iterationStatus")) return; if(!struct_has(group, "iterationStatus")) return [];
var _ren = group.iterationStatus(); 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? 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)); 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 } else if(_ren == ITERATION_STATUS.complete) { //Go out of loop
printIf(global.RENDER_LOG, " > Loop completed"); printIf(global.RENDER_LOG, " > Loop completed");
group.setRenderStatus(true); 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) { if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) {
_to.node.triggerRender(); _to.node.triggerRender();
if(_to.node.isRenderable()) ds_queue_enqueue(RENDER_QUEUE, _to.node); if(_to.node.isRenderable())
array_push(nodes, _to.node);
} }
} }
} else } else
printIf(global.RENDER_LOG, " > Loop not ready"); printIf(global.RENDER_LOG, " > Loop not ready");
return nodes;
} }
static step = function() { static step = function() {

View file

@ -32,16 +32,14 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y
cache_value = -1; cache_value = -1;
static getNextNodes = function() { static getNextNodes = function() {
var nodes = [];
var _node_it = group; var _node_it = group;
if(!struct_has(_node_it, "iterationStatus")) return; if(!struct_has(_node_it, "iterationStatus")) return nodes;
var _ren = _node_it.iterationStatus(); 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? 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)); printIf(global.RENDER_LOG, " > Loop restart: iteration " + string(group.iterated));
__nodeLeafList(group.getNodeList(), RENDER_QUEUE); nodes = array_append(nodes, __nodeLeafList(group.getNodeList()));
//var loopEnt = inputs[| 2].value_from.node;
//ds_queue_enqueue(RENDER_QUEUE, loopEnt);
} else if(_ren == ITERATION_STATUS.complete) { //Go out of loop } else if(_ren == ITERATION_STATUS.complete) { //Go out of loop
printIf(global.RENDER_LOG, " > Loop completed"); printIf(global.RENDER_LOG, " > Loop completed");
group.setRenderStatus(true); 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.renderActive) continue;
if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) { if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) {
_to.node.triggerRender(); if(_to.node.isRenderable())
if(_to.node.isRenderable()) ds_queue_enqueue(RENDER_QUEUE, _to.node); array_push(nodes, _to.node);
} }
} }
} else } else
printIf(global.RENDER_LOG, " > Loop not ready"); printIf(global.RENDER_LOG, " > Loop not ready");
return nodes;
} }
static initLoop = function() { static initLoop = function() {

View file

@ -69,7 +69,7 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
return false; return false;
} }
static onInspectorUpdate = function() { static onInspector1Update = function() {
var path = inputs[| 0].getValue(); var path = inputs[| 0].getValue();
if(path == "") return; if(path == "") return;
updatePaths(path); updatePaths(path);

View file

@ -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 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) { static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
var bbox = drawGetBbox(xx, yy, _s); var bbox = drawGetBbox(xx, yy, _s);

View file

@ -64,6 +64,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
suffix = ""; suffix = "";
values = ds_list_create(); values = ds_list_create();
sep_axis = _sep_axis; sep_axis = _sep_axis;
if(_prop.type != VALUE_TYPE.trigger)
ds_list_add(values, new valueKey(0, _val, self)); ds_list_add(values, new valueKey(0, _val, self));
//print(_prop.name + ": " + string(_val)); //print(_prop.name + ": " + string(_val));
@ -126,15 +127,29 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
static getName = function() { return prop.name + suffix; } static getName = function() { return prop.name + suffix; }
static getValue = function(_time = ANIMATOR.current_frame) { static getValue = function(_time = ANIMATOR.current_frame) {
if(ds_list_size(values) == 0) return processTypeDefault(); if(prop.type == VALUE_TYPE.trigger) {
if(ds_list_size(values) == 1) { for(var i = 0; i < ds_list_size(values); i++) { //Find trigger
//if(prop.name == "Position") print(values[| 0].value); var _key = values[| i];
return processType(values[| 0].value); if(_key.time == _time)
return _key.value;
}
return false;
} }
if(prop.display_type == VALUE_DISPLAY.gradient) return values[| 0].value; if(ds_list_size(values) == 0)
if(prop.type == VALUE_TYPE.path) return processType(values[| 0].value); return processTypeDefault();
if(!prop.is_anim) return processType(values[| 0].value);
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_first = values[| 0].time;
var _time_last = values[| ds_list_size(values) - 1].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 : case VALUE_TYPE.surface :
if(is_string(_val)) if(is_string(_val))
return get_asset(_val); return get_asset(_val);
return is_surface(_val)? _val : DEF_SURFACE; return _val;
} }
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) { 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(!prop.is_anim) {
if(isEqual(values[| 0].value, _val)) if(isEqual(values[| 0].value, _val))
return false; return false;

View file

@ -90,7 +90,7 @@ function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
static onValueFromUpdate = function(index) { static onValueFromUpdate = function(index) {
if(index == 0) { if(index == 0) {
update(); doUpdate();
if(array_length(current_data) > 0) if(array_length(current_data) > 0)
histogramUpdate(current_data[0]); histogramUpdate(current_data[0]);
} }

View file

@ -218,14 +218,14 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
lua_add_code(getState(), lua_code); lua_add_code(getState(), lua_code);
} }
static onInspectorUpdate = function() { //compile static onInspector1Update = function() { //compile
var thrd = inputs[| 3].value_from; var thrd = inputs[| 3].value_from;
if(thrd == noone) { if(thrd == noone) {
doCompile(); doCompile();
return; return;
} }
thrd.node.onInspectorUpdate(); thrd.node.onInspector1Update();
} }
static doCompile = function() { static doCompile = function() {

View file

@ -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; var thrd = inputs[| 2].value_from;
if(thrd == noone) { if(thrd == noone) {
doCompile(); doCompile();
return; return;
} }
thrd.node.onInspectorUpdate(); thrd.node.onInspector1Update();
} }
static doCompile = function() { static doCompile = function() {

View file

@ -228,14 +228,14 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
lua_add_code(getState(), lua_code); lua_add_code(getState(), lua_code);
} }
static onInspectorUpdate = function() { //compile static onInspector1Update = function() { //compile
var thrd = inputs[| 3].value_from; var thrd = inputs[| 3].value_from;
if(thrd == noone) { if(thrd == noone) {
doCompile(); doCompile();
return; return;
} }
thrd.node.onInspectorUpdate(); thrd.node.onInspector1Update();
} }
static doCompile = function() { static doCompile = function() {

View file

@ -302,7 +302,7 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con
outputs[| 0].setValue(res); outputs[| 0].setValue(res);
} }
static onInspectorUpdate = function() { extractPalettes(); } static onInspector1Update = function() { extractPalettes(); }
static onValueUpdate = function() { extractPalettes(); } static onValueUpdate = function() { extractPalettes(); }
static onValueFromUpdate = function() { extractPalettes(); } static onValueFromUpdate = function() { extractPalettes(); }

View file

@ -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() { function update() {
updateBoundary(); updateBoundary();
outputs[| 0].setValue(self); outputs[| 0].setValue(self);

View file

@ -75,10 +75,11 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
} }
function __initNodes() { function __initNodes() {
var path = DIRECTORY + "Nodes/fav.json"; var favPath = DIRECTORY + "Nodes/fav.json";
global.FAV_NODES = []; global.FAV_NODES = file_exists(favPath)? json_load_struct(favPath) : [];
if(file_exists(path))
global.FAV_NODES = json_load_struct(path); var recPath = DIRECTORY + "Nodes/recent.json";
global.RECENT_NODES = file_exists(recPath)? json_load_struct(recPath) : [];
var group = ds_list_create(); var group = ds_list_create();
addNodeCatagory("Group", group, ["Node_Group"]); addNodeCatagory("Group", group, ["Node_Group"]);
@ -326,7 +327,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
ds_list_add(threeD, "2D operations"); 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", 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, "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."); 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"); 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, "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" ]); 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"); ds_list_add(values, "Struct");
addNodeObject(values, "Struct", s_node_struct, "Node_Struct", [1, Node_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]); 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 #endregion
#region attribute #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 = [ global.SURFACE_INTERPOLATION = [
"No aliasing", "No aliasing",
"Linear", "Linear",
@ -640,8 +625,41 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
"Repeat" "Repeat"
]; ];
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 = [ "Input" ];
global.SURFACE_FORMAT_NAME_PROCESS = array_append(global.SURFACE_FORMAT_NAME_PROCESS, global.SURFACE_FORMAT_NAME); global.SURFACE_FORMAT_NAME_PROCESS = array_append(global.SURFACE_FORMAT_NAME_PROCESS, global.SURFACE_FORMAT_NAME);
}
function attribute_surface_depth(label = true) { function attribute_surface_depth(label = true) {
attributes[? "color_depth"] = inputs[| 0].type == VALUE_TYPE.surface? 0 : 1; attributes[? "color_depth"] = inputs[| 0].type == VALUE_TYPE.surface? 0 : 1;

View file

@ -218,7 +218,7 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
outputs[| 1].setValue(_atl); outputs[| 1].setValue(_atl);
} }
static onInspectorUpdate = function(updateAll = true) { static onInspector1Update = function(updateAll = true) {
var key = ds_map_find_first(NODE_MAP); var key = ds_map_find_first(NODE_MAP);
repeat(ds_map_size(NODE_MAP)) { repeat(ds_map_size(NODE_MAP)) {
var node = NODE_MAP[? key]; var node = NODE_MAP[? key];

View file

@ -2,6 +2,7 @@ function Node_Rigid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro
name = "RigidSim"; name = "RigidSim";
color = COLORS.node_blend_simulation; color = COLORS.node_blend_simulation;
icon = THEME.rigidSim; icon = THEME.rigidSim;
update_on_frame = true;
ungroupable = false; ungroupable = false;
update_on_frame = true; update_on_frame = true;
@ -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_iterations(30);
//physics_world_update_speed(100) //physics_world_update_speed(100)
static reset = function() { //static reset = function() {
instance_destroy(oRigidbody); // instance_destroy(oRigidbody);
physics_pause_enable(true); // physics_pause_enable(true);
var node_list = getNodeList(); // var node_list = getNodeList();
for( var i = 0; i < ds_list_size(node_list); i++ ) { // for( var i = 0; i < ds_list_size(node_list); i++ ) {
var n = node_list[| i]; // var n = node_list[| i];
if(variable_struct_exists(n, "reset")) // if(variable_struct_exists(n, "reset"))
n.reset(); // n.reset();
} // }
physics_pause_enable(false); // physics_pause_enable(false);
} //}
static update = function() { //static update = function() {
if(ANIMATOR.current_frame == 0) // if(ANIMATOR.current_frame == 0)
reset(); // reset();
} //}
PATCH_STATIC PATCH_STATIC
} }

View file

@ -1,7 +1,7 @@
{ {
"resourceType": "GMScript", "resourceType": "GMScript",
"resourceVersion": "1.0", "resourceVersion": "1.0",
"name": "node_rigid_sim", "name": "node_rigid_group",
"isCompatibility": false, "isCompatibility": false,
"isDnD": false, "isDnD": false,
"parent": { "parent": {

View file

@ -2,6 +2,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
name = "Object"; name = "Object";
color = COLORS.node_blend_simulation; color = COLORS.node_blend_simulation;
icon = THEME.rigidSim; icon = THEME.rigidSim;
update_on_frame = true;
w = 96; w = 96;
min_h = 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.") inputs[| 8] = nodeValue("Spawn", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Make object spawn when start.")
.rejectArray(); .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() { .setDisplay(VALUE_DISPLAY.button, [ function() {
var _tex = inputs[| 6].getValue(); var _tex = inputs[| 6].getValue();
if(is_array(_tex)) { if(is_array(_tex)) {
@ -44,7 +46,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
generateMesh(i); generateMesh(i);
} else } else
generateMesh(); generateMesh();
update(); doUpdate();
}, "Generate"] ); }, "Generate"] );
inputs[| 10] = nodeValue("Mesh expansion", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) inputs[| 10] = nodeValue("Mesh expansion", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
@ -517,6 +519,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
physics_fixture_set_linear_damping(fixture, _air_frc); physics_fixture_set_linear_damping(fixture, _air_frc);
physics_fixture_set_angular_damping(fixture, _rot_frc); physics_fixture_set_angular_damping(fixture, _rot_frc);
physics_fixture_set_awake(fixture, true); physics_fixture_set_awake(fixture, true);
if(group != noone)
physics_fixture_set_collision_group(fixture, group.collIndex); physics_fixture_set_collision_group(fixture, group.collIndex);
array_push(object.fixture, physics_fixture_bind_ext(fixture, object, _spos[2], _spos[3])); array_push(object.fixture, physics_fixture_bind_ext(fixture, object, _spos[2], _spos[3]));
@ -659,7 +662,10 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
} }
static update = function(frame = ANIMATOR.current_frame) { static update = function(frame = ANIMATOR.current_frame) {
if(ANIMATOR.current_frame == 0) return; if(ANIMATOR.current_frame == 0) {
reset();
return;
}
if(!isAnimated()) return; if(!isAnimated()) return;
for( var i = 0; i < array_length(object); i++ ) for( var i = 0; i < array_length(object); i++ )

View file

@ -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.") 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" ]); .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); outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ input_display_list = [
["Surface", false], 0, 1, 15, 10, ["Surface", false], 0, 1, 15, 10,
["Scatter", false], 5, 6, 13, 14, 17, 9, 2, ["Scatter", false], 5, 6, 13, 14, 17, 9, 2,
["Transform", false], 3, 8, 7, 4, ["Transform", false], 3, 8, 7, 4,
["Render", false], 11, 12, 16, ["Render", false], 18, 11, 12, 16,
]; ];
attribute_surface_depth(); 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 alpha = _data[12];
var mulpA = _data[16]; var mulpA = _data[16];
var useV = _data[17]; var useV = _data[17];
var blend = _data[18];
var _in_w, _in_h; 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); surface_set_target(_outSurf);
DRAW_CLEAR DRAW_CLEAR
switch(blend) {
case 0 :
if(mulpA) BLEND_ALPHA_MULP; if(mulpA) BLEND_ALPHA_MULP;
else BLEND_ALPHA; else BLEND_ALPHA;
break;
case 1 :
BLEND_ADD;
break;
}
var _sed = seed; var _sed = seed;
var res_index = 0, bg = 0; var res_index = 0, bg = 0;

View file

@ -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]) .setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01])
.rejectArray(); .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(); .rejectArray();
inputs[| 3] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white) inputs[| 3] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white)
.rejectArray(); .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(); .rejectArray();
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
@ -47,7 +47,7 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
_prev_type = -1; _prev_type = -1;
static onInspectorUpdate = function() { separateShape(); } static onInspector1Update = function() { separateShape(); }
static update = function() { static update = function() {
if(attributes[? "auto_exe"]) if(attributes[? "auto_exe"])

View file

@ -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) inputs[| input_fix_len + 0] = nodeValue("Chance", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]); .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, array_push(input_display_list,
["Break", false], input_fix_len + 0, input_fix_len + 1 ["Break", false], input_fix_len + 0, input_fix_len + 1
); );

View file

@ -2,6 +2,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
name = "Strand Create"; name = "Strand Create";
color = COLORS.node_blend_strand; color = COLORS.node_blend_strand;
icon = THEME.strandSim; icon = THEME.strandSim;
update_on_frame = true;
w = 96; w = 96;
inputs[| 0] = nodeValue("Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) 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) inputs[| 14] = nodeValue("Distribution", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Uniform", "Random" ]); .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() { .setDisplay(VALUE_DISPLAY.button, [ function() {
attributes[? "use_groom"] = !attributes[? "use_groom"]; attributes[? "use_groom"] = !attributes[? "use_groom"];
if(attributes[? "use_groom"]) if(attributes[? "use_groom"])

View file

@ -52,7 +52,7 @@ function Node_Text_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
return false; return false;
} }
static onInspectorUpdate = function() { static onInspector1Update = function() {
var path = inputs[| 0].getValue(); var path = inputs[| 0].getValue();
if(path == "") return; if(path == "") return;
updatePaths(path); updatePaths(path);

View file

@ -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 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) { static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
var bbox = drawGetBbox(xx, yy, _s); var bbox = drawGetBbox(xx, yy, _s);

View file

@ -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);
}
}

View file

@ -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",
},
}

View file

@ -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);
}
}

View file

@ -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",
},
}

View file

@ -120,6 +120,7 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
} }
static getNextNodes = function() { static getNextNodes = function() {
var nodes = [];
var _key = inputs[| 0].getValue(); var _key = inputs[| 0].getValue();
var amo = ds_map_size(TUNNELS_OUT); var amo = ds_map_size(TUNNELS_OUT);
var k = ds_map_find_first(TUNNELS_OUT); var k = ds_map_find_first(TUNNELS_OUT);
@ -127,11 +128,13 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
repeat(amo) { repeat(amo) {
if(TUNNELS_OUT[? k] == _key) { if(TUNNELS_OUT[? k] == _key) {
NODE_MAP[? k].triggerRender(); 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); k = ds_map_find_next(TUNNELS_OUT, k);
} }
return nodes;
} }
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {

View file

@ -26,6 +26,9 @@ enum VALUE_TYPE {
struct = 16, struct = 16,
strands = 17, strands = 17,
mesh = 18, mesh = 18,
trigger = 19,
action = 99,
} }
enum VALUE_DISPLAY { enum VALUE_DISPLAY {
@ -95,7 +98,10 @@ function value_color(i) {
$5d3f8c, //struct $5d3f8c, //struct
$6691ff, //strand $6691ff, //strand
$d1c2c2, //mesh $d1c2c2, //mesh
$5dde8f, //trigger
]; ];
if(i == 99) return $5dde8f;
return JUNCTION_COLORS[safe_mod(max(0, i), array_length(JUNCTION_COLORS))]; 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.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); case VALUE_TYPE.any : return ~0 & ~(1 << 32);
} }
return 0; return 0;
@ -234,10 +243,6 @@ function isGraphable(prop) {
return false; return false;
} }
function nodeValue(_name, _node, _connect, _type, _value, _tooltip = "") {
return new NodeValue(_name, _node, _connect, _type, _value, _tooltip);
}
function nodeValueUnit(value) constructor { function nodeValueUnit(value) constructor {
self.value = value; self.value = value;
@ -247,7 +252,7 @@ function nodeValueUnit(value) constructor {
mode = !mode; mode = !mode;
value.cache_value[0] = false; value.cache_value[0] = false;
value.unitConvert(mode); value.unitConvert(mode);
value.node.update(); value.node.doUpdate();
}); });
triggerButton.icon_blend = COLORS._main_icon_light; triggerButton.icon_blend = COLORS._main_icon_light;
triggerButton.icon = THEME.unit_ref; 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_VecRange = [ "x min", "x max", "y min", "y max" ];
global.displaySuffix_Axis = [ "x", "y", "z", "w"]; 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 { function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constructor {
name = _name; name = _name;
node = _node; node = _node;
@ -357,6 +366,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
draw_line_shift_x = 0; draw_line_shift_x = 0;
draw_line_shift_y = 0; draw_line_shift_y = 0;
draw_line_thick = new Tween(1,,, 1.5);
draw_line_shift_hover = false; draw_line_shift_hover = false;
drawLineIndex = 1; drawLineIndex = 1;
@ -534,7 +544,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
} }
for( var i = 0; i < array_length(animators); i++ ) 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; break;
case VALUE_DISPLAY.vector_range : case VALUE_DISPLAY.vector_range :
@ -557,7 +567,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
extract_node = "Node_Vector4"; extract_node = "Node_Vector4";
for( var i = 0; i < array_length(animators); i++ ) 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; break;
case VALUE_DISPLAY.rotation : case VALUE_DISPLAY.rotation :
@ -798,7 +808,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
case VALUE_DISPLAY.text_array : case VALUE_DISPLAY.text_array :
editWidget = new textArrayBox(function() { editWidget = new textArrayBox(function() {
MODIFIED = true; MODIFIED = true;
return animator.values[| 0].value; }, display_data, function() { node.update(); return animator.values[| 0].value; }, display_data, function() { node.doUpdate();
}); });
break; break;
} }
@ -947,6 +957,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
return unit.apply(value, arrIndex); 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; return value;
} }
@ -1046,6 +1059,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
static setAnim = function(anim) { static setAnim = function(anim) {
is_anim = anim; is_anim = anim;
PANEL_ANIMATION.updatePropertyList();
} }
static __anim = function() { static __anim = function() {
@ -1167,6 +1181,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
} }
if(_valueFrom == value_from) { if(_valueFrom == value_from) {
print("whaT")
return false; return false;
} }
@ -1248,6 +1263,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
draw_line_shift_y = 0; draw_line_shift_y = 0;
if(!LOADING) MODIFIED = true; if(!LOADING) MODIFIED = true;
return 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)) { if(PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, x, y, 10 * _s * sca)) {
is_hover = true; is_hover = true;
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); draw_sprite_ext(isArray()? THEME.node_junctions_array_hover : THEME.node_junctions_single_hover, type, x, y, ss, ss, 0, c_white, 1);
} else } 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); draw_sprite_ext(isArray()? THEME.node_junctions_array : THEME.node_junctions_single, type, x, y, ss, ss, 0, c_white, 1);
}
return is_hover; 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); 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; 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; 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 { } else {
var tx = x + 12 * _s; 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) { 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; var _draw_cc = _hover? COLORS._main_text : COLORS._main_text_sub;
draw_set_text(f_p1, fa_left, fa_center, _draw_cc); 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; var tx = x - 12 * _s;
draw_set_halign(fa_right); draw_set_halign(fa_right);
draw_text(tx, y, name); draw_text(tx, y, name);
@ -1474,7 +1504,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break; break;
} }
ext.update(); ext.doUpdate();
PANEL_ANIMATION.updatePropertyList(); PANEL_ANIMATION.updatePropertyList();
} }

View file

@ -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) inputs[| 3] = nodeValue("Display", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "Coordinate" ]); .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 () { .setDisplay(VALUE_DISPLAY.button, [ function () {
wd_minx = -1; wd_minx = -1;
wd_miny = -1; wd_miny = -1;

View file

@ -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) inputs[| 2] = nodeValue("Spring force", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
.setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ] ); .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"] ); .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."); 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() { function createControl() {
var index = ds_list_size(inputs); 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) .setDisplay(VALUE_DISPLAY.puppet_control)
array_push(input_display_list, index); 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(); attribute_interpolation();
input_display_index = array_length(input_display_list); input_display_index = array_length(input_display_list);
points = [];
attributes[? "iteration"] = 4; attributes[? "iteration"] = 4;
array_push(attributeEditors, ["Iteration", "iteration", array_push(attributeEditors, ["Iteration", "iteration",
@ -61,13 +62,10 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
new NodeTool( "Pin / unpin (+ Shift) mesh", THEME.control_pin ) new NodeTool( "Pin / unpin (+ Shift) mesh", THEME.control_pin )
]; ];
attributes[? "pin"] = ds_map_create();
static onValueFromUpdate = function(index) { static onValueFromUpdate = function(index) {
if(index == 0 && ds_list_empty(data.tris)) { if(index == 0 && array_empty(data.tris))
setTriangle(); setTriangle();
} }
}
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
for(var i = 0; i < array_length(data.links); i++) for(var i = 0; i < array_length(data.links); i++)
@ -91,7 +89,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
if(mouse_press(mb_left)) { if(mouse_press(mb_left)) {
if(hover == -1) { if(hover == -1) {
var i = createControl(); 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_type = 2;
i.drag_sx = 0; i.drag_sx = 0;
i.drag_sy = 0; i.drag_sy = 0;
@ -137,12 +135,14 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
xp = x; xp = x;
yp = y; yp = y;
node.points[index] = self;
ndx = 0; ndx = 0;
ndy = 0; ndy = 0;
sx = x; sx = x;
sy = y; sy = y;
pin = ds_map_exists(node.attributes[? "pin"], index); pin = false;
static reset = function() { static reset = function() {
x = sx; x = sx;
@ -196,11 +196,6 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
} }
static setPin = function(pin) { 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; self.pin = pin;
} }
} }
@ -301,9 +296,10 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
surface_reset_target(); surface_reset_target();
} }
points = [];
data.points = [[]]; data.points = [[]];
ds_list_clear(data.tris); data.tris = [];
ds_list_clear(data.links); data.links = [];
var ind = 0; var ind = 0;
for(var i = 0; i <= sample; i++) 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(i == 0) continue;
if(j && data.points[i - 1][j] != 0 && data.points[i][j - 1] != 0) 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) 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 } else
data.points[i][j] = 0; 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(data.points[i][j] == 0) continue;
if(i && data.points[i - 1][j] != 0) { 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) { 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(diagon) {
if(i && j && data.points[i - 1][j - 1] != 0) { if(i && j && data.points[i - 1][j - 1] != 0) {
var l = new link(data.points[i][j], data.points[i - 1][j - 1]); var l = new link(data.points[i][j], data.points[i - 1][j - 1]);
l.k = spring; 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) { 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]); var l = new link(data.points[i][j], data.points[i - 1][j + 1]);
l.k = spring; 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"]; var _inputs = load_map[? "inputs"];
for(var i = control_index; i < ds_list_size(_inputs); i++) { for(var i = control_index; i < ds_list_size(_inputs); i++) {
createControl(); var inp = createControl();
inputs[| i].deserialize(_inputs[| i]); print(instanceof(inp))
inp.applyDeserialize(_inputs[| i]);
} }
} }
static attributeSerialize = function() { static attributeSerialize = function() {
var att = ds_map_create(); 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; return att;
} }
loadPin = noone;
static attributeDeserialize = function(attr) { static attributeDeserialize = function(attr) {
if(ds_map_exists(attr, "pin")) if(ds_map_exists(attr, "pin"))
attributes[? "pin"] = ds_map_clone(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;
}
} }
} }

View file

@ -1077,9 +1077,15 @@ function Panel_Animation() : PanelContent() constructor {
if(stagger_mode == 1 && ds_list_exist(keyframe_selecting, keyframe)) if(stagger_mode == 1 && ds_list_exist(keyframe_selecting, keyframe))
cc = key_hover == keyframe? COLORS.panel_animation_keyframe_selected : COLORS._main_accent; cc = key_hover == keyframe? COLORS.panel_animation_keyframe_selected : COLORS._main_accent;
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)) 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) { if(keyframe_boxing) {
var box_x0 = min(keyframe_box_sx, msx); var box_x0 = min(keyframe_box_sx, msx);

View file

@ -522,6 +522,10 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
menuCall(,, menu); menuCall(,, menu);
} }
if(DRAGGING) {
content_index = i;
}
} }
var cc = foc? COLORS.panel_bg_clear_inner : COLORS._main_text_sub; var cc = foc? COLORS.panel_bg_clear_inner : COLORS._main_text_sub;
@ -820,6 +824,7 @@ function PanelContent() constructor {
showHeader = true; showHeader = true;
function refresh() { function refresh() {
setPanelSize(panel);
onResize(); onResize();
} }
@ -829,6 +834,7 @@ function PanelContent() constructor {
function onFocusEnd() {} function onFocusEnd() {}
function initSize() {} function initSize() {}
function setPanelSize(panel) { function setPanelSize(panel) {
x = panel.tx; x = panel.tx;
y = panel.ty; y = panel.ty;

View file

@ -61,6 +61,7 @@
case "Panel_Color" : return new Panel_Color(); 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; return noone;

View file

@ -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();
}
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "panel_gradient",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "colors",
"path": "folders/panels/colors.yy",
},
}

View file

@ -614,9 +614,6 @@ function Panel_Graph() : PanelContent() constructor {
} }
//print("Node selection time: " + string(current_time - t)); t = current_time; //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) if(node_focus)
node_focus.drawActive(gr_x, gr_y, graph_s); 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) { if(target != noone) {
_mx = target.x; _mx = target.x;
_my = target.y; _my = target.y;
drawCorner |= target.type == VALUE_TYPE.action;
} }
var col = value_color(value_dragging.type); var col = value_color(value_dragging.type);
@ -1338,24 +1338,47 @@ function Panel_Graph() : PanelContent() constructor {
draw_set_color(col); draw_set_color(col);
var th = PREF_MAP[? "connection_line_width"] * graph_s; var th = PREF_MAP[? "connection_line_width"] * graph_s;
switch(PREF_MAP[? "curve_connection_line"]) { 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 : case 1 :
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) if(value_dragging.connect_type == JUNCTION_CONNECT.output)
draw_line_curve_color(_mx, _my, xx, yy,,, graph_s, th, col, col); draw_line_curve_color(_mx, _my, xx, yy,,, graph_s, th, col, col);
else else
draw_line_curve_color(xx, yy, _mx, _my,,, graph_s, th, col, col); draw_line_curve_color(xx, yy, _mx, _my,,, graph_s, th, col, col);
}
break; break;
case 2 : case 2 :
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) if(value_dragging.connect_type == JUNCTION_CONNECT.output)
draw_line_elbow_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner); draw_line_elbow_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner);
else else
draw_line_elbow_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner); draw_line_elbow_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner);
}
break; break;
case 3 : case 3 :
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) if(value_dragging.connect_type == JUNCTION_CONNECT.output)
draw_line_elbow_diag_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner); draw_line_elbow_diag_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner);
else else
draw_line_elbow_diag_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner); draw_line_elbow_diag_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner);
}
break; break;
} }
@ -1366,7 +1389,7 @@ function Panel_Graph() : PanelContent() constructor {
if(mouse_release(mb_left)) { if(mouse_release(mb_left)) {
if(value_focus && value_focus != value_dragging) { if(value_focus && value_focus != value_dragging) {
if(value_focus.connect_type == JUNCTION_CONNECT.input) if(value_focus.connect_type == JUNCTION_CONNECT.input)
value_focus.setFrom(value_dragging); var res = value_focus.setFrom(value_dragging);
else else
value_dragging.setFrom(value_focus); value_dragging.setFrom(value_focus);
} else if(target != noone && value_dragging.connect_type == JUNCTION_CONNECT.input) { } else if(target != noone && value_dragging.connect_type == JUNCTION_CONNECT.input) {

View file

@ -554,10 +554,10 @@ function Panel_Inspector() : PanelContent() constructor {
var bx = w - ui(44); var bx = w - ui(44);
var by = ui(12); var by = ui(12);
if(inspecting.hasInspectorUpdate(true)) { if(inspecting.hasInspector1Update(true)) {
var icon = inspecting.inspUpdateIcon; var icon = inspecting.insp1UpdateIcon;
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, inspecting.inspUpdateTooltip, icon[0], icon[1], icon[2]) == 2) 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.inspectorUpdate(); inspecting.inspector1Update();
} else } else
draw_sprite_ui(THEME.sequence_control, 1, bx + ui(16), by + ui(16),,,, COLORS._main_icon_dark); draw_sprite_ui(THEME.sequence_control, 1, bx + ui(16), by + ui(16),,,, COLORS._main_icon_dark);

View file

@ -190,6 +190,7 @@ function Panel_Menu() : PanelContent() constructor {
return submenuCall(_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_color", "Color"), function() { panelAdd("Panel_Color", true) },,, function() { return findPanel("Panel_Color") != noone; } ),
menuItem(get_text("panel_menu_palette", "Palette"), function() { panelAdd("Panel_Palette", true) },,, function() { return findPanel("Panel_Palette") != noone; } ), menuItem(get_text("panel_menu_palette", "Palette"), function() { panelAdd("Panel_Palette", true) },,, function() { return findPanel("Panel_Palette") != noone; } ),
menuItem(get_text("panel_menu_gradient", "Gradient"),function() { panelAdd("Panel_Gradient", true) },,, function() { return findPanel("Panel_Gradient") != noone; } ),
]); ]);
} ).setIsShelf(), } ).setIsShelf(),
]], ]],

View file

@ -117,7 +117,7 @@ function Panel_Nodes() : PanelContent() constructor {
sc_nodes.draw(px, py + ui(40), mx - px, my - (py + ui(40))); sc_nodes.draw(px, py + ui(40), mx - px, my - (py + ui(40)));
//var bx = w - ui(32 + 16); //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) { //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); // nodeBuild("Node_Tunnel_In", build_x, build_y);

View file

@ -139,14 +139,12 @@ function Panel_Notification() : PanelContent() constructor {
function drawContent(panel) { function drawContent(panel) {
PANEL_PADDING PANEL_PADDING
PANEL_TITLE
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);
var ww = ui(28); var ww = ui(28);
var hh = ui(28); var hh = ui(28);
var bx = w - ui(in_dialog? padding - 8 : padding) - ww; 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 error = !!(filter & NOTI_TYPE.error);
var toolt = error? get_text("noti_hide_error", "Hide error") : get_text("noti_show_error", "Show error"); var toolt = error? get_text("noti_hide_error", "Hide error") : get_text("noti_show_error", "Show error");

View file

@ -8,6 +8,8 @@ function Panel_Workspace() : PanelContent() constructor {
scroll_max = 0; scroll_max = 0;
hori = false; hori = false;
layout_selecting = "";
function refreshContent() { function refreshContent() {
workspaces = []; workspaces = [];
@ -33,12 +35,14 @@ function Panel_Workspace() : PanelContent() constructor {
var y0 = hori? ui(6) : ui(6) + scroll, y1; var y0 = hori? ui(6) : ui(6) + scroll, y1;
var ww = 0; var ww = 0;
var hh = 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); 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++ ) { for( var i = 0; i <= amo; i++ ) {
var tw = hori? string_width(workspaces[i]) + ui(16) : w - ui(16); var str = i == amo? "+" : workspaces[i];
var th = string_height(workspaces[i]) + ui(8); var tw = hori? string_width(str) + ui(16) : w - ui(16);
var th = string_height(str) + ui(8);
x1 = x0 + tw; x1 = x0 + tw;
y1 = y0 + th; 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); draw_sprite_stretched(THEME.button_hide_fill, 1, x0, y0, x1 - x0, y1 - y0);
if(mouse_press(mb_left, pFOCUS)) { if(mouse_press(mb_left, pFOCUS)) {
PREF_MAP[? "panel_layout_file"] = workspaces[i]; 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(); PREF_SAVE();
setPanel(); setPanel();
} }
} }
draw_set_color(PREF_MAP[? "panel_layout_file"] == workspaces[i]? COLORS._main_text : COLORS._main_text_sub) if(mouse_press(mb_right, pFOCUS)) {
draw_text_add(hori? x0 + ui(8) : (x0 + x1) / 2, y0 + ui(4), workspaces[i]); 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"] == str? COLORS._main_text : COLORS._main_text_sub)
draw_text_add(hori? x0 + ui(8) : (x0 + x1) / 2, y0 + ui(4), str);
if(hori) { if(hori) {
x0 += tw + ui(4); x0 += tw + ui(4);

View file

@ -25,6 +25,7 @@
PREF_MAP[? "connection_line_sample"] = 1; PREF_MAP[? "connection_line_sample"] = 1;
PREF_MAP[? "connection_line_corner"] = 8; PREF_MAP[? "connection_line_corner"] = 8;
PREF_MAP[? "connection_line_aa"] = 2; PREF_MAP[? "connection_line_aa"] = 2;
PREF_MAP[? "connection_line_transition"] = true;
PREF_MAP[? "curve_connection_line"] = 1; PREF_MAP[? "curve_connection_line"] = 1;
PREF_MAP[? "default_surface_side"] = 32; PREF_MAP[? "default_surface_side"] = 32;
@ -204,8 +205,8 @@
file_text_write_all(path, json_encode_minify(map)); file_text_write_all(path, json_encode_minify(map));
ds_map_destroy(map); ds_map_destroy(map);
var path = DIRECTORY + "Nodes/fav.json"; json_save_struct(DIRECTORY + "Nodes/fav.json", global.FAV_NODES);
json_save_struct(path, global.FAV_NODES); json_save_struct(DIRECTORY + "Nodes/recent.json", global.RECENT_NODES);
} }
function PREF_LOAD() { function PREF_LOAD() {

View file

@ -4,10 +4,16 @@ enum RENDER_TYPE {
full = 2 full = 2
} }
global.RENDER_LOG = false; #region globalvar
global.group_inputs = [ "Node_Group_Input", "Node_Feedback_Input", "Node_Iterator_Input", "Node_Iterator_Each_Input" ]; 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) {
var nodes = [];
function __nodeLeafList(_list, _queue) {
for( var i = 0; i < ds_list_size(_list); i++ ) { for( var i = 0; i < ds_list_size(_list); i++ ) {
var _node = _list[| i]; var _node = _list[| i];
if(!_node.active) continue; if(!_node.active) continue;
@ -16,10 +22,12 @@ function __nodeLeafList(_list, _queue) {
_node.triggerRender(); _node.triggerRender();
var _startNode = _node.isRenderable(); var _startNode = _node.isRenderable();
if(_startNode) { if(_startNode) {
ds_queue_enqueue(_queue, _node); array_push(nodes, _node);
printIf(global.RENDER_LOG, "Push node " + _node.name + " to stack"); printIf(global.RENDER_LOG, "Push node " + _node.name + " to stack");
} }
} }
return nodes;
} }
function __nodeIsLoop(_node) { function __nodeIsLoop(_node) {
@ -43,11 +51,12 @@ function __nodeInLoop(_node) {
} }
function Render(partial = false, runAction = false) { function Render(partial = false, runAction = false) {
var t = current_time;
printIf(global.RENDER_LOG, "=== RENDER START [frame " + string(ANIMATOR.current_frame) + "] ===");
try { try {
var rendering = noone; var rendering = noone;
var error = 0; var error = 0;
var t = current_time;
printIf(global.RENDER_LOG, "=== RENDER START [frame " + string(ANIMATOR.current_frame) + "] ===");
if(!partial || ALWAYS_FULL) { if(!partial || ALWAYS_FULL) {
var _key = ds_map_find_first(NODE_MAP); var _key = ds_map_find_first(NODE_MAP);
@ -78,11 +87,13 @@ function Render(partial = false, runAction = false) {
if(__nodeInLoop(_node)) continue; if(__nodeInLoop(_node)) continue;
var _startNode = _node.isRenderable(); var _startNode = _node.isRenderable();
printIf(global.RENDER_LOG, " > Check leaf " + _node.name + " (" + _node.display_name + "): " + string(_startNode)); if(_startNode) {
printIf(global.RENDER_LOG, " > Found leaf " + _node.name + " (" + _node.display_name + ")");
if(_startNode) _node.triggerRender();
ds_queue_enqueue(RENDER_QUEUE, _node); ds_queue_enqueue(RENDER_QUEUE, _node);
} }
}
// render forward // render forward
while(!ds_queue_empty(RENDER_QUEUE)) { while(!ds_queue_empty(RENDER_QUEUE)) {
@ -90,20 +101,23 @@ function Render(partial = false, runAction = false) {
if(!rendering.rendered) { if(!rendering.rendered) {
rendering.doUpdate(); rendering.doUpdate();
rendering.setRenderStatus(true);
printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "] (Update)"); 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()) if(runAction && rendering.hasInspector1Update())
rendering.inspectorUpdate(); rendering.inspector1Update();
} else } else
printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "] (Skip)"); 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) } catch(e)
noti_warning(exception_print(e)); noti_warning(exception_print(e));
printIf(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n");
} }
function __renderListReset(list) { function __renderListReset(list) {
@ -151,13 +165,16 @@ function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) {
var txt = rendering.rendered? " [Skip]" : " [Update]"; var txt = rendering.rendered? " [Skip]" : " [Update]";
if(!rendering.rendered) { if(!rendering.rendered) {
rendering.doUpdate(); rendering.doUpdate();
if(rendering.hasInspectorUpdate()) { if(rendering.hasInspector1Update()) {
rendering.inspectorUpdate(); rendering.inspector1Update();
printIf(global.RENDER_LOG, " > Toggle manual execution " + rendering.name + " (" + rendering.display_name + ")"); printIf(global.RENDER_LOG, " > Toggle manual execution " + rendering.name + " (" + rendering.display_name + ")");
} }
rendering.setRenderStatus(true); var nextNodes = rendering.getNextNodes();
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); printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "]" + txt);
} }

Some files were not shown because too many files have changed in this diff Show more