Panel change

This commit is contained in:
Tanasart 2023-03-11 07:40:17 +07:00
parent 0801d4cfcf
commit 73a735d5f0
77 changed files with 3692 additions and 2631 deletions

View file

@ -79,6 +79,7 @@
{"name":"rigidSim","order":16,"path":"folders/nodes/data/rigidSim.yy",},
{"name":"transform","order":8,"path":"folders/nodes/data/transform.yy",},
{"name":"value","order":3,"path":"folders/nodes/data/value.yy",},
{"name":"struct","order":6,"path":"folders/nodes/data/value/struct.yy",},
{"name":"VFX","order":13,"path":"folders/nodes/data/VFX.yy",},
{"name":"icons","order":6,"path":"folders/nodes/icons.yy",},
{"name":"3D","order":133,"path":"folders/nodes/icons/3D.yy",},
@ -97,6 +98,7 @@
{"name":"color","order":46,"path":"folders/nodes/icons/value/color.yy",},
{"name":"number","order":47,"path":"folders/nodes/icons/value/number.yy",},
{"name":"path","order":48,"path":"folders/nodes/icons/value/path.yy",},
{"name":"struct","order":50,"path":"folders/nodes/icons/value/struct.yy",},
{"name":"texts","order":49,"path":"folders/nodes/icons/value/texts.yy",},
{"name":"VFX","order":134,"path":"folders/nodes/icons/VFX.yy",},
{"name":"panels","order":2,"path":"folders/panels.yy",},
@ -128,6 +130,7 @@
{"name":"panel_function","order":5,"path":"scripts/panel_function/panel_function.yy",},
{"name":"node_time_remap","order":3,"path":"scripts/node_time_remap/node_time_remap.yy",},
{"name":"sh_perlin","order":1,"path":"shaders/sh_perlin/sh_perlin.yy",},
{"name":"node_tool","order":10,"path":"scripts/node_tool/node_tool.yy",},
{"name":"sh_find_pixel","order":46,"path":"shaders/sh_find_pixel/sh_find_pixel.yy",},
{"name":"sh_scale3x","order":29,"path":"shaders/sh_scale3x/sh_scale3x.yy",},
{"name":"node_csv_file_write","order":13,"path":"scripts/node_csv_file_write/node_csv_file_write.yy",},
@ -253,6 +256,7 @@
{"name":"fd_rectangle_create_view","order":3,"path":"scripts/fd_rectangle_create_view/fd_rectangle_create_view.yy",},
{"name":"node_fluid_vortex","order":8,"path":"scripts/node_fluid_vortex/node_fluid_vortex.yy",},
{"name":"sh_cell_noise_round","order":9,"path":"shaders/sh_cell_noise_round/sh_cell_noise_round.yy",},
{"name":"s_node_path_plot","order":12,"path":"sprites/s_node_path_plot/s_node_path_plot.yy",},
{"name":"json_functions","order":8,"path":"scripts/json_functions/json_functions.yy",},
{"name":"event_recorder","order":3,"path":"scripts/event_recorder/event_recorder.yy",},
{"name":"s_node_path_l_system","order":10,"path":"sprites/s_node_path_l_system/s_node_path_l_system.yy",},
@ -268,6 +272,7 @@
{"name":"__node","order":9,"path":"scripts/__node/__node.yy",},
{"name":"fd_rectangle_add_velocity","order":5,"path":"scripts/fd_rectangle_add_velocity/fd_rectangle_add_velocity.yy",},
{"name":"sh_level_selector","order":23,"path":"shaders/sh_level_selector/sh_level_selector.yy",},
{"name":"checkboxGroup","order":28,"path":"scripts/checkboxGroup/checkboxGroup.yy",},
{"name":"s_node_pixel_find","order":13,"path":"sprites/s_node_pixel_find/s_node_pixel_find.yy",},
{"name":"sh_noise_grid_tri","order":25,"path":"shaders/sh_noise_grid_tri/sh_noise_grid_tri.yy",},
{"name":"globals","order":1,"path":"scripts/globals/globals.yy",},
@ -319,6 +324,7 @@
{"name":"sh_blur_box_contrast","order":3,"path":"shaders/sh_blur_box_contrast/sh_blur_box_contrast.yy",},
{"name":"sh_fd_calculate_pressure_jacobi_glsl","order":8,"path":"shaders/sh_fd_calculate_pressure_jacobi_glsl/sh_fd_calculate_pressure_jacobi_glsl.yy",},
{"name":"node_color_from_rgb","order":7,"path":"scripts/node_color_from_rgb/node_color_from_rgb.yy",},
{"name":"node_struct_get","order":1,"path":"scripts/node_struct_get/node_struct_get.yy",},
{"name":"curveBox","order":8,"path":"scripts/curveBox/curveBox.yy",},
{"name":"s_node_iterator_length","order":24,"path":"sprites/s_node_iterator_length/s_node_iterator_length.yy",},
{"name":"preview_overlay_vector","order":2,"path":"scripts/preview_overlay_vector/preview_overlay_vector.yy",},
@ -909,6 +915,7 @@
{"name":"fd_rectangle_get_material_type","order":14,"path":"scripts/fd_rectangle_get_material_type/fd_rectangle_get_material_type.yy",},
{"name":"node_area","order":5,"path":"scripts/node_area/node_area.yy",},
{"name":"s_node_posterize","order":31,"path":"sprites/s_node_posterize/s_node_posterize.yy",},
{"name":"s_node_struct_get","order":1,"path":"sprites/s_node_struct_get/s_node_struct_get.yy",},
{"name":"s_node_vfx_vortex","order":4,"path":"sprites/s_node_vfx_vortex/s_node_vfx_vortex.yy",},
{"name":"s_node_array_add","order":1,"path":"sprites/s_node_array_add/s_node_array_add.yy",},
{"name":"s_node_image_sequence_to_anim","order":9,"path":"sprites/s_node_image_sequence_to_anim/s_node_image_sequence_to_anim.yy",},
@ -1000,6 +1007,7 @@
{"name":"node_frame","order":1,"path":"scripts/node_frame/node_frame.yy",},
{"name":"s_node_scale_algo","order":7,"path":"sprites/s_node_scale_algo/s_node_scale_algo.yy",},
{"name":"sh_sdf_dist","order":4,"path":"shaders/sh_sdf_dist/sh_sdf_dist.yy",},
{"name":"node_path_plot","order":12,"path":"scripts/node_path_plot/node_path_plot.yy",},
{"name":"sh_de_corner","order":15,"path":"shaders/sh_de_corner/sh_de_corner.yy",},
{"name":"node_rigid_object_spawner","order":6,"path":"scripts/node_rigid_object_spawner/node_rigid_object_spawner.yy",},
{"name":"o_dialog_graph_connection","order":5,"path":"objects/o_dialog_graph_connection/o_dialog_graph_connection.yy",},

View file

@ -104,6 +104,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"color","folderPath":"folders/nodes/data/value/color.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"number","folderPath":"folders/nodes/data/value/number.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":"texts","folderPath":"folders/nodes/data/value/texts.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",},
@ -123,6 +124,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"color","folderPath":"folders/nodes/icons/value/color.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"number","folderPath":"folders/nodes/icons/value/number.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"path","folderPath":"folders/nodes/icons/value/path.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"struct","folderPath":"folders/nodes/icons/value/struct.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"texts","folderPath":"folders/nodes/icons/value/texts.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"VFX","folderPath":"folders/nodes/icons/VFX.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"panels","folderPath":"folders/panels.yy",},
@ -156,6 +158,9 @@
{"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":"icon.png","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"layouts.zip","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Horizontal.json","CopyToMask":-1,"filePath":"datafiles/data/layouts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Vertical.json","CopyToMask":-1,"filePath":"datafiles/data/layouts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"en.json","CopyToMask":-1,"filePath":"datafiles/data/locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"storepage_533260_english.json","CopyToMask":-1,"filePath":"datafiles/data/locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"node_guides.json","CopyToMask":-1,"filePath":"datafiles/data/nodes",},
@ -367,6 +372,7 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_timeline_keyframe_selecting.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/timeline",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_timeline_keyframes.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/timeline",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_canvas_channel.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_canvas_tools_bucket.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_canvas_tools_ellip_fill.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_canvas_tools_ellip.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
@ -384,6 +390,7 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_path_tools_add.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_path_tools_anchor.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_path_tools_circle.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_path_tools_draw.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_path_tools_rectangle.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_splice_draw.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphic.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
@ -454,6 +461,10 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"LICENSE.txt","CopyToMask":-1,"filePath":"datafiles/ImageMagick",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"magick.exe","CopyToMask":-1,"filePath":"datafiles/ImageMagick",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"LuaLicense.txt","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mf.dll","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfcore.dll","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"mfplat.dll","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"README.txt","CopyToMask":-1,"filePath":"datafiles",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"arrowRight.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Bevel.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Broken heart.png","CopyToMask":-1,"filePath":"datafiles/Sample Projects",},
@ -497,6 +508,7 @@
{"id":{"name":"node_time_remap","path":"scripts/node_time_remap/node_time_remap.yy",},},
{"id":{"name":"sh_perlin","path":"shaders/sh_perlin/sh_perlin.yy",},},
{"id":{"name":"sh_normal_light","path":"shaders/sh_normal_light/sh_normal_light.yy",},},
{"id":{"name":"node_tool","path":"scripts/node_tool/node_tool.yy",},},
{"id":{"name":"sh_find_pixel","path":"shaders/sh_find_pixel/sh_find_pixel.yy",},},
{"id":{"name":"sh_scale3x","path":"shaders/sh_scale3x/sh_scale3x.yy",},},
{"id":{"name":"node_csv_file_write","path":"scripts/node_csv_file_write/node_csv_file_write.yy",},},
@ -638,6 +650,7 @@
{"id":{"name":"fd_rectangle_create_view","path":"scripts/fd_rectangle_create_view/fd_rectangle_create_view.yy",},},
{"id":{"name":"node_fluid_vortex","path":"scripts/node_fluid_vortex/node_fluid_vortex.yy",},},
{"id":{"name":"sh_cell_noise_round","path":"shaders/sh_cell_noise_round/sh_cell_noise_round.yy",},},
{"id":{"name":"s_node_path_plot","path":"sprites/s_node_path_plot/s_node_path_plot.yy",},},
{"id":{"name":"json_functions","path":"scripts/json_functions/json_functions.yy",},},
{"id":{"name":"event_recorder","path":"scripts/event_recorder/event_recorder.yy",},},
{"id":{"name":"s_node_path_l_system","path":"sprites/s_node_path_l_system/s_node_path_l_system.yy",},},
@ -655,6 +668,8 @@
{"id":{"name":"fd_rectangle_add_velocity","path":"scripts/fd_rectangle_add_velocity/fd_rectangle_add_velocity.yy",},},
{"id":{"name":"sh_level_selector","path":"shaders/sh_level_selector/sh_level_selector.yy",},},
{"id":{"name":"string_eval","path":"scripts/string_eval/string_eval.yy",},},
{"id":{"name":"s_node_struct","path":"sprites/s_node_struct/s_node_struct.yy",},},
{"id":{"name":"checkboxGroup","path":"scripts/checkboxGroup/checkboxGroup.yy",},},
{"id":{"name":"s_node_pixel_find","path":"sprites/s_node_pixel_find/s_node_pixel_find.yy",},},
{"id":{"name":"sh_noise_grid_tri","path":"shaders/sh_noise_grid_tri/sh_noise_grid_tri.yy",},},
{"id":{"name":"globals","path":"scripts/globals/globals.yy",},},
@ -692,6 +707,7 @@
{"id":{"name":"font_loader","path":"scripts/font_loader/font_loader.yy",},},
{"id":{"name":"point_rotate","path":"scripts/point_rotate/point_rotate.yy",},},
{"id":{"name":"s_node_vfx_variable","path":"sprites/s_node_vfx_variable/s_node_vfx_variable.yy",},},
{"id":{"name":"node_struct","path":"scripts/node_struct/node_struct.yy",},},
{"id":{"name":"node_displacement","path":"scripts/node_displacement/node_displacement.yy",},},
{"id":{"name":"mask_function","path":"scripts/mask_function/mask_function.yy",},},
{"id":{"name":"text_file","path":"scripts/text_file/text_file.yy",},},
@ -714,6 +730,7 @@
{"id":{"name":"sh_blur_box_contrast","path":"shaders/sh_blur_box_contrast/sh_blur_box_contrast.yy",},},
{"id":{"name":"sh_fd_calculate_pressure_jacobi_glsl","path":"shaders/sh_fd_calculate_pressure_jacobi_glsl/sh_fd_calculate_pressure_jacobi_glsl.yy",},},
{"id":{"name":"node_color_from_rgb","path":"scripts/node_color_from_rgb/node_color_from_rgb.yy",},},
{"id":{"name":"node_struct_get","path":"scripts/node_struct_get/node_struct_get.yy",},},
{"id":{"name":"node_transform","path":"scripts/node_transform/node_transform.yy",},},
{"id":{"name":"curveBox","path":"scripts/curveBox/curveBox.yy",},},
{"id":{"name":"s_node_iterator_length","path":"sprites/s_node_iterator_length/s_node_iterator_length.yy",},},
@ -1384,6 +1401,7 @@
{"id":{"name":"node_area","path":"scripts/node_area/node_area.yy",},},
{"id":{"name":"s_node_vfx_accel","path":"sprites/s_node_vfx_accel/s_node_vfx_accel.yy",},},
{"id":{"name":"s_node_posterize","path":"sprites/s_node_posterize/s_node_posterize.yy",},},
{"id":{"name":"s_node_struct_get","path":"sprites/s_node_struct_get/s_node_struct_get.yy",},},
{"id":{"name":"s_node_vfx_vortex","path":"sprites/s_node_vfx_vortex/s_node_vfx_vortex.yy",},},
{"id":{"name":"s_node_array_add","path":"sprites/s_node_array_add/s_node_array_add.yy",},},
{"id":{"name":"s_node_counter","path":"sprites/s_node_counter/s_node_counter.yy",},},
@ -1488,6 +1506,7 @@
{"id":{"name":"node_frame","path":"scripts/node_frame/node_frame.yy",},},
{"id":{"name":"s_node_scale_algo","path":"sprites/s_node_scale_algo/s_node_scale_algo.yy",},},
{"id":{"name":"sh_sdf_dist","path":"shaders/sh_sdf_dist/sh_sdf_dist.yy",},},
{"id":{"name":"node_path_plot","path":"scripts/node_path_plot/node_path_plot.yy",},},
{"id":{"name":"node_bw","path":"scripts/node_bw/node_bw.yy",},},
{"id":{"name":"sh_de_corner","path":"shaders/sh_de_corner/sh_de_corner.yy",},},
{"id":{"name":"node_rigid_object_spawner","path":"scripts/node_rigid_object_spawner/node_rigid_object_spawner.yy",},},

18
datafiles/README.txt Normal file
View file

@ -0,0 +1,18 @@
This file was provided by: https://www.dll-files.com/
If you downloaded it from somewhere else, please let us know: info@dll-files.com
DLL-Files.com is owned and operated by Tilf AB, Sweden. The collection of DLL files as a whole (falls under the “collection copyright” laws) are © Copyright Tilf AB
The individual DLL files are provided free of charge with the understanding that the user is familiar with their use.
If you need help installing the file, please see:
https://www.dll-files.com/support/
or ask your question in the forum:
https://forum.dll-files.com/
DISCLAIMER AND LIMITATION OF LIABILITY
The Following Refers to all Files with the Extension of "dll" or dlls compressed as "zip".
All files are provided on an as is basis. No guarantees or warranties are given or implied. Downloading files from this site is free of charge and the user assumes all risks of any damages that may occur, including but not limited to loss of data, damages to hardware, or loss of business profits. We do our best to ensure that all files are virus-free using available means. However, all files have not been tested for functionality or contamination. Many have been sent to us by visitors like yourself. Thus, we suggest that you do a virus scan using an up-to-date version of an anti-virus program before use. Please use at your own risk.

BIN
datafiles/data/layouts.zip Normal file

Binary file not shown.

View file

@ -0,0 +1,29 @@
{
"panel": {
"split": "h",
"width": -400,
"content": [
{
"split": "v",
"width": -48,
"content": [
{
"split": "v",
"width": -400,
"content": [
{ "content": "PREVIEW" },
{ "content": "GRAPH" }
]
},
{ "content": "ANIMATION" }
]
},
{ "content": "INSPECTOR" }
]
},
"collection": {
"parent": "GRAPH",
"width": 460,
"split": "h"
}
}

View file

@ -0,0 +1,29 @@
{
"panel": {
"split": "h",
"width": -400,
"content": [
{
"split": "v",
"width": -300,
"content": [
{
"split": "h",
"width": 400,
"content": [
{ "content": "PREVIEW" },
{ "content": "GRAPH" }
]
},
{ "content": "ANIMATION" }
]
},
{ "content": "INSPECTOR" }
]
},
"collection": {
"parent": "ANIMATION",
"width": 500,
"split": "h"
}
}

Binary file not shown.

View file

@ -998,28 +998,28 @@
},
"node_junctions_array": {
"path": "./node/s_node_junctions_array.png",
"subimages": 16,
"subimages": 17,
"xorigin": 16,
"yorigin": 16,
"slice": null
},
"node_junctions_array_hover": {
"path": "./node/s_node_junctions_array_hover.png",
"subimages": 16,
"subimages": 17,
"xorigin": 16,
"yorigin": 16,
"slice": null
},
"node_junctions_single": {
"path": "./node/s_node_junctions_single.png",
"subimages": 16,
"subimages": 17,
"xorigin": 16,
"yorigin": 16,
"slice": null
},
"node_junctions_single_hover": {
"path": "./node/s_node_junctions_single_hover.png",
"subimages": 16,
"subimages": 17,
"xorigin": 16,
"yorigin": 16,
"slice": null
@ -1551,6 +1551,20 @@
"yorigin": 24,
"slice": null
},
"path_tools_draw": {
"path": "./tool/s_path_tools_draw.png",
"subimages": 1,
"xorigin": 24,
"yorigin": 24,
"slice": null
},
"tools_canvas_channel": {
"path": "./tool/s_canvas_channel.png",
"subimages": 4,
"xorigin": 12,
"yorigin": 12,
"slice": null
},
"splice_draw": {
"path": "./tool/s_splice_draw.png",
"subimages": 1,

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 6 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

BIN
datafiles/mf.dll Normal file

Binary file not shown.

BIN
datafiles/mfcore.dll Normal file

Binary file not shown.

BIN
datafiles/mfplat.dll Normal file

Binary file not shown.

View file

@ -10,9 +10,6 @@
gpu_set_tex_mip_enable(mip_off);
gc_enable(true);
gc_target_frame_time(100);
window_set_min_width(480)
window_set_min_height(480);
#endregion
#region window
@ -24,9 +21,8 @@
gameframe_button_array = [ game_frame_button_create("", s_kenney, 0, function() {}),
game_frame_button_create("", s_kenney, 0, function() {}),
];
} else if(OS == os_macosx) {
} else if(OS == os_macosx)
mac_window_init();
}
depth = 0;
win_wp = WIN_W;
@ -49,6 +45,8 @@
kb_hold = false;
kb_hkey = 0;
panelInit();
//show_debug_overlay(true);
//display_set_timing_method(tm_sleep);

View file

@ -35,6 +35,8 @@ if(OS == os_windows && gameframe_is_minimized()) {
noti_warning(exception_print(e));
}
panelDraw();
gameframe_update();
#endregion

View file

@ -13,6 +13,7 @@
case VALUE_TYPE.float :
case VALUE_TYPE.integer :
case VALUE_TYPE.text :
case VALUE_TYPE.struct :
case VALUE_TYPE.path :
draw_tooltip_text(string_real(content));
break;

View file

@ -143,3 +143,6 @@
}
#endregion
//print("===== Step end =====");
if(keyboard_check_pressed(ord("Q")))
panelSerialize();

View file

@ -7,311 +7,3 @@ enum FORCE_TYPE {
Turbulence,
Destroy
}
/*
function Node_Particle_Effector(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Effector";
previewable = false;
color = COLORS.node_blend_vfx;
icon = THEME.vfx;
w = 96;
h = 32 + 24;
min_h = h;
inputs[| 0] = nodeValue("Particle data", self, JUNCTION_CONNECT.input, VALUE_TYPE.object, -1 )
.setVisible(true, true);
inputs[| 1] = nodeValue("Output dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 2] = nodeValue("Area", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 16, 16, 4, 4, AREA_SHAPE.rectangle ])
.setDisplay(VALUE_DISPLAY.area);
inputs[| 3] = nodeValue("Falloff", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_01 );
inputs[| 4] = nodeValue("Falloff distance", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 4 );
inputs[| 5] = nodeValue("Effect type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 )
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Wind", "Accelerate", "Attract", "Repel", "Vortex", "Turbulence", "Destroy" ] );
inputs[| 6] = nodeValue("Effect Vector", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ -1, 0 ] )
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 7] = nodeValue("Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1 );
inputs[| 8] = nodeValue("Rotate particle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ] )
.setDisplay(VALUE_DISPLAY.rotation_range);
inputs[| 9] = nodeValue("Scale particle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0 ] )
.setDisplay(VALUE_DISPLAY.vector_range);
inputs[| 10] = nodeValue("Turbulence scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 16 );
input_display_list = [ 0, 1,
["Area", false], 2, 3, 4,
["Effect", false], 5, 10, 7, 6, 8, 9
];
outputs[| 0] = nodeValue("Particle data", self, JUNCTION_CONNECT.output, VALUE_TYPE.object, -1 );
current_data = [];
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
var parts = inputs[| 0].getValue();
if(!parts) return;
var _area = current_data[2];
var _fall = current_data[3];
var _fads = current_data[4];
var _type = current_data[5];
var _vect = current_data[6];
var _area_x = _area[0];
var _area_y = _area[1];
var _area_w = _area[2];
var _area_h = _area[3];
var _area_t = _area[4];
var _area_x0 = _area_x - _area_w;
var _area_x1 = _area_x + _area_w;
var _area_y0 = _area_y - _area_h;
var _area_y1 = _area_y + _area_h;
for(var i = 0; i < array_length(parts); i++) {
var part = parts[i];
var pv = part.getPivot();
var px = _x + part.x * _s;
var py = _y + part.y * _s;
var str = 0;
if(_area_t == AREA_SHAPE.rectangle) {
if(point_in_rectangle(pv[0], pv[1], _area_x0, _area_y0, _area_x1, _area_y1)) {
var _dst = min( distance_to_line(pv[0], pv[1], _area_x0, _area_y0, _area_x1, _area_y0),
distance_to_line(pv[0], pv[1], _area_x0, _area_y1, _area_x1, _area_y1),
distance_to_line(pv[0], pv[1], _area_x0, _area_y0, _area_x0, _area_y1),
distance_to_line(pv[0], pv[1], _area_x1, _area_y0, _area_x1, _area_y1));
str = eval_curve_x(_fall, clamp(_dst / _fads, 0., 1.));
}
} else if(_area_t == AREA_SHAPE.elipse) {
if(point_in_circle(pv[0], pv[1], _area_x, _area_y, min(_area_w, _area_h))) {
var _dst = point_distance(pv[0], pv[1], _area_x, _area_y);
str = eval_curve_x(_fall, clamp(_dst / _fads, 0., 1.));
}
}
var ss = 0.5 + 0.5 * str;
var cc = str < 0.5? merge_color(COLORS.heat[0], COLORS.heat[1], str * 2)
: merge_color(COLORS.heat[1], COLORS.heat[2], str * 2 - 1);
draw_set_color(cc);
var vx = 0, vy = 0;
var scale = 8;
switch(_type) {
case FORCE_TYPE.Wind :
vx = _vect[0] * scale * str * _s;
vy = _vect[1] * scale * str * _s;
draw_line(px, py, px + vx, py + vy);
break;
case FORCE_TYPE.Attract :
var dirr = point_direction(pv[0], pv[1], _area_x, _area_y);
vx = lengthdir_x(str * scale * _s, dirr);
vy = lengthdir_y(str * scale * _s, dirr);
draw_line(px, py, px + vx, py + vy);
break;
case FORCE_TYPE.Repel :
var dirr = point_direction(_area_x, _area_y, pv[0], pv[1]);
vx = lengthdir_x(str * scale * _s, dirr);
vy = lengthdir_y(str * scale * _s, dirr);
draw_line(px, py, px + vx, py + vy);
break;
case FORCE_TYPE.Vortex :
var dirr = point_direction(_area_x, _area_y, pv[0], pv[1]) + 90;
vx = lengthdir_x(str * scale * _s, dirr);
vy = lengthdir_y(str * scale * _s, dirr);
draw_line(px, py, px + vx, py + vy);
break;
}
draw_sprite_ui_uniform(THEME.preview_crosshair, 0, px, py, 1, cc, ss);
}
}
static updateParticleForward = function(_render = true) {
update();
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 step = function() {
var _type = inputs[| 5].getValue();
switch(_type) {
case FORCE_TYPE.Wind :
inputs[| 6].setVisible(true);
inputs[| 10].setVisible(false);
break;
case FORCE_TYPE.Accelerate :
inputs[| 6].setVisible(true);
inputs[| 10].setVisible(false);
break;
case FORCE_TYPE.Turbulence :
inputs[| 6].setVisible(true);
inputs[| 10].setVisible(true);
break;
case FORCE_TYPE.Destroy :
inputs[| 6].setVisible(false);
inputs[| 8].setVisible(false);
inputs[| 9].setVisible(false);
inputs[| 10].setVisible(false);
break;
default :
inputs[| 6].setVisible(false);
inputs[| 10].setVisible(false);
break;
}
}
function affect(part) {
if(!part.active) return;
var _area = current_data[2];
var _fall = current_data[3];
var _fads = current_data[4];
var _type = current_data[5];
var _vect = current_data[6];
var _sten = current_data[7];
var _rot_range = current_data[8];
var _sca_range = current_data[9];
var _area_x = _area[0];
var _area_y = _area[1];
var _area_w = _area[2];
var _area_h = _area[3];
var _area_t = _area[4];
var _area_x0 = _area_x - _area_w;
var _area_x1 = _area_x + _area_w;
var _area_y0 = _area_y - _area_h;
var _area_y1 = _area_y + _area_h;
random_set_seed(part.seed);
var _rot = random_range(_rot_range[0], _rot_range[1]);
var _sca = [ random_range(_sca_range[0], _sca_range[1]), random_range(_sca_range[2], _sca_range[3]) ];
var str = 0;
var pv = part.getPivot();
if(_area_t == AREA_SHAPE.rectangle) {
if(point_in_rectangle(pv[0], pv[1], _area_x0, _area_y0, _area_x1, _area_y1)) {
var _dst = min( distance_to_line(pv[0], pv[1], _area_x0, _area_y0, _area_x1, _area_y0),
distance_to_line(pv[0], pv[1], _area_x0, _area_y1, _area_x1, _area_y1),
distance_to_line(pv[0], pv[1], _area_x0, _area_y0, _area_x0, _area_y1),
distance_to_line(pv[0], pv[1], _area_x1, _area_y0, _area_x1, _area_y1));
str = eval_curve_x(_fall, clamp(_dst / _fads, 0., 1.));
}
} else if(_area_t == AREA_SHAPE.elipse) {
if(point_in_circle(pv[0], pv[1], _area_x, _area_y, min(_area_w, _area_h))) {
var _dst = point_distance(pv[0], pv[1], _area_x, _area_y);
str = eval_curve_x(_fall, clamp(_dst / _fads, 0., 1.));
}
}
if(str == 0) return;
switch(_type) {
case FORCE_TYPE.Wind :
part.x = part.x + _vect[0] * _sten * str;
part.y = part.y + _vect[1] * _sten * str;
part.rot += _rot * str;
break;
case FORCE_TYPE.Accelerate :
part.sx = part.sx + _vect[0] * _sten * str;
part.sy = part.sy + _vect[1] * _sten * str;
part.rot += _rot * str;
break;
case FORCE_TYPE.Attract :
var dirr = point_direction(pv[0], pv[1], _area_x, _area_y);
part.x = part.x + lengthdir_x(_sten * str, dirr);
part.y = part.y + lengthdir_y(_sten * str, dirr);
part.rot += _rot * str;
break;
case FORCE_TYPE.Repel :
var dirr = point_direction(_area_x, _area_y, pv[0], pv[1]);
part.x = part.x + lengthdir_x(_sten * str, dirr);
part.y = part.y + lengthdir_y(_sten * str, dirr);
part.rot += _rot * str;
break;
case FORCE_TYPE.Vortex :
var dirr = point_direction(_area_x, _area_y, pv[0], pv[1]) + 90;
part.x = part.x + lengthdir_x(_sten * str, dirr);
part.y = part.y + lengthdir_y(_sten * str, dirr);
part.rot += _rot * str;
break;
case FORCE_TYPE.Turbulence :
var t_scale = current_data[10];
var per = (perlin_noise(pv[0] / t_scale, pv[1] / t_scale, 4, part.seed) - 0.5) * 2;
per *= str;
part.x = part.x + _vect[0] * per;
part.y = part.y + _vect[1] * per;
part.rot += _rot * per;
break;
case FORCE_TYPE.Destroy :
if(random(1) < _sten)
part.kill();
break;
}
var scx_s = _sca[0] * str;
var scy_s = _sca[1] * str;
if(scx_s < 0) part.scx = lerp_linear(part.scx, 0, abs(scx_s));
else part.scx += sign(part.scx) * scx_s;
if(scy_s < 0) part.scy = lerp_linear(part.scy, 0, abs(scy_s));
else part.scy += sign(part.scy) * scy_s;
}
static update = function(frame = ANIMATOR.current_frame) {
outputs[| 0].setValue(inputs[| 0].getValue());
var jun = outputs[| 0];
for(var j = 0; j < ds_list_size(jun.value_to); j++) {
if(jun.value_to[| j].value_from == jun) {
jun.value_to[| j].node.doUpdate();
}
}
render();
}
function render(_time = ANIMATOR.current_frame) {
var parts = inputs[| 0].getValue(_time);
if(!parts) return;
for(var i = 0; i < ds_list_size(inputs); i++) {
current_data[i] = inputs[| i].getValue();
}
for(var i = 0; i < array_length(parts); i++)
affect(parts[i]);
}
}

View file

@ -0,0 +1,59 @@
function checkBoxGroup(sprs, _onClick) : widget() constructor {
self.sprs = sprs;
self.size = sprite_get_number(sprs);
onClick = _onClick;
holding = noone;
static trigger = function(ind, val) {
onClick(ind, val);
}
static draw = function(_x, _y, _value, _m, ss = ui(28), halign = fa_left, valign = fa_top) {
x = _x;
y = _y;
w = ss * size;
h = ss;
var _dx, _dy;
switch(halign) {
case fa_left: _dx = _x; break;
case fa_center: _dx = _x - ss / 2; break;
case fa_right: _dx = _x - ss; break;
}
switch(valign) {
case fa_top: _dy = _y; break;
case fa_center: _dy = _y - ss / 2; break;
case fa_bottom: _dy = _y - ss; break;
}
if(mouse_release(mb_left))
holding = noone;
var aa = interactable * 0.25 + 0.75;
for( var i = 0; i < size; i++ ) {
var spr = i == 0 ? THEME.button_left : (i == size - 1? THEME.button_right : THEME.button_middle);
draw_sprite_stretched_ext(spr, _value[i] * 2, _dx, _dy, ss, ss, c_white, aa);
if(hover && point_in_rectangle(_m[0], _m[1], _dx, _dy, _dx + ss, _dy + ss)) {
if(holding != noone)
trigger(i, holding);
if(mouse_press(mb_left, active)) {
trigger(i, !_value[i]);
holding = _value[i];
}
} else
if(mouse_press(mb_left)) deactivate();
draw_sprite_stretched_ext(sprs, i, _dx, _dy, ss, ss, c_white, 0.5 + _value[i] * 0.5);
_dx += ss;
}
if(WIDGET_CURRENT == self)
draw_sprite_stretched(THEME.widget_selecting, 0, _dx - ui(3), _dy - ui(3), ss + ui(6), ss + ui(6));
resetFocus();
}
}

View file

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

View file

@ -71,7 +71,7 @@ function exception_print(e) {
function setException() {
exception_unhandled_handler(function(ex) {
var path = string(DIRECTORY) + "prev_crash.pxc";
SAVE_AT(path);
if(!SAVING) SAVE_AT(path);
var tt = "\n-------------------------- OH NO --------------------------\n\n";
tt += "\n" + ex.longMessage;
@ -104,7 +104,7 @@ function setException() {
return 0;
});
}
setException();
//setException();
function resetException() {
exception_unhandled_handler(undefined);

View file

@ -1,8 +1,8 @@
function display_refresh() {
o_main.win_wp = WIN_W;
o_main.win_hp = WIN_H;
room_width = WIN_W;
room_height = WIN_H;
o_main.win_wp = WIN_W;
o_main.win_hp = WIN_H;
room_width = WIN_W;
room_height = WIN_H;
display_set_gui_size(WIN_SW, WIN_SH);

View file

@ -32,7 +32,7 @@
globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING;
VERSION = 1138;
SAVEFILE_VERSION = 1138;
SAVEFILE_VERSION = 1380;
VERSION_STRING = "1.13.8";
globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES;

View file

@ -41,22 +41,22 @@ function draw_code(_x, _y, str) {
var tx = _x
var ty = _y;
var isStr = true;
var stringSplice = string_splice(str, "\"");
var amo = array_length(stringSplice);
var isStr = true;
var strSpl = string_splice(str, "\"");
var amo = array_length(strSpl);
var word;
for( var i = 0; i < amo; i++ ) {
var _w = stringSplice[i];
var _w = strSpl[i];
_w = string_trim_end(_w);
isStr = !isStr;
if(isStr) {
word = "\"" + _w;
word = "\"" + string(_w);
if(i < amo - 1) word += "\"";
draw_set_color(isStr? COLORS.lua_highlight_string : COLORS._main_text);
draw_set_color(COLORS.lua_highlight_string);
draw_text(tx, ty, word);
tx += string_width(word);
continue;

View file

@ -27,13 +27,15 @@ function luaArgumentRenderer() {
draw_text_add(tx + ui(8), ty + _th + ui(6) + ui(6), "Value");
var _jValue = inputs[| i + 2];
_jValue.editWidget.setActiveFocus(_focus, _hover);
if(_typ == 2) {
_jValue.editWidget.draw(tx + ui(64), ty + _th + ui(6), _w - ui(64), ui(96), _jValue.showValue(), _m, argument_renderer.rx, argument_renderer.ry);
_h += ui(96 + 8);
} else {
_jValue.editWidget.draw(tx + ui(64), ty + _th + ui(6), _w - ui(64), TEXTBOX_HEIGHT, _jValue.showValue(), _m);
_h += TEXTBOX_HEIGHT + ui(8);
if(_jValue.editWidget != noone) {
_jValue.editWidget.setActiveFocus(_focus, _hover);
if(_typ == 2) {
_jValue.editWidget.draw(tx + ui(64), ty + _th + ui(6), _w - ui(64), ui(96), _jValue.showValue(), _m, argument_renderer.rx, argument_renderer.ry);
_h += ui(96 + 8);
} else {
_jValue.editWidget.draw(tx + ui(64), ty + _th + ui(6), _w - ui(64), TEXTBOX_HEIGHT, _jValue.showValue(), _m);
_h += TEXTBOX_HEIGHT + ui(8);
}
}
hh += _h;
@ -48,7 +50,8 @@ function luaArgumentRenderer() {
for( var i = input_fix_len; i < ds_list_size(inputs); i += data_length ) {
inputs[| i + 1].editWidget.register(parent);
inputs[| i + 0].editWidget.register(parent);
inputs[| i + 2].editWidget.register(parent);
if(inputs[| i + 2].editWidget != noone)
inputs[| i + 2].editWidget.register(parent);
}
}
}

View file

@ -39,17 +39,26 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
["Display", false], 5, 8, 9, 10,
];
canvas_surface = surface_create(1, 1);
canvas_surface = surface_create(1, 1);
drawing_surface = surface_create(1, 1);
surface_buffer = buffer_create(1 * 1 * 4, buffer_fixed, 2);
surface_w = 1;
surface_h = 1;
tool_channel_edit = new checkBoxGroup(THEME.tools_canvas_channel, function(ind, val) { tool_attribute.channel[ind] = val; });
tool_attribute.channel = [ true, true, true, true ];
tool_attribute.alpha = 1;
tool_settings = [
[ "Channel", tool_channel_edit, "channel", tool_attribute ],
[ "Alpha", new textBox(TEXTBOX_INPUT.number, function(alp) { tool_attribute.alpha = alp; }), "alpha", tool_attribute ],
];
tools = [
[ "Pencil", THEME.canvas_tools_pencil ],
[ "Eraser", THEME.canvas_tools_eraser ],
[ "Rectangle", [ THEME.canvas_tools_rect, THEME.canvas_tools_rect_fill ]],
[ "Ellipse", [ THEME.canvas_tools_ellip, THEME.canvas_tools_ellip_fill ]],
[ "Fill", THEME.canvas_tools_bucket ],
new NodeTool( "Pencil", THEME.canvas_tools_pencil ),
new NodeTool( "Eraser", THEME.canvas_tools_eraser ),
new NodeTool( "Rectangle", [ THEME.canvas_tools_rect, THEME.canvas_tools_rect_fill ]),
new NodeTool( "Ellipse", [ THEME.canvas_tools_ellip, THEME.canvas_tools_ellip_fill ]),
new NodeTool( "Fill", THEME.canvas_tools_bucket ),
];
draw_stack = ds_list_create();
@ -66,6 +75,18 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
apply_surface();
}
function apply_draw_surface() {
BLEND_ALPHA;
if(isUsingTool(1))
gpu_set_blendmode(bm_subtract);
draw_surface_ext(drawing_surface, 0, 0, 1, 1, 0, c_white, tool_attribute.alpha);
surface_set_target(drawing_surface);
draw_clear_alpha(0, 0);
surface_reset_target();
BLEND_NORMAL;
}
function apply_surface() {
var _dim = inputs[| 0].getValue();
var _bg = inputs[| 8].getValue();
@ -82,6 +103,8 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
surface_buffer = buffer_create(_dim[0] * _dim[1] * 4, buffer_fixed, 4);
}
drawing_surface = surface_verify(drawing_surface, _dim[0], _dim[1]);
surface_set_target(_outSurf);
draw_clear_alpha(0, 0);
BLEND_ALPHA
@ -133,7 +156,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var _sw = surface_get_width(_brush);
var _sh = surface_get_height(_brush);
draw_surface_ext(_brush, _x - floor(_sw / 2), _y - floor(_sh / 2), 1, 1, 0, draw_get_color(), 1);
draw_surface_ext(_brush, _x - floor(_sw / 2), _y - floor(_sh / 2), 1, 1, 0, draw_get_color(), draw_get_alpha());
}
}
@ -284,7 +307,10 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
spanBelow = false;
while(x1 < surface_w && ff_fillable(colorBase, colorFill, x1, y1, thr)) {
draw_set_alpha(tool_attribute.alpha);
draw_point(x1, y1);
draw_set_alpha(1);
buffer_seek(surface_buffer, buffer_seek_start, (surface_w * y1 + x1) * 4);
buffer_write(surface_buffer, buffer_u32, colorFill);
@ -345,6 +371,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var _c1 = get_color_buffer(_x, _y);
var thr = _thres * _thres;
draw_set_alpha(tool_attribute.alpha);
for( var i = 0; i < w; i++ ) {
for( var j = 0; j < h; j++ ) {
if(i == _x && j == _y) {
@ -357,6 +384,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
draw_point(i, j);
}
}
draw_set_alpha(1);
surface_update();
}
@ -391,114 +419,122 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
surface_set_target(canvas_surface);
draw_set_color(_col);
var _tool = PANEL_PREVIEW.tool_index;
var _sub_tool = PANEL_PREVIEW.tool_sub_index;
gpu_set_colorwriteenable(tool_attribute.channel[0], tool_attribute.channel[1], tool_attribute.channel[2], tool_attribute.channel[3]);
if(active) {
if(_tool == 0 || _tool == 1) {
if(_tool == 0) BLEND_ALPHA;
if(isUsingTool(0) || isUsingTool(1)) {
if(key_mod_press(SHIFT) && key_mod_press(CTRL)) {
var aa = point_direction(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y);
var dd = point_distance(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y);
var _a = round(aa / 45) * 45;
dd = dd * cos(degtorad(_a - aa));
if(_tool == 1) {
gpu_set_blendmode(bm_subtract);
gpu_set_colorwriteenable(false, false, false, true);
}
mouse_cur_x = mouse_pre_draw_x + lengthdir_x(dd, _a);
mouse_cur_y = mouse_pre_draw_y + lengthdir_y(dd, _a);
}
if(key_mod_press(SHIFT) && key_mod_press(CTRL)) {
var aa = point_direction(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y);
var dd = point_distance(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y);
var _a = round(aa / 45) * 45;
dd = dd * cos(degtorad(_a - aa));
mouse_cur_x = mouse_pre_draw_x + lengthdir_x(dd, _a);
mouse_cur_y = mouse_pre_draw_y + lengthdir_y(dd, _a);
}
if(mouse_press(mb_left)) {
if(mouse_press(mb_left, active)) {
drawing_surface = surface_verify(drawing_surface, _dim[0], _dim[1]);
BLEND_ALPHA;
surface_set_target(drawing_surface);
draw_clear_alpha(0, 0);
draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush);
surface_reset_target();
mouse_holding = true;
if(key_mod_press(SHIFT)) {
mouse_holding = true;
if(key_mod_press(SHIFT)) {
BLEND_ALPHA;
surface_set_target(drawing_surface);
draw_line_size(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y, _siz, _brush);
mouse_holding = false;
}
surface_reset_target();
mouse_holding = false;
mouse_pre_draw_x = mouse_cur_x;
mouse_pre_draw_y = mouse_cur_y;
apply_draw_surface();
surface_update();
}
if(mouse_holding && mouse_click(mb_left, active)) {
if(mouse_pre_draw_x != mouse_cur_x || mouse_pre_draw_y != mouse_cur_y) {
mouse_pre_draw_x = mouse_cur_x;
mouse_pre_draw_y = mouse_cur_y;
}
if(mouse_holding && mouse_click(mb_left, active)) {
if(mouse_pre_draw_x != mouse_cur_x || mouse_pre_draw_y != mouse_cur_y) {
BLEND_ALPHA;
surface_set_target(drawing_surface);
draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush);
draw_line_size(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y, _siz, _brush);
}
mouse_pre_draw_x = mouse_cur_x;
mouse_pre_draw_y = mouse_cur_y;
surface_reset_target();
}
BLEND_NORMAL;
mouse_pre_draw_x = mouse_cur_x;
mouse_pre_draw_y = mouse_cur_y;
}
if(_tool == 1)
gpu_set_colorwriteenable(true, true, true, true);
if(mouse_holding && mouse_release(mb_left)) {
mouse_holding = false;
apply_draw_surface();
surface_update();
}
if(mouse_release(mb_left)) {
surface_update();
mouse_holding = false;
}
BLEND_NORMAL;
mouse_pre_x = mouse_cur_x;
mouse_pre_y = mouse_cur_y;
apply_surface();
} else if(isUsingTool(2) || isUsingTool(3)) {
if(mouse_holding && key_mod_press(SHIFT)) {
var ww = mouse_cur_x - mouse_pre_x;
var hh = mouse_cur_y - mouse_pre_y;
var ss = max(abs(ww), abs(hh));
mouse_cur_x = mouse_pre_x + ss * sign(ww);
mouse_cur_y = mouse_pre_y + ss * sign(hh);
}
if(mouse_press(mb_left, active)) {
mouse_pre_x = mouse_cur_x;
mouse_pre_y = mouse_cur_y;
apply_surface();
} else if(_tool == 2 || _tool == 3) {
if(mouse_holding && key_mod_press(SHIFT)) {
var ww = mouse_cur_x - mouse_pre_x;
var hh = mouse_cur_y - mouse_pre_y;
var ss = max(abs(ww), abs(hh));
mouse_holding = true;
}
mouse_cur_x = mouse_pre_x + ss * sign(ww);
mouse_cur_y = mouse_pre_y + ss * sign(hh);
if(mouse_holding && mouse_release(mb_left)) {
BLEND_ALPHA;
surface_set_target(drawing_surface);
draw_clear_alpha(0, 0);
if(isUsingTool(2))
draw_rect_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, isUsingTool(2, 1), _brush);
else if(isUsingTool(3))
draw_ellp_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, isUsingTool(3, 1), _brush);
surface_reset_target();
BLEND_NORMAL;
apply_draw_surface();
surface_update();
mouse_holding = false;
}
apply_surface();
} else if(isUsingTool(4)) {
if(point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, _surf_w - 1, _surf_h - 1) && mouse_press(mb_left)) {
switch(_fill_type) {
case 0 :
flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, false);
break;
case 1 :
flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, true);
break;
case 2 :
canvas_fill(mouse_cur_x, mouse_cur_y, canvas_surface, _thr);
break;
}
if(mouse_press(mb_left)) {
mouse_pre_x = mouse_cur_x;
mouse_pre_y = mouse_cur_y;
mouse_holding = true;
}
if(mouse_release(mb_left)) {
BLEND_ALPHA;
if(_tool == 2)
draw_rect_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, _sub_tool, _brush);
else if(_tool == 3)
draw_ellp_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, _sub_tool, _brush);
BLEND_NORMAL;
surface_update();
mouse_holding = false;
}
apply_surface();
} else if(_tool == 4) {
if(point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, _surf_w - 1, _surf_h - 1) && mouse_press(mb_left)) {
switch(_fill_type) {
case 0 :
flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, false);
break;
case 1 :
flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, true);
break;
case 2 :
canvas_fill(mouse_cur_x, mouse_cur_y, canvas_surface, _thr);
break;
}
surface_update();
}
surface_update();
}
}
draw_set_alpha(1);
gpu_set_colorwriteenable(true, true, true, true);
surface_reset_target();
#region preview
@ -513,31 +549,34 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
draw_clear_alpha(0, 0);
BLEND_ALPHA;
if(is_surface(_bg))
draw_surface_stretched_ext(_bg, 0, 0, _dim[0], _dim[1], c_white, _bga);
if(is_surface(_bg)) draw_surface_stretched_ext(_bg, 0, 0, _dim[0], _dim[1], c_white, _bga);
draw_surface(canvas_surface, 0, 0);
BLEND_ALPHA;
if(isUsingTool(1))
gpu_set_blendmode(bm_subtract);
draw_surface_ext(drawing_surface, 0, 0, 1, 1, 0, c_white, tool_attribute.alpha);
BLEND_NORMAL;
draw_set_color(_col);
if(_tool == 0 || _tool == 1) {
if(isUsingTool(0) || isUsingTool(1)) {
if(key_mod_press(SHIFT))
draw_line_size(mouse_pre_draw_x, mouse_pre_draw_y, mouse_cur_x, mouse_cur_y, _siz, _brush);
else
draw_point_size(mouse_cur_x, mouse_cur_y, _siz, _brush);
if(_tool == 1) gpu_set_blendmode(bm_normal);
} else if (_tool == 2 || _tool == 3) {
if(mouse_holding) {
if(_tool == 2)
draw_rect_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, _sub_tool, _brush);
else if(_tool == 3)
draw_ellp_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, _sub_tool, _brush);
}
if(isUsingTool(1)) gpu_set_blendmode(bm_normal);
} else if (mouse_holding) {
if(isUsingTool(2))
draw_rect_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, isUsingTool(2, 1), _brush);
else if(isUsingTool(3))
draw_ellp_size(mouse_pre_x, mouse_pre_y, mouse_cur_x, mouse_cur_y, _siz, isUsingTool(3, 1), _brush);
}
BLEND_NORMAL;
surface_reset_target();
if (_tool == 2 || _tool == 3) {
if (isUsingTool(2) || isUsingTool(3)) {
if(mouse_holding) {
var _pr_x = _x + mouse_pre_x * _s;
var _pr_y = _y + mouse_pre_y * _s;
@ -549,7 +588,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
}
}
if(_tool > -1 && point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, _surf_w - 1, _surf_h - 1)) {
if(!isNotUsingTool() && point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, _surf_w - 1, _surf_h - 1)) {
var _pr_x = _x + mouse_cur_x * _s;
var _pr_y = _y + mouse_cur_y * _s;

View file

@ -74,6 +74,8 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
metadata = new MetaDataManager();
attributes[? "Separator"] = [];
attributes[? "w"] = 128;
attributes[? "h"] = 128;
inspUpdateTooltip = get_text("panel_inspector_execute", "Execute node contents");
inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
@ -106,9 +108,24 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
return instanceBase.getNodeList();
}
static setHeight = function() {
var _hi = ui(32);
var _ho = ui(32);
for( var i = 0; i < ds_list_size(inputs); i++ )
if(inputs[| i].isVisible()) _hi += 24;
for( var i = 0; i < ds_list_size(outputs); i++ )
if(outputs[| i].isVisible()) _ho += 24;
var preH = (preview_surface && previewable)? 128 : 0;
h = max(min_h, preH, _hi, _ho);
}
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
var _in = inputs[| i];
var _in = inputs[| i];
var _show = _in.from.inputs[| 6].getValue();
if(!_show) continue;
@ -229,6 +246,8 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
DOUBLE_CLICK = false;
}
w = attributes[? "w"];
onStep();
}
@ -376,12 +395,16 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
static attributeSerialize = function() {
var att = ds_map_create();
att[? "Separator"] = json_stringify(attributes[? "Separator"]);
att[? "w"] = attributes[? "w"];
att[? "h"] = attributes[? "h"];
return att;
}
static attributeDeserialize = function(attr) {
if(ds_map_exists(attr, "Separator"))
attributes[? "Separator"] = json_parse(attr[? "Separator"]);
attributes[? "w"] = ds_map_try_get(attr, "w", 128);
attributes[? "h"] = ds_map_try_get(attr, "h", 128);
}
}

View file

@ -59,6 +59,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
preview_alpha = 1;
preview_x = 0;
preview_y = 0;
preview_align = fa_center;
rendered = false;
update_on_frame = false;
@ -85,6 +86,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
manual_updated = false;
manual_deletable = true;
tool_settings = [];
tool_attribute = {};
static initTooltip = function() {
if(!struct_has(global.NODE_GUIDE, instanceof(self))) return;
@ -647,8 +651,15 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
var pw = surface_get_width(surf);
var ph = surface_get_height(surf);
var ps = min((w * _s - 8) / pw, (h * _s - 8) / ph);
var px = xx + w * _s / 2 - pw * ps / 2;
var py = yy + h * _s / 2 - ph * ps / 2;
var px = xx + w * _s / 2 - pw * ps / 2, py = yy;
switch(preview_align) {
case fa_center :
py = yy + h * _s / 2 - ph * ps / 2;
break;
case fa_top :
py = yy;
break;
}
var aa = 0.5 + 0.5 * renderActive;
draw_surface_ext_safe(surf, px, py, ps, ps, 0, c_white, aa);
@ -992,6 +1003,20 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
return nodes;
}
static isNotUsingTool = function() {
return PANEL_PREVIEW.tool_current == noone;
}
static isUsingTool = function(index, subtool = noone) {
if(tools == -1)
return false;
if(PANEL_PREVIEW.tool_current != tools[index])
return false;
if(subtool == noone)
return true;
return tools[index].selecting == subtool;
}
static clone = function(target = PANEL_GRAPH.getCurrentContext()) {
CLONING = true;
var _type = instanceof(self);
@ -1023,6 +1048,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
static serialize = function(scale = false, preset = false) {
var _map = ds_map_create();
//print(" > Serializing: " + name);
if(!preset) {
_map[? "id"] = node_id;
@ -1100,10 +1126,12 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
var _inputs = load_map[? "inputs"];
var amo = min(ds_list_size(inputs), ds_list_size(_inputs));
printIf(TESTING, " > Applying deserialize to node " + name);
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;
inputs[| i].applyDeserialize(_inputs[| i], load_scale, preset);
}
printIf(TESTING, " > Applying deserialize to node " + name + " completed");

View file

@ -54,7 +54,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
inputs[| 5] = nodeValue("Order", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.rejectArray();
inputs[| 6] = nodeValue("Display gizmo", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
inputs[| 6] = nodeValue("Display preview gizmo", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
.rejectArray();
inputs[| 7] = nodeValue("Step", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.01)

View file

@ -38,14 +38,18 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
outputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.path, "")
.setVisible(true, true);
outputs[| 1] = nodeValue("Struct", self, JUNCTION_CONNECT.output, VALUE_TYPE.struct, {});
data_length = 1;
input_fix_len = ds_list_size(inputs);
input_fix_len = ds_list_size(inputs);
output_fix_len = ds_list_size(outputs);
static createNewInput = function() {
var index = ds_list_size(inputs);
inputs[| index] = nodeValue("Key", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "" )
.setVisible(true, true);
var index = ds_list_size(outputs);
outputs[| index] = nodeValue("Values", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0 )
.setVisible(true, true);
}
@ -76,20 +80,26 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
var _in = ds_list_create();
var _ot = ds_list_create();
for( var i = 0; i < ds_list_size(inputs); i++ ) {
if(i < input_fix_len || inputs[| i].getValue() != "") {
ds_list_add(_in, inputs[| i]);
ds_list_add(_ot, outputs[| i]);
for( var i = 0; i < input_fix_len; i++ )
ds_list_add(_in, inputs[| i]);
for( var i = 0; i < output_fix_len; i++ )
ds_list_add(_ot, outputs[| i]);
for( var i = input_fix_len; i < ds_list_size(inputs); i++ ) {
if(inputs[| i].getValue() != "") {
ds_list_add(_in, inputs[| i + 0]);
ds_list_add(_ot, outputs[| i + 1]);
} else {
delete inputs[| i];
delete outputs[| i];
delete inputs[| i + 0];
delete outputs[| i + 1];
}
}
for( var i = 0; i < ds_list_size(_in); i++ ) {
for( var i = 0; i < ds_list_size(_in); i++ )
_in[| i].index = i;
for( var i = 0; i < ds_list_size(_ot); i++ )
_ot[| i].index = i;
}
ds_list_destroy(inputs);
inputs = _in;
@ -132,21 +142,39 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
if(path == "") return;
if(path_current != path) updatePaths(path);
outputs[| 1].setValue(content);
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
var key = inputs[| i].getValue();
var out = outputs[| i + 1];
outputs[| i].name = key;
if(variable_struct_exists(content, key)) {
var val = variable_struct_get(content, key);
outputs[| i].setValue(val);
out.name = key;
var keys = string_splice(key, ".");
var _str = content;
if(is_array(val) && array_length(val))
outputs[| i].type = is_string(val[0])? VALUE_TYPE.text : VALUE_TYPE.float;
else
outputs[| i].type = is_string(val)? VALUE_TYPE.text : VALUE_TYPE.float;
} else {
outputs[| i].setValue(0);
outputs[| i].type = VALUE_TYPE.float;
for( var j = 0; j < array_length(keys); j++ ) {
var k = keys[j];
if(!variable_struct_exists(_str, k)) {
out.setValue(0);
out.type = VALUE_TYPE.float;
break;
}
var val = variable_struct_get(_str, k);
if(j == array_length(keys) - 1) {
if(is_struct(val))
out.type = VALUE_TYPE.struct;
else if(is_array(val) && array_length(val))
out.type = is_string(val[0])? VALUE_TYPE.text : VALUE_TYPE.float;
else
out.type = is_string(val)? VALUE_TYPE.text : VALUE_TYPE.float;
out.setValue(val);
}
if(is_struct(val)) _str = val;
else break;
}
}
}

View file

@ -9,6 +9,9 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con
.setDisplay(VALUE_DISPLAY.path_save, ["*.json", ""])
.rejectArray();
inputs[| 1] = nodeValue("Struct", self, JUNCTION_CONNECT.input, VALUE_TYPE.struct, {})
.setVisible(true, true);
static createNewInput = function() {
var index = ds_list_size(inputs);
inputs[| index + 0] = nodeValue("Key", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "" );
@ -20,7 +23,7 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con
array_push(input_display_list, index + 1);
}
input_display_list = [ 0,
input_display_list = [ 0, 1,
["Inputs", false],
]
@ -38,6 +41,12 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con
array_resize(input_display_list, input_display_len);
if(inputs[| 1].value_from != noone) {
ds_list_destroy(inputs);
inputs = _in;
return;
}
for( var i = input_fix_len; i < ds_list_size(inputs); i += data_length ) {
if(inputs[| i].getValue() != "") {
ds_list_add(_in, inputs[| i + 0]);
@ -78,18 +87,30 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con
path += ".json";
var cont = {};
for( var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length ) {
var _key = inputs[| i + 0].getValue();
var _val = inputs[| i + 1].getValue();
inputs[| i + 1].type = inputs[| i + 1].value_from? inputs[| i + 1].value_from.type : VALUE_TYPE.any;
if(inputs[| 1].value_from == noone) {
for( var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length ) {
var _key = inputs[| i + 0].getValue();
var _val = inputs[| i + 1].getValue();
variable_struct_set(cont, _key, _val);
}
inputs[| i + 1].type = inputs[| i + 1].value_from? inputs[| i + 1].value_from.type : VALUE_TYPE.any;
variable_struct_set(cont, _key, _val);
}
} else
cont = inputs[| 1].getValue();
json_save_struct(path, cont);
}
function step() {
for(var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length) {
var inp = inputs[| i + 1];
var typ = inp.value_from == noone? VALUE_TYPE.any : inp.value_from.type;
inp.type = typ;
}
}
static update = function(frame = ANIMATOR.current_frame) { writeFile(); }
static onInspectorUpdate = function() { writeFile(); }

View file

@ -311,9 +311,12 @@ function valueAnimator(_val, _prop) constructor {
_value_list[| 0] = values[| i].time;
var val = values[| i].value;
if(is_struct(val)) {
if(prop.type == VALUE_TYPE.struct)
_value_list[| 1] = json_stringify(val);
else if(is_struct(val))
_value_list[| 1] = val.serialize();
} else if(typeArray(prop.display_type) && is_array(val)) {
else if(typeArray(prop.display_type) && is_array(val)) {
var __v = ds_list_create();
for(var j = 0; j < array_length(val); j++) {
if(is_struct(val[j]) && struct_has(val[j], "serialize"))
@ -323,9 +326,8 @@ function valueAnimator(_val, _prop) constructor {
}
_value_list[| 1] = __v;
ds_list_mark_as_list(_value_list, 1);
} else {
} else
_value_list[| 1] = values[| i].value;
}
_value_list[| 2] = ds_list_create_from_array(values[| i].ease_in);
ds_list_mark_as_list(_value_list, 2);
@ -384,7 +386,9 @@ function valueAnimator(_val, _prop) constructor {
var ease_out_type = ds_list_get(_keyframe, 5, CURVE_TYPE.bezier);
var _val = value;
if(prop.type == VALUE_TYPE.path && prop.display_type == VALUE_DISPLAY.path_array) {
if(prop.type == VALUE_TYPE.struct)
_val = json_parse(value);
else if(prop.type == VALUE_TYPE.path && prop.display_type == VALUE_DISPLAY.path_array) {
for(var j = 0; j < ds_list_size(value); j++)
_val[j] = value[| j];
} else if(prop.type == VALUE_TYPE.color && prop.display_type == VALUE_DISPLAY.gradient) {

View file

@ -120,8 +120,8 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
var _rangeMax = max(_ratio[0], _ratio[1]);
if(_rangeMax == 1) _rangeMax = 0.99999;
var _rtStr = _rangeMin;
var _rtLen = _rangeMax - _rangeMin;
var _rtStr = min(_rangeMin, _rangeMax);
var _rtMax = max(_rangeMin, _rangeMax);
var _use_path = _pat != noone;
@ -150,30 +150,31 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
else if(struct_has(_pat, "getLineCount"))
lineLen = _pat.getLineCount();
if(_rtMax > 0)
for( var i = 0; i < lineLen; i++ ) {
var ww = min(_rtLen, 1 / _seg);
var _stepLen = min(_rtMax, 1 / _seg);
if(_stepLen <= 0.00001) continue;
var _total = _rtLen;
var _total = _rtMax;
var _total_prev = _total;
var _freeze = 0;
var _prog_curr = frac(_shift + _rtStr) - ww;
var _prog_curr = frac(_shift) - _stepLen;
var _prog = _prog_curr + 1;
var _prog_eli = 0;
var _prog_total = 0;
var points = [];
while(_total > 0) {
if(_rtLen == 0) break;
if(ww <= 0.001) break;
if(_prog_curr >= 1) _prog_curr = frac(_prog_curr);
else _prog_curr = min(_prog_curr + min(_total, ww), 1);
_prog_eli = _prog_eli + min(_total, ww);
if(_prog_curr >= 1) //cut overflow path
_prog_curr = frac(_prog_curr);
else
_prog_curr = min(_prog_curr + min(_total, _stepLen), 1); //move forward _stepLen or _total (if less) stop at 1
_prog_total += min(_total, _stepLen);
var p = arrPath? _pat[i].getPointRatio(_prog_curr) : _pat.getPointRatio(_prog_curr, i);
_nx = p[0];
_ny = p[1];
_nx = p[0];
_ny = p[1];
if(_total < _rtLen) {
if(_total < _rtMax) {
var _d = point_direction(_ox, _oy, _nx, _ny);
_nx += lengthdir_x(random1D(_sed + _sedIndex, -_wig, _wig), _d + 90);
_sedIndex++;
@ -182,7 +183,8 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_sedIndex++;
}
array_push(points, [_nx, _ny, _prog_eli / _rtLen, _prog_curr]);
if(_prog_total > _rtStr) //prevent drawing point before range start.
array_push(points, [_nx, _ny, _prog_total / _rtMax, _prog_curr]);
if(_prog_curr > _prog)
_total -= _prog_curr - _prog;
@ -195,7 +197,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_total_prev = _total;
}
lines[i] = points;
array_push(lines, points);
}
} else {
var x0, y0, x1, y1;
@ -208,17 +210,17 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
var _d = point_direction(x0, y0, x1, y1);
var _od = _d, _nd = _d;
var ww = _rtLen / _seg;
var _total = _rtLen;
var _prog_curr = frac(_shift + _rtStr) - ww;
var ww = _rtMax / _seg;
var _total = _rtMax;
var _prog_curr = frac(_shift) - ww;
var _prog = _prog_curr + 1;
var _prog_eli = 0;
var _prog_total = 0;
var points = [];
while(_total > 0) {
if(_prog_curr >= 1) _prog_curr = 0;
else _prog_curr = min(_prog_curr + min(_total, ww), 1);
_prog_eli += min(_total, ww);
_prog_total += min(_total, ww);
_nx = x0 + lengthdir_x(_l * _prog_curr, _d);
_ny = y0 + lengthdir_y(_l * _prog_curr, _d);
@ -227,7 +229,8 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_nx += lengthdir_x(wgLen, _d + 90);
_ny += lengthdir_y(wgLen, _d + 90);
array_push(points, [_nx, _ny, _prog_eli / _rtLen, _prog_curr]);
if(_prog_total > _rtStr) //prevent drawing point before range start.
array_push(points, [_nx, _ny, _prog_total / _rtMax, _prog_curr]);
if(_prog_curr > _prog)
_total -= (_prog_curr - _prog);

View file

@ -5,7 +5,7 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
inputs[| 0] = nodeValue("Function name", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "render" + string(irandom_range(100000, 999999)));
inputs[| 1] = nodeValue("Return type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "String" ], { update_hover: false });
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "String", "Struct" ], { update_hover: false });
inputs[| 2] = nodeValue("Lua code", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "", o_dialog_lua_reference)
.setDisplay(VALUE_DISPLAY.code);
@ -13,12 +13,14 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
inputs[| 3] = nodeValue("Execution thread", self, JUNCTION_CONNECT.input, VALUE_TYPE.node, noone)
.setVisible(false, true);
inputs[| 4] = nodeValue("Execute on frame", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
static createNewInput = function() {
var index = ds_list_size(inputs);
inputs[| index + 0] = nodeValue("Argument name", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "" );
inputs[| index + 1] = nodeValue("Argument type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 )
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "String", "Surface" ], { update_hover: false });
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "String", "Surface", "Struct" ], { update_hover: false });
inputs[| index + 1].editWidget.interactable = false;
inputs[| index + 2] = nodeValue("Argument value", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 )
@ -32,7 +34,7 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
luaArgumentRenderer();
input_display_list = [ 3,
input_display_list = [ 3, 4,
["Function", false], 0, 1,
["Arguments", false], argument_renderer,
["Script", false], 2,
@ -47,6 +49,7 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
argument_val = [];
lua_state = lua_create();
lua_error_handler = _lua_error;
error_notification = noone;
compiled = false;
@ -73,8 +76,9 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
var _type = inputs[| 1].getValue();
switch(_type) {
case 0 : outputs[| 1].type = VALUE_TYPE.float; break;
case 1 : outputs[| 1].type = VALUE_TYPE.text; break;
case 0 : outputs[| 1].type = VALUE_TYPE.float; break;
case 1 : outputs[| 1].type = VALUE_TYPE.text; break;
case 2 : outputs[| 1].type = VALUE_TYPE.struct; break;
}
}
@ -99,7 +103,8 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
ds_list_add(_in, inputs[| i + 2]);
inputs[| i + 1].editWidget.interactable = true;
inputs[| i + 2].editWidget.interactable = true;
if(inputs[| i + 2].editWidget != noone)
inputs[| i + 2].editWidget.interactable = true;
array_push(input_display_list, i + 2);
} else {
@ -146,6 +151,7 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
case 0 : inputs[| index + 1].type = VALUE_TYPE.float; break;
case 1 : inputs[| index + 1].type = VALUE_TYPE.text; break;
case 2 : inputs[| index + 1].type = VALUE_TYPE.surface; break;
case 3 : inputs[| index + 1].type = VALUE_TYPE.struct; break;
}
inputs[| index + 1].setDisplay(VALUE_DISPLAY._default);
@ -167,30 +173,30 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
var _func = inputs[| 0].getValue();
var _dimm = inputs[| 1].getValue();
var _exec = inputs[| 4].getValue();
if(!_exec) return;
argument_val = [];
for( var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length ) {
for( var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length )
array_push(argument_val, inputs[| i + 2].getValue());
}
if(ANIMATOR.current_frame == 0) { //rerfesh state on the first frame
lua_state_destroy(lua_state);
lua_state = lua_create();
}
//if(ANIMATOR.current_frame == 0) { //rerfesh state on the first frame
// lua_state_destroy(lua_state);
// lua_state = lua_create();
// addCode();
//}
lua_projectData(getState());
var res = 0;
try {
res = lua_call_w(getState(), _func, argument_val);
} catch(e) {
noti_warning(exception_print(e),, self);
}
try res = lua_call_w(getState(), _func, argument_val);
catch(e) noti_warning(exception_print(e),, self);
outputs[| 1].setValue(res);
}
static onInspectorUpdate = function() { //compile
static addCode = function() {
var _func = inputs[| 0].getValue();
var _code = inputs[| 2].getValue();
argument_name = [];
@ -207,8 +213,13 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
lua_code += ")\n";
lua_code += _code;
lua_code += "\nend";
//print(lua_code);
lua_add_code(getState(), lua_code);
}
static onInspectorUpdate = function() { //compile
addCode();
compiled = true;
@ -224,6 +235,9 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
static postDeserialize = function() {
var _inputs = load_map[? "inputs"];
if(LOADING_VERSION < 1380 && !CLONING)
ds_list_insert(_inputs, 4, noone);
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
createNewInput();
}
@ -241,6 +255,7 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
case 0 : inputs[| i + 2].type = VALUE_TYPE.float; break;
case 1 : inputs[| i + 2].type = VALUE_TYPE.text; break;
case 2 : inputs[| i + 2].type = VALUE_TYPE.surface; break;
case 3 : inputs[| i + 2].type = VALUE_TYPE.struct; break;
}
inputs[| i + 2].setDisplay(VALUE_DISPLAY._default);

View file

@ -19,6 +19,7 @@ function Node_Lua_Global(_x, _y, _group = noone) : Node(_x, _y, _group) construc
];
lua_state = lua_create();
lua_error_handler = _lua_error;
is_beginning = false;
error_notification = noone;
@ -65,18 +66,17 @@ function Node_Lua_Global(_x, _y, _group = noone) : Node(_x, _y, _group) construc
var _code = inputs[| 0].getValue();
var _type = inputs[| 1].getValue();
if(ANIMATOR.current_frame == 0) { //rerfesh state on the first frame
lua_state_destroy(lua_state);
lua_state = lua_create();
}
//if(ANIMATOR.current_frame == 0) { //rerfesh state on the first frame
// lua_state_destroy(lua_state);
// lua_state = lua_create();
// addCode();
//}
lua_projectData(getState());
if(ANIMATOR.current_frame == 0 || _type == 1) {
try
lua_add_code(getState(), _code);
catch(e)
noti_warning(exception_print(e),, self);
try lua_add_code(getState(), _code);
catch(e) noti_warning(exception_print(e),, self);
}
}

View file

@ -13,12 +13,14 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
inputs[| 3] = nodeValue("Execution thread", self, JUNCTION_CONNECT.input, VALUE_TYPE.node, noone)
.setVisible(false, true);
inputs[| 4] = nodeValue("Execute on frame", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
static createNewInput = function() {
var index = ds_list_size(inputs);
inputs[| index + 0] = nodeValue("Argument name", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "" );
inputs[| index + 1] = nodeValue("Argument type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 )
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "String", "Surface" ], { update_hover: false });
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "String", "Surface", "Struct" ], { update_hover: false });
inputs[| index + 1].editWidget.interactable = false;
inputs[| index + 2] = nodeValue("Argument value", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 )
@ -32,7 +34,7 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
luaArgumentRenderer();
input_display_list = [ 3,
input_display_list = [ 3, 4,
["Function", false], 0, 1,
["Arguments", false], argument_renderer,
["Script", false], 2,
@ -47,6 +49,7 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
argument_val = [];
lua_state = lua_create();
lua_error_handler = _lua_error;
error_notification = noone;
compiled = false;
@ -93,7 +96,8 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
ds_list_add(_in, inputs[| i + 2]);
inputs[| i + 1].editWidget.interactable = true;
inputs[| i + 2].editWidget.interactable = true;
if(inputs[| i + 2].editWidget != noone)
inputs[| i + 2].editWidget.interactable = true;
if(LOADING || APPENDING) {
var type = inputs[| i + 1].getValue();
@ -101,6 +105,7 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
case 0 : inputs[| i + 2].type = VALUE_TYPE.float; break;
case 1 : inputs[| i + 2].type = VALUE_TYPE.text; break;
case 2 : inputs[| i + 2].type = VALUE_TYPE.surface; break;
case 3 : inputs[| i + 2].type = VALUE_TYPE.struct; break;
}
inputs[| i + 2].setDisplay(VALUE_DISPLAY._default);
@ -151,6 +156,7 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
case 0 : inputs[| index + 1].type = VALUE_TYPE.float; break;
case 1 : inputs[| index + 1].type = VALUE_TYPE.text; break;
case 2 : inputs[| index + 1].type = VALUE_TYPE.surface; break;
case 3 : inputs[| index + 1].type = VALUE_TYPE.struct; break;
}
inputs[| index + 1].setDisplay(VALUE_DISPLAY._default);
@ -172,16 +178,20 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
var _func = inputs[| 0].getValue();
var _dimm = inputs[| 1].getValue();
var _exec = inputs[| 4].getValue();
if(!_exec) return;
argument_val = [];
for( var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length ) {
array_push(argument_val, inputs[| i + 2].getValue());
}
if(ANIMATOR.current_frame == 0) { //rerfesh state on the first frame
lua_state_destroy(lua_state);
lua_state = lua_create();
}
//if(ANIMATOR.current_frame == 0) { //rerfesh state on the first frame
// lua_state_destroy(lua_state);
// lua_state = lua_create();
// addCode();
//}
lua_projectData(getState());
@ -189,17 +199,14 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
_outSurf = surface_verify(_outSurf, _dimm[0], _dimm[1]);
surface_set_target(_outSurf);
try {
lua_call_w(getState(), _func, argument_val);
} catch(e) {
noti_warning(exception_print(e),, self);
}
try lua_call_w(getState(), _func, argument_val);
catch(e) noti_warning(exception_print(e),, self);
surface_reset_target();
outputs[| 1].setValue(_outSurf);
}
static onInspectorUpdate = function() { //compile
static addCode = function() {
var _func = inputs[| 0].getValue();
var _code = inputs[| 2].getValue();
argument_name = [];
@ -218,7 +225,10 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
lua_code += "\nend";
lua_add_code(getState(), lua_code);
}
static onInspectorUpdate = function() { //compile
addCode();
compiled = true;
for( var i = 0; i < ds_list_size(outputs[| 0].value_to); i++ ) {
@ -233,6 +243,9 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
static postDeserialize = function() {
var _inputs = load_map[? "inputs"];
if(LOADING_VERSION < 1380 && !CLONING)
ds_list_insert(_inputs, 4, noone);
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
createNewInput();
}
@ -250,6 +263,7 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
case 0 : inputs[| i + 2].type = VALUE_TYPE.float; break;
case 1 : inputs[| i + 2].type = VALUE_TYPE.text; break;
case 2 : inputs[| i + 2].type = VALUE_TYPE.surface; break;
case 3 : inputs[| i + 2].type = VALUE_TYPE.struct; break;
}
inputs[| i + 2].setDisplay(VALUE_DISPLAY._default);

View file

@ -14,18 +14,21 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
.setDisplay(VALUE_DISPLAY.enum_scroll, ["Entire line", "Segment"])
.rejectArray();
inputs[| 3] = nodeValue("Round anchor", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
.rejectArray();
input_display_list = [
["Path", false], 0, 2, 1,
["Path", false], 0, 2, 1, 3,
["Anchors", false],
];
input_fix_len = ds_list_size(inputs);
input_display_list_len = array_length(input_display_list);
function createAnchor(_x, _y) {
function createAnchor(_x, _y, _dxx = 0, _dxy = 0, _dyx = 0, _dyy = 0) {
var index = ds_list_size(inputs);
inputs[| index] = nodeValue("Anchor", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ _x, _y, 0, 0, 0, 0 ])
inputs[| index] = nodeValue("Anchor", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ _x, _y, _dxx, _dxy, _dyx, _dyy ])
.setDisplay(VALUE_DISPLAY.vector);
array_push(input_display_list, index);
@ -37,11 +40,16 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
outputs[| 1] = nodeValue("Path data", self, JUNCTION_CONNECT.output, VALUE_TYPE.pathnode, self);
tool_pathDrawer = new NodeTool( "Draw path", THEME.path_tools_draw )
.addSetting("Smoothness", VALUE_TYPE.float, function(val) { tool_pathDrawer.attribute.thres = val; }, "thres", 4)
.addSetting("Replace", VALUE_TYPE.boolean, function() { tool_pathDrawer.attribute.create = !tool_pathDrawer.attribute.create; }, "create", true);
tools = [
[ "Anchor add / remove (+ Shift)", THEME.path_tools_add ],
[ "Edit Control point", THEME.path_tools_anchor ],
[ "Rectangle path", THEME.path_tools_rectangle ],
[ "Circle path", THEME.path_tools_circle ],
new NodeTool( "Anchor add / remove (+ Shift)", THEME.path_tools_add ),
new NodeTool( "Edit Control point", THEME.path_tools_anchor ),
tool_pathDrawer,
new NodeTool( "Rectangle path", THEME.path_tools_rectangle ),
new NodeTool( "Circle path", THEME.path_tools_circle ),
];
anchors = [];
@ -49,6 +57,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
length_total = 0;
drag_point = -1;
drag_points = [];
drag_type = 0;
drag_point_mx = 0;
drag_point_my = 0;
@ -110,6 +119,106 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
inp.setValue(anc);
} else if(drag_type == 2) {
var ox, oy, nx, ny;
var pxx = (_mx - _x) / _s;
var pxy = (_my - _y) / _s;
draw_set_color(COLORS._main_accent);
for( var i = 0; i < array_length(drag_points); i++ ) {
var _p = drag_points[i];
nx = _x + _p[0] * _s;
ny = _y + _p[1] * _s;
if(i)
draw_line(ox, oy, nx, ny);
ox = nx;
oy = ny;
}
if(point_distance(drag_point_mx, drag_point_my, pxx, pxy) > 4) {
array_push(drag_points, [ pxx, pxy ]);
drag_point_mx = pxx;
drag_point_my = pxy;
}
if(mouse_release(mb_left)) {
var amo = array_length(drag_points);
var _p = 0;
var points = [];
var thres = tool_pathDrawer.attribute.thres;
var replace = tool_pathDrawer.attribute.create;
var asize = ds_list_size(inputs) - input_fix_len;
for( var i = 0; i < amo; i++ ) {
var pT = drag_points[i];
if(i == 0 || i == amo - 1) {
array_push(points, i);
continue;
}
var maxT = 0;
var pF = drag_points[_p];
for( var j = _p; j < i; j++ ) {
var pP = drag_points[j];
maxT = max(maxT, distance_to_line(pP[0], pP[1], pF[0], pF[1], pT[0], pT[1]));
}
if(maxT >= thres) {
array_push(points, i);
_p = i;
}
}
var amo = array_length(points);
if(!replace) amo = min(amo, asize);
var i = 0;
var anc = [];
for( i = 0; i < amo; i++ ) {
var _ind = points[i];
var _p = drag_points[_ind];
var dxx = 0;
var dxy = 0;
var dyx = 0;
var dyy = 0;
if(i > 0 && i < amo - 1) {
var _p0 = drag_points[points[i - 1]];
var _p1 = drag_points[points[i + 1]];
var d0 = point_direction(_p0[0], _p0[1], _p[0], _p[1]);
var d1 = point_direction(_p[0], _p[1], _p1[0], _p1[1]);
var dd = d0 + angle_difference(d1, d0) / 2;
var ds0 = point_distance(_p0[0], _p0[1], _p[0], _p[1]);
var ds1 = point_distance(_p[0], _p[1], _p1[0], _p1[1]);
dxx = lengthdir_x(ds0 / 3, dd + 180);
dxy = lengthdir_y(ds0 / 3, dd + 180);
dyx = lengthdir_x(ds1 / 3, dd);
dyy = lengthdir_y(ds1 / 3, dd);
}
anc = [_p[0], _p[1], dxx, dxy, dyx, dyy];
if(input_fix_len + i >= ds_list_size(inputs))
createAnchor(_p[0], _p[1], dxx, dxy, dyx, dyy);
else
inputs[| input_fix_len + i].setValue(anc);
}
if(!replace) {
for(; i < asize; i++ ) {
inputs[| input_fix_len + i].setValue(anc);
}
}
}
} else if(drag_type == 3) {
var minx = min((_mx - _x) / _s, (drag_point_mx - _x) / _s);
var maxx = max((_mx - _x) / _s, (drag_point_mx - _x) / _s);
var miny = min((_my - _y) / _s, (drag_point_my - _y) / _s);
@ -144,7 +253,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
for( var i = 0; i < 4; i++ )
inputs[| input_fix_len + i].setValue(a[i]);
} else if(drag_type == 3) {
} else if(drag_type == 4) {
var minx = min((_mx - _x) / _s, (drag_point_mx - _x) / _s);
var maxx = max((_mx - _x) / _s, (drag_point_mx - _x) / _s);
var miny = min((_my - _y) / _s, (drag_point_my - _y) / _s);
@ -197,7 +306,6 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
inputs[| input_fix_len + i].setValue(a[i]);
}
if(mouse_release(mb_left))
drag_point = -1;
}
@ -225,7 +333,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
_ny = _y + p[1] * _s;
if(j) {
if((key_mod_press(CTRL) || PANEL_PREVIEW.tool_index == 0) && distance_to_line(_mx, _my, _ox, _oy, _nx, _ny) < 4)
if((key_mod_press(CTRL) || isUsingTool(0)) && distance_to_line(_mx, _my, _ox, _oy, _nx, _ny) < 4)
line_hover = i;
}
@ -309,9 +417,43 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
}
}
if(anchor_hover != -1) {
if(isUsingTool(2)) {
draw_sprite_ui_uniform(THEME.path_tools_draw, 0, _mx + 16, _my + 16);
if(mouse_press(mb_left, active)) {
var replace = tool_pathDrawer.attribute.create;
if(replace) {
while(ds_list_size(inputs) > input_fix_len)
ds_list_delete(inputs, input_fix_len);
array_resize(input_display_list, input_display_list_len);
}
drag_point = 0;
drag_type = 2;
drag_points = [ [ (_mx - _x) / _s, (_my - _y) / _s ] ];
drag_point_mx = (_mx - _x) / _s;
drag_point_my = (_my - _y) / _s;
}
} else if(isUsingTool(3) || isUsingTool(4)) {
draw_sprite_ui_uniform(THEME.cursor_path_add, 0, _mx + 16, _my + 16);
if(mouse_press(mb_left, active)) {
while(ds_list_size(inputs) > input_fix_len)
ds_list_delete(inputs, input_fix_len);
array_resize(input_display_list, input_display_list_len);
drag_point = 0;
drag_type = isUsingTool(3)? 3 : 4;
drag_point_mx = _mx;
drag_point_my = _my;
inputs[| 1].setValue(true);
repeat(4)
createAnchor(value_snap((_mx - _x) / _s, _snx), value_snap((_my - _y) / _s, _sny));
}
} else if(anchor_hover != -1) {
var _a = inputs[| input_fix_len + anchor_hover].getValue();
if(PANEL_PREVIEW.tool_index == 1) {
if(isUsingTool(1)) {
draw_sprite_ui_uniform(THEME.cursor_path_anchor, 0, _mx + 16, _my + 16);
if(mouse_press(mb_left, active)) {
@ -363,7 +505,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
}
}
}
} else if(key_mod_press(CTRL) || PANEL_PREVIEW.tool_index == 0) {
} else if(key_mod_press(CTRL) || isUsingTool(0)) {
draw_sprite_ui_uniform(THEME.cursor_path_add, 0, _mx + 16, _my + 16);
if(mouse_press(mb_left, active)) {
@ -384,30 +526,13 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
drag_point_sx = (_mx - _x) / _s;
drag_point_sy = (_my - _y) / _s;
}
} else if(PANEL_PREVIEW.tool_index >= 2) {
draw_sprite_ui_uniform(THEME.cursor_path_add, 0, _mx + 16, _my + 16);
if(mouse_press(mb_left, active)) {
while(ds_list_size(inputs) > input_fix_len) {
ds_list_delete(inputs, input_fix_len);
}
array_resize(input_display_list, input_display_list_len);
drag_point = 0;
drag_type = PANEL_PREVIEW.tool_index;
drag_point_mx = _mx;
drag_point_my = _my;
inputs[| 1].setValue(true);
repeat(4)
createAnchor(value_snap((_mx - _x) / _s, _snx), value_snap((_my - _y) / _s, _sny));
}
}
}
static updateLength = function() {
length_total = 0;
var loop = inputs[| 1].getValue();
var rond = inputs[| 3].getValue();
var ansize = ds_list_size(inputs) - input_fix_len;
if(ansize < 2) {
lengths = [];
@ -431,6 +556,11 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
anchors[i] = _a0;
anchors[i + 1] = _a1;
if(rond) {
_a0[0] = round(_a0[0]); _a0[1] = round(_a0[1]);
_a1[0] = round(_a1[0]); _a1[1] = round(_a1[1]);
}
var l = 0;
var _ox = 0, _oy = 0, _nx = 0, _ny = 0, p = 0;
@ -454,12 +584,15 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
static getSegmentRatio = function(_rat) {
var loop = inputs[| 1].getValue();
var rond = inputs[| 3].getValue();
var ansize = array_length(lengths);
var amo = ds_list_size(inputs) - input_fix_len;
if(amo < 1) return [0, 0];
if(_rat < 0) {
var _p0 = inputs[| input_fix_len].getValue();
if(rond)
return [round(_p0[0]), round(_p0[1])];
return [_p0[0], _p0[1]];
}
@ -471,6 +604,8 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
if(_i1 >= amo) {
if(!loop) {
var _p1 = inputs[| ds_list_size(inputs) - 1].getValue()
if(rond)
return [round(_p1[0]), round(_p1[1])];
return [_p1[0], _p1[1]];
}
@ -480,6 +615,11 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
var _a0 = inputs[| input_fix_len + _i0].getValue();
var _a1 = inputs[| input_fix_len + _i1].getValue();
if(rond) {
_a0[0] = round(_a0[0]); _a0[1] = round(_a0[1]);
_a1[0] = round(_a1[0]); _a1[1] = round(_a1[1]);
}
return eval_bezier(_t, _a0[0], _a0[1], _a1[0], _a1[1], _a0[0] + _a0[4], _a0[1] + _a0[5], _a1[0] + _a1[2], _a1[1] + _a1[3]);
}
@ -487,6 +627,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
static getPointRatio = function(_rat) {
var loop = inputs[| 1].getValue();
var rond = inputs[| 3].getValue();
var ansize = array_length(lengths);
var amo = ds_list_size(inputs) - input_fix_len;
@ -499,6 +640,11 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
_a0 = anchors[i];
_a1 = anchors[safe_mod(i + 1, amo)];
if(rond) {
_a0[0] = round(_a0[0]); _a0[1] = round(_a0[1]);
_a1[0] = round(_a1[0]); _a1[1] = round(_a1[1]);
}
if(pix > lengths[i]) {
pix -= lengths[i];
continue;
@ -508,7 +654,8 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
if(!is_array(_a0) || !is_array(_a1))
return [0, 0];
return eval_bezier(_t, _a0[0], _a0[1], _a1[0], _a1[1], _a0[0] + _a0[4], _a0[1] + _a0[5], _a1[0] + _a1[2], _a1[1] + _a1[3]);
var _p = eval_bezier(_t, _a0[0], _a0[1], _a1[0], _a1[1], _a0[0] + _a0[4], _a0[1] + _a0[5], _a1[0] + _a1[2], _a1[1] + _a1[3]);
return _p;
}
return [0, 0];
@ -574,6 +721,9 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
static postDeserialize = function() {
var _inputs = load_map[? "inputs"];
if(LOADING_VERSION < 1380 && !CLONING)
ds_list_insert(_inputs, 3, noone);
for(var i = input_fix_len; i < ds_list_size(_inputs); i++)
createAnchor(0, 0);
}

View file

@ -5,7 +5,7 @@ function Node_Path_Array(_x, _y, _group = noone) : Node(_x, _y, _group) construc
w = 96;
input_fix_len = ds_list_size(inputs);
data_length = 1;
data_length = 1;
outputs[| 0] = nodeValue("Path array", self, JUNCTION_CONNECT.output, VALUE_TYPE.pathnode, self);
@ -22,11 +22,10 @@ function Node_Path_Array(_x, _y, _group = noone) : Node(_x, _y, _group) construc
static refreshDynamicInput = function() {
var _l = ds_list_create();
for( var i = 0; i < input_fix_len; i++ ) {
for( var i = 0; i < input_fix_len; i++ )
_l[| i] = inputs[| i];
}
for( var i = input_fix_len; i < ds_list_size(inputs); i++ ) {
for( var i = input_fix_len; i < ds_list_size(inputs); i += data_length ) {
if(inputs[| i].value_from)
ds_list_add(_l, inputs[| i]);
else
@ -50,7 +49,7 @@ function Node_Path_Array(_x, _y, _group = noone) : Node(_x, _y, _group) construc
static getLineCount = function() {
var l = 0;
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i += data_length ) {
var _path = inputs[| i].getValue();
l += struct_has(_path, "getLineCount")? _path.getLineCount() : 1;
}
@ -62,7 +61,7 @@ function Node_Path_Array(_x, _y, _group = noone) : Node(_x, _y, _group) construc
}
static getPointRatio = function(_rat, ind = 0) {
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i += data_length ) {
var _path = inputs[| i].getValue();
var lc = struct_has(_path, "getLineCount")? _path.getLineCount() : 1;

View file

@ -8,7 +8,7 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr
.setVisible(true, true)
.setArrayDepth(2);
inputs[| 1] = nodeValue("Connected", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
inputs[| 1] = nodeValue("Connected", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "If set to true, will draw a single path from one point to another. If not set will treat each pair of points as an individual line.");
outputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.pathnode, self);
@ -30,6 +30,9 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_p0 = array_safe_get(_lines, floor(_st) + 0,, ARRAY_OVERFLOW._default);
_p1 = array_safe_get(_lines, floor(_st) + 1,, ARRAY_OVERFLOW._default);
if(!is_array(_p0)) return [0, 0];
if(!is_array(_p1)) return [0, 0];
_x = lerp(_p0[0], _p1[0], frac(_st));
_y = lerp(_p0[1], _p1[1], frac(_st));
@ -38,6 +41,9 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr
_p0 = array_safe_get(_lines, _ind * 2 + 0,, ARRAY_OVERFLOW._default);
_p1 = array_safe_get(_lines, _ind * 2 + 1,, ARRAY_OVERFLOW._default);
if(!is_array(_p0)) return [0, 0];
if(!is_array(_p1)) return [0, 0];
_x = lerp(_p0[0], _p1[0], _rat);
_y = lerp(_p0[1], _p1[1], _rat);

View file

@ -24,7 +24,7 @@ function Node_Path_L_System(_x, _y, _group = noone) : Node(_x, _y, _group) const
inputs[| 4] = nodeValue("Starting rule", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "", o_dialog_l_system);
inputs[| 5] = nodeValue("End replacement", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "");
inputs[| 5] = nodeValue("End replacement", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "", "Replace symbol of the last generated rule, for example a=F to replace all a with F. Use comma to separate different replacements.");
inputs[| 6] = nodeValue("Starting angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 90)
.setDisplay(VALUE_DISPLAY.rotation);

View file

@ -0,0 +1,164 @@
function Node_Path_Plot(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Plot Path";
previewable = false;
w = 96;
inputs[| 0] = nodeValue("Output scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 8, 8 ])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 1] = nodeValue("Coordinate", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Cartesian", "Polar" ]);
eq_type_car = [ "x function", "y function", "parametric" ];
eq_type_pol = [ "r function", "O function", "parametric" ];
inputs[| 2] = nodeValue("Equation type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, eq_type_car);
inputs[| 3] = nodeValue("0 function", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "");
inputs[| 4] = nodeValue("1 function", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "");
inputs[| 5] = nodeValue("Origin", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ] )
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 6] = nodeValue("Range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
.setDisplay(VALUE_DISPLAY.slider_range, [ -1, 1, 0.01 ]);
inputs[| 7] = nodeValue("Input scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 8] = nodeValue("Input shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
.setDisplay(VALUE_DISPLAY.vector);
outputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.pathnode, self);
input_display_list = [
[ "Variable", false ], 5, 7, 8, 0,
[ "Equation", false ], 1, 2, 3, 4, 6,
]
static getLineCount = function() { return 1; }
static getSegmentCount = function() { return 0; }
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
inputs[| 5].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
}
static getPointRatio = function(_rat, ind = 0) {
var _sca = inputs[| 0].getValue();
var _coor = inputs[| 1].getValue();
var _eqa = inputs[| 2].getValue();
var _eq0 = inputs[| 3].getValue();
var _eq1 = inputs[| 4].getValue();
var _orig = inputs[| 5].getValue();
var _ran = inputs[| 6].getValue();
var _iran = inputs[| 7].getValue();
var _shf = inputs[| 8].getValue();
_rat = _ran[0] + (_rat * (_ran[1] - _ran[0]));
var _p = [ 0, 0 ];
switch(_coor) {
case 0 :
switch(_eqa) {
case 0 :
_p[0] = _rat * _iran[0] + _shf[0];
_p[1] = evaluateFunction(_eq0, { x: _rat * _iran[0] + _shf[0] });
break;
case 1 :
_p[0] = evaluateFunction(_eq0, { y: _rat * _iran[1] + _shf[1] });
_p[1] = _rat * _iran[1] + _shf[1];
break;
case 2 :
_p[0] = evaluateFunction(_eq0, { t: _rat * _iran[0] + _shf[0] });
_p[1] = evaluateFunction(_eq1, { t: _rat * _iran[1] + _shf[1] });
break;
}
break;
case 1 :
var _a = [ 0, 0 ];
switch(_eqa) {
case 0 :
_a[0] = _rat * _iran[0] + _shf[0];
_a[1] = evaluateFunction(_eq0, { r: _rat * _iran[0] + _shf[0] });
break;
case 1 :
_a[0] = evaluateFunction(_eq0, { O: _rat * _iran[1] + _shf[1] });
_a[1] = _rat * _iran[1] + _shf[1];
break;
case 2 :
_a[0] = evaluateFunction(_eq0, { t: _rat * _iran[0] + _shf[0] });
_a[1] = evaluateFunction(_eq1, { t: _rat * _iran[1] + _shf[1] });
break;
}
_p[0] = cos(_a[1]) * _a[0];
_p[1] = -sin(_a[1]) * _a[0];
break;
}
_p[0] = _p[0] * _sca[0] + _orig[0];
_p[1] = -_p[1] * _sca[1] + _orig[1];
return _p;
}
function step() {
var _coor = inputs[| 1].getValue();
var _eqa = inputs[| 2].getValue();
inputs[| 2].editWidget.data_list = _coor? eq_type_pol : eq_type_car;
inputs[| 2].display_data = _coor? eq_type_pol : eq_type_car;
switch(_coor) {
case 0 :
switch(_eqa) {
case 0 :
inputs[| 3].name = "f(x) = ";
inputs[| 4].setVisible(false);
inputs[| 6].name = "x range";
break;
case 1 :
inputs[| 3].name = "f(y) = ";
inputs[| 4].setVisible(false);
inputs[| 6].name = "y range";
break;
case 2 :
inputs[| 3].name = "x(t) = ";
inputs[| 4].name = "y(t) = ";
inputs[| 4].setVisible(true);
inputs[| 6].name = "t range";
break;
}
break;
case 1 :
switch(_eqa) {
case 0 :
inputs[| 3].name = "f(r) = ";
inputs[| 4].setVisible(false);
inputs[| 6].name = "r range";
break;
case 1 :
inputs[| 3].name = "f(O) = ";
inputs[| 4].setVisible(false);
inputs[| 6].name = "O range";
break;
case 2 :
inputs[| 3].name = "r(t) = ";
inputs[| 4].name = "O(t) = ";
inputs[| 4].setVisible(true);
inputs[| 6].name = "t range";
break;
}
break;
}
}
function update() { outputs[| 0].setValue(self); }
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
var bbox = drawGetBbox(xx, yy, _s);
draw_sprite_fit(s_node_path_trim, 0, bbox.xc, bbox.yc, bbox.w, bbox.h);
}
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_path_plot",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "path",
"path": "folders/nodes/data/value/path.yy",
},
}

View file

@ -16,8 +16,21 @@ function Node_Path_Transform(_x, _y, _group = noone) : Node(_x, _y, _group) cons
inputs[| 3] = nodeValue("Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 4] = nodeValue("Anchor", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
.setDisplay(VALUE_DISPLAY.vector);
outputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.pathnode, self);
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
var pos = inputs[| 4].getValue();
var px = _x + pos[0] * _s;
var py = _y + pos[1] * _s;
active &= !inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
active &= !inputs[| 2].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny);
active &= !inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny, THEME.anchor );
}
static getLineCount = function() {
var _path = inputs[| 0].getValue();
return struct_has(_path, "getLineCount")? _path.getLineCount() : 1;
@ -33,6 +46,7 @@ function Node_Path_Transform(_x, _y, _group = noone) : Node(_x, _y, _group) cons
var _pos = inputs[| 1].getValue();
var _rot = inputs[| 2].getValue();
var _sca = inputs[| 3].getValue();
var _anc = inputs[| 4].getValue();
if(is_array(_path)) {
_path = array_safe_get(_path, ind);
@ -45,13 +59,10 @@ function Node_Path_Transform(_x, _y, _group = noone) : Node(_x, _y, _group) cons
var _b = struct_has(_path, "getBoundary")? _path.getBoundary() : [0, 0, 0, 0];
var _p = _path.getPointRatio(_rat, ind);
var cx = (_b[0] + _b[2]) / 2;
var cy = (_b[1] + _b[1]) / 2;
_p[0] = _anc[0] + (_p[0] - _anc[0]) * _sca[0];
_p[1] = _anc[1] + (_p[1] - _anc[1]) * _sca[1];
_p[0] = cx + (_p[0] - cx) * _sca[0];
_p[1] = cy + (_p[1] - cy) * _sca[1];
_p = point_rotate(_p[0], _p[1], cx, cy, _rot);
_p = point_rotate(_p[0], _p[1], _anc[0], _anc[1], _rot);
_p[0] += _pos[0];
_p[1] += _pos[1];

View file

@ -420,14 +420,19 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
addNodeObject(values, "Trim Path", s_node_path_trim, "Node_Path_Trim", [1, Node_Path_Trim]).setVersion(1130);
addNodeObject(values, "Wave Path", s_node_path_wave, "Node_Path_Wave", [1, Node_Path_Wave], ["zigzag path"]).setVersion(1130);
addNodeObject(values, "Reverse Path", s_node_path_reverse, "Node_Path_Reverse", [1, Node_Path_Reverse]).setVersion(1130);
addNodeObject(values, "Path Builder", s_node_path_builder, "Node_Path_Builder", [1, Node_Path_Builder]).setVersion(1137);
addNodeObject(values, "Path Builder", s_node_path_builder, "Node_Path_Builder", [1, Node_Path_Builder],, "Create path from array of vec2 points.").setVersion(1137);
addNodeObject(values, "L system", s_node_path_l_system, "Node_Path_L_System", [1, Node_Path_L_System]).setVersion(1137);
addNodeObject(values, "Path plot", s_node_path_plot, "Node_Path_Plot", [1, Node_Path_Plot]).setVersion(1138);
ds_list_add(values, "Boolean");
addNodeObject(values, "Boolean", s_node_boolean, "Node_Boolean", [1, Node_Boolean]);
addNodeObject(values, "Compare", s_node_compare, "Node_Compare", [0, Node_create_Compare], ["equal", "greater", "lesser"]);
addNodeObject(values, "Logic Opr", s_node_logic_opr, "Node_Logic", [0, Node_create_Logic], [ "and", "or", "not", "nand", "nor" , "xor" ]);
ds_list_add(values, "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]);
var color = ds_list_create();
addNodeCatagory("Color", color);
ds_list_add(color, "Colors");

View file

@ -77,8 +77,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
newMesh(0);
tools = [
[ "Mesh edit", THEME.mesh_tool_edit ],
[ "Anchor remove", THEME.mesh_tool_delete ],
new NodeTool( "Mesh edit", THEME.mesh_tool_edit ),
new NodeTool( "Anchor remove", THEME.mesh_tool_delete ),
];
static getPreviewValue = function() { return inputs[| 6]; }
@ -103,7 +103,6 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var lx = attributes[? mshx];
var ly = attributes[? mshy];
var len = ds_list_size(lx);
var _tool = PANEL_PREVIEW.tool_index;
if(previewing == 0) {
if(_shp == 2) {
@ -182,7 +181,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
draw_line_width(_dx0, _dy0, _dx1, _dy1, hover == i + 0.5? 4 : 2);
if(_tool == 0 && distance_to_line(_mx, _my, _dx0, _dy0, _dx1, _dy1) < 6)
if(isUsingTool(0) && distance_to_line(_mx, _my, _dx0, _dy0, _dx1, _dy1) < 6)
_hover = i + 0.5;
}
@ -197,13 +196,13 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var _dy = _y + _py * _s;
//draw_text(_dx, _dy - 8, i);
if(_tool == -1)
if(isNotUsingTool())
draw_circle(_dx, _dy, 4, false)
else
else {
draw_sprite_ui_uniform(THEME.anchor_selector, hover == i, _dx, _dy);
if(_tool >= 0 && point_distance(_mx, _my, _dx, _dy) < 8)
_hover = i;
if(point_distance(_mx, _my, _dx, _dy) < 8)
_hover = i;
}
}
hover = _hover;
@ -227,13 +226,13 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(frac(hover) == 0) {
if(mouse_click(mb_left, active)) {
if(_tool == 0) {
if(isUsingTool(0)) {
anchor_dragging = hover;
anchor_drag_sx = lx[| hover];
anchor_drag_sy = ly[| hover];
anchor_drag_mx = _mx;
anchor_drag_my = _my;
} else if(_tool == 1) {
} else if(isUsingTool(1)) {
if(ds_list_size(lx) > 3) {
ds_list_delete(lx, hover);
ds_list_delete(ly, hover);

View file

@ -0,0 +1,102 @@
function Node_Struct(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Struct";
previewable = false;
w = 96;
outputs[| 0] = nodeValue("Struct", self, JUNCTION_CONNECT.output, VALUE_TYPE.struct, {});
static createNewInput = function() {
var index = ds_list_size(inputs);
inputs[| index + 0] = nodeValue("Key", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "" );
inputs[| index + 1] = nodeValue("value", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0 )
.setVisible(false, false);
}
input_fix_len = ds_list_size(inputs);
data_length = 2;
if(!LOADING && !APPENDING) createNewInput();
static refreshDynamicInput = function() {
var _in = ds_list_create();
for( var i = 0; i < input_fix_len; i++ )
ds_list_add(_in, inputs[| i]);
for( var i = input_fix_len; i < ds_list_size(inputs); i += data_length ) {
if(inputs[| i].getValue() != "") {
ds_list_add(_in, inputs[| i + 0]);
ds_list_add(_in, inputs[| i + 1].setVisible(false, true));
} else {
delete inputs[| i + 0];
delete inputs[| i + 1];
}
}
for( var i = 0; i < ds_list_size(_in); i++ )
_in[| i].index = i;
ds_list_destroy(inputs);
inputs = _in;
createNewInput();
}
static onValueUpdate = function(index = 0) {
if(LOADING || APPENDING) return;
if(safe_mod(index - input_fix_len, data_length) == 0) { //Variable name
inputs[| index + 1].name = inputs[| index].getValue() + " value";
}
refreshDynamicInput();
}
function step() {
for(var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length) {
var inp = inputs[| i + 1];
var typ = inp.value_from == noone? VALUE_TYPE.any : inp.value_from.type;
inp.type = typ;
}
}
function update() {
var str = {};
for(var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length) {
var key = inputs[| i + 0].getValue();
var val = inputs[| i + 1].getValue();
str[$ key] = val;
}
outputs[| 0].setValue(str);
}
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
var bbox = drawGetBbox(xx, yy, _s);
draw_set_text(f_p0b, fa_left, fa_center, COLORS._main_text);
for(var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length) {
var key = inputs[| i + 0].getValue();
var val = inputs[| i + 1];
draw_set_color(value_color(val.type));
draw_text_transformed(bbox.x0 + 6 * _s, inputs[| i + 0].y - 1 * _s, key, _s, _s, 0);
}
}
static postDeserialize = function() {
var _inputs = load_map[? "inputs"];
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
createNewInput();
}
static doApplyDeserialize = function() {
refreshDynamicInput();
}
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_struct",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "struct",
"path": "folders/nodes/data/value/struct.yy",
},
}

View file

@ -0,0 +1,57 @@
function Node_Struct_Get(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Struct Get";
previewable = false;
w = 96;
inputs[| 0] = nodeValue("Struct", self, JUNCTION_CONNECT.input, VALUE_TYPE.struct, {})
.setVisible(true, true);
inputs[| 1] = nodeValue("Key", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "");
outputs[| 0] = nodeValue("Struct", self, JUNCTION_CONNECT.output, VALUE_TYPE.struct, {});
function update() {
var str = inputs[| 0].getValue();
var key = inputs[| 1].getValue();
var keys = string_splice(key, ".");
var _str = str;
var out = outputs[| 0];
for( var j = 0; j < array_length(keys); j++ ) {
var k = keys[j];
if(!variable_struct_exists(_str, k)) {
out.setValue(0);
out.type = VALUE_TYPE.float;
break;
}
var val = variable_struct_get(_str, k);
if(j == array_length(keys) - 1) {
if(is_struct(val))
out.type = VALUE_TYPE.struct;
else if(is_array(val) && array_length(val))
out.type = is_string(val[0])? VALUE_TYPE.text : VALUE_TYPE.float;
else
out.type = is_string(val)? VALUE_TYPE.text : VALUE_TYPE.float;
out.setValue(val);
}
if(is_struct(val)) _str = val;
else break;
}
}
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
var bbox = drawGetBbox(xx, yy, _s);
var str = inputs[| 1].getValue();
draw_set_text(f_h5, fa_center, fa_center, COLORS._main_text);
var ss = string_scale(str, bbox.w, bbox.h);
draw_text_transformed(bbox.xc, bbox.yc, str, ss, ss, 0);
}
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_struct_get",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "struct",
"path": "folders/nodes/data/value/struct.yy",
},
}

View file

@ -0,0 +1,47 @@
function NodeTool(name, spr) constructor {
self.name = name;
self.spr = spr;
subtools = is_array(spr)? array_length(spr) : 0;
selecting = 0;
settings = [];
attribute = {};
static addSetting = function(name, type, onEdit, keyAttr, val) {
var w;
switch(type) {
case VALUE_TYPE.float :
w = new textBox(TEXTBOX_INPUT.number, onEdit);
w.font = f_p2;
break;
case VALUE_TYPE.boolean :
w = new checkBox(onEdit);
break;
}
array_push(settings, [ name, w, keyAttr, attribute ]);
attribute[$ keyAttr] = val;
return self;
}
static toggle = function() {
if(subtools == 0) {
PANEL_PREVIEW.tool_current = PANEL_PREVIEW.tool_current == self? noone : self;
} else {
if(PANEL_PREVIEW.tool_current != self) {
PANEL_PREVIEW.tool_current = self;
selecting = 0;
return;
}
selecting++;
if(selecting == subtools) {
selecting = 0;
PANEL_PREVIEW.tool_current = noone;
} else
PANEL_PREVIEW.tool_current = self;
}
}
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_tool",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "__base__",
"path": "folders/nodes/data/__base__.yy",
},
}

View file

@ -23,6 +23,7 @@ enum VALUE_TYPE {
particle = 13,
rigid = 14,
fdomain = 15,
struct = 16,
}
enum VALUE_DISPLAY {
@ -96,6 +97,7 @@ function value_color(i) {
$5dde8f, //particle
$e3ff66, //rigid
#4da6ff, //fdomain
$5d3f8c, //struct
];
return JUNCTION_COLORS[safe_mod(max(0, i), array_length(JUNCTION_COLORS))];
}
@ -116,6 +118,7 @@ function value_bit(i) {
case VALUE_TYPE.particle : return 1 << 16;
case VALUE_TYPE.rigid : return 1 << 17;
case VALUE_TYPE.fdomain : return 1 << 18;
case VALUE_TYPE.struct : return 1 << 19;
case VALUE_TYPE.node : return 1 << 32;
@ -189,7 +192,8 @@ function typeIncompatible(from, to) {
case VALUE_DISPLAY.vector_range :
case VALUE_DISPLAY.puppet_control :
case VALUE_DISPLAY.padding :
case VALUE_DISPLAY.curve : return true;
case VALUE_DISPLAY.curve :
return true;
}
}
@ -1389,6 +1393,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
static serialize = function(scale = false, preset = false) {
var _map = ds_map_create();
//print(" = > Serializing: " + name);
ds_map_add_list(_map, "raw value", animator.serialize(scale));
_map[? "on end"] = on_end;

View file

@ -46,8 +46,8 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
input_display_index = array_length(input_display_list);
tools = [
[ "Add / Remove (+ Shift) control point", THEME.control_add ],
[ "Pin / unpin (+ Shift) mesh", THEME.control_pin ]
new NodeTool( "Add / Remove (+ Shift) control point", THEME.control_add ),
new NodeTool( "Pin / unpin (+ Shift) mesh", THEME.control_pin )
];
attributes[? "pin"] = ds_map_create();
@ -72,10 +72,8 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
hover = i;
}
var _tool = PANEL_PREVIEW.tool_index;
if(!active) return;
if(_tool == 0) {
if(isUsingTool(0)) {
if(key_mod_press(SHIFT))
draw_sprite_ui_uniform(THEME.cursor_path_remove, 0, _mx + 16, _my + 16);
else
@ -98,7 +96,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
reset();
control(input_display_list);
}
} else if(_tool == 1) {
} else if(isUsingTool(1)) {
draw_sprite_ui_uniform(key_mod_press(SHIFT)? THEME.cursor_path_remove : THEME.cursor_path_add, 0, _mx + 16, _my + 16);
draw_set_color(COLORS._main_accent);

View file

@ -9,7 +9,7 @@ function Panel_Animation() : PanelContent() constructor {
context_str = "Animation";
timeline_h = ui(28);
min_w = ui(348);
min_w = ui(32);
min_h = ui(48);
tool_width = ui(280);
@ -1359,6 +1359,9 @@ function Panel_Animation() : PanelContent() constructor {
function drawAnimationControl() {
var bx = ui(8);
if(w < ui(348))
bx = w / 2 - ui(36) * 6 / 2;
var by = h - ui(40);
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, get_text("stop", "Stop"), THEME.sequence_control, 4, ANIMATOR.is_playing? COLORS._main_accent : COLORS._main_icon) == 2) {
ANIMATOR.is_playing = false;
@ -1393,6 +1396,8 @@ function Panel_Animation() : PanelContent() constructor {
ANIMATOR.setFrame(ANIMATOR.real_frame + 1);
}
if(w < ui(348)) return;
bx = w - ui(44);
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, get_text("panel_animation_animation_settings", "Animation settings"), THEME.animation_setting, 2) == 2)
dialogCall(o_dialog_animation, x + bx + 32, y + by - 8);
@ -1414,9 +1419,13 @@ function Panel_Animation() : PanelContent() constructor {
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
drawTimeline();
if(dope_sheet_h > 8)
drawDopesheet();
if(w < ui(348)) {
draw_sprite_stretched(THEME.ui_panel_bg, 1, ui(8), h - ui(32 + 8), w - ui(16), ui(32));
} else {
drawTimeline();
if(dope_sheet_h > 8)
drawDopesheet();
}
drawAnimationControl();
if(timeline_show_time > -1) {

View file

@ -19,6 +19,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
y = _y;
w = _w;
h = _h;
split = -1;
min_w = ui(32);
min_h = ui(32);
@ -26,6 +27,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
dragging = -1;
drag_sval = 0;
drag_sm = 0;
mouse_active = true;
content_surface = surface_create_valid(w, h);
mask_surface = surface_create_valid(w, h);
@ -60,9 +62,8 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
if(content != noone)
content.refresh();
for( var i = 0; i < ds_list_size(childs); i++ ) {
for( var i = 0; i < ds_list_size(childs); i++ )
childs[| i].refresh();
}
}
function move(dx, dy) {
@ -97,19 +98,48 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
return true;
}
function refreshSize() {
for(var i = 0; i < ds_list_size(childs); i++)
childs[| i].refreshSize();
refreshContentSize();
}
function refreshContentSize() {
function refreshSize() { //refresh content surface after resize
if(content) {
content.w = w;
content.h = h;
content.onResize();
} else if(ds_list_size(childs) == 2) {
print("=== Refreshing (" + string(w) + ", " + string(h) + ") " + string(split) + " ===");
var tw = childs[| 0].w + childs[| 1].w;
var th = childs[| 0].h + childs[| 1].h;
var fixChild = childs[| 1].x == x && childs[| 1].y == y;
childs[| fixChild].x = x;
childs[| fixChild].y = y;
if(split == 0) {
childs[| fixChild].w = childs[| fixChild].w / tw * w;
childs[| fixChild].h = h;
childs[| !fixChild].x = x + childs[| fixChild].w;
childs[| !fixChild].y = y;
childs[| !fixChild].w = w - childs[| fixChild].w;
childs[| !fixChild].h = h;
} else if(split == 1) {
childs[| fixChild].w = w;
childs[| fixChild].h = childs[| fixChild].h / th * h;
childs[| !fixChild].x = x;
childs[| !fixChild].y = y + childs[| fixChild].h;
childs[| !fixChild].w = w;
childs[| !fixChild].h = h - childs[| fixChild].h;
}
for(var i = 0; i < ds_list_size(childs); i++) {
childs[| i].refreshSize();
}
}
refresh();
}
function resize(dw, dh, oppose = ANCHOR.left) {
@ -139,7 +169,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
resetMask();
}
refreshContentSize();
refreshSize();
}
function set(_content) {
@ -153,6 +183,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
if(_w < 0) _w = w + _w;
var _panelParent = new Panel(parent, x, y, w, h);
_panelParent.anchor = anchor;
_panelParent.split = 0;
var _panelL = self;
ds_list_add(_panelParent.childs, _panelL);
@ -185,6 +216,7 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
if(_h < 0) _h = h + _h;
var _panelParent = new Panel(parent, x, y, w, h);
_panelParent.anchor = anchor;
_panelParent.split = 1;
var _panelT = self;
ds_list_add(_panelParent.childs, _panelT);
@ -213,6 +245,8 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
function stepBegin() {
if(content) content.panelStepBegin(self);
if(o_main.panel_dragging != noone) dragging = -1;
if(dragging == 1) {
var _mx = clamp(mouse_mx, ui(16), WIN_W - ui(16));
var dw = _mx - drag_sm;
@ -310,10 +344,19 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
function draw() {
if(content != noone) {
drawPanel();
if(!keyboard_check(ord("W")))
drawPanel();
return;
}
if(keyboard_check(ord("W")) && point_in_rectangle(mouse_mx, mouse_my, x, y, x + w, y + h)) {
draw_set_color(c_lime);
draw_set_alpha(0.1);
draw_rectangle(x + 8, y + 8, x + w - 8, y + h - 8, false);
draw_set_alpha(1);
draw_rectangle(x + 8, y + 8, x + w - 8, y + h - 8, true);
}
if(ds_list_empty(childs))
return;
@ -360,6 +403,11 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
function drawPanel() {
if(w <= ui(16)) return;
var p = ui(8);
var m_in = point_in_rectangle(mouse_mx, mouse_my, x + p, y + p, x + w - p, y + h - p);
var m_ot = point_in_rectangle(mouse_mx, mouse_my, x, y, x + w, y + h);
mouse_active = m_in;
draw_sprite_stretched(THEME.ui_panel_bg, 0, x + padding, y + padding, w - padding * 2, h - padding * 2);
if(!is_surface(mask_surface)) {
@ -384,8 +432,70 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
draw_surface_safe(content_surface, x, y);
if(FOCUS == self)
if(FOCUS == self) {
draw_sprite_stretched_ext(THEME.ui_panel_active, 0, x + padding, y + padding, w - padding * 2, h - padding * 2, COLORS._main_accent, 1);
if(content && !m_in && m_ot && DOUBLE_CLICK) {
content.dragSurface = surface_clone(content_surface);
o_main.panel_dragging = content;
content = noone;
var ind = !ds_list_find_index(parent.childs, self); //index of the other child
var sib = parent.childs[| ind];
if(parent.childs[| ind].content == noone) { //other child is compound panel
var gparent = parent.parent;
var pind = ds_list_find_index(gparent.childs, parent); //index of parent in grandparent object
gparent.childs[| pind] = sib;
gparent.refreshSize();
} else { //other child is content panel, set parent to content panel
parent.set(sib.content);
ds_list_clear(parent.childs);
}
}
}
if(o_main.panel_dragging != noone && m_ot) {
var dx = (mouse_mx - x) / w;
var dy = (mouse_my - y) / h;
var p = ui(8);
draw_set_color(COLORS._main_accent);
o_main.panel_hovering = self;
if(dx + dy > 1) {
if((1 - dx) + dy > 1) {
draw_set_alpha(.4);
draw_roundrect_ext(x + p, y + h / 2 + p, x + w - p, y + h - p, 8, 8, false);
draw_set_alpha(1.);
draw_roundrect_ext(x + p, y + h / 2 + p, x + w - p, y + h - p, 8, 8, true);
o_main.panel_split = 3;
} else {
draw_set_alpha(.4);
draw_roundrect_ext(x + p + w / 2, y + p, x + w - p, y + h - p, 8, 8, false);
draw_set_alpha(1.);
draw_roundrect_ext(x + p + w / 2, y + p, x + w - p, y + h - p, 8, 8, true);
o_main.panel_split = 1;
}
} else {
if((1 - dx) + dy > 1) {
draw_set_alpha(.4);
draw_roundrect_ext(x + p, y + p, x + w / 2 - p, y + h - p, 8, 8, false);
draw_set_alpha(1.);
draw_roundrect_ext(x + p, y + p, x + w / 2 - p, y + h - p, 8, 8, true);
o_main.panel_split = 2;
} else {
draw_set_alpha(.4);
draw_roundrect_ext(x + p, y + p, x + w - p, y + h / 2 - p, 8, 8, false);
draw_set_alpha(1.);
draw_roundrect_ext(x + p, y + p, x + w - p, y + h / 2 - p, 8, 8, true);
o_main.panel_split = 0;
}
}
}
}
function remove() {
@ -406,6 +516,7 @@ function PanelContent() constructor {
draggable = true;
expandable = true;
panel = noone;
mx = 0;
my = 0;
@ -420,6 +531,8 @@ function PanelContent() constructor {
pFOCUS = false;
pHOVER = false;
dragSurface = surface_create(1, 1);
function refresh() {
onResize();
}
@ -438,6 +551,7 @@ function PanelContent() constructor {
}
function onSetPanel(panel) {
self.panel = panel;
setPanelSize(panel);
initSize();
onResize();
@ -458,8 +572,8 @@ function PanelContent() constructor {
function stepBegin() {}
function draw(panel) {
pFOCUS = FOCUS == panel;
pHOVER = HOVER == panel;
pFOCUS = FOCUS == panel && panel.mouse_active;
pHOVER = HOVER == panel && panel.mouse_active;
drawContent(panel);
}

View file

@ -37,6 +37,51 @@
PANEL_COLLECTION = 0;
}
function loadPanelStruct(panel, str) {
if(variable_struct_exists(str, "split")) {
var pan = panel;
if(str.split == "v")
pan = panel.split_v(ui(str.width));
else if(str.split == "h")
pan = panel.split_h(ui(str.width));
if(variable_struct_exists(str, "content")) {
loadPanelStruct(pan[0], str.content[0]);
loadPanelStruct(pan[1], str.content[1]);
}
} else if(variable_struct_exists(str, "content"))
panel.set(getPanelFromName(str.content));
}
function getPanelFromName(name) {
switch(name) {
case "INSPECTOR" : return PANEL_INSPECTOR;
case "ANIMATION" : return PANEL_ANIMATION;
case "PREVIEW" : return PANEL_PREVIEW;
case "GRAPH" : return PANEL_GRAPH;
}
return noone;
}
function loadPanel(path, panel) {
var f = json_load_struct(path);
loadPanelStruct(panel, f.panel);
if(PREF_MAP[? "panel_collection"]) {
var pan = getPanelFromName(f.collection.parent);
var p;
if(f.collection.split == "v")
p = pan.panel.split_v(ui(f.collection.width));
else if(f.collection.split == "h")
p = pan.panel.split_h(ui(f.collection.width));
p[0].set(PANEL_COLLECTION);
p[1].set(pan);
}
}
function setPanel() {
PANEL_MAIN = new Panel(noone, ui(2), ui(2), WIN_SW - ui(4), WIN_SH - ui(4));
@ -50,45 +95,8 @@
var split_menu = PANEL_MAIN.split_v(ui(40));
split_menu[0].set(PANEL_MENU);
var split_ins = split_menu[1].split_h(ui(-400));
split_ins[1].set(PANEL_INSPECTOR);
switch(PREF_MAP[? "panel_layout"]) {
case 0 :
var split_anim = split_ins[0].split_v(ui(-48));
split_anim[1].set(PANEL_ANIMATION);
var split_prev = split_anim[0].split_v(ui(-500));
if(split_prev == noone) break;
split_prev[0].set(PANEL_PREVIEW);
split_prev[1].set(PANEL_GRAPH);
if(PREF_MAP[? "panel_collection"]) {
var pane = split_prev[1].split_h(ui(460));
if(pane == noone) break;
pane[1].set(PANEL_GRAPH);
pane[0].set(PANEL_COLLECTION);
}
break;
case 1 :
var split_anim = split_ins[0].split_v(ui(-300));
split_anim[1].set(PANEL_ANIMATION);
var split_prev = split_anim[0].split_h(ui(400));
if(split_prev == noone) break;
split_prev[0].set(PANEL_PREVIEW);
split_prev[1].set(PANEL_GRAPH);
if(PREF_MAP[? "panel_collection"]) {
var pane = split_anim[1].split_h(ui(500));
if(pane == noone) break;
pane[1].set(PANEL_ANIMATION);
pane[0].set(PANEL_COLLECTION);
}
break;
}
zip_unzip("data/layouts.zip", DIRECTORY);
loadPanel(DIRECTORY + "layouts/" + PREF_MAP[? "panel_layout_file"] + ".json", split_menu[1]);
PANEL_ANIMATION.updatePropertyList();
PANEL_MAIN.refresh();
@ -111,6 +119,57 @@
return _res;
}
function panelInit() {
panel_dragging = noone;
panel_hovering = noone;
panel_split = 0;
}
function panelDraw() {
if(panel_dragging) {
draw_surface_ext(panel_dragging.dragSurface, mouse_mx + 8, mouse_my + 8, 0.5, 0.5, 0, c_white, 0.5);
if(mouse_release(mb_left)) {
var p = [];
var c = panel_hovering.content;
panel_hovering.content = noone;
switch(panel_split) {
case 0 : p = panel_hovering.split_v( panel_hovering.h / 2); break;
case 1 : p = panel_hovering.split_h( panel_hovering.w / 2); break;
case 2 : p = panel_hovering.split_h( panel_hovering.w / 2); break;
case 3 : p = panel_hovering.split_v( panel_hovering.h / 2); break;
}
p[(panel_split + 1) % 2].set(c);
p[(panel_split + 0) % 2].set(panel_dragging);
panel_hovering.refreshSize();
panel_hovering = noone;
panel_dragging = noone;
}
}
}
function panelSerialize() {
var cont = _panelSerialize(PANEL_MAIN);
print(json_stringify(cont, true));
}
function _panelSerialize(panel) {
var cont = {};
cont.content = panel.content == noone? noone : instanceof(panel.content);
cont.split = panel.split;
cont.child = [];
for( var i = 0; i < ds_list_size(panel.childs); i++ )
cont.child[i] = _panelSerialize(panel.childs[| i]);
return cont;
}
#endregion
#region fullscreen

View file

@ -22,6 +22,8 @@ function Panel_Inspector() : PanelContent() constructor {
keyframe_drag_st = 0;
anim_toggling = false;
anim_hold = noone;
visi_hold = noone;
min_w = ui(160);
lineBreak = true;
@ -33,12 +35,12 @@ function Panel_Inspector() : PanelContent() constructor {
tb_prop_filter = new textBox(TEXTBOX_INPUT.text, function(txt) {
filter_text = txt;
})
tb_prop_filter.no_empty = false;
tb_prop_filter.auto_update = true;
tb_prop_filter.font = f_p0;
tb_prop_filter.color = COLORS._main_text_sub;
tb_prop_filter.align = fa_center;
tb_prop_filter.hide = true;
tb_prop_filter.no_empty = false;
tb_prop_filter.auto_update = true;
tb_prop_filter.font = f_p0;
tb_prop_filter.color = COLORS._main_text_sub;
tb_prop_filter.align = fa_center;
tb_prop_filter.hide = true;
filter_text = "";
current_meta = -1;
@ -287,6 +289,9 @@ function Panel_Inspector() : PanelContent() constructor {
var index = jun.value_from == noone? jun.animator.is_anim : 2;
draw_sprite_ui_uniform(THEME.animate_clock, index, butx, lb_y, 1,, 0.8);
if(_hover && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
if(anim_hold != noone)
jun.animator.is_anim = anim_hold;
draw_sprite_ui_uniform(THEME.animate_clock, index, butx, lb_y, 1,, 1);
TOOLTIP = jun.value_from == noone? get_text("panel_inspector_toggle_anim", "Toggle animation") : get_text("panel_inspector_remove_link", "Remove link");
@ -296,12 +301,16 @@ function Panel_Inspector() : PanelContent() constructor {
else {
recordAction(ACTION_TYPE.var_modify, jun.animator, [ jun.animator.is_anim, "is_anim", jun.name + " animation" ]);
jun.animator.is_anim = !jun.animator.is_anim;
anim_hold = jun.animator.is_anim;
}
PANEL_ANIMATION.updatePropertyList();
}
}
}
if(anim_hold != noone && mouse_release(mb_left))
anim_hold = noone;
butx += ui(20);
if(!global_var) {
if(jun.global_use) {
@ -310,16 +319,24 @@ function Panel_Inspector() : PanelContent() constructor {
index = jun.visible;
draw_sprite_ui_uniform(THEME.junc_visible, index, butx, lb_y, 1,, 0.8);
if(_hover && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
if(visi_hold != noone)
jun.visible = visi_hold;
draw_sprite_ui_uniform(THEME.junc_visible, index, butx, lb_y, 1,, 1);
TOOLTIP = get_text("visibility", "Visibility");
if(mouse_press(mb_left, pFOCUS))
if(mouse_press(mb_left, pFOCUS)) {
jun.visible = !jun.visible;
visi_hold = jun.visible;
}
}
}
} else
draw_sprite_ui_uniform(THEME.node_use_global, 0, butx, lb_y, 1,, 0.8);
if(visi_hold != noone && mouse_release(mb_left))
visi_hold = noone;
var cc = COLORS._main_text;
if(jun.global_use)
cc = GLOBAL.inputGetable(jun, jun.global_key)? COLORS._main_value_positive : COLORS._main_value_negative;

View file

@ -140,10 +140,25 @@ function Panel_Menu() : PanelContent() constructor {
}),
]],
[ get_text("panel_menu_panels", "Panels"), [
menuItemGroup(get_text("panel_menu_workspace", "Workspace"), [
[ THEME.workspace_horizontal, function() { clearPanel(); PREF_MAP[? "panel_layout"] = 0; setPanel(); PREF_SAVE(); } ],
[ THEME.workspace_vertical, function() { clearPanel(); PREF_MAP[? "panel_layout"] = 1; setPanel(); PREF_SAVE(); } ]
]),
menuItem(get_text("panel_menu_workspace", "Workspace"), function(_x, _y, _depth) {
var arr = [], lays = [];
var f = file_find_first(DIRECTORY + "layouts/*", 0);
while(f != "") {
array_push(lays, filename_name_only(f));
f = file_find_next();
}
for(var i = 0; i < array_length(lays); i++) {
array_push(arr, menuItem(lays[i],
function(_x, _y, _depth, _path) {
PREF_MAP[? "panel_layout_file"] = _path;
PREF_SAVE();
setPanel();
}));
}
return submenuCall(_x, _y, _depth, arr);
}).setIsShelf(),
-1,
menuItem(get_text("panel_menu_collections", "Collections"), function() {
clearPanel();

View file

@ -48,10 +48,12 @@ function Panel_Preview() : PanelContent() constructor {
grid_opacity = 0.5;
grid_color = COLORS.panel_preview_grid;
tool_index = -1;
tool_sub_index = 0;
tool_x = 0;
tool_x_to = 0;
tool_x_max = 0;
tool_current = noone;
right_menu_y = 8;
right_menu_y = 8;
mouse_on_preview = false;
resetViewOnDoubleClick = true;
@ -242,7 +244,7 @@ function Panel_Preview() : PanelContent() constructor {
}
}
canvas_hover = true;
canvas_hover = point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height);
}
function fullView() {
@ -272,7 +274,7 @@ function Panel_Preview() : PanelContent() constructor {
var node = getNodePreview();
if(node == noone) return;
node.preview_channel = sbChannelIndex[index];
node.preview_channel = array_safe_get(sbChannelIndex, index);
});
sbChannelIndex = [];
@ -285,9 +287,10 @@ function Panel_Preview() : PanelContent() constructor {
var chName = [];
sbChannelIndex = [];
var ww = ui(96);
var hh = toolbar_height - ui(12);
var currName = _node.outputs[| _node.preview_channel].name;
draw_set_text(f_p0, fa_center, fa_center);
var ww = clamp(w - ui(240), string_width(currName) + ui(48), ui(200));
var hh = toolbar_height - ui(12);
for( var i = 0; i < ds_list_size(_node.outputs); i++ ) {
if(_node.outputs[| i].type != VALUE_TYPE.surface) continue;
@ -300,7 +303,7 @@ function Panel_Preview() : PanelContent() constructor {
sbChannel.hover = pHOVER;
sbChannel.active = pFOCUS;
sbChannel.draw(_x - ww, _y - hh / 2, ww, hh, _node.outputs[| _node.preview_channel].name, [mx, my], x, y);
sbChannel.draw(_x - ww, _y - hh / 2, ww, hh, currName, [mx, my], x, y);
right_menu_y += ui(40);
}
@ -461,7 +464,7 @@ function Panel_Preview() : PanelContent() constructor {
}
function drawPreviewOverlay() {
right_menu_y = ui(32);
right_menu_y = toolbar_height - ui(4);
draw_set_text(f_p0, fa_right, fa_top, fps >= ANIMATOR.framerate? COLORS._main_text_sub : COLORS._main_value_negative);
draw_text(w - ui(8), right_menu_y, "fps " + string(fps));
right_menu_y += string_height("l");
@ -493,7 +496,7 @@ function Panel_Preview() : PanelContent() constructor {
var prev_size = ui(48);
preview_x = lerp_float(preview_x, preview_x_to, 4);
if(pHOVER && my > h - toolbar_height - prev_size - ui(16)) {
if(pHOVER && my > h - toolbar_height - prev_size - ui(16) && my > toolbar_height) {
canvas_hover = false;
if(mouse_wheel_down()) preview_x_to = clamp(preview_x_to - prev_size, - preview_x_max, 0);
@ -587,7 +590,11 @@ function Panel_Preview() : PanelContent() constructor {
_sny = grid_height;
}
_node.drawOverlay(active && isHover && !key_mod_press(CTRL), cx, cy, canvas_s, _mx, _my, _snx, _sny);
var overlayHover = active && isHover && point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height);
if(_node.tools != -1)
overlayHover &= mx > ui(48);
_node.drawOverlay(overlayHover && !key_mod_press(CTRL), cx, cy, canvas_s, _mx, _my, _snx, _sny);
if(_node.tools != -1) {
var xx = ui(8);
@ -595,43 +602,31 @@ function Panel_Preview() : PanelContent() constructor {
for(var i = 0; i < array_length(_node.tools); i++) {
var b = buttonInstant(THEME.button, xx, yy, ui(40), ui(40), [_mx, _my], pFOCUS, isHover);
var toggle = false;
if(b == 1)
TOOLTIP = _node.tools[i][0];
else if(b == 2)
toggle = true;
var tool = _node.tools[i];
if(b == 1) {
TOOLTIP = tool.name;
mouse_on_preview = false;
} if(b == 2)
tool.toggle();
if(pFOCUS && keyboard_check_pressed(ord(string(i + 1))))
toggle = true;
tool.toggle();
if(toggle) {
if(is_array(_node.tools[i][1])) {
if(tool_index == i) {
tool_sub_index++;
if(tool_sub_index >= array_length(_node.tools[i][1])) {
tool_index = -1;
tool_sub_index = 0;
}
} else
tool_index = i;
} else
tool_index = tool_index == i? -1 : i;
}
if(tool_index == i)
if(tool_current == tool)
draw_sprite_stretched(THEME.button, 2, xx, yy, ui(40), ui(40));
if(is_array(_node.tools[i][1])) {
var _ind = safe_mod(tool_sub_index, array_length(_node.tools[i][1]));
draw_sprite_ui_uniform(_node.tools[i][1][_ind], 0, xx + ui(20), yy + ui(20));
} else
draw_sprite_ui_uniform(_node.tools[i][1], 0, xx + ui(20), yy + ui(20));
if(tool.subtools > 0)
draw_sprite_ui_uniform(tool.spr[tool.selecting], 0, xx + ui(20), yy + ui(20));
else
draw_sprite_ui_uniform(tool.spr, 0, xx + ui(20), yy + ui(20));
yy += ui(48);
}
}
} else
tool_current = noone;
}
function drawToolBar() {
function drawToolBar(_node) {
toolbar_height = ui(40);
var ty = h - toolbar_height;
//draw_sprite_stretched_ext(THEME.toolbar_shadow, 0, 0, ty - 12 + 4, w, 12, c_white, 0.5);
@ -639,36 +634,89 @@ function Panel_Preview() : PanelContent() constructor {
var scHeight = ui(32);
draw_set_color(COLORS.panel_toolbar_fill);
draw_set_alpha(0.5);
draw_rectangle(0, 0, w, scHeight, false);
draw_set_alpha(1);
var cx = ui(10);
var cy = ui(10);
var cw = ui(32);
var ch = scHeight - ui(16);
if(sample_color != noone) {
draw_set_color(sample_color);
draw_rectangle(cx, cy, cx + cw, cy + ch, false);
}
draw_set_color(COLORS.panel_toolbar_outline);
draw_rectangle(cx, cy, cx + cw, cy + ch, true);
draw_line(0, scHeight, w, scHeight);
if(sample_color != noone) {
var tx = cx + cw + ui(16);
var hx = color_get_hex(sample_color);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text(tx, cy + ch / 2, hx);
if(tool_current != noone) { //tool settings
var settings = PANEL_GRAPH.node_focus.tool_settings;
var len = array_length(settings);
for( var i = 0; i < array_length(tool_current.settings); i++ )
settings[len + i] = tool_current.settings[i];
tx += string_width(hx) + ui(8);
draw_set_color(COLORS._main_text_sub);
draw_text(tx, cy + ch / 2, "(" + string(color_get_alpha(sample_color)) + ")");
}
tool_x = lerp_float(tool_x, tool_x_to, 5);
var tolx = tool_x + ui(16);
var toly = ui(8);
var tolw = ui(64);
var tolh = toolbar_height - ui(20);
var tol_max_w = ui(32);
if(sample_x != noone) {
draw_set_text(f_p0, fa_right, fa_center, COLORS._main_text_sub);
draw_text(w - ui(10), cy + ch / 2, "[" + string(sample_x) + ", " + string(sample_y) + "]");
for( var i = 0; i < array_length(settings); i++ ) {
var sett = settings[i];
var nme = sett[0];
var wdg = sett[1];
var key = sett[2];
var atr = sett[3];
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_sub);
draw_text(tolx, toolbar_height / 2 - ui(2), nme);
tolx += string_width(nme) + ui(8);
tol_max_w += string_width(nme) + ui(8);
wdg.setActiveFocus(pFOCUS, pHOVER);
switch(instanceof(wdg)) {
case "textBox" :
wdg.draw(tolx, toly, tolw, tolh, atr[$ key], [ mx, my ]);
break;
case "checkBoxGroup" :
tolw = tolh * wdg.size;
wdg.draw(tolx, toly, atr[$ key], [ mx, my ], tolh);
break;
case "checkBox" :
tolw = tolh;
wdg.draw(tolx, toly, atr[$ key], [ mx, my ], tolh);
break;
}
tolx += tolw + ui(16);
tol_max_w += tolw + ui(16);
}
tol_max_w = max(0, tol_max_w - w);
if(point_in_rectangle(mx, my, 0, 0, w, toolbar_height)) {
if(mouse_wheel_up()) tool_x_to = clamp(tool_x_to + ui(64), -tol_max_w, 0);
if(mouse_wheel_down()) tool_x_to = clamp(tool_x_to - ui(64), -tol_max_w, 0);
}
} else { //color sampler
var cx = ui(10);
var cy = ui(10);
var cw = ui(32);
var ch = scHeight - ui(16);
if(sample_color != noone) {
draw_set_color(sample_color);
draw_rectangle(cx, cy, cx + cw, cy + ch, false);
}
draw_set_color(COLORS.panel_toolbar_outline);
draw_rectangle(cx, cy, cx + cw, cy + ch, true);
if(sample_color != noone) {
var tx = cx + cw + ui(16);
var hx = color_get_hex(sample_color);
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
draw_text(tx, cy + ch / 2, hx);
tx += string_width(hx) + ui(8);
draw_set_color(COLORS._main_text_sub);
draw_text(tx, cy + ch / 2, "(" + string(color_get_alpha(sample_color)) + ")");
}
if(sample_x != noone) {
draw_set_text(f_p0, fa_right, fa_center, COLORS._main_text_sub);
draw_text(w - ui(10), cy + ch / 2, "[" + string(sample_x) + ", " + string(sample_y) + "]");
}
}
draw_set_color(COLORS.panel_toolbar_fill);
@ -772,7 +820,7 @@ function Panel_Preview() : PanelContent() constructor {
}
function drawContent(panel) {
mouse_on_preview = pHOVER && point_in_rectangle(mx, my, 0, 0, w, h - toolbar_height);
mouse_on_preview = pHOVER && point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height);
draw_clear(COLORS.panel_bg_clear);
if(canvas_bg == -1) {
@ -790,7 +838,7 @@ function Panel_Preview() : PanelContent() constructor {
drawNodeTools(pFOCUS, PANEL_GRAPH.node_focus);
if(last_focus != PANEL_GRAPH.node_focus) {
last_focus = PANEL_GRAPH.node_focus;
tool_index = -1;
tool_current = noone;
}
if(do_fullView) {
@ -798,7 +846,7 @@ function Panel_Preview() : PanelContent() constructor {
fullView();
}
if(my < h - toolbar_height && mouse_press(mb_right, pFOCUS)) {
if(mouse_on_preview && mouse_press(mb_right, pFOCUS)) {
menuCall(,, [
menuItem(get_text("panel_graph_preview_window", "Send to preview window"), function() { previewWindow(getNodePreview()); }, noone, ["Preview", "Preview window"]),
-1,
@ -811,7 +859,7 @@ function Panel_Preview() : PanelContent() constructor {
}
drawSplitView();
drawToolBar();
drawToolBar(PANEL_GRAPH.node_focus);
}
function saveCurrentFrame() {

View file

@ -29,8 +29,8 @@
PREF_MAP[? "default_surface_side"] = 32;
PREF_MAP[? "panel_layout"] = 1;
PREF_MAP[? "panel_collection"] = true;
PREF_MAP[? "panel_layout_file"] = "Vertical";
PREF_MAP[? "panel_collection"] = true;
PREF_MAP[? "inspector_line_break_width"] = 500;

View file

@ -1,3 +1,6 @@
globalvar SAVING;
SAVING = false;
function NEW() {
if(MODIFIED && !READONLY) {
var dia = dialogCall(o_dialog_load);
@ -28,9 +31,9 @@ function save_serialize() {
repeat(ds_map_size(NODE_MAP)) {
var _node = NODE_MAP[? _key];
if(_node.active) {
if(_node.active)
ds_list_add_map(_node_list, _node.serialize());
}
_key = ds_map_find_next(NODE_MAP, _key);
}
@ -104,12 +107,15 @@ function SAVE_AS() {
function SAVE_AT(path, log = "save at ") {
if(DEMO) return false;
SAVING = true;
if(file_exists(path))
file_delete(path);
var file = file_text_open_write(path);
file_text_write_string(file, save_serialize());
file_text_close(file);
SAVING = false;
READONLY = false;
MODIFIED = false;
@ -153,7 +159,7 @@ function SAVE_COLLECTIONS(_list, _path, save_surface = true, metadata = noone) {
file_text_close(file);
ds_map_destroy(_map);
var pane = findPanel(Panel_Collection, PANEL_MAIN, noone);
var pane = findPanel("Panel_Collection", PANEL_MAIN, noone);
if(pane) pane.refreshContext();
log_message("COLLECTION", "save collection at " + _path, THEME.noti_icon_file_save);
@ -184,7 +190,7 @@ function SAVE_COLLECTION(_node, _path, save_surface = true, metadata = noone) {
file_text_close(file);
ds_map_destroy(_map);
var pane = findPanel(Panel_Collection, PANEL_MAIN, noone);
var pane = findPanel("Panel_Collection", PANEL_MAIN, noone);
if(pane) pane.refreshContext();
log_message("COLLECTION", "save collection at " + _path, THEME.noti_icon_file_save);

View file

@ -1,135 +1,23 @@
#region evaluator
function functionTree(_val, _child) constructor {
val = _val;
child = _child;
function eval(_x, _n) {
switch(val) {
case "+" : if(array_length(child) >= 2) return child[0].eval(_x, _n) + child[1].eval(_x, _n);
case "-" : if(array_length(child) >= 2) return child[0].eval(_x, _n) - child[1].eval(_x, _n);
case "*" : if(array_length(child) >= 2) return child[0].eval(_x, _n) * child[1].eval(_x, _n);
case "/" : if(array_length(child) >= 2) return child[0].eval(_x, _n) / child[1].eval(_x, _n);
case "sin" : if(array_length(child) >= 1) return sin(child[0].eval(_x, _n));
case "cos" : if(array_length(child) >= 1) return cos(child[0].eval(_x, _n));
case "tan" : if(array_length(child) >= 1) return tan(child[0].eval(_x, _n));
case "pi" : return pi;
case "x" :
case "t" : return _x;
case "n" : return _n;
default : return toNumber(val);
}
return 0;
}
}
function buildTree(_op, vl) {
var ch = [];
switch(_op) {
case "+":
case "-":
case "*":
case "/":
if(ds_stack_size(vl) >= 2) ch = [ds_stack_pop(vl), ds_stack_pop(vl)]; break;
case "sin":
case "cos":
case "tan":
if(ds_stack_size(vl) >= 1) ch = [ds_stack_pop(vl)]; break;
}
return new functionTree(_op, ch);
}
function functionGraph(fx) {
static pres = ds_map_create();
pres[? "+"] = 1;
pres[? "-"] = 1;
pres[? "*"] = 2;
pres[? "/"] = 2;
pres[? "sin"] = 5;
pres[? "cos"] = 5;
pres[? "tan"] = 5;
var vl = ds_stack_create();
var op = ds_stack_create();
fx = string_replace_all(fx, " ", "");
var len = string_length(fx);
var l = 1;
var ch, cch;
while(l <= len) {
ch = string_char_at(fx, l);
if(ds_map_exists(pres, ch)) {
if(ds_stack_empty(op)) ds_stack_push(op, ch);
else {
if(pres[? ch] > pres[? ds_stack_top(op)] || ds_stack_top(op) == "(") ds_stack_push(op, ch);
else {
while(pres[? ch] <= pres[? ds_stack_top(op)] && !ds_stack_empty(op)) {
ds_stack_push(vl, buildTree(ds_stack_pop(op), vl));
}
ds_stack_push(op, ch);
}
}
l++;
} else if (ch == "(") {
ds_stack_push(op, ch);
l++;
} else if (ch == ")") {
while(ds_stack_top(op) != "(" && !ds_stack_empty(op)) {
ds_stack_push(vl, buildTree(ds_stack_pop(op), vl));
}
ds_stack_pop(op);
l++;
} else {
var vsl = "";
while(l <= len) {
cch = string_char_at(fx, l);
if(ds_map_exists(pres, cch) || cch == ")" || cch == "(") break;
vsl += cch;
l++;
}
if(ds_map_exists(pres, vsl)) {
ds_stack_push(op, vsl);
} else {
ds_stack_push(vl, new functionTree(vsl, []));
}
}
}
while(!ds_stack_empty(op)) {
ds_stack_push(vl, buildTree(ds_stack_pop(op), vl));
}
ds_stack_destroy(op);
return ds_stack_empty(vl)? new functionTree("", []) : ds_stack_pop(vl);
}
function evaluateFunction(fx, params = {}) {
static pres = ds_map_create();
pres[? "+"] = 1;
pres[? "-"] = 1;
pres[? "*"] = 2;
pres[? "/"] = 2;
pres[? "^"] = 3;
pres[? "sin"] = 5;
pres[? "cos"] = 5;
pres[? "tan"] = 5;
pres[? "+"] = 1;
pres[? "-"] = 1;
pres[? "*"] = 2;
pres[? "/"] = 2;
pres[? "^"] = 3;
pres[? "sin"] = 5;
pres[? "cos"] = 5;
pres[? "tan"] = 5;
pres[? "abs"] = 5;
pres[? "round"] = 5;
pres[? "ceil"] = 5;
pres[? "floor"] = 5;
var vl = ds_stack_create();
var op = ds_stack_create();
fx = string_replace_all(fx, " ", "");
fx = string_replace_all(fx, " ", "");
fx = string_replace_all(fx, "\n", "");
var len = string_length(fx);
@ -203,28 +91,35 @@
function evalToken(operator, vl) {
if(ds_stack_empty(vl)) return 0;
switch(operator) {
case "+": if(ds_stack_size(vl) >= 2) return ds_stack_pop(vl) + ds_stack_pop(vl);
case "+":
if(ds_stack_size(vl) >= 2)
return ds_stack_pop(vl) + ds_stack_pop(vl);
case "-":
if(ds_stack_size(vl) >= 2) return -ds_stack_pop(vl) + ds_stack_pop(vl);
else return -ds_stack_pop(vl);
case "*": if(ds_stack_size(vl) >= 2) return ds_stack_pop(vl) * ds_stack_pop(vl);
if(ds_stack_size(vl) >= 2)
return -ds_stack_pop(vl) + ds_stack_pop(vl);
else
return -ds_stack_pop(vl);
case "*":
if(ds_stack_size(vl) >= 2)
return ds_stack_pop(vl) * ds_stack_pop(vl);
case "^":
if(ds_stack_size(vl) >= 2) {
var ex = ds_stack_pop(vl);
var bs = ds_stack_pop(vl);
return power(bs, ex);
}
return 1;
if(ds_stack_size(vl) < 2) return 1;
var ex = ds_stack_pop(vl);
var bs = ds_stack_pop(vl);
return power(bs, ex);
case "/":
if(ds_stack_size(vl) >= 2) {
var _d = ds_stack_pop(vl);
if(_d == 0) return 0;
return ds_stack_pop(vl) / _d;
}
if(ds_stack_size(vl) < 2) return 0;
var _d = ds_stack_pop(vl);
if(_d == 0) return 0;
return ds_stack_pop(vl) / _d;
case "sin": if(ds_stack_size(vl) >= 1) return sin(ds_stack_pop(vl));
case "cos": if(ds_stack_size(vl) >= 1) return cos(ds_stack_pop(vl));
case "tan": if(ds_stack_size(vl) >= 1) return tan(ds_stack_pop(vl));
case "sin" : if(ds_stack_size(vl) >= 1) return sin(ds_stack_pop(vl));
case "cos" : if(ds_stack_size(vl) >= 1) return cos(ds_stack_pop(vl));
case "tan" : if(ds_stack_size(vl) >= 1) return tan(ds_stack_pop(vl));
case "abs" : if(ds_stack_size(vl) >= 1) return abs(ds_stack_pop(vl));
case "round" : if(ds_stack_size(vl) >= 1) return round(ds_stack_pop(vl));
case "ceil" : if(ds_stack_size(vl) >= 1) return ceil(ds_stack_pop(vl));
case "floor" : if(ds_stack_size(vl) >= 1) return floor(ds_stack_pop(vl));
}
return 0;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_path_plot",
"bbox_bottom": 63,
"bbox_left": 0,
"bbox_right": 63,
"bbox_top": 0,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
"DynamicTexturePage": false,
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"de0af11e-1d94-4bd9-9b0a-8833941278ec",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"69c59eab-237b-41cf-98fc-4be54acb2022","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "path",
"path": "folders/nodes/icons/value/path.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_path_plot",
"autoRecord": true,
"backdropHeight": 768,
"backdropImageOpacity": 0.5,
"backdropImagePath": "",
"backdropWidth": 1366,
"backdropXOffset": 0.0,
"backdropYOffset": 0.0,
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"eventStubScript": null,
"eventToFunction": {},
"length": 1.0,
"lockOrigin": false,
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"playback": 1,
"playbackSpeed": 30.0,
"playbackSpeedType": 0,
"showBackdrop": true,
"showBackdropImage": false,
"timeUnits": 1,
"tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"de0af11e-1d94-4bd9-9b0a-8833941278ec","path":"sprites/s_node_path_plot/s_node_path_plot.yy",},},},"Disabled":false,"id":"fb0facfe-f4d5-4842-94c9-a5d52c64eaa3","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange": null,
"volume": 1.0,
"xorigin": 32,
"yorigin": 32,
},
"swatchColours": null,
"swfPrecision": 2.525,
"textureGroupId": {
"name": "Default",
"path": "texturegroups/Default",
},
"type": 0,
"VTile": false,
"width": 64,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_struct",
"bbox_bottom": 54,
"bbox_left": 9,
"bbox_right": 54,
"bbox_top": 9,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
"DynamicTexturePage": false,
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"92e3047d-c017-4c22-858a-35e9128230f6",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"fe357525-346e-4f34-b0ce-d4c2058c7edf","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "struct",
"path": "folders/nodes/icons/value/struct.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_struct",
"autoRecord": true,
"backdropHeight": 768,
"backdropImageOpacity": 0.5,
"backdropImagePath": "",
"backdropWidth": 1366,
"backdropXOffset": 0.0,
"backdropYOffset": 0.0,
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"eventStubScript": null,
"eventToFunction": {},
"length": 1.0,
"lockOrigin": false,
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"playback": 1,
"playbackSpeed": 30.0,
"playbackSpeedType": 0,
"showBackdrop": true,
"showBackdropImage": false,
"timeUnits": 1,
"tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"92e3047d-c017-4c22-858a-35e9128230f6","path":"sprites/s_node_struct/s_node_struct.yy",},},},"Disabled":false,"id":"58955283-59b2-4fbc-82ac-1d9b854e1e6f","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange": null,
"volume": 1.0,
"xorigin": 32,
"yorigin": 32,
},
"swatchColours": null,
"swfPrecision": 2.525,
"textureGroupId": {
"name": "Default",
"path": "texturegroups/Default",
},
"type": 0,
"VTile": false,
"width": 64,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_struct_get",
"bbox_bottom": 58,
"bbox_left": 14,
"bbox_right": 49,
"bbox_top": 4,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
"DynamicTexturePage": false,
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"784c8eb7-83ea-4521-bbe5-159b7bb3f6a2",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"2ea8fede-d145-4b30-89b0-fc4d3a68d58a","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "struct",
"path": "folders/nodes/icons/value/struct.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_struct_get",
"autoRecord": true,
"backdropHeight": 768,
"backdropImageOpacity": 0.5,
"backdropImagePath": "",
"backdropWidth": 1366,
"backdropXOffset": 0.0,
"backdropYOffset": 0.0,
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"eventStubScript": null,
"eventToFunction": {},
"length": 1.0,
"lockOrigin": false,
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"playback": 1,
"playbackSpeed": 30.0,
"playbackSpeedType": 0,
"showBackdrop": true,
"showBackdropImage": false,
"timeUnits": 1,
"tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"784c8eb7-83ea-4521-bbe5-159b7bb3f6a2","path":"sprites/s_node_struct_get/s_node_struct_get.yy",},},},"Disabled":false,"id":"20eb57ef-1462-4db3-9f8b-a20b8bdd679a","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange": null,
"volume": 1.0,
"xorigin": 32,
"yorigin": 32,
},
"swatchColours": null,
"swfPrecision": 2.525,
"textureGroupId": {
"name": "Default",
"path": "texturegroups/Default",
},
"type": 0,
"VTile": false,
"width": 64,
}