mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 11:28:06 +01:00
1.14pr6
This commit is contained in:
parent
c1d13aec4d
commit
4b37dfb82e
109 changed files with 1526 additions and 540 deletions
|
@ -50,6 +50,7 @@
|
|||
{"name":"string","order":4,"path":"folders/functions/string.yy",},
|
||||
{"name":"surface","order":8,"path":"folders/functions/surface.yy",},
|
||||
{"name":"test","order":23,"path":"folders/functions/test.yy",},
|
||||
{"name":"tween","order":33,"path":"folders/functions/tween.yy",},
|
||||
{"name":"value","order":1,"path":"folders/functions/value.yy",},
|
||||
{"name":"vector","order":3,"path":"folders/functions/vector.yy",},
|
||||
{"name":"window","order":29,"path":"folders/functions/window.yy",},
|
||||
|
@ -84,6 +85,7 @@
|
|||
{"name":"value","order":3,"path":"folders/nodes/data/value.yy",},
|
||||
{"name":"mesh","order":7,"path":"folders/nodes/data/value/mesh.yy",},
|
||||
{"name":"struct","order":6,"path":"folders/nodes/data/value/struct.yy",},
|
||||
{"name":"trigger","order":8,"path":"folders/nodes/data/value/trigger.yy",},
|
||||
{"name":"VFX","order":13,"path":"folders/nodes/data/VFX.yy",},
|
||||
{"name":"icons","order":6,"path":"folders/nodes/icons.yy",},
|
||||
{"name":"3D","order":133,"path":"folders/nodes/icons/3D.yy",},
|
||||
|
@ -132,12 +134,11 @@
|
|||
{"name":"misc","order":50,"path":"folders/shader/misc.yy",},
|
||||
{"name":"shape seperator","order":35,"path":"folders/shader/shape seperator.yy",},
|
||||
{"name":"sprites","order":20,"path":"folders/shader/sprites.yy",},
|
||||
{"name":"transition","order":52,"path":"folders/shader/transition.yy",},
|
||||
{"name":"warp","order":41,"path":"folders/shader/warp.yy",},
|
||||
{"name":"sprites","order":12,"path":"folders/sprites.yy",},
|
||||
{"name":"gameframe","order":2,"path":"folders/sprites/gameframe.yy",},
|
||||
{"name":"widgets","order":5,"path":"folders/widgets.yy",},
|
||||
{"name":"transition","order":52,"path":"folders/shader/transition.yy",},
|
||||
{"name":"tween","order":33,"path":"folders/functions/tween.yy",},
|
||||
],
|
||||
"ResourceOrderSettings": [
|
||||
{"name":"s_node_corner","order":14,"path":"sprites/s_node_corner/s_node_corner.yy",},
|
||||
|
@ -649,6 +650,7 @@
|
|||
{"name":"point_rect_overlap","order":2,"path":"scripts/point_rect_overlap/point_rect_overlap.yy",},
|
||||
{"name":"s_node_bevel","order":4,"path":"sprites/s_node_bevel/s_node_bevel.yy",},
|
||||
{"name":"color_selector","order":4,"path":"scripts/color_selector/color_selector.yy",},
|
||||
{"name":"node_trigger_bool","order":1,"path":"scripts/node_trigger_bool/node_trigger_bool.yy",},
|
||||
{"name":"s_node_strandSim_gravity","order":4,"path":"sprites/s_node_strandSim_gravity/s_node_strandSim_gravity.yy",},
|
||||
{"name":"node_VFX_effect_turbulence","order":11,"path":"scripts/node_VFX_effect_turbulence/node_VFX_effect_turbulence.yy",},
|
||||
{"name":"node_ase_file_read","order":14,"path":"scripts/node_ase_file_read/node_ase_file_read.yy",},
|
||||
|
@ -809,6 +811,7 @@
|
|||
{"name":"sh_fd_visualize_pixel_art_fire_glsl","order":15,"path":"shaders/sh_fd_visualize_pixel_art_fire_glsl/sh_fd_visualize_pixel_art_fire_glsl.yy",},
|
||||
{"name":"struct_functions","order":4,"path":"scripts/struct_functions/struct_functions.yy",},
|
||||
{"name":"sh_content_sampler","order":1,"path":"shaders/sh_content_sampler/sh_content_sampler.yy",},
|
||||
{"name":"s_node_trigger","order":3,"path":"sprites/s_node_trigger/s_node_trigger.yy",},
|
||||
{"name":"fd_rectangle_get_repeat","order":19,"path":"scripts/fd_rectangle_get_repeat/fd_rectangle_get_repeat.yy",},
|
||||
{"name":"s_menu_white","order":1,"path":"sprites/s_menu_white/s_menu_white.yy",},
|
||||
{"name":"color_loader","order":13,"path":"scripts/color_loader/color_loader.yy",},
|
||||
|
@ -934,6 +937,7 @@
|
|||
{"name":"sh_grid_noise","order":8,"path":"shaders/sh_grid_noise/sh_grid_noise.yy",},
|
||||
{"name":"draw_set_blend_mode","order":1,"path":"scripts/draw_set_blend_mode/draw_set_blend_mode.yy",},
|
||||
{"name":"gameframe_macros","order":1,"path":"scripts/gameframe_macros/gameframe_macros.yy",},
|
||||
{"name":"s_node_trigger_bool","order":4,"path":"sprites/s_node_trigger_bool/s_node_trigger_bool.yy",},
|
||||
{"name":"panel_color","order":1,"path":"scripts/panel_color/panel_color.yy",},
|
||||
{"name":"s_node_line","order":7,"path":"sprites/s_node_line/s_node_line.yy",},
|
||||
{"name":"fd_rectangle_get_material_dissipation_value","order":9,"path":"scripts/fd_rectangle_get_material_dissipation_value/fd_rectangle_get_material_dissipation_value.yy",},
|
||||
|
@ -1060,6 +1064,7 @@
|
|||
{"name":"o_dialog_warning","order":10,"path":"objects/o_dialog_warning/o_dialog_warning.yy",},
|
||||
{"name":"s_node_group_output","order":15,"path":"sprites/s_node_group_output/s_node_group_output.yy",},
|
||||
{"name":"node_path_l_system","order":10,"path":"scripts/node_path_l_system/node_path_l_system.yy",},
|
||||
{"name":"panel_gradient","order":2,"path":"scripts/panel_gradient/panel_gradient.yy",},
|
||||
{"name":"sh_channel_S","order":5,"path":"shaders/sh_channel_S/sh_channel_S.yy",},
|
||||
{"name":"string_scale","order":4,"path":"scripts/string_scale/string_scale.yy",},
|
||||
{"name":"s_node_cache","order":27,"path":"sprites/s_node_cache/s_node_cache.yy",},
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"string","folderPath":"folders/functions/string.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"surface","folderPath":"folders/functions/surface.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"test","folderPath":"folders/functions/test.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"tween","folderPath":"folders/functions/tween.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"value","folderPath":"folders/functions/value.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"vector","folderPath":"folders/functions/vector.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"window","folderPath":"folders/functions/window.yy",},
|
||||
|
@ -112,6 +113,7 @@
|
|||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"path","folderPath":"folders/nodes/data/value/path.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"struct","folderPath":"folders/nodes/data/value/struct.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"texts","folderPath":"folders/nodes/data/value/texts.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"trigger","folderPath":"folders/nodes/data/value/trigger.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"VFX","folderPath":"folders/nodes/data/VFX.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"icons","folderPath":"folders/nodes/icons.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"3D","folderPath":"folders/nodes/icons/3D.yy",},
|
||||
|
@ -161,6 +163,7 @@
|
|||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"misc","folderPath":"folders/shader/misc.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"shape seperator","folderPath":"folders/shader/shape seperator.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/shader/sprites.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"transition","folderPath":"folders/shader/transition.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"warp","folderPath":"folders/shader/warp.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"sprites","folderPath":"folders/sprites.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"gameframe","folderPath":"folders/sprites/gameframe.yy",},
|
||||
|
@ -168,13 +171,12 @@
|
|||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"Steamworks","folderPath":"folders/Steamworks.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"UGC","folderPath":"folders/Steamworks/UGC.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"widgets","folderPath":"folders/widgets.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"transition","folderPath":"folders/shader/transition.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"tween","folderPath":"folders/functions/tween.yy",},
|
||||
],
|
||||
"IncludedFiles": [
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","CopyToMask":-1,"filePath":"datafiles",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Guides.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"icon.png","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"layouts.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Horizontal.json","CopyToMask":-1,"filePath":"datafiles/data/layouts",},
|
||||
|
@ -364,6 +366,7 @@
|
|||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_frame_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_frame_title.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_glow.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junction_inspector.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junction_name_bg.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_array_hover.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_array.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
|
@ -373,6 +376,7 @@
|
|||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_pin_active.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_pin.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_state_strip2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_trigger.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphic.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node/widget",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_checkbox_strip4.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node/widget",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_coor_pin.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node/widget",},
|
||||
|
@ -1019,6 +1023,7 @@
|
|||
{"id":{"name":"spr_gameframe_pixel","path":"sprites/spr_gameframe_pixel/spr_gameframe_pixel.yy",},},
|
||||
{"id":{"name":"s_node_radial","path":"sprites/s_node_radial/s_node_radial.yy",},},
|
||||
{"id":{"name":"s_node_grid","path":"sprites/s_node_grid/s_node_grid.yy",},},
|
||||
{"id":{"name":"node_trigger","path":"scripts/node_trigger/node_trigger.yy",},},
|
||||
{"id":{"name":"node_perlin","path":"scripts/node_perlin/node_perlin.yy",},},
|
||||
{"id":{"name":"node_blur_simple","path":"scripts/node_blur_simple/node_blur_simple.yy",},},
|
||||
{"id":{"name":"node_feedback_input","path":"scripts/node_feedback_input/node_feedback_input.yy",},},
|
||||
|
@ -1122,6 +1127,7 @@
|
|||
{"id":{"name":"point_rect_overlap","path":"scripts/point_rect_overlap/point_rect_overlap.yy",},},
|
||||
{"id":{"name":"s_node_bevel","path":"sprites/s_node_bevel/s_node_bevel.yy",},},
|
||||
{"id":{"name":"color_selector","path":"scripts/color_selector/color_selector.yy",},},
|
||||
{"id":{"name":"node_trigger_bool","path":"scripts/node_trigger_bool/node_trigger_bool.yy",},},
|
||||
{"id":{"name":"s_node_strandSim_gravity","path":"sprites/s_node_strandSim_gravity/s_node_strandSim_gravity.yy",},},
|
||||
{"id":{"name":"node_VFX_effect_turbulence","path":"scripts/node_VFX_effect_turbulence/node_VFX_effect_turbulence.yy",},},
|
||||
{"id":{"name":"node_ase_file_read","path":"scripts/node_ase_file_read/node_ase_file_read.yy",},},
|
||||
|
@ -1253,7 +1259,7 @@
|
|||
{"id":{"name":"s_node_3d_plane","path":"sprites/s_node_3d_plane/s_node_3d_plane.yy",},},
|
||||
{"id":{"name":"Regex","path":"extensions/Regex/Regex.yy",},},
|
||||
{"id":{"name":"s_node_path_shift","path":"sprites/s_node_path_shift/s_node_path_shift.yy",},},
|
||||
{"id":{"name":"node_rigid_sim","path":"scripts/node_rigid_sim/node_rigid_sim.yy",},},
|
||||
{"id":{"name":"node_rigid_group","path":"scripts/node_rigid_group/node_rigid_group.yy",},},
|
||||
{"id":{"name":"s_node_grid_tri","path":"sprites/s_node_grid_tri/s_node_grid_tri.yy",},},
|
||||
{"id":{"name":"s_node_local_analyze","path":"sprites/s_node_local_analyze/s_node_local_analyze.yy",},},
|
||||
{"id":{"name":"_f_p0b","path":"fonts/_f_p0b/_f_p0b.yy",},},
|
||||
|
@ -1294,6 +1300,7 @@
|
|||
{"id":{"name":"sh_fd_visualize_pixel_art_fire_glsl","path":"shaders/sh_fd_visualize_pixel_art_fire_glsl/sh_fd_visualize_pixel_art_fire_glsl.yy",},},
|
||||
{"id":{"name":"struct_functions","path":"scripts/struct_functions/struct_functions.yy",},},
|
||||
{"id":{"name":"sh_content_sampler","path":"shaders/sh_content_sampler/sh_content_sampler.yy",},},
|
||||
{"id":{"name":"s_node_trigger","path":"sprites/s_node_trigger/s_node_trigger.yy",},},
|
||||
{"id":{"name":"fd_rectangle_get_repeat","path":"scripts/fd_rectangle_get_repeat/fd_rectangle_get_repeat.yy",},},
|
||||
{"id":{"name":"s_menu_white","path":"sprites/s_menu_white/s_menu_white.yy",},},
|
||||
{"id":{"name":"color_loader","path":"scripts/color_loader/color_loader.yy",},},
|
||||
|
@ -1445,6 +1452,7 @@
|
|||
{"id":{"name":"sh_grid_noise","path":"shaders/sh_grid_noise/sh_grid_noise.yy",},},
|
||||
{"id":{"name":"draw_set_blend_mode","path":"scripts/draw_set_blend_mode/draw_set_blend_mode.yy",},},
|
||||
{"id":{"name":"gameframe_macros","path":"scripts/gameframe_macros/gameframe_macros.yy",},},
|
||||
{"id":{"name":"s_node_trigger_bool","path":"sprites/s_node_trigger_bool/s_node_trigger_bool.yy",},},
|
||||
{"id":{"name":"panel_color","path":"scripts/panel_color/panel_color.yy",},},
|
||||
{"id":{"name":"s_node_line","path":"sprites/s_node_line/s_node_line.yy",},},
|
||||
{"id":{"name":"fd_rectangle_get_material_dissipation_value","path":"scripts/fd_rectangle_get_material_dissipation_value/fd_rectangle_get_material_dissipation_value.yy",},},
|
||||
|
@ -1590,6 +1598,7 @@
|
|||
{"id":{"name":"o_dialog_warning","path":"objects/o_dialog_warning/o_dialog_warning.yy",},},
|
||||
{"id":{"name":"s_node_group_output","path":"sprites/s_node_group_output/s_node_group_output.yy",},},
|
||||
{"id":{"name":"node_path_l_system","path":"scripts/node_path_l_system/node_path_l_system.yy",},},
|
||||
{"id":{"name":"panel_gradient","path":"scripts/panel_gradient/panel_gradient.yy",},},
|
||||
{"id":{"name":"sh_channel_S","path":"shaders/sh_channel_S/sh_channel_S.yy",},},
|
||||
{"id":{"name":"string_scale","path":"scripts/string_scale/string_scale.yy",},},
|
||||
{"id":{"name":"s_node_cache","path":"sprites/s_node_cache/s_node_cache.yy",},},
|
||||
|
|
BIN
datafiles/data/Guides.zip
Normal file
BIN
datafiles/data/Guides.zip
Normal file
Binary file not shown.
Binary file not shown.
|
@ -154,8 +154,9 @@
|
|||
if(anchor & ANCHOR.top) dialog_y = min(ystart, WIN_SH - dialog_h);
|
||||
if(anchor & ANCHOR.bottom) dialog_y = max(ystart - dialog_h, 0);
|
||||
}
|
||||
dialog_x = round(dialog_x);
|
||||
dialog_y = round(dialog_y);
|
||||
|
||||
dialog_x = round(clamp(dialog_x, 2, WIN_SW - dialog_w - 2));
|
||||
dialog_y = round(clamp(dialog_y, 2, WIN_SH - dialog_h - 2));
|
||||
}
|
||||
|
||||
function checkMouse() {
|
||||
|
|
|
@ -55,6 +55,8 @@ event_inherited();
|
|||
var typ = node_called.type;
|
||||
|
||||
for( var i = 0; i < array_length(ar); i++ ) {
|
||||
if(!ar[i].visible) continue;
|
||||
|
||||
var _in = call_in? node_called.type : ar[i].type;
|
||||
var _ot = call_in? ar[i].type : node_called.type;
|
||||
|
||||
|
@ -69,6 +71,7 @@ event_inherited();
|
|||
for( var i = 0; i < array_length(io.inputs); i++ ) {
|
||||
var _in = fr;
|
||||
var _ot = io.inputs[i].type;
|
||||
if(!io.inputs[i].visible) continue;
|
||||
|
||||
if(typeCompatible(_in, _ot, false)) return true;
|
||||
}
|
||||
|
@ -91,7 +94,7 @@ event_inherited();
|
|||
node_list = pageIndex == -1? noone : NODE_CATEGORY[| ADD_NODE_PAGE].list;
|
||||
}
|
||||
ADD_NODE_PAGE = 0;
|
||||
setPage(ADD_NODE_PAGE);
|
||||
setPage(NODE_PAGE_DEFAULT);
|
||||
|
||||
function buildNode(_node, _param = "") {
|
||||
if(!_node) {
|
||||
|
@ -109,6 +112,12 @@ event_inherited();
|
|||
return;
|
||||
}
|
||||
|
||||
if(array_exists(global.RECENT_NODES, _node.node))
|
||||
array_remove(global.RECENT_NODES, _node.node);
|
||||
array_insert(global.RECENT_NODES, 0, _node.node);
|
||||
if(array_length(global.RECENT_NODES) > 20)
|
||||
array_pop(global.RECENT_NODES);
|
||||
|
||||
_inputs = _new_node.inputs;
|
||||
_outputs = _new_node.outputs;
|
||||
} else {
|
||||
|
@ -153,6 +162,8 @@ event_inherited();
|
|||
var _node_list = node_called.connect_type == JUNCTION_CONNECT.input? _outputs : _inputs;
|
||||
for(var i = 0; i < ds_list_size(_node_list); i++) {
|
||||
var _target = _node_list[| i];
|
||||
if(!_target.visible) continue;
|
||||
|
||||
if(_target.auto_connect && (value_bit(_target.type) & value_bit(node_called.type)) ) {
|
||||
if(node_called.connect_type == JUNCTION_CONNECT.input) {
|
||||
node_called.setFrom(_node_list[| i]);
|
||||
|
@ -168,6 +179,7 @@ event_inherited();
|
|||
|
||||
for( var i = 0; i < ds_list_size(_inputs); i++ ) {
|
||||
var _in = _inputs[| i];
|
||||
|
||||
if(_in.auto_connect && _in.isConnectable(from)) {
|
||||
_in.setFrom(from);
|
||||
break;
|
||||
|
@ -259,12 +271,25 @@ event_inherited();
|
|||
ds_list_add(_list, cat.list[| j]);
|
||||
}
|
||||
}
|
||||
} else if(ADD_NODE_PAGE == 0) {
|
||||
} else if(ADD_NODE_PAGE == NODE_PAGE_DEFAULT) {
|
||||
_list = ds_list_create();
|
||||
|
||||
ds_list_add(_list, "Favourites");
|
||||
for( var i = 0; i < array_length(global.FAV_NODES); i++ ) {
|
||||
var _nodeIndex = global.FAV_NODES[i];
|
||||
ds_list_add(_list, ALL_NODES[? _nodeIndex]);
|
||||
}
|
||||
|
||||
ds_list_add(_list, "Recents");
|
||||
for( var i = 0; i < array_length(global.RECENT_NODES); i++ ) {
|
||||
var _nodeIndex = global.RECENT_NODES[i];
|
||||
ds_list_add(_list, ALL_NODES[? _nodeIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
if(_list == noone) {
|
||||
setPage(NODE_PAGE_DEFAULT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
var node_count = ds_list_size(_list);
|
||||
|
|
|
@ -84,36 +84,6 @@ event_inherited();
|
|||
#endregion
|
||||
|
||||
#region preset
|
||||
function loadGradient(path) {
|
||||
if(path == "") return noone;
|
||||
if(!file_exists(path)) return noone;
|
||||
|
||||
var grad = new gradientObject();
|
||||
grad.keys = [];
|
||||
|
||||
var _t = file_text_open_read(path);
|
||||
while(!file_text_eof(_t)) {
|
||||
var key = file_text_readln(_t);
|
||||
var _col = 0, _pos = 0;
|
||||
|
||||
if(string_pos(",", key)) {
|
||||
var keys = string_splice(key, ",");
|
||||
if(array_length(keys) != 2) continue;
|
||||
|
||||
_col = toNumber(keys[0]);
|
||||
_pos = toNumber(keys[1]);
|
||||
} else {
|
||||
_col = toNumber(key);
|
||||
if(file_text_eof(_t)) break;
|
||||
_pos = toNumber(file_text_readln(_t));
|
||||
}
|
||||
|
||||
array_push(grad.keys, new gradientKey(_pos, _col));
|
||||
}
|
||||
file_text_close(_t);
|
||||
return grad;
|
||||
}
|
||||
|
||||
presets = ds_list_create();
|
||||
preset_name = ds_list_create();
|
||||
|
||||
|
|
|
@ -70,12 +70,12 @@ event_inherited();
|
|||
if(show_icon)
|
||||
dialog_w += ui(32);
|
||||
|
||||
dialog_y = min(dialog_y, WIN_H - dialog_h);
|
||||
dialog_y = min(dialog_y, WIN_H - dialog_h - 2);
|
||||
|
||||
switch(align) {
|
||||
case fa_left: dialog_x = round(min(dialog_x, WIN_W - dialog_w)); break;
|
||||
case fa_center: dialog_x = round(min(dialog_x - dialog_w / 2, WIN_W - dialog_w)); break;
|
||||
case fa_right: dialog_x = round(max(dialog_x - dialog_w, 0)); break;
|
||||
case fa_left: dialog_x = round(min(dialog_x, WIN_W - dialog_w - 2)); break;
|
||||
case fa_center: dialog_x = round(min(dialog_x - dialog_w / 2, WIN_W - dialog_w - 2)); break;
|
||||
case fa_right: dialog_x = round(max(dialog_x - dialog_w, 2)); break;
|
||||
}
|
||||
|
||||
ready = true;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/// @description init
|
||||
if(!ready) exit;
|
||||
|
||||
#region draw
|
||||
var yy = dialog_y;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ if !ready exit;
|
|||
if(buttonInstant(THEME.button_hide, bx, by, ss, ss, mouse_ui, sFOCUS, sHOVER, txt, THEME.pin, ind, cc,, sc) == 2)
|
||||
destroy_on_click_out = !destroy_on_click_out;
|
||||
|
||||
if(sFOCUS)
|
||||
if(sFOCUS) {
|
||||
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
|
||||
|
||||
if(!m_in && m_ot) {
|
||||
|
@ -85,5 +85,7 @@ if !ready exit;
|
|||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
|
@ -246,6 +246,16 @@ event_inherited();
|
|||
})
|
||||
])
|
||||
|
||||
ds_list_add(pref_appr, [
|
||||
get_text("pref_connection_anim", "Connection line animation"),
|
||||
"connection_line_transition",
|
||||
new checkBox(function() {
|
||||
PREF_MAP[? "connection_line_transition"] =
|
||||
!PREF_MAP[? "connection_line_transition"];
|
||||
PREF_SAVE();
|
||||
})
|
||||
])
|
||||
|
||||
ds_list_add(pref_appr, [
|
||||
get_text("panel_menu_right_control", "Use Windows style window control."),
|
||||
"panel_menu_right_control",
|
||||
|
|
|
@ -203,6 +203,7 @@
|
|||
|
||||
#region parameter
|
||||
file_open_parameter = "";
|
||||
minimized = false;
|
||||
|
||||
_modified = false;
|
||||
#endregion
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// @description init
|
||||
if(OS == os_windows && gameframe_is_minimized()) {
|
||||
gameframe_update();
|
||||
//gameframe_update();
|
||||
exit;
|
||||
} else if(OS == os_macosx) {
|
||||
mac_window_step();
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/// @description tooltip filedrop
|
||||
if(OS == os_windows && gameframe_is_minimized()) exit;
|
||||
|
||||
#region tooltip
|
||||
if(is_array(TOOLTIP) || TOOLTIP != "") {
|
||||
if(is_struct(TOOLTIP) && struct_has(TOOLTIP, "drawTooltip")) {
|
||||
|
@ -36,7 +38,7 @@
|
|||
draw_tooltip_surface(content);
|
||||
break;
|
||||
case VALUE_TYPE.rigid :
|
||||
draw_tooltip_text("[" + get_text("tooltip_rigid_object", "Rigidbody Object") + " (id: " + string(content[$ "object"]) + ")(]");
|
||||
draw_tooltip_text("[" + get_text("tooltip_rigid_object", "Rigidbody Object") + " (id: " + string(content[$ "object"]) + ")]");
|
||||
break;
|
||||
case VALUE_TYPE.particle :
|
||||
var txt = "[" +
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
window_set_showborder(false);
|
||||
|
||||
__initSurfaceFormat();
|
||||
__initLocale();
|
||||
__initTheme();
|
||||
__initCollection();
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/// @description init
|
||||
if(OS == os_windows && gameframe_is_minimized()) exit;
|
||||
|
||||
//print("===== Step start =====");
|
||||
#region animation
|
||||
if(ANIMATOR.is_playing && ANIMATOR.play_freeze == 0) {
|
||||
|
|
|
@ -1,4 +1,18 @@
|
|||
/// @description init
|
||||
#region minimize
|
||||
if(OS == os_windows && gameframe_is_minimized()) {
|
||||
if(!minimized)
|
||||
game_set_speed(1, gamespeed_fps);
|
||||
minimized = true;
|
||||
exit;
|
||||
}
|
||||
|
||||
if(minimized) {
|
||||
game_set_speed(PREF_MAP[? "ui_framerate"], gamespeed_fps);
|
||||
minimized = false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region window
|
||||
//if(keyboard_check_pressed(vk_f12)) DEBUG = !DEBUG;
|
||||
|
||||
|
@ -56,6 +70,8 @@
|
|||
#endregion
|
||||
|
||||
#region nodes
|
||||
DEF_SURFACE_RESET();
|
||||
|
||||
var _k = ds_map_find_first(NODE_MAP);
|
||||
var _a = ds_map_size(NODE_MAP);
|
||||
repeat(_a) {
|
||||
|
|
|
@ -8,7 +8,7 @@ enum TWEEN_VALUE {
|
|||
color
|
||||
}
|
||||
|
||||
function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twSpeed = 5) constructor {
|
||||
function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twSpeed = 2) constructor {
|
||||
array_push(TWEEN_VALUES, self);
|
||||
|
||||
realVal = value;
|
||||
|
@ -20,7 +20,7 @@ function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twS
|
|||
colTrans = 0;
|
||||
|
||||
static set = function(value) {
|
||||
if(valType == VALUE_TYPE.color) {
|
||||
if(valType == TWEEN_VALUE.color) {
|
||||
showVal = get();
|
||||
colTrans = 0;
|
||||
}
|
||||
|
@ -28,21 +28,21 @@ function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twS
|
|||
realVal = value;
|
||||
}
|
||||
static get = function(value) {
|
||||
if(valType == VALUE_TYPE.color)
|
||||
if(valType == TWEEN_VALUE.color)
|
||||
return colTrans == 1? realVal : merge_color(showVal, realVal, colTrans);
|
||||
else
|
||||
return showVal;
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
if(valType == VALUE_TYPE.color) {
|
||||
if(valType == TWEEN_VALUE.color) {
|
||||
if(tweenType == TWEEN_TYPE.linear)
|
||||
colTrans = lerp_linear(colTrans, 1, 1 / tweenSpeed);
|
||||
else if(tweenType == TWEEN_TYPE.log)
|
||||
colTrans = lerp_float(colTrans, 1, tweenSpeed);
|
||||
if(colTrans == 1)
|
||||
showVal = realVal;
|
||||
} else if(valType == VALUE_TYPE.number) {
|
||||
} else if(valType == TWEEN_VALUE.number) {
|
||||
if(tweenType == TWEEN_TYPE.linear)
|
||||
showVal = lerp_linear(showVal, realVal, 1 / tweenSpeed);
|
||||
else if(tweenType == TWEEN_TYPE.log)
|
||||
|
|
|
@ -15,16 +15,26 @@ function __part(_node) constructor {
|
|||
node = _node;
|
||||
active = false;
|
||||
surf = noone;
|
||||
prevx = 0;
|
||||
prevy = 0;
|
||||
x = 0;
|
||||
y = 0;
|
||||
sx = 0;
|
||||
sy = 0;
|
||||
speedx = 0;
|
||||
speedy = 0;
|
||||
turning = 0;
|
||||
turnSpd = 0
|
||||
|
||||
ac = 0;
|
||||
g = 0;
|
||||
wig = 0;
|
||||
spVec = [ 0, 0 ];
|
||||
|
||||
boundary_data = -1;
|
||||
|
||||
g = 0;
|
||||
gDir = -90;
|
||||
_gx = 0;
|
||||
_gy = 0;
|
||||
gx = 0;
|
||||
gy = 0;
|
||||
|
||||
scx = 1;
|
||||
|
@ -55,6 +65,7 @@ function __part(_node) constructor {
|
|||
surf = _surf;
|
||||
x = _x;
|
||||
y = _y;
|
||||
gx = 0;
|
||||
gy = 0;
|
||||
|
||||
life = _life;
|
||||
|
@ -62,11 +73,17 @@ function __part(_node) constructor {
|
|||
node.onPartCreate(self);
|
||||
}
|
||||
|
||||
static setPhysic = function(_sx, _sy, _ac, _g, _wig) {
|
||||
sx = _sx;
|
||||
sy = _sy;
|
||||
static setPhysic = function(_sx, _sy, _ac, _g, _gDir, _wig, _turn, _turnSpd) {
|
||||
speedx = _sx;
|
||||
speedy = _sy;
|
||||
ac = _ac;
|
||||
g = _g;
|
||||
gDir = _gDir;
|
||||
_gx = lengthdir_x(g, gDir);
|
||||
_gy = lengthdir_y(g, gDir);
|
||||
|
||||
turning = _turn;
|
||||
turnSpd = _turnSpd;
|
||||
|
||||
wig = _wig;
|
||||
}
|
||||
|
@ -96,30 +113,45 @@ function __part(_node) constructor {
|
|||
|
||||
static step = function() {
|
||||
if(!active) return;
|
||||
var xp = x, yp = y;
|
||||
x += sx;
|
||||
y += sy;
|
||||
x += speedx;
|
||||
y += speedy;
|
||||
|
||||
var dirr = point_direction(0, 0, sx, sy);
|
||||
var diss = point_distance(0, 0, sx, sy);
|
||||
if(diss > 0) {
|
||||
var dirr = point_direction(0, 0, speedx, speedy);
|
||||
var diss = point_distance(0, 0, speedx, speedy);
|
||||
diss += ac;
|
||||
|
||||
if(speedx != 0 || speedy != 0) {
|
||||
if(wig != 0)
|
||||
dirr += random_range(-wig, wig);
|
||||
sx = lengthdir_x(diss, dirr);
|
||||
sy = lengthdir_y(diss, dirr);
|
||||
|
||||
if(turning != 0) {
|
||||
var trn = turnSpd? turning * diss : turning;
|
||||
dirr += trn
|
||||
}
|
||||
}
|
||||
|
||||
gy += g;
|
||||
y += gy;
|
||||
speedx = lengthdir_x(diss, dirr);
|
||||
speedy = lengthdir_y(diss, dirr);
|
||||
|
||||
if(follow)
|
||||
rot = point_direction(xp, yp, x, y);
|
||||
else
|
||||
rot += rot_s;
|
||||
if(_gx != 0 || _gy != 0) {
|
||||
gx += _gx;
|
||||
gy += _gy;
|
||||
x += gx;
|
||||
y += gy;
|
||||
}
|
||||
|
||||
if(follow) rot = spVec[1];
|
||||
else rot += rot_s;
|
||||
|
||||
if(step_int > 0 && safe_mod(life, step_int) == 0)
|
||||
node.onPartStep(self);
|
||||
if(life-- < 0) kill();
|
||||
|
||||
spVec[0] = point_distance(prevx, prevy, x, y);
|
||||
spVec[1] = point_direction(prevx, prevy, x, y);
|
||||
|
||||
prevx = x;
|
||||
prevy = y;
|
||||
}
|
||||
|
||||
static draw = function(exact, surf_w, surf_h) {
|
||||
|
@ -201,3 +233,16 @@ function __part(_node) constructor {
|
|||
return [cx, cy];
|
||||
}
|
||||
}
|
||||
|
||||
#region helper
|
||||
#macro UPDATE_PART_FORWARD static updateParticleForward = function() { \
|
||||
var pt = outputs[| 0]; \
|
||||
for( var i = 0; i < ds_list_size(pt.value_to); i++ ) { \
|
||||
var _n = pt.value_to[| i]; \
|
||||
if(_n.value_from != pt) continue; \
|
||||
\
|
||||
if(variable_struct_exists(_n.node, "updateParticleForward")) \
|
||||
_n.node.updateParticleForward(); \
|
||||
} \
|
||||
}
|
||||
#endregion
|
|
@ -10,5 +10,7 @@
|
|||
#macro BLEND_ALPHA gpu_set_blendmode_ext_sepalpha(bm_one, bm_inv_src_alpha, bm_one, bm_one)
|
||||
#macro BLEND_ALPHA_MULP gpu_set_blendmode_ext_sepalpha(bm_src_alpha, bm_inv_src_alpha, bm_one, bm_one)
|
||||
|
||||
#macro BLEND_MULTIPLY gpu_set_blendmode_ext(bm_dest_colour, bm_zero)
|
||||
|
||||
#macro DRAW_CLEAR draw_clear_alpha(0, 0)
|
||||
#endregion
|
|
@ -90,13 +90,23 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
|
||||
inputs[| 32] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, irandom_range(100000, 999999))
|
||||
|
||||
inputs[| 33] = nodeValue("Gravity direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, -90 )
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
||||
inputs[| 34] = nodeValue("Turning", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ] )
|
||||
.setDisplay(VALUE_DISPLAY.range);
|
||||
|
||||
inputs[| 35] = nodeValue("Turn both directions", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Apply randomized 1, -1 multiplier to the turning speed." );
|
||||
|
||||
inputs[| 36] = nodeValue("Turn scale with speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false );
|
||||
|
||||
input_len = ds_list_size(inputs);
|
||||
|
||||
input_display_list = [ 32,
|
||||
["Sprite", false], 0, 22, 23, 26,
|
||||
["Spawn", true], 27, 16, 1, 2, 3, 4, 30, 31, 24, 25, 5,
|
||||
["Movement", true], 29, 6, 18, 7,
|
||||
["Physics", true], 19, 20,
|
||||
["Movement", true], 29, 6, 18,
|
||||
["Physics", true], 7, 19, 33, 20, 34, 35, 36,
|
||||
["Rotation", true], 15, 8, 9,
|
||||
["Scale", true], 10, 17, 11,
|
||||
["Color", true], 12, 28, 13, 14,
|
||||
|
@ -145,7 +155,11 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
|
||||
var _accel = current_data[ 7];
|
||||
var _grav = current_data[19];
|
||||
var _gvDir = current_data[33];
|
||||
var _wigg = current_data[20];
|
||||
var _turn = current_data[34];
|
||||
var _turnBi = current_data[35];
|
||||
var _turnSc = current_data[36];
|
||||
|
||||
var _follow = current_data[15];
|
||||
var _rotation = current_data[ 8];
|
||||
|
@ -252,7 +266,10 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
part.anim_speed = _anim_speed;
|
||||
part.anim_end = _anim_end;
|
||||
|
||||
part.setPhysic(_vx, _vy, _acc, _grav, _wigg);
|
||||
var _trn = random_range(_turn[0], _turn[1]);
|
||||
if(_turnBi) _trn *= choose(-1, 1);
|
||||
|
||||
part.setPhysic(_vx, _vy, _acc, _grav, _gvDir, _wigg, _trn, _turnSc);
|
||||
part.setTransform(_scx, _scy, _scale_time, _rot, _rot_spd, _follow);
|
||||
part.setDraw(_color, _bld, _alp, _fade);
|
||||
spawn_index = safe_mod(spawn_index + 1, attributes[? "part_amount"]);
|
||||
|
@ -264,7 +281,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
|
||||
static onSpawn = function(_time, part) {}
|
||||
|
||||
static updateParticleForward = function(_render = true) {}
|
||||
static updateParticleForward = function() {}
|
||||
|
||||
function reset() {
|
||||
spawn_index = 0;
|
||||
|
@ -282,7 +299,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
|||
|
||||
for(var i = 0; i < ANIMATOR.frames_total; i++) {
|
||||
runVFX(i, false);
|
||||
updateParticleForward(false);
|
||||
updateParticleForward();
|
||||
}
|
||||
|
||||
seed = inputs[| 32].getValue();
|
||||
|
|
|
@ -45,6 +45,10 @@ function array_exists(arr, val) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function array_empty(arr) {
|
||||
return array_length(arr) == 0;
|
||||
}
|
||||
|
||||
function array_find(arr, val) {
|
||||
for( var i = 0; i < array_length(arr); i++ ) {
|
||||
if(arr[i] == val) return i;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
function draw_sprite_fit(spr, ind, xx, yy, w, h) {
|
||||
function draw_sprite_fit(spr, ind, xx, yy, w, h, color = c_white, alpha = 1) {
|
||||
var ss = min(w / sprite_get_width(spr), h / sprite_get_height(spr));
|
||||
draw_sprite_ext(spr, ind, xx, yy, ss, ss, 0, c_white, 1);
|
||||
draw_sprite_ext(spr, ind, xx, yy, ss, ss, 0, color, alpha);
|
||||
}
|
||||
|
||||
function draw_surface_fit(surf, xx, yy, w, h) {
|
||||
|
|
|
@ -87,6 +87,43 @@ function draw_line_curve_color(x0, y0, x1, y1, xc = noone, yc = noone, _s = 1, t
|
|||
}
|
||||
}
|
||||
|
||||
function draw_line_curve_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white) {
|
||||
var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 16 * PREF_MAP[? "connection_line_sample"]);
|
||||
sample = clamp(sample, 8, 128);
|
||||
|
||||
var x2 = lerp(x0, x1, 0.9);
|
||||
var x3 = x1;
|
||||
var y2 = lerp(y0, y1, 0.1);
|
||||
var y3 = y1;
|
||||
|
||||
var c = draw_get_color();
|
||||
var ox, oy, nx, ny, t, it, oc, nc;
|
||||
|
||||
for( var i = 0; i <= sample; i++ ) {
|
||||
t = i / sample;
|
||||
it = 1 - t;
|
||||
|
||||
nx = x0 * power(t, 3)
|
||||
+ 3 * x2 * power(it, 1) * power(t, 2)
|
||||
+ 3 * x3 * power(it, 2) * power(t, 1)
|
||||
+ x1 * power(it, 3);
|
||||
|
||||
ny = y0 * power(t, 3)
|
||||
+ 3 * y2 * power(it, 1) * power(t, 2)
|
||||
+ 3 * y3 * power(it, 2) * power(t, 1)
|
||||
+ y1 * power(it, 3);
|
||||
|
||||
nc = merge_color(col1, col2, t);
|
||||
|
||||
if(i)
|
||||
draw_line_round_color(ox, oy, nx, ny, thick, oc, nc);
|
||||
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
oc = nc;
|
||||
}
|
||||
}
|
||||
|
||||
function distance_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s) {
|
||||
var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 16 * PREF_MAP[? "connection_line_sample"]);
|
||||
sample = clamp(sample, 8, 128);
|
||||
|
@ -124,3 +161,39 @@ function distance_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s) {
|
|||
|
||||
return dist;
|
||||
}
|
||||
|
||||
function distance_to_curve_corner(mx, my, x0, y0, x1, y1, _s) {
|
||||
var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 16 * PREF_MAP[? "connection_line_sample"]);
|
||||
sample = clamp(sample, 8, 128);
|
||||
|
||||
var dist = 999999;
|
||||
var ox, oy, nx, ny, t, it;
|
||||
|
||||
var x2 = lerp(x0, x1, 0.9);
|
||||
var x3 = x1;
|
||||
var y2 = lerp(y0, y1, 0.1);
|
||||
var y3 = y1;
|
||||
|
||||
for( var i = 0; i <= sample; i++ ) {
|
||||
t = i / sample;
|
||||
it = 1 - t;
|
||||
|
||||
nx = x0 * power(t, 3)
|
||||
+ 3 * x2 * power(it, 1) * power(t, 2)
|
||||
+ 3 * x3 * power(it, 2) * power(t, 1)
|
||||
+ x1 * power(it, 3);
|
||||
|
||||
ny = y0 * power(t, 3)
|
||||
+ 3 * y2 * power(it, 1) * power(t, 2)
|
||||
+ 3 * y3 * power(it, 2) * power(t, 1)
|
||||
+ y1 * power(it, 3);
|
||||
|
||||
if(i)
|
||||
dist = min(dist, distance_to_line(mx, my, ox, oy, nx, ny));
|
||||
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
}
|
||||
|
||||
return dist;
|
||||
}
|
|
@ -67,6 +67,19 @@ function draw_line_elbow_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = 1, t
|
|||
}
|
||||
}
|
||||
|
||||
function draw_line_elbow_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white, corner = 0, indexIn = 1, indexOut = 1, type = LINE_STYLE.solid) {
|
||||
var rat = abs(x0 - x1) / (abs(x0 - x1) + abs(y0 - y1));
|
||||
var colc = merge_color(col1, col2, rat);
|
||||
corner = min(corner, abs(x0 - x1), abs(y0 - y1));
|
||||
|
||||
var sx = sign(x1 - x0);
|
||||
var sy = sign(y1 - y0);
|
||||
|
||||
draw_line_round_color(x0, y0, x1 - corner * sx, y0, thick, col1, colc);
|
||||
draw_line_round_color(x1, y0 + corner * sy, x1, y1, thick, colc, col2);
|
||||
draw_corner(x1 - corner * sx, y0, x1, y0, x1, y0 + corner * sy, thick, colc);
|
||||
}
|
||||
|
||||
function distance_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, indexOut = 1) {
|
||||
var inv = x1 - 16 * _s * indexOut <= x0 + 16 * _s * indexIn;
|
||||
var xx0 = x0 + 16 * _s * indexIn;
|
||||
|
@ -87,11 +100,9 @@ function distance_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, inde
|
|||
}
|
||||
}
|
||||
|
||||
function elbow_distance_center(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, indexOut = 1) {
|
||||
var inv = x1 - 16 * _s * indexOut <= x0 + 16 * _s * indexIn;
|
||||
function distance_to_elbow_corner(mx, my, x0, y0, x1, y1) {
|
||||
var dist = distance_to_line(mx, my, x0, y0, x1, y0);
|
||||
dist = min(dist, distance_to_line(mx, my, x1, y0, x1, y1));
|
||||
|
||||
if(inv)
|
||||
return distance_to_line(mx, my, x0, cy, x1, cy);
|
||||
else
|
||||
return distance_to_line(mx, my, cx, y0, cx, y1);
|
||||
return dist;
|
||||
}
|
|
@ -198,6 +198,27 @@ function draw_line_elbow_diag_color(x0, y0, x1, y1, cx = noone, cy = noone, _s =
|
|||
}
|
||||
}
|
||||
|
||||
function draw_line_elbow_diag_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_white, col2 = c_white, corner = 0, indexIn = 1, indexOut = 1, type = LINE_STYLE.solid) {
|
||||
var rat = abs(x0 - x1) / (abs(x0 - x1) + abs(y0 - y1));
|
||||
var colc = merge_color(col1, col2, rat);
|
||||
|
||||
var sx = sign(x1 - x0);
|
||||
var sy = sign(y1 - y0);
|
||||
var diag = min(abs(x0 - x1) / 2, abs(y0 - y1) / 2);
|
||||
corner = min(corner, abs(x0 - x1 - diag), abs(y0 - y1 - diag));
|
||||
var cor2 = corner / sqrt(2);
|
||||
|
||||
draw_line_round_color( x0, y0, x1 - (diag + corner) * sx, y0, thick, col1, colc);
|
||||
draw_line_round_color(x1 - (diag - cor2) * sx, y0 + cor2 * sy, x1 - cor2 * sx, y0 + (diag - cor2) * sy, thick, colc, colc);
|
||||
draw_line_round_color( x1, y0 + (diag + corner) * sy, x1, y1, thick, colc, col2);
|
||||
|
||||
draw_corner(x1 - (diag + corner) * sx, y0, x1 - diag * sx, y0, x1 - (diag - cor2) * sx, y0 + cor2 * sy, thick, colc);
|
||||
draw_corner(x1 - cor2 * sx, y0 + (diag - cor2) * sy, x1, y0 + diag * sy, x1, y0 + (diag + corner) * sy, thick, colc);
|
||||
|
||||
//draw_circle(x1 - diag * sx, y0, 4, false);
|
||||
//draw_circle(x1, y0 + diag * sy, 4, false);
|
||||
}
|
||||
|
||||
function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1, indexOut = 1) {
|
||||
var iy = sign(y1 - y0);
|
||||
var xx0 = x0 + 16 * _s * indexIn;
|
||||
|
@ -296,3 +317,16 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, indexIn = 1,
|
|||
return dist;
|
||||
}
|
||||
}
|
||||
|
||||
function distance_to_elbow_diag_corner(mx, my, x0, y0, x1, y1) {
|
||||
var sx = sign(x1 - x0);
|
||||
var sy = sign(y1 - y0);
|
||||
var diag = min(abs(x0 - x1) / 2, abs(y0 - y1) / 2);
|
||||
|
||||
var dist = 99999;
|
||||
dist = min(dist, distance_to_line(mx, my, x0, y0, x1 - diag * sx, y0));
|
||||
dist = min(dist, distance_to_line(mx, my, x1 - diag * sx, y0, x1, y0 + diag * sy));
|
||||
dist = min(dist, distance_to_line(mx, my, x1, y0 + diag * sy, x1, y1));
|
||||
|
||||
return dist;
|
||||
}
|
|
@ -33,7 +33,7 @@
|
|||
globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING;
|
||||
VERSION = 1140;
|
||||
SAVEFILE_VERSION = 1400;
|
||||
VERSION_STRING = "1.14.0pr5";
|
||||
VERSION_STRING = "1.14.0pr7";
|
||||
|
||||
globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES;
|
||||
|
||||
|
@ -146,11 +146,16 @@
|
|||
#endregion
|
||||
|
||||
#region default
|
||||
globalvar DEF_SURFACE;
|
||||
globalvar DEF_SURFACE, USE_DEF;
|
||||
DEF_SURFACE = noone;
|
||||
USE_DEF = -10;
|
||||
|
||||
function DEF_SURFACE_RESET() {
|
||||
DEF_SURFACE = surface_create_valid(1, 1);
|
||||
if(is_surface(DEF_SURFACE)) return;
|
||||
|
||||
DEF_SURFACE = surface_create_valid(32, 32);
|
||||
surface_set_target(DEF_SURFACE);
|
||||
draw_clear_alpha(c_white, 0);
|
||||
draw_clear(c_white);
|
||||
surface_reset_target();
|
||||
}
|
||||
DEF_SURFACE_RESET();
|
||||
|
|
|
@ -149,3 +149,33 @@ function gradientObject(color = c_black) constructor {
|
|||
return self;
|
||||
}
|
||||
}
|
||||
|
||||
function loadGradient(path) {
|
||||
if(path == "") return noone;
|
||||
if(!file_exists(path)) return noone;
|
||||
|
||||
var grad = new gradientObject();
|
||||
grad.keys = [];
|
||||
|
||||
var _t = file_text_open_read(path);
|
||||
while(!file_text_eof(_t)) {
|
||||
var key = file_text_readln(_t);
|
||||
var _col = 0, _pos = 0;
|
||||
|
||||
if(string_pos(",", key)) {
|
||||
var keys = string_splice(key, ",");
|
||||
if(array_length(keys) != 2) continue;
|
||||
|
||||
_col = toNumber(keys[0]);
|
||||
_pos = toNumber(keys[1]);
|
||||
} else {
|
||||
_col = toNumber(key);
|
||||
if(file_text_eof(_t)) break;
|
||||
_pos = toNumber(file_text_readln(_t));
|
||||
}
|
||||
|
||||
array_push(grad.keys, new gradientKey(_pos, _col));
|
||||
}
|
||||
file_text_close(_t);
|
||||
return grad;
|
||||
}
|
|
@ -25,10 +25,10 @@ function Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
inputs[| 7] = nodeValue("Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 8] = nodeValue("Manual generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 8] = nodeValue("Manual generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
generateMesh();
|
||||
update();
|
||||
doUpdate();
|
||||
}, "Generate"] );
|
||||
|
||||
inputs[| 9] = nodeValue("Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
|
|
|
@ -13,7 +13,7 @@ function Node_3D_Obj(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
.setDisplay(VALUE_DISPLAY.path_load, [ "*.obj", "" ])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue("Generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 1] = nodeValue("Generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
updateObj();
|
||||
doUpdate();
|
||||
|
|
|
@ -2,7 +2,7 @@ function Node_3D_Cube(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
name = "3D Cube";
|
||||
dimension_index = 1;
|
||||
|
||||
inputs[| 0] = nodeValue("Main texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, DEF_SURFACE);
|
||||
inputs[| 0] = nodeValue("Main texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, USE_DEF);
|
||||
|
||||
inputs[| 1] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
|
|
@ -46,6 +46,8 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
|
||||
current_data = [];
|
||||
|
||||
UPDATE_PART_FORWARD
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
|
||||
|
|
|
@ -17,16 +17,7 @@ function Node_VFX_Spawner(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y
|
|||
|
||||
array_insert(input_display_list, 0, ["Trigger", true], input_len + 0, input_len + 1);
|
||||
|
||||
static updateParticleForward = function(_render = true) {
|
||||
var pt = outputs[| 0];
|
||||
for( var i = 0; i < ds_list_size(pt.value_to); i++ ) {
|
||||
var _n = pt.value_to[| i];
|
||||
if(_n.value_from != pt) continue;
|
||||
|
||||
if(variable_struct_exists(_n.node, "updateParticleForward"))
|
||||
_n.node.updateParticleForward();
|
||||
}
|
||||
}
|
||||
UPDATE_PART_FORWARD
|
||||
|
||||
static onUpdate = function() {
|
||||
RETURN_ON_REST
|
||||
|
|
|
@ -33,7 +33,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, ["*.ase, *.aseprite", ""]);
|
||||
|
||||
inputs[| 1] = nodeValue("Generate layers", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 1] = nodeValue("Generate layers", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() { refreshLayers(); }, "Generate"] );
|
||||
|
||||
inputs[| 2] = nodeValue("Current tag", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, "");
|
||||
|
@ -247,7 +247,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
|
||||
var p_arr = [];
|
||||
for( var k = 0; k < array_length(plt); k++ )
|
||||
array_push(p_arr, make_color_rgb(plt[i][0], plt[i][1], plt[i][2]));
|
||||
array_push(p_arr, make_color_rgb(plt[k][0], plt[k][1], plt[k][2]));
|
||||
outputs[| 3].setValue(p_arr);
|
||||
break;
|
||||
case 0x2004: //layer
|
||||
|
@ -276,7 +276,7 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
return true;
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
var path = inputs[| 0].getValue();
|
||||
if(path == "") return;
|
||||
updatePaths(path);
|
||||
|
|
|
@ -43,6 +43,16 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
attribute_surface_depth();
|
||||
attribute_oversample();
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
var _surf = current_data[0];
|
||||
if(!is_surface(_surf)) return;
|
||||
|
||||
var _pw = surface_get_width(_surf) * _s / 2;
|
||||
var _ph = surface_get_height(_surf) * _s / 2;
|
||||
|
||||
inputs[| 2].drawOverlay(active, _x + _pw, _y + _ph, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _hei = _data[1];
|
||||
var _shf = _data[2];
|
||||
|
|
|
@ -6,8 +6,8 @@ function Node_create_Blend(_x, _y, _group = noone, _param = "") {
|
|||
function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Blend";
|
||||
|
||||
inputs[| 0] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, DEF_SURFACE);
|
||||
inputs[| 1] = nodeValue("Foreground", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, DEF_SURFACE);
|
||||
inputs[| 0] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
inputs[| 1] = nodeValue("Foreground", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
inputs[| 2] = nodeValue("Blend mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, BLEND_TYPES );
|
||||
|
|
|
@ -512,8 +512,14 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
apply_surface();
|
||||
|
||||
} else if(isUsingTool(4)) {
|
||||
if(point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, _surf_w - 1, _surf_h - 1) && mouse_press(mb_left)) {
|
||||
}
|
||||
|
||||
if(isUsingTool(4) || (DRAGGING && DRAGGING.type == "Color")) {
|
||||
if(point_in_rectangle(mouse_cur_x, mouse_cur_y, 0, 0, _surf_w - 1, _surf_h - 1)) {
|
||||
var fill = DRAGGING? mouse_release(mb_left) : mouse_press(mb_left);
|
||||
|
||||
if(fill) {
|
||||
if(DRAGGING) draw_set_color(DRAGGING.data);
|
||||
switch(_fill_type) {
|
||||
case 0 :
|
||||
flood_fill_scanline(mouse_cur_x, mouse_cur_y, canvas_surface, _thr, false);
|
||||
|
@ -525,10 +531,10 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
canvas_fill(mouse_cur_x, mouse_cur_y, canvas_surface, _thr);
|
||||
break;
|
||||
}
|
||||
|
||||
surface_store_buffer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
draw_set_alpha(1);
|
||||
gpu_set_colorwriteenable(true, true, true, true);
|
||||
|
|
|
@ -83,17 +83,17 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
dia.node = self;
|
||||
}) ]);
|
||||
|
||||
inspUpdateTooltip = get_text("panel_inspector_execute", "Execute node contents");
|
||||
inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||
insp1UpdateTooltip = get_text("panel_inspector_execute", "Execute node contents");
|
||||
insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||
|
||||
static inspectorUpdate = function() { onInspectorUpdate(); }
|
||||
static onInspectorUpdate = function() { RenderListAction(nodes, group); }
|
||||
static inspector1Update = function() { onInspector1Update(); }
|
||||
static onInspector1Update = function() { RenderListAction(nodes, group); }
|
||||
|
||||
static hasInspectorUpdate = function(group = false) {
|
||||
static hasInspector1Update = function(group = false) {
|
||||
if(!group) return false;
|
||||
|
||||
for( var i = 0; i < ds_list_size(nodes); i++ ) {
|
||||
if(nodes[| i].hasInspectorUpdate())
|
||||
if(nodes[| i].hasInspector1Update())
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -136,13 +136,16 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
}
|
||||
|
||||
static getNextNodes = function() {
|
||||
var nodes = [];
|
||||
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||
var _in = inputs[| i].from;
|
||||
if(!_in.renderActive) continue;
|
||||
|
||||
ds_queue_enqueue(RENDER_QUEUE, _in);
|
||||
array_push(nodes, _in);
|
||||
printIf(global.RENDER_LOG, "Push group input " + _in.name + " to stack");
|
||||
}
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
static setRenderStatus = function(result) {
|
||||
|
@ -252,12 +255,12 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
|
||||
PATCH_STATIC
|
||||
|
||||
static triggerRender = function() {
|
||||
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||
var jun_node = inputs[| i].from;
|
||||
jun_node.triggerRender();
|
||||
}
|
||||
}
|
||||
//static triggerRender = function() {
|
||||
// for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||
// var jun_node = inputs[| i].from;
|
||||
// jun_node.triggerRender();
|
||||
// }
|
||||
//}
|
||||
|
||||
static preConnect = function() {
|
||||
sortIO();
|
||||
|
|
|
@ -97,7 +97,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
if(mouse_click(mb_left, _focus) && _vis[| ind] != hold_visibility) {
|
||||
_vis[| ind] = hold_visibility;
|
||||
update();
|
||||
doUpdate();
|
||||
}
|
||||
} else
|
||||
draw_sprite_ui_uniform(THEME.junc_visible, vis, _bx, _cy + lh / 2, 1, COLORS._main_icon, 0.5 + 0.5 * vis);
|
||||
|
@ -179,7 +179,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
ds_list_insert(inputs, targt + i, ext[i]);
|
||||
}
|
||||
|
||||
update();
|
||||
doUpdate();
|
||||
}
|
||||
layer_dragging = noone;
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
if(input_display_list[i] > idx)
|
||||
input_display_list[i] = input_display_list[i] - data_length;
|
||||
}
|
||||
update();
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
function createNewSurface() {
|
||||
|
|
|
@ -90,7 +90,7 @@ function Node_CSV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
return true;
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
var path = inputs[| 0].getValue();
|
||||
if(path == "") return;
|
||||
updatePaths(path);
|
||||
|
|
|
@ -49,7 +49,7 @@ function Node_CSV_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
}
|
||||
|
||||
static update = function(frame = ANIMATOR.current_frame) { writeFile(); }
|
||||
static onInspectorUpdate = function() { writeFile(); }
|
||||
static onInspector1Update = function() { writeFile(); }
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
|
|
|
@ -36,15 +36,20 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
draw_name = true;
|
||||
draggable = true;
|
||||
|
||||
inputs = ds_list_create();
|
||||
outputs = ds_list_create();
|
||||
|
||||
input_display_list = -1;
|
||||
output_display_list = -1;
|
||||
inspector_display_list = -1;
|
||||
is_dynamic_output = false;
|
||||
inputs = ds_list_create();
|
||||
outputs = ds_list_create();
|
||||
|
||||
attributes = ds_map_create();
|
||||
attributeEditors = [];
|
||||
|
||||
inspectInput1 = nodeValue("Toggle execution", self, JUNCTION_CONNECT.input, VALUE_TYPE.action, false).setVisible(true, true);
|
||||
inspectInput2 = nodeValue("Toggle execution", self, JUNCTION_CONNECT.input, VALUE_TYPE.action, false).setVisible(true, true);
|
||||
|
||||
show_input_name = false;
|
||||
show_output_name = false;
|
||||
|
||||
|
@ -219,18 +224,18 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
if(!LOADING) MODIFIED = true;
|
||||
}
|
||||
|
||||
inspUpdateTooltip = get_text("panel_inspector_execute", "Execute node");
|
||||
inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||
insp1UpdateTooltip = get_text("panel_inspector_execute", "Execute node");
|
||||
insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||
|
||||
static inspectorUpdate = function() {
|
||||
static inspector1Update = function() {
|
||||
if(error_update_enabled && error_noti_update != noone)
|
||||
noti_remove(error_noti_update);
|
||||
error_noti_update = noone;
|
||||
|
||||
onInspectorUpdate();
|
||||
onInspector1Update();
|
||||
}
|
||||
static onInspectorUpdate = noone;
|
||||
static hasInspectorUpdate = function() { return onInspectorUpdate != noone; }
|
||||
static onInspector1Update = noone;
|
||||
static hasInspector1Update = function() { return onInspector1Update != noone; }
|
||||
|
||||
insp2UpdateTooltip = get_text("panel_inspector_execute", "Execute node");
|
||||
insp2UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||
|
@ -240,8 +245,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
static hasInspector2Update = function() { return onInspector2Update != noone; }
|
||||
|
||||
static stepBegin = function() {
|
||||
if(use_cache)
|
||||
cacheArrayCheck();
|
||||
if(use_cache) cacheArrayCheck();
|
||||
var willUpdate = false;
|
||||
|
||||
if(always_output) {
|
||||
|
@ -279,6 +283,9 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
setHeight();
|
||||
|
||||
doStepBegin();
|
||||
|
||||
if(hasInspector1Update()) inspectInput1.name = insp1UpdateTooltip;
|
||||
if(hasInspector2Update()) inspectInput2.name = insp2UpdateTooltip;
|
||||
}
|
||||
static doStepBegin = function() {}
|
||||
|
||||
|
@ -289,6 +296,14 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
if(SAFE_MODE) return;
|
||||
var sBase = surface_get_target();
|
||||
|
||||
for( var i = 0; i < ds_list_size(inputs); i++ ) {
|
||||
if(inputs[| i].type != VALUE_TYPE.trigger) continue;
|
||||
if(inputs[| i].editWidget == noone) continue;
|
||||
|
||||
var trg = inputs[| i].getValue();
|
||||
if(trg) inputs[| i].editWidget.onClick();
|
||||
}
|
||||
|
||||
try {
|
||||
var t = get_timer();
|
||||
update();
|
||||
|
@ -302,6 +317,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
|
||||
log_warning("RENDER", exception_print(exception), self);
|
||||
}
|
||||
|
||||
if(hasInspector1Update()) {
|
||||
var trigger = inspectInput1.getValue();
|
||||
if(trigger) onInspector1Update();
|
||||
}
|
||||
|
||||
if(hasInspector2Update()) {
|
||||
var trigger = inspectInput2.getValue();
|
||||
if(trigger) onInspector2Update();
|
||||
}
|
||||
}
|
||||
|
||||
static valueUpdate = function(index) {
|
||||
|
@ -315,34 +340,15 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
static onValueFromUpdate = function(index) {}
|
||||
|
||||
static triggerRender = function() {
|
||||
printIf(global.RENDER_LOG, " -> Trigger render for " + name + " (" + display_name + ")");
|
||||
|
||||
setRenderStatus(false);
|
||||
UPDATE |= RENDER_TYPE.partial;
|
||||
|
||||
for(var i = 0; i < ds_list_size(outputs); i++) {
|
||||
var jun = outputs[| i];
|
||||
for(var j = 0; j < ds_list_size(jun.value_to); j++) {
|
||||
var _to = jun.value_to[| j];
|
||||
if(_to.value_from != jun) continue;
|
||||
|
||||
_to.node.triggerRender();
|
||||
var nodes = getNextNodes();
|
||||
for(var i = 0; i < array_length(nodes); i++)
|
||||
nodes[i].triggerRender();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//static isUpdateReady = function() { //Removed, same as isRenderable()
|
||||
// for(var j = 0; j < ds_list_size(inputs); j++) {
|
||||
// var _in = inputs[| j];
|
||||
// var val_from = _in.value_from;
|
||||
// if(val_from == noone) continue;
|
||||
// if(!val_from.node.active) continue;
|
||||
// if(!val_from.node.renderActive) continue;
|
||||
|
||||
// if (!val_from.node.rendered)
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// return true;
|
||||
//}
|
||||
|
||||
static isRenderable = function() { //Check if every input is ready (updated)
|
||||
if(!active) return false;
|
||||
|
@ -365,25 +371,24 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
}
|
||||
|
||||
static getNextNodes = function() {
|
||||
var nodes = [];
|
||||
|
||||
for(var i = 0; i < ds_list_size(outputs); i++) {
|
||||
var _ot = outputs[| i];
|
||||
//if(_ot.type == VALUE_TYPE.node) continue;
|
||||
|
||||
for(var j = 0; j < ds_list_size(_ot.value_to); j++) {
|
||||
var _to = _ot.value_to[| j];
|
||||
if(!_to.node.renderActive) continue;
|
||||
if(!_to.node.active || _to.value_from == noone) continue;
|
||||
|
||||
printIf(global.RENDER_LOG, " -> Check render " + _to.node.name + " from " + _to.value_from.node.name);
|
||||
if(_to.value_from.node != self) continue;
|
||||
|
||||
_to.node.triggerRender();
|
||||
printIf(global.RENDER_LOG, " --> Check complete, push " + _to.node.name + " to stack.");
|
||||
array_push(nodes, _to.node);
|
||||
}
|
||||
}
|
||||
|
||||
if(_to.node.isRenderable()) {
|
||||
ds_queue_enqueue(RENDER_QUEUE, _to.node);
|
||||
printIf(global.RENDER_LOG, " >| Push " + _to.node.name + " (" + _to.node.display_name + ") node to stack");
|
||||
} else
|
||||
printIf(global.RENDER_LOG, " >| Node " + _to.node.name + " not ready");
|
||||
}
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
|
||||
static onInspect = function() {}
|
||||
|
@ -407,6 +412,20 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
var yy = y * _s + _y;
|
||||
var jun;
|
||||
|
||||
var inspCount = hasInspector1Update() + hasInspector2Update();
|
||||
var ind = 1;
|
||||
if(hasInspector1Update()) {
|
||||
inspectInput1.x = xx + w * _s * ind / (inspCount + 1);
|
||||
inspectInput1.y = yy;
|
||||
ind++;
|
||||
}
|
||||
|
||||
if(hasInspector2Update()) {
|
||||
inspectInput2.x = xx + w * _s * ind / (inspCount + 1);
|
||||
inspectInput2.y = yy;
|
||||
ind++;
|
||||
}
|
||||
|
||||
var inamo = input_display_list == -1? ds_list_size(inputs) : array_length(input_display_list);
|
||||
var _in = yy + ui(32) * _s;
|
||||
|
||||
|
@ -476,7 +495,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
|
||||
draw_set_text(f_p1, fa_left, fa_center, cc);
|
||||
|
||||
if(hasInspectorUpdate()) icon = THEME.refresh_s;
|
||||
if(hasInspector1Update()) icon = THEME.refresh_s;
|
||||
var ts = clamp(power(_s, 0.5), 0.5, 1);
|
||||
|
||||
var aa = 0.5 + 0.5 * renderActive;
|
||||
|
@ -514,6 +533,12 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
hover = jun;
|
||||
}
|
||||
|
||||
if(hasInspector1Update() && inspectInput1.drawJunction(_s, _mx, _my))
|
||||
hover = inspectInput1;
|
||||
|
||||
if(hasInspector2Update() && inspectInput2.drawJunction(_s, _mx, _my))
|
||||
hover = inspectInput2;
|
||||
|
||||
return hover;
|
||||
}
|
||||
|
||||
|
@ -553,6 +578,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
for(var i = 0; i < ds_list_size(outputs); i++)
|
||||
outputs[| i].drawName(_s, _mx, _my);
|
||||
}
|
||||
|
||||
if(hasInspector1Update() && PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, inspectInput1.x, inspectInput1.y, 10)) {
|
||||
inspectInput1.drawNameBG(_s);
|
||||
inspectInput1.drawName(_s, _mx, _my);
|
||||
}
|
||||
|
||||
if(hasInspector2Update() && PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, inspectInput2.x, inspectInput2.y, 10)) {
|
||||
inspectInput2.drawNameBG(_s);
|
||||
inspectInput2.drawName(_s, _mx, _my);
|
||||
}
|
||||
}
|
||||
|
||||
static drawConnections = function(_x, _y, _s, mx, my, _active, aa = 1) {
|
||||
|
@ -576,9 +611,17 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
}
|
||||
}
|
||||
|
||||
var st = 0;
|
||||
if(hasInspector1Update()) st = -1;
|
||||
if(hasInspector2Update()) st = -2;
|
||||
|
||||
var drawLineIndex = 1;
|
||||
for(var i = 0; i < ds_list_size(inputs); i++) {
|
||||
var jun = inputs[| i];
|
||||
for(var i = st; i < ds_list_size(inputs); i++) {
|
||||
var jun;
|
||||
if(i == -1) jun = inspectInput1;
|
||||
else if(i == -2) jun = inspectInput2;
|
||||
else jun = inputs[| i];
|
||||
|
||||
var jx = jun.x;
|
||||
var jy = jun.y;
|
||||
|
||||
|
@ -603,23 +646,35 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
var th = max(1, PREF_MAP[? "connection_line_width"] * _s);
|
||||
jun.draw_line_shift_hover = false;
|
||||
|
||||
var drawCorner = jun.type == VALUE_TYPE.action || jun.value_from.type == VALUE_TYPE.action;
|
||||
|
||||
if(PANEL_GRAPH.pHOVER)
|
||||
switch(PREF_MAP[? "curve_connection_line"]) {
|
||||
case 0 :
|
||||
hover = distance_to_line(mx, my, jx, jy, frx, fry) < max(th * 2, 6);
|
||||
break;
|
||||
case 1 :
|
||||
if(drawCorner)
|
||||
hover = distance_to_curve_corner(mx, my, jx, jy, frx, fry, _s) < max(th * 2, 6);
|
||||
else
|
||||
hover = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s) < max(th * 2, 6);
|
||||
|
||||
if(PANEL_GRAPH._junction_hovering == noone)
|
||||
jun.draw_line_shift_hover = hover;
|
||||
break;
|
||||
case 2 :
|
||||
if(drawCorner)
|
||||
hover = distance_to_elbow_corner(mx, my, frx, fry, jx, jy) < max(th * 2, 6);
|
||||
else
|
||||
hover = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, jun.value_from.drawLineIndex, jun.drawLineIndex) < max(th * 2, 6);
|
||||
|
||||
if(PANEL_GRAPH._junction_hovering == noone)
|
||||
jun.draw_line_shift_hover = hover;
|
||||
break;
|
||||
case 3 :
|
||||
if(drawCorner)
|
||||
hover = distance_to_elbow_diag_corner(mx, my, frx, fry, jx, jy) < max(th * 2, 6);
|
||||
else
|
||||
hover = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, jun.value_from.drawLineIndex, jun.drawLineIndex) < max(th * 2, 6);
|
||||
|
||||
if(PANEL_GRAPH._junction_hovering == noone)
|
||||
|
@ -635,8 +690,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
thicken |= _active && PANEL_GRAPH.junction_hovering == jun && PANEL_GRAPH._junction_hovering == noone;
|
||||
thicken |= instance_exists(o_dialog_add_node) && o_dialog_add_node.junction_hovering == jun;
|
||||
|
||||
if(thicken)
|
||||
th *= 2;
|
||||
if(PREF_MAP[? "connection_line_transition"]) {
|
||||
jun.draw_line_thick.set(thicken? 2 : 1);
|
||||
th *= jun.draw_line_thick.get();
|
||||
} else
|
||||
th *= thicken? 2 : 1;
|
||||
|
||||
var corner = PREF_MAP[? "connection_line_corner"] * _s;
|
||||
var ty = LINE_STYLE.solid;
|
||||
|
@ -660,9 +718,24 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
else
|
||||
draw_line_dashed_color(jx, jy, frx, fry, th, c1, c0, 12 * ss);
|
||||
break;
|
||||
case 1 : draw_line_curve_color(jx, jy, frx, fry, cx, cy, ss, th, c0, c1, ty); break;
|
||||
case 2 : draw_line_elbow_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty); break;
|
||||
case 3 : draw_line_elbow_diag_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty); break;
|
||||
case 1 :
|
||||
if(drawCorner)
|
||||
draw_line_curve_corner(jx, jy, frx, fry, ss, th, c0, c1);
|
||||
else
|
||||
draw_line_curve_color(jx, jy, frx, fry, cx, cy, ss, th, c0, c1, ty);
|
||||
break;
|
||||
case 2 :
|
||||
if(drawCorner)
|
||||
draw_line_elbow_corner(frx, fry, jx, jy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty);
|
||||
else
|
||||
draw_line_elbow_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty);
|
||||
break;
|
||||
case 3 :
|
||||
if(drawCorner)
|
||||
draw_line_elbow_diag_corner(frx, fry, jx, jy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty);
|
||||
else
|
||||
draw_line_elbow_diag_color(frx, fry, jx, jy, cx, cy, ss, th, c0, c1, corner, jun.value_from.drawLineIndex, jun.drawLineIndex, ty);
|
||||
break;
|
||||
}
|
||||
|
||||
drawLineIndex += 0.5;
|
||||
|
@ -831,20 +904,29 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
|
||||
return drawJunctions(xx, yy, _mx, _my, _s);
|
||||
}
|
||||
|
||||
static onDrawNodeBehind = function(_x, _y, _mx, _my, _s) {}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover = false, _focus = false) {}
|
||||
|
||||
badgePreview = 0;
|
||||
badgeInspect = 0;
|
||||
static drawBadge = function(_x, _y, _s) {
|
||||
if(!active) return;
|
||||
var xx = x * _s + _x + w * _s;
|
||||
var yy = y * _s + _y;
|
||||
|
||||
if(previewing) {
|
||||
draw_sprite(THEME.node_state, 0, xx, yy);
|
||||
xx -= max(32 * _s, 16);
|
||||
badgePreview = lerp_float(badgePreview, !!previewing, 2);
|
||||
badgeInspect = lerp_float(badgeInspect, inspecting, 2);
|
||||
|
||||
if(badgePreview > 0) {
|
||||
draw_sprite_ext(THEME.node_state, 0, xx, yy, badgePreview, badgePreview, 0, c_white, 1);
|
||||
xx -= 28 * badgePreview;
|
||||
}
|
||||
if(inspecting) {
|
||||
draw_sprite(THEME.node_state, 1, xx, yy);
|
||||
|
||||
if(badgeInspect > 0) {
|
||||
draw_sprite_ext(THEME.node_state, 1, xx, yy, badgeInspect, badgeInspect, 0, c_white, 1);
|
||||
xx -= 28 * badgeInspect;
|
||||
}
|
||||
|
||||
inspecting = false;
|
||||
|
@ -1133,6 +1215,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
ds_list_add_map(_inputs, inputs[| i].serialize(scale, preset));
|
||||
ds_map_add_list(_map, "inputs", _inputs);
|
||||
|
||||
var _trigger = ds_list_create();
|
||||
ds_list_add_map(_trigger, inspectInput1.serialize(scale, preset));
|
||||
ds_list_add_map(_trigger, inspectInput2.serialize(scale, preset));
|
||||
ds_map_add_list(_map, "inspectInputs", _trigger);
|
||||
|
||||
doSerialize(_map);
|
||||
processSerialize(_map);
|
||||
return _map;
|
||||
|
@ -1175,10 +1262,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
|
||||
doDeserialize();
|
||||
processDeserialize();
|
||||
|
||||
if(!ds_map_exists(load_map, "inputs"))
|
||||
return;
|
||||
}
|
||||
|
||||
static doDeserialize = function() {}
|
||||
|
||||
static attributeDeserialize = function(attr) {
|
||||
|
@ -1192,14 +1277,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
var _inputs = load_map[? "inputs"];
|
||||
var amo = min(ds_list_size(inputs), ds_list_size(_inputs));
|
||||
|
||||
//printIf(TESTING, " > Applying deserialize to node " + name + " (amount: " + string(amo) + ")");
|
||||
|
||||
for(var i = 0; i < amo; i++) {
|
||||
if(inputs[| i] == noone) continue;
|
||||
inputs[| i].applyDeserialize(_inputs[| i], load_scale, preset);
|
||||
}
|
||||
|
||||
//printIf(TESTING, " > Applying deserialize to node " + name + " completed");
|
||||
if(ds_map_exists(load_map, "inspectInputs")) {
|
||||
var insInp = load_map[? "inspectInputs"];
|
||||
inspectInput1.applyDeserialize(insInp[| 0], load_scale, preset);
|
||||
inspectInput2.applyDeserialize(insInp[| 1], load_scale, preset);
|
||||
}
|
||||
|
||||
doApplyDeserialize();
|
||||
}
|
||||
|
@ -1224,9 +1311,14 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
|
||||
static connect = function(log = false) {
|
||||
var connected = true;
|
||||
for(var i = 0; i < ds_list_size(inputs); i++) {
|
||||
for(var i = 0; i < ds_list_size(inputs); i++)
|
||||
connected &= inputs[| i].connect(log);
|
||||
|
||||
if(ds_map_exists(load_map, "inspectInputs")) {
|
||||
inspectInput1.connect(log);
|
||||
inspectInput2.connect(log);
|
||||
}
|
||||
|
||||
if(!connected) ds_queue_enqueue(CONNECTION_CONFLICT, self);
|
||||
|
||||
return connected;
|
||||
|
|
|
@ -39,7 +39,7 @@ function Node_Display_Image(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
|
||||
first_update = false;
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
var path = inputs[| 0].getValue();
|
||||
if(path == "") return;
|
||||
updatePaths(path);
|
||||
|
|
|
@ -339,13 +339,13 @@ function Node_Export(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
}
|
||||
|
||||
inspUpdateTooltip = "Export";
|
||||
inspUpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||
insp1UpdateTooltip = "Export";
|
||||
insp1UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||
|
||||
insp2UpdateTooltip = "Export All";
|
||||
insp2UpdateIcon = [ THEME.play_all, 0, COLORS._main_value_positive ];
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
if(isInLoop()) UPDATE |= RENDER_TYPE.full;
|
||||
else doInspectorAction();
|
||||
}
|
||||
|
|
|
@ -27,9 +27,9 @@ function Node_Feedback(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
|
|||
allReady &= _in.isRenderable()
|
||||
}
|
||||
|
||||
if(!allReady) return;
|
||||
if(!allReady) return [];
|
||||
|
||||
__nodeLeafList(getNodeList(), RENDER_QUEUE);
|
||||
return __nodeLeafList(getNodeList());
|
||||
}
|
||||
|
||||
PATCH_STATIC
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Fluid_Domain(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
|
|||
name = "Fluid Domain";
|
||||
color = COLORS.node_blend_fluid;
|
||||
icon = THEME.fluid_sim;
|
||||
update_on_frame = true;
|
||||
|
||||
min_h = 128;
|
||||
|
||||
|
|
|
@ -25,10 +25,11 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
}
|
||||
|
||||
static getNextNodes = function() {
|
||||
if(is_undefined(outParent)) return;
|
||||
if(is_undefined(outParent)) return [];
|
||||
group.setRenderStatus(true);
|
||||
//printIf(global.RENDER_LOG, "Value to amount " + string(ds_list_size(outParent.value_to)));
|
||||
|
||||
var nodes = [];
|
||||
for(var j = 0; j < ds_list_size(outParent.value_to); j++) {
|
||||
var _to = outParent.value_to[| j];
|
||||
if(!_to.node.renderActive) continue;
|
||||
|
@ -47,14 +48,18 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
printIf(global.RENDER_LOG, "Group output ready " + string(_to.node.isRenderable()));
|
||||
|
||||
if(_to.node.isRenderable()) {
|
||||
ds_queue_enqueue(RENDER_QUEUE, _to.node);
|
||||
array_push(nodes, _to.node);
|
||||
printIf(global.RENDER_LOG, "Push node " + _to.node.name + " to stack");
|
||||
}
|
||||
}
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
static createOutput = function(override_order = true) {
|
||||
if(group && is_struct(group)) {
|
||||
if(group == noone) return;
|
||||
if(!is_struct(group)) return;
|
||||
|
||||
if(override_order) {
|
||||
output_index = ds_list_size(group.outputs);
|
||||
inputs[| 1].setValue(output_index);
|
||||
|
@ -75,7 +80,6 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
|
||||
outParent.setFrom(inputs[| 0]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!LOADING && !APPENDING)
|
||||
createOutput();
|
||||
|
@ -95,14 +99,14 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
outParent.display_type = inputs[| 0].display_type;
|
||||
}
|
||||
|
||||
static triggerRender = function() {
|
||||
if(is_undefined(outParent)) return;
|
||||
//static triggerRender = function() {
|
||||
// if(is_undefined(outParent)) return;
|
||||
|
||||
for(var j = 0; j < ds_list_size(outParent.value_to); j++) {
|
||||
if(outParent.value_to[| j].value_from == outParent)
|
||||
outParent.value_to[| j].node.triggerRender();
|
||||
}
|
||||
}
|
||||
// for(var j = 0; j < ds_list_size(outParent.value_to); j++) {
|
||||
// if(outParent.value_to[| j].value_from == outParent)
|
||||
// outParent.value_to[| j].node.triggerRender();
|
||||
// }
|
||||
//}
|
||||
|
||||
static postDeserialize = function() {
|
||||
createOutput(false);
|
||||
|
|
|
@ -4,7 +4,7 @@ function __generate_node_data() {
|
|||
|
||||
CLONING = true;
|
||||
|
||||
var dir = DIRECTORY + "Nodes//";
|
||||
var dir = DIRECTORY + "Nodes/Guides/";
|
||||
if(!directory_exists(dir)) directory_create(dir);
|
||||
|
||||
repeat(amo) {
|
||||
|
@ -27,6 +27,7 @@ function __generate_node_data() {
|
|||
name: _b.inputs[| i].name,
|
||||
tooltip: _b.inputs[| i].tooltip,
|
||||
type: _b.inputs[| i].type,
|
||||
visible: _b.inputs[| i].visible,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -35,6 +36,7 @@ function __generate_node_data() {
|
|||
name: _b.outputs[| i].name,
|
||||
tooltip: _b.outputs[| i].tooltip,
|
||||
type: _b.outputs[| i].type,
|
||||
visible: _b.outputs[| i].visible,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -52,11 +54,11 @@ function __generate_node_data() {
|
|||
function __initNodeData() {
|
||||
global.NODE_GUIDE = {};
|
||||
|
||||
var dir = DIRECTORY + "Nodes/Guides";
|
||||
var dir = DIRECTORY + "Nodes/Guides/";
|
||||
if(!directory_exists(dir))
|
||||
directory_create(dir);
|
||||
|
||||
var f = file_find_first(dir + "*", 0);
|
||||
var f = file_find_first(dir + "*.json", 0);
|
||||
while(f != "") {
|
||||
var path = dir + f;
|
||||
|
||||
|
@ -68,16 +70,22 @@ function __initNodeData() {
|
|||
f = file_find_next();
|
||||
}
|
||||
|
||||
//var _l = dir + "/version";
|
||||
//if(file_exists(_l)) {
|
||||
// var res = json_load_struct(_l);
|
||||
// if(res.version >= VERSION) return;
|
||||
//}
|
||||
//json_save_struct(_l, { version: VERSION });
|
||||
var nodeDir = DIRECTORY + "Nodes/";
|
||||
var _l = nodeDir + "/version";
|
||||
|
||||
if(file_exists(_l)) {
|
||||
var res = json_load_struct(_l);
|
||||
if(res.version >= VERSION) return;
|
||||
}
|
||||
json_save_struct(_l, { version: VERSION });
|
||||
|
||||
var tooltipDir = DIRECTORY + "Nodes/";
|
||||
if(file_exists("data/tooltip.zip"))
|
||||
zip_unzip("data/tooltip.zip", tooltipDir);
|
||||
zip_unzip("data/tooltip.zip", nodeDir);
|
||||
else
|
||||
noti_status("Tooltip image file not found.")
|
||||
|
||||
if(file_exists("data/Guides.zip"))
|
||||
zip_unzip("data/Guides.zip", nodeDir);
|
||||
else
|
||||
noti_status("Node data file not found.")
|
||||
}
|
|
@ -80,7 +80,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
return false;
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
var path = inputs[| 0].getValue();
|
||||
if(path == "") return;
|
||||
updatePaths(path);
|
||||
|
@ -127,7 +127,7 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
_splice.inputs[| 1].setValue([ww, hh]);
|
||||
_splice.inputs[| 2].setValue(amo);
|
||||
_splice.inputs[| 3].setValue([ amo, 1 ]);
|
||||
_splice.inspectorUpdate();
|
||||
_splice.inspector1Update();
|
||||
|
||||
ds_list_add(PANEL_GRAPH.nodes_select_list, self);
|
||||
ds_list_add(PANEL_GRAPH.nodes_select_list, _splice);
|
||||
|
|
|
@ -57,7 +57,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
.setDisplay(VALUE_DISPLAY.enum_scroll, ["Loop", "Ping pong", "Hold last frame", "Hide"])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 5] = nodeValue("Set animation length to match", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 5] = nodeValue("Set animation length to match", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
if(array_length(spr) == 0) return;
|
||||
ANIMATOR.frames_total = array_length(spr);
|
||||
|
@ -124,7 +124,7 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
return true;
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
var path = inputs[| 0].getValue();
|
||||
if(path == "") return;
|
||||
updatePaths(path);
|
||||
|
|
|
@ -34,7 +34,7 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "")
|
||||
.setDisplay(VALUE_DISPLAY.path_load, ["*.gif", ""]);
|
||||
|
||||
inputs[| 1] = nodeValue("Set animation length to gif", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 1] = nodeValue("Set animation length to gif", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
if(!spr) return;
|
||||
if(!sprite_exists(spr)) return;
|
||||
|
@ -62,7 +62,7 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
return false;
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
var path = inputs[| 0].getValue();
|
||||
if(path == "") return;
|
||||
updatePaths(path);
|
||||
|
|
|
@ -82,7 +82,7 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
return false;
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
var path = inputs[| 0].getValue();
|
||||
if(path == "") return;
|
||||
updatePaths(path);
|
||||
|
|
|
@ -29,7 +29,7 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
inputs[| 9] = nodeValue("Orientation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Horizontal", "Vertical"]);
|
||||
|
||||
inputs[| 10] = nodeValue("Auto fill", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 10] = nodeValue("Auto fill", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
var _sur = inputs[| 0].getValue();
|
||||
if(!is_surface(_sur) || _sur == DEF_SURFACE) return;
|
||||
|
@ -52,10 +52,10 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
else
|
||||
inputs[| 3].setValue([ fill_h, fill_w ]);
|
||||
|
||||
inspectorUpdate();
|
||||
inspector1Update();
|
||||
}, "Auto fill"] );
|
||||
|
||||
inputs[| 11] = nodeValue("Sync animation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 11] = nodeValue("Sync animation", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
var _amo = inputs[| 3].getValue();
|
||||
ANIMATOR.frames_total = max(1, _amo[0] * _amo[1]);
|
||||
|
@ -261,7 +261,7 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
inputs[| 8].setVisible(!_out);
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
if(isInLoop()) Render();
|
||||
else doInspectorAction();
|
||||
}
|
||||
|
|
|
@ -49,10 +49,10 @@ function Node_Iterate(_x, _y, _group = noone) : Node_Collection(_x, _y, _group)
|
|||
allReady &= _in.isRenderable()
|
||||
}
|
||||
|
||||
if(!allReady) return;
|
||||
if(!allReady) return [];
|
||||
|
||||
__nodeLeafList(getNodeList(), RENDER_QUEUE);
|
||||
initLoop();
|
||||
return __nodeLeafList(getNodeList());
|
||||
}
|
||||
|
||||
static iterationStatus = function() {
|
||||
|
|
|
@ -24,8 +24,8 @@ function Node_Iterate_Each(_x, _y, _group = noone) : Node_Collection(_x, _y, _gr
|
|||
}
|
||||
|
||||
static getNextNodes = function() {
|
||||
__nodeLeafList(getNodeList(), RENDER_QUEUE);
|
||||
initLoop();
|
||||
return __nodeLeafList(getNodeList());
|
||||
}
|
||||
|
||||
static onStep = function() {
|
||||
|
|
|
@ -26,8 +26,8 @@ function Node_Iterate_Filter(_x, _y, _group = noone) : Node_Collection(_x, _y, _
|
|||
}
|
||||
|
||||
static getNextNodes = function() {
|
||||
__nodeLeafList(getNodeList(), RENDER_QUEUE);
|
||||
initLoop();
|
||||
return __nodeLeafList(getNodeList());
|
||||
}
|
||||
|
||||
static onStep = function() {
|
||||
|
|
|
@ -11,12 +11,13 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group
|
|||
.setVisible(false);
|
||||
|
||||
static getNextNodes = function() {
|
||||
if(!struct_has(group, "iterationStatus")) return;
|
||||
if(!struct_has(group, "iterationStatus")) return [];
|
||||
var _ren = group.iterationStatus();
|
||||
var nodes = [];
|
||||
|
||||
if(_ren == ITERATION_STATUS.loop) { //Go back to the beginning of the loop, reset render status for leaf node inside?
|
||||
printIf(global.RENDER_LOG, " > Loop restart: iteration " + string(group.iterated));
|
||||
__nodeLeafList(group.getNodeList(), RENDER_QUEUE);
|
||||
nodes = array_append(nodes, __nodeLeafList(group.getNodeList()));
|
||||
} else if(_ren == ITERATION_STATUS.complete) { //Go out of loop
|
||||
printIf(global.RENDER_LOG, " > Loop completed");
|
||||
group.setRenderStatus(true);
|
||||
|
@ -28,11 +29,14 @@ function Node_Iterator_Each_Output(_x, _y, _group = noone) : Node(_x, _y, _group
|
|||
|
||||
if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) {
|
||||
_to.node.triggerRender();
|
||||
if(_to.node.isRenderable()) ds_queue_enqueue(RENDER_QUEUE, _to.node);
|
||||
if(_to.node.isRenderable())
|
||||
array_push(nodes, _to.node);
|
||||
}
|
||||
}
|
||||
} else
|
||||
printIf(global.RENDER_LOG, " > Loop not ready");
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
|
|
|
@ -11,12 +11,13 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro
|
|||
.setVisible(true, true);
|
||||
|
||||
static getNextNodes = function() {
|
||||
if(!struct_has(group, "iterationStatus")) return;
|
||||
if(!struct_has(group, "iterationStatus")) return [];
|
||||
var _ren = group.iterationStatus();
|
||||
var nodes = [];
|
||||
|
||||
if(_ren == ITERATION_STATUS.loop) { //Go back to the beginning of the loop, reset render status for leaf node inside?
|
||||
printIf(global.RENDER_LOG, " > Loop restart: iteration " + string(group.iterated));
|
||||
__nodeLeafList(group.getNodeList(), RENDER_QUEUE);
|
||||
nodes = array_append(nodes, __nodeLeafList(group.getNodeList()));
|
||||
} else if(_ren == ITERATION_STATUS.complete) { //Go out of loop
|
||||
printIf(global.RENDER_LOG, " > Loop completed");
|
||||
group.setRenderStatus(true);
|
||||
|
@ -28,11 +29,14 @@ function Node_Iterator_Filter_Output(_x, _y, _group = noone) : Node(_x, _y, _gro
|
|||
|
||||
if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) {
|
||||
_to.node.triggerRender();
|
||||
if(_to.node.isRenderable()) ds_queue_enqueue(RENDER_QUEUE, _to.node);
|
||||
if(_to.node.isRenderable())
|
||||
array_push(nodes, _to.node);
|
||||
}
|
||||
}
|
||||
} else
|
||||
printIf(global.RENDER_LOG, " > Loop not ready");
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
|
|
|
@ -32,16 +32,14 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y
|
|||
cache_value = -1;
|
||||
|
||||
static getNextNodes = function() {
|
||||
var nodes = [];
|
||||
var _node_it = group;
|
||||
if(!struct_has(_node_it, "iterationStatus")) return;
|
||||
if(!struct_has(_node_it, "iterationStatus")) return nodes;
|
||||
var _ren = _node_it.iterationStatus();
|
||||
|
||||
if(_ren == ITERATION_STATUS.loop) { //Go back to the beginning of the loop, reset render status for leaf node inside?
|
||||
printIf(global.RENDER_LOG, " > Loop restart: iteration " + string(group.iterated));
|
||||
__nodeLeafList(group.getNodeList(), RENDER_QUEUE);
|
||||
|
||||
//var loopEnt = inputs[| 2].value_from.node;
|
||||
//ds_queue_enqueue(RENDER_QUEUE, loopEnt);
|
||||
nodes = array_append(nodes, __nodeLeafList(group.getNodeList()));
|
||||
} else if(_ren == ITERATION_STATUS.complete) { //Go out of loop
|
||||
printIf(global.RENDER_LOG, " > Loop completed");
|
||||
group.setRenderStatus(true);
|
||||
|
@ -51,12 +49,14 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y
|
|||
if(!_to.node.renderActive) continue;
|
||||
|
||||
if(_to.node.active && _to.value_from != noone && _to.value_from.node == group) {
|
||||
_to.node.triggerRender();
|
||||
if(_to.node.isRenderable()) ds_queue_enqueue(RENDER_QUEUE, _to.node);
|
||||
if(_to.node.isRenderable())
|
||||
array_push(nodes, _to.node);
|
||||
}
|
||||
}
|
||||
} else
|
||||
printIf(global.RENDER_LOG, " > Loop not ready");
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
static initLoop = function() {
|
||||
|
|
|
@ -69,7 +69,7 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
return false;
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
var path = inputs[| 0].getValue();
|
||||
if(path == "") return;
|
||||
updatePaths(path);
|
||||
|
|
|
@ -112,7 +112,7 @@ function Node_Json_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
}
|
||||
|
||||
static update = function(frame = ANIMATOR.current_frame) { writeFile(); }
|
||||
static onInspectorUpdate = function() { writeFile(); }
|
||||
static onInspector1Update = function() { writeFile(); }
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
|
|
|
@ -64,6 +64,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
|||
suffix = "";
|
||||
values = ds_list_create();
|
||||
sep_axis = _sep_axis;
|
||||
if(_prop.type != VALUE_TYPE.trigger)
|
||||
ds_list_add(values, new valueKey(0, _val, self));
|
||||
//print(_prop.name + ": " + string(_val));
|
||||
|
||||
|
@ -126,15 +127,29 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
|||
static getName = function() { return prop.name + suffix; }
|
||||
|
||||
static getValue = function(_time = ANIMATOR.current_frame) {
|
||||
if(ds_list_size(values) == 0) return processTypeDefault();
|
||||
if(ds_list_size(values) == 1) {
|
||||
//if(prop.name == "Position") print(values[| 0].value);
|
||||
return processType(values[| 0].value);
|
||||
if(prop.type == VALUE_TYPE.trigger) {
|
||||
for(var i = 0; i < ds_list_size(values); i++) { //Find trigger
|
||||
var _key = values[| i];
|
||||
if(_key.time == _time)
|
||||
return _key.value;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if(prop.display_type == VALUE_DISPLAY.gradient) return values[| 0].value;
|
||||
if(prop.type == VALUE_TYPE.path) return processType(values[| 0].value);
|
||||
if(!prop.is_anim) return processType(values[| 0].value);
|
||||
if(ds_list_size(values) == 0)
|
||||
return processTypeDefault();
|
||||
|
||||
if(ds_list_size(values) == 1)
|
||||
return processType(values[| 0].value);
|
||||
|
||||
if(prop.display_type == VALUE_DISPLAY.gradient)
|
||||
return values[| 0].value;
|
||||
|
||||
if(prop.type == VALUE_TYPE.path)
|
||||
return processType(values[| 0].value);
|
||||
|
||||
if(!prop.is_anim)
|
||||
return processType(values[| 0].value);
|
||||
|
||||
var _time_first = values[| 0].time;
|
||||
var _time_last = values[| ds_list_size(values) - 1].time;
|
||||
|
@ -225,7 +240,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
|||
case VALUE_TYPE.surface :
|
||||
if(is_string(_val))
|
||||
return get_asset(_val);
|
||||
return is_surface(_val)? _val : DEF_SURFACE;
|
||||
return _val;
|
||||
}
|
||||
|
||||
return _val;
|
||||
|
@ -260,6 +275,22 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
|||
}
|
||||
|
||||
static setValue = function(_val = 0, _record = true, _time = ANIMATOR.current_frame, ease_in = 0, ease_out = 0) {
|
||||
if(prop.type == VALUE_TYPE.trigger) {
|
||||
for(var i = 0; i < ds_list_size(values); i++) { //Find trigger
|
||||
var _key = values[| i];
|
||||
if(_key.time == _time) {
|
||||
_key.value = _val;
|
||||
return false;
|
||||
} else if(_key.time > _time) {
|
||||
ds_list_insert(values, i, new valueKey(_time, _val, self));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
ds_list_add(values, new valueKey(_time, _val, self));
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!prop.is_anim) {
|
||||
if(isEqual(values[| 0].value, _val))
|
||||
return false;
|
||||
|
|
|
@ -90,7 +90,7 @@ function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
|
||||
static onValueFromUpdate = function(index) {
|
||||
if(index == 0) {
|
||||
update();
|
||||
doUpdate();
|
||||
if(array_length(current_data) > 0)
|
||||
histogramUpdate(current_data[0]);
|
||||
}
|
||||
|
|
|
@ -218,14 +218,14 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
lua_add_code(getState(), lua_code);
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() { //compile
|
||||
static onInspector1Update = function() { //compile
|
||||
var thrd = inputs[| 3].value_from;
|
||||
if(thrd == noone) {
|
||||
doCompile();
|
||||
return;
|
||||
}
|
||||
|
||||
thrd.node.onInspectorUpdate();
|
||||
thrd.node.onInspector1Update();
|
||||
}
|
||||
|
||||
static doCompile = function() {
|
||||
|
|
|
@ -80,14 +80,14 @@ function Node_Lua_Global(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
}
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() { //compile
|
||||
static onInspector1Update = function() { //compile
|
||||
var thrd = inputs[| 2].value_from;
|
||||
if(thrd == noone) {
|
||||
doCompile();
|
||||
return;
|
||||
}
|
||||
|
||||
thrd.node.onInspectorUpdate();
|
||||
thrd.node.onInspector1Update();
|
||||
}
|
||||
|
||||
static doCompile = function() {
|
||||
|
|
|
@ -228,14 +228,14 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
lua_add_code(getState(), lua_code);
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() { //compile
|
||||
static onInspector1Update = function() { //compile
|
||||
var thrd = inputs[| 3].value_from;
|
||||
if(thrd == noone) {
|
||||
doCompile();
|
||||
return;
|
||||
}
|
||||
|
||||
thrd.node.onInspectorUpdate();
|
||||
thrd.node.onInspector1Update();
|
||||
}
|
||||
|
||||
static doCompile = function() {
|
||||
|
|
|
@ -302,7 +302,7 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
outputs[| 0].setValue(res);
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() { extractPalettes(); }
|
||||
static onInspector1Update = function() { extractPalettes(); }
|
||||
static onValueUpdate = function() { extractPalettes(); }
|
||||
static onValueFromUpdate = function() { extractPalettes(); }
|
||||
|
||||
|
|
|
@ -158,6 +158,16 @@ function Node_Path_Plot(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
}
|
||||
}
|
||||
|
||||
function updateBoundary() {
|
||||
boundary = new BoundingBox( 0, 0, 1, 1 );
|
||||
var sample = 64;
|
||||
|
||||
for( var i = 0; i <= sample; i++ ) {
|
||||
var p = getPointRatio(i / sample);
|
||||
boundary.addPoint(p.x, p.y);
|
||||
}
|
||||
}
|
||||
|
||||
function update() {
|
||||
updateBoundary();
|
||||
outputs[| 0].setValue(self);
|
||||
|
|
|
@ -75,10 +75,11 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
}
|
||||
|
||||
function __initNodes() {
|
||||
var path = DIRECTORY + "Nodes/fav.json";
|
||||
global.FAV_NODES = [];
|
||||
if(file_exists(path))
|
||||
global.FAV_NODES = json_load_struct(path);
|
||||
var favPath = DIRECTORY + "Nodes/fav.json";
|
||||
global.FAV_NODES = file_exists(favPath)? json_load_struct(favPath) : [];
|
||||
|
||||
var recPath = DIRECTORY + "Nodes/recent.json";
|
||||
global.RECENT_NODES = file_exists(recPath)? json_load_struct(recPath) : [];
|
||||
|
||||
var group = ds_list_create();
|
||||
addNodeCatagory("Group", group, ["Node_Group"]);
|
||||
|
@ -326,7 +327,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
ds_list_add(threeD, "2D operations");
|
||||
addNodeObject(threeD, "Normal", s_node_normal, "Node_Normal", [1, Node_Normal],, "Create normal map using greyscale value as height.");
|
||||
addNodeObject(threeD, "Normal Light", s_node_normal_light, "Node_Normal_Light", [1, Node_Normal_Light],, "Light up the image using normal mapping.");
|
||||
addNodeObject(threeD, "Bevel", s_node_bevel, "Node_Bevel", [1, Node_Bevel],, "Apply 2D bevel on the image.");
|
||||
addNodeObject(threeD, "Bevel", s_node_bevel, "Node_Bevel", [1, Node_Bevel], ["shade", "auto shade"], "Apply 2D bevel on the image.");
|
||||
addNodeObject(threeD, "Sprite Stack", s_node_stack, "Node_Sprite_Stack", [1, Node_Sprite_Stack],, "Create sprite stack either from repeating a single image or stacking different images using array.");
|
||||
|
||||
ds_list_add(threeD, "3D generates");
|
||||
|
@ -474,6 +475,10 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
addNodeObject(values, "Compare", s_node_compare, "Node_Compare", [0, Node_create_Compare], ["equal", "greater", "lesser"]);
|
||||
addNodeObject(values, "Logic Opr", s_node_logic_opr, "Node_Logic", [0, Node_create_Logic], [ "and", "or", "not", "nand", "nor" , "xor" ]);
|
||||
|
||||
ds_list_add(values, "Trigger");
|
||||
addNodeObject(values, "Trigger", s_node_trigger, "Node_Trigger", [1, Node_Trigger]).setVersion(1140);
|
||||
addNodeObject(values, "Boolean Trigger", s_node_trigger_bool, "Node_Trigger_Bool", [1, Node_Trigger_Bool], ["trigger boolean"]).setVersion(1140);
|
||||
|
||||
ds_list_add(values, "Struct");
|
||||
addNodeObject(values, "Struct", s_node_struct, "Node_Struct", [1, Node_Struct]);
|
||||
addNodeObject(values, "Struct Get", s_node_struct_get, "Node_Struct_Get", [1, Node_Struct_Get]);
|
||||
|
@ -607,26 +612,6 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
#endregion
|
||||
|
||||
#region attribute
|
||||
global.SURFACE_FORMAT = [
|
||||
surface_rgba4unorm,
|
||||
surface_rgba8unorm,
|
||||
surface_rgba16float,
|
||||
surface_rgba32float,
|
||||
surface_r8unorm,
|
||||
surface_r16float,
|
||||
surface_r32float
|
||||
];
|
||||
|
||||
global.SURFACE_FORMAT_NAME = [
|
||||
"4 bit RGBA",
|
||||
"8 bit RGBA",
|
||||
"16 bit RGBA",
|
||||
"32 bit RGBA",
|
||||
"8 bit Greyscale",
|
||||
"16 bit Greyscale",
|
||||
"32 bit Greyscale"
|
||||
];
|
||||
|
||||
global.SURFACE_INTERPOLATION = [
|
||||
"No aliasing",
|
||||
"Linear",
|
||||
|
@ -640,8 +625,41 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
"Repeat"
|
||||
];
|
||||
|
||||
function __initSurfaceFormat() {
|
||||
var surface_format = [
|
||||
surface_rgba4unorm,
|
||||
surface_rgba8unorm,
|
||||
surface_rgba16float,
|
||||
surface_rgba32float,
|
||||
surface_r8unorm,
|
||||
surface_r16float,
|
||||
surface_r32float
|
||||
];
|
||||
|
||||
var surface_format_name = [
|
||||
"4 bit RGBA",
|
||||
"8 bit RGBA",
|
||||
"16 bit RGBA",
|
||||
"32 bit RGBA",
|
||||
"8 bit Greyscale",
|
||||
"16 bit Greyscale",
|
||||
"32 bit Greyscale"
|
||||
];
|
||||
|
||||
global.SURFACE_FORMAT = [];
|
||||
global.SURFACE_FORMAT_NAME = [];
|
||||
|
||||
for( var i = 0; i < array_length(surface_format); i++ ) {
|
||||
if(surface_format_is_supported(surface_format[i])) {
|
||||
array_push(global.SURFACE_FORMAT, surface_format[i]);
|
||||
array_push(global.SURFACE_FORMAT_NAME, surface_format_name[i]);
|
||||
} else
|
||||
log_message("WARNING", "Surface format [" + surface_format_name[i] + "] not supported in this device.");
|
||||
}
|
||||
|
||||
global.SURFACE_FORMAT_NAME_PROCESS = [ "Input" ];
|
||||
global.SURFACE_FORMAT_NAME_PROCESS = array_append(global.SURFACE_FORMAT_NAME_PROCESS, global.SURFACE_FORMAT_NAME);
|
||||
}
|
||||
|
||||
function attribute_surface_depth(label = true) {
|
||||
attributes[? "color_depth"] = inputs[| 0].type == VALUE_TYPE.surface? 0 : 1;
|
||||
|
|
|
@ -218,7 +218,7 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group)
|
|||
outputs[| 1].setValue(_atl);
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function(updateAll = true) {
|
||||
static onInspector1Update = function(updateAll = true) {
|
||||
var key = ds_map_find_first(NODE_MAP);
|
||||
repeat(ds_map_size(NODE_MAP)) {
|
||||
var node = NODE_MAP[? key];
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Rigid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro
|
|||
name = "RigidSim";
|
||||
color = COLORS.node_blend_simulation;
|
||||
icon = THEME.rigidSim;
|
||||
update_on_frame = true;
|
||||
|
||||
ungroupable = false;
|
||||
update_on_frame = true;
|
||||
|
@ -17,23 +18,23 @@ function Node_Rigid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro
|
|||
//physics_world_update_iterations(30);
|
||||
//physics_world_update_speed(100)
|
||||
|
||||
static reset = function() {
|
||||
instance_destroy(oRigidbody);
|
||||
physics_pause_enable(true);
|
||||
//static reset = function() {
|
||||
// instance_destroy(oRigidbody);
|
||||
// physics_pause_enable(true);
|
||||
|
||||
var node_list = getNodeList();
|
||||
for( var i = 0; i < ds_list_size(node_list); i++ ) {
|
||||
var n = node_list[| i];
|
||||
if(variable_struct_exists(n, "reset"))
|
||||
n.reset();
|
||||
}
|
||||
physics_pause_enable(false);
|
||||
}
|
||||
// var node_list = getNodeList();
|
||||
// for( var i = 0; i < ds_list_size(node_list); i++ ) {
|
||||
// var n = node_list[| i];
|
||||
// if(variable_struct_exists(n, "reset"))
|
||||
// n.reset();
|
||||
// }
|
||||
// physics_pause_enable(false);
|
||||
//}
|
||||
|
||||
static update = function() {
|
||||
if(ANIMATOR.current_frame == 0)
|
||||
reset();
|
||||
}
|
||||
//static update = function() {
|
||||
// if(ANIMATOR.current_frame == 0)
|
||||
// reset();
|
||||
//}
|
||||
|
||||
PATCH_STATIC
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_rigid_sim",
|
||||
"name": "node_rigid_group",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
|
@ -2,6 +2,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
name = "Object";
|
||||
color = COLORS.node_blend_simulation;
|
||||
icon = THEME.rigidSim;
|
||||
update_on_frame = true;
|
||||
|
||||
w = 96;
|
||||
min_h = 96;
|
||||
|
||||
|
@ -36,7 +38,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
inputs[| 8] = nodeValue("Spawn", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Make object spawn when start.")
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 9] = nodeValue("Generate mesh", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 9] = nodeValue("Generate mesh", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
var _tex = inputs[| 6].getValue();
|
||||
if(is_array(_tex)) {
|
||||
|
@ -44,7 +46,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
generateMesh(i);
|
||||
} else
|
||||
generateMesh();
|
||||
update();
|
||||
doUpdate();
|
||||
}, "Generate"] );
|
||||
|
||||
inputs[| 10] = nodeValue("Mesh expansion", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
|
@ -517,6 +519,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
physics_fixture_set_linear_damping(fixture, _air_frc);
|
||||
physics_fixture_set_angular_damping(fixture, _rot_frc);
|
||||
physics_fixture_set_awake(fixture, true);
|
||||
if(group != noone)
|
||||
physics_fixture_set_collision_group(fixture, group.collIndex);
|
||||
|
||||
array_push(object.fixture, physics_fixture_bind_ext(fixture, object, _spos[2], _spos[3]));
|
||||
|
@ -659,7 +662,10 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
}
|
||||
|
||||
static update = function(frame = ANIMATOR.current_frame) {
|
||||
if(ANIMATOR.current_frame == 0) return;
|
||||
if(ANIMATOR.current_frame == 0) {
|
||||
reset();
|
||||
return;
|
||||
}
|
||||
if(!isAnimated()) return;
|
||||
|
||||
for( var i = 0; i < array_length(object); i++ )
|
||||
|
|
|
@ -52,13 +52,16 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
inputs[| 17] = nodeValue("Use value", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, [ "Scale" ], "Apply the third value in each data point (if exist) on given properties.")
|
||||
.setDisplay(VALUE_DISPLAY.text_array, [ "Scale", "Rotation", "Color" ]);
|
||||
|
||||
inputs[| 18] = nodeValue("Blend mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Normal", "Add" ]);
|
||||
|
||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [
|
||||
["Surface", false], 0, 1, 15, 10,
|
||||
["Scatter", false], 5, 6, 13, 14, 17, 9, 2,
|
||||
["Transform", false], 3, 8, 7, 4,
|
||||
["Render", false], 11, 12, 16,
|
||||
["Render", false], 18, 11, 12, 16,
|
||||
];
|
||||
|
||||
attribute_surface_depth();
|
||||
|
@ -117,6 +120,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
var alpha = _data[12];
|
||||
var mulpA = _data[16];
|
||||
var useV = _data[17];
|
||||
var blend = _data[18];
|
||||
|
||||
var _in_w, _in_h;
|
||||
|
||||
|
@ -130,8 +134,15 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
|
||||
surface_set_target(_outSurf);
|
||||
DRAW_CLEAR
|
||||
switch(blend) {
|
||||
case 0 :
|
||||
if(mulpA) BLEND_ALPHA_MULP;
|
||||
else BLEND_ALPHA;
|
||||
break;
|
||||
case 1 :
|
||||
BLEND_ADD;
|
||||
break;
|
||||
}
|
||||
|
||||
var _sed = seed;
|
||||
var res_index = 0, bg = 0;
|
||||
|
|
|
@ -9,13 +9,13 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01])
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 2] = nodeValue("Override color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
|
||||
inputs[| 2] = nodeValue("Override color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 3] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 4] = nodeValue("Ignore blank", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Skip empty and black shape.")
|
||||
inputs[| 4] = nodeValue("Ignore blank", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Skip empty and black shape.")
|
||||
.rejectArray();
|
||||
|
||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||
|
@ -47,7 +47,7 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
|
||||
_prev_type = -1;
|
||||
|
||||
static onInspectorUpdate = function() { separateShape(); }
|
||||
static onInspector1Update = function() { separateShape(); }
|
||||
|
||||
static update = function() {
|
||||
if(attributes[? "auto_exe"])
|
||||
|
|
|
@ -7,6 +7,8 @@ function Node_Strand_Break(_x, _y, _group = noone) : _Node_Strand_Affector(_x, _
|
|||
inputs[| input_fix_len + 0] = nodeValue("Chance", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]);
|
||||
|
||||
inputs[| input_fix_len + 1] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, irandom_range(100000, 999999));
|
||||
|
||||
array_push(input_display_list,
|
||||
["Break", false], input_fix_len + 0, input_fix_len + 1
|
||||
);
|
||||
|
|
|
@ -2,6 +2,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
name = "Strand Create";
|
||||
color = COLORS.node_blend_strand;
|
||||
icon = THEME.strandSim;
|
||||
update_on_frame = true;
|
||||
w = 96;
|
||||
|
||||
inputs[| 0] = nodeValue("Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
|
@ -43,7 +44,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
inputs[| 14] = nodeValue("Distribution", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Uniform", "Random" ]);
|
||||
|
||||
inputs[| 15] = nodeValue("Bake hair", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0, "Prevent strand reseting to apply manual modification. Unbaking will remove all changes.")
|
||||
inputs[| 15] = nodeValue("Bake hair", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0, "Prevent strand reseting to apply manual modification. Unbaking will remove all changes.")
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
attributes[? "use_groom"] = !attributes[? "use_groom"];
|
||||
if(attributes[? "use_groom"])
|
||||
|
|
|
@ -52,7 +52,7 @@ function Node_Text_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
return false;
|
||||
}
|
||||
|
||||
static onInspectorUpdate = function() {
|
||||
static onInspector1Update = function() {
|
||||
var path = inputs[| 0].getValue();
|
||||
if(path == "") return;
|
||||
updatePaths(path);
|
||||
|
|
|
@ -26,7 +26,7 @@ function Node_Text_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) con
|
|||
}
|
||||
|
||||
static update = function(frame = ANIMATOR.current_frame) { writeFile(); }
|
||||
static onInspectorUpdate = function() { writeFile(); }
|
||||
static onInspector1Update = function() { writeFile(); }
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
|
|
38
scripts/node_trigger/node_trigger.gml
Normal file
38
scripts/node_trigger/node_trigger.gml
Normal file
|
@ -0,0 +1,38 @@
|
|||
function Node_Trigger(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Trigger";
|
||||
previewable = false;
|
||||
update_on_frame = true;
|
||||
|
||||
w = 96;
|
||||
min_h = 32 + 24 * 1;
|
||||
|
||||
inputs[| 0] = nodeValue("Trigger", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, false)
|
||||
.setVisible(false, false);
|
||||
|
||||
inputs[| 1] = nodeValue("Trigger", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, false)
|
||||
.setVisible(true, true)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() { onInspector2Update(); }, "Trigger"]);
|
||||
|
||||
outputs[| 0] = nodeValue("Trigger", self, JUNCTION_CONNECT.output, VALUE_TYPE.trigger, false);
|
||||
|
||||
insp2UpdateTooltip = "Trigger";
|
||||
insp2UpdateIcon = [ THEME.sequence_control, 1, COLORS._main_value_positive ];
|
||||
|
||||
static onInspector2Update = function() {
|
||||
inputs[| 0].setAnim(true);
|
||||
inputs[| 0].setValue(true);
|
||||
}
|
||||
|
||||
function update() {
|
||||
var trg = inputs[| 0].getValue();
|
||||
outputs[| 0].setValue(trg);
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
draw_set_text(f_h5, fa_center, fa_center, COLORS._main_text);
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
var trg = outputs[| 0].getValue();
|
||||
|
||||
draw_sprite_fit(THEME.node_trigger, trg, bbox.xc, bbox.yc, bbox.w, bbox.h, trg? COLORS._main_accent : COLORS._main_icon);
|
||||
}
|
||||
}
|
11
scripts/node_trigger/node_trigger.yy
Normal file
11
scripts/node_trigger/node_trigger.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_trigger",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "trigger",
|
||||
"path": "folders/nodes/data/value/trigger.yy",
|
||||
},
|
||||
}
|
50
scripts/node_trigger_bool/node_trigger_bool.gml
Normal file
50
scripts/node_trigger_bool/node_trigger_bool.gml
Normal file
|
@ -0,0 +1,50 @@
|
|||
function Node_Trigger_Bool(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Boolean Trigger";
|
||||
previewable = false;
|
||||
update_on_frame = true;
|
||||
|
||||
w = 96;
|
||||
min_h = 32 + 24 * 1;
|
||||
|
||||
inputs[| 0] = nodeValue("Boolean", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
inputs[| 1] = nodeValue("Trigger condition", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "True frame", "False to True", "True to False", "Value changed" ]);
|
||||
|
||||
outputs[| 0] = nodeValue("Trigger", self, JUNCTION_CONNECT.output, VALUE_TYPE.trigger, false);
|
||||
|
||||
prevVal = false;
|
||||
preview = false;
|
||||
|
||||
function update() {
|
||||
var val = inputs[| 0].getValue();
|
||||
var con = inputs[| 1].getValue();
|
||||
|
||||
switch(con) {
|
||||
case 0 :
|
||||
outputs[| 0].setValue(val);
|
||||
preview = val;
|
||||
break;
|
||||
case 1 :
|
||||
outputs[| 0].setValue(!prevVal && val);
|
||||
preview = !prevVal && val;
|
||||
break;
|
||||
case 2 :
|
||||
outputs[| 0].setValue( prevVal && !val);
|
||||
preview = prevVal && !val;
|
||||
break;
|
||||
case 3 :
|
||||
outputs[| 0].setValue( prevVal != val);
|
||||
preview = prevVal != val;
|
||||
break;
|
||||
}
|
||||
|
||||
prevVal = val;
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
draw_set_text(f_h5, fa_center, fa_center, COLORS._main_text);
|
||||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
draw_sprite_fit(THEME.node_trigger, preview, bbox.xc, bbox.yc, bbox.w, bbox.h, preview? COLORS._main_accent : COLORS._main_icon);
|
||||
}
|
||||
}
|
11
scripts/node_trigger_bool/node_trigger_bool.yy
Normal file
11
scripts/node_trigger_bool/node_trigger_bool.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_trigger_bool",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "trigger",
|
||||
"path": "folders/nodes/data/value/trigger.yy",
|
||||
},
|
||||
}
|
|
@ -120,6 +120,7 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
}
|
||||
|
||||
static getNextNodes = function() {
|
||||
var nodes = [];
|
||||
var _key = inputs[| 0].getValue();
|
||||
var amo = ds_map_size(TUNNELS_OUT);
|
||||
var k = ds_map_find_first(TUNNELS_OUT);
|
||||
|
@ -127,11 +128,13 @@ function Node_Tunnel_In(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||
repeat(amo) {
|
||||
if(TUNNELS_OUT[? k] == _key) {
|
||||
NODE_MAP[? k].triggerRender();
|
||||
ds_queue_enqueue(RENDER_QUEUE, NODE_MAP[? k]);
|
||||
array_push(nodes, NODE_MAP[? k]);
|
||||
}
|
||||
|
||||
k = ds_map_find_next(TUNNELS_OUT, k);
|
||||
}
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
|
|
|
@ -26,6 +26,9 @@ enum VALUE_TYPE {
|
|||
struct = 16,
|
||||
strands = 17,
|
||||
mesh = 18,
|
||||
trigger = 19,
|
||||
|
||||
action = 99,
|
||||
}
|
||||
|
||||
enum VALUE_DISPLAY {
|
||||
|
@ -95,7 +98,10 @@ function value_color(i) {
|
|||
$5d3f8c, //struct
|
||||
$6691ff, //strand
|
||||
$d1c2c2, //mesh
|
||||
$5dde8f, //trigger
|
||||
];
|
||||
|
||||
if(i == 99) return $5dde8f;
|
||||
return JUNCTION_COLORS[safe_mod(max(0, i), array_length(JUNCTION_COLORS))];
|
||||
}
|
||||
|
||||
|
@ -121,6 +127,9 @@ function value_bit(i) {
|
|||
|
||||
case VALUE_TYPE.node : return 1 << 32;
|
||||
|
||||
case VALUE_TYPE.trigger : return 1 << 22;
|
||||
case VALUE_TYPE.action : return 1 << 22 | 1 << 3;
|
||||
|
||||
case VALUE_TYPE.any : return ~0 & ~(1 << 32);
|
||||
}
|
||||
return 0;
|
||||
|
@ -234,10 +243,6 @@ function isGraphable(prop) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function nodeValue(_name, _node, _connect, _type, _value, _tooltip = "") {
|
||||
return new NodeValue(_name, _node, _connect, _type, _value, _tooltip);
|
||||
}
|
||||
|
||||
function nodeValueUnit(value) constructor {
|
||||
self.value = value;
|
||||
|
||||
|
@ -247,7 +252,7 @@ function nodeValueUnit(value) constructor {
|
|||
mode = !mode;
|
||||
value.cache_value[0] = false;
|
||||
value.unitConvert(mode);
|
||||
value.node.update();
|
||||
value.node.doUpdate();
|
||||
});
|
||||
triggerButton.icon_blend = COLORS._main_icon_light;
|
||||
triggerButton.icon = THEME.unit_ref;
|
||||
|
@ -318,6 +323,10 @@ global.displaySuffix_Padding = [ "right", "top", "left", "bottom" ];
|
|||
global.displaySuffix_VecRange = [ "x min", "x max", "y min", "y max" ];
|
||||
global.displaySuffix_Axis = [ "x", "y", "z", "w"];
|
||||
|
||||
function nodeValue(_name, _node, _connect, _type, _value, _tooltip = "") {
|
||||
return new NodeValue(_name, _node, _connect, _type, _value, _tooltip);
|
||||
}
|
||||
|
||||
function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constructor {
|
||||
name = _name;
|
||||
node = _node;
|
||||
|
@ -357,6 +366,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
draw_line_shift_x = 0;
|
||||
draw_line_shift_y = 0;
|
||||
draw_line_thick = new Tween(1,,, 1.5);
|
||||
draw_line_shift_hover = false;
|
||||
drawLineIndex = 1;
|
||||
|
||||
|
@ -534,7 +544,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
}
|
||||
|
||||
for( var i = 0; i < array_length(animators); i++ )
|
||||
animators[i].suffix = " " + array_safe_get(global.displaySuffix_Axis, i);
|
||||
animators[i].suffix = " " + string(array_safe_get(global.displaySuffix_Axis, i));
|
||||
|
||||
break;
|
||||
case VALUE_DISPLAY.vector_range :
|
||||
|
@ -557,7 +567,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
extract_node = "Node_Vector4";
|
||||
|
||||
for( var i = 0; i < array_length(animators); i++ )
|
||||
animators[i].suffix = " " + array_safe_get(global.displaySuffix_VecRange, i);
|
||||
animators[i].suffix = " " + string(array_safe_get(global.displaySuffix_VecRange, i));
|
||||
|
||||
break;
|
||||
case VALUE_DISPLAY.rotation :
|
||||
|
@ -798,7 +808,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
case VALUE_DISPLAY.text_array :
|
||||
editWidget = new textArrayBox(function() {
|
||||
MODIFIED = true;
|
||||
return animator.values[| 0].value; }, display_data, function() { node.update();
|
||||
return animator.values[| 0].value; }, display_data, function() { node.doUpdate();
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
@ -947,6 +957,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
return unit.apply(value, arrIndex);
|
||||
}
|
||||
|
||||
if(type == VALUE_TYPE.surface && connect_type == JUNCTION_CONNECT.input && !is_surface(value) && def_val == USE_DEF)
|
||||
return DEF_SURFACE;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
@ -1046,6 +1059,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
static setAnim = function(anim) {
|
||||
is_anim = anim;
|
||||
PANEL_ANIMATION.updatePropertyList();
|
||||
}
|
||||
|
||||
static __anim = function() {
|
||||
|
@ -1167,6 +1181,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
}
|
||||
|
||||
if(_valueFrom == value_from) {
|
||||
print("whaT")
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1248,6 +1263,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
draw_line_shift_y = 0;
|
||||
|
||||
if(!LOADING) MODIFIED = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1375,9 +1391,16 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
if(PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, x, y, 10 * _s * sca)) {
|
||||
is_hover = true;
|
||||
if(type == VALUE_TYPE.action)
|
||||
draw_sprite_ext(THEME.node_junction_inspector, 1, x, y, ss, ss, 0, c_white, 1);
|
||||
else
|
||||
draw_sprite_ext(isArray()? THEME.node_junctions_array_hover : THEME.node_junctions_single_hover, type, x, y, ss, ss, 0, c_white, 1);
|
||||
} else
|
||||
} else {
|
||||
if(type == VALUE_TYPE.action)
|
||||
draw_sprite_ext(THEME.node_junction_inspector, 0, x, y, ss, ss, 0, c_white, 1);
|
||||
else
|
||||
draw_sprite_ext(isArray()? THEME.node_junctions_array : THEME.node_junctions_single, type, x, y, ss, ss, 0, c_white, 1);
|
||||
}
|
||||
|
||||
return is_hover;
|
||||
}
|
||||
|
@ -1387,15 +1410,18 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
draw_set_text(f_p1, fa_left, fa_center);
|
||||
|
||||
var tw = string_width(name) + 16;
|
||||
var tw = string_width(name) + 32;
|
||||
var th = string_height(name) + 16;
|
||||
|
||||
if(connect_type == JUNCTION_CONNECT.input) {
|
||||
if(type == VALUE_TYPE.action) {
|
||||
var tx = x;
|
||||
draw_sprite_stretched_ext(THEME.node_junction_name_bg, 0, tx - tw / 2, y - th, tw, th, c_white, 0.5);
|
||||
} else if(connect_type == JUNCTION_CONNECT.input) {
|
||||
var tx = x - 12 * _s;
|
||||
draw_sprite_stretched_ext(THEME.node_junction_name_bg, 0, tx - tw, y - th / 2, tw + 16, th, c_white, 0.5);
|
||||
draw_sprite_stretched_ext(THEME.node_junction_name_bg, 0, tx - tw + 16, y - th / 2, tw, th, c_white, 0.5);
|
||||
} else {
|
||||
var tx = x + 12 * _s;
|
||||
draw_sprite_stretched_ext(THEME.node_junction_name_bg, 0, tx - 16, y - th / 2, tw + 16, th, c_white, 0.5);
|
||||
draw_sprite_stretched_ext(THEME.node_junction_name_bg, 0, tx - 16, y - th / 2, tw, th, c_white, 0.5);
|
||||
}
|
||||
}
|
||||
static drawName = function(_s, _mx, _my) {
|
||||
|
@ -1405,7 +1431,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
var _draw_cc = _hover? COLORS._main_text : COLORS._main_text_sub;
|
||||
draw_set_text(f_p1, fa_left, fa_center, _draw_cc);
|
||||
|
||||
if(connect_type == JUNCTION_CONNECT.input) {
|
||||
if(type == VALUE_TYPE.action) {
|
||||
var tx = x;
|
||||
draw_set_text(f_p1, fa_center, fa_center, _draw_cc);
|
||||
draw_text(tx, y - (line_height() + 16) / 2, name);
|
||||
} else if(connect_type == JUNCTION_CONNECT.input) {
|
||||
var tx = x - 12 * _s;
|
||||
draw_set_halign(fa_right);
|
||||
draw_text(tx, y, name);
|
||||
|
@ -1474,7 +1504,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
break;
|
||||
}
|
||||
|
||||
ext.update();
|
||||
ext.doUpdate();
|
||||
PANEL_ANIMATION.updatePropertyList();
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ function Node_Vector2(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
inputs[| 3] = nodeValue("Display", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Number", "Coordinate" ]);
|
||||
|
||||
inputs[| 4] = nodeValue("Reset to center", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 4] = nodeValue("Reset to center", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function () {
|
||||
wd_minx = -1;
|
||||
wd_miny = -1;
|
||||
|
|
|
@ -15,7 +15,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
inputs[| 2] = nodeValue("Spring force", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ] );
|
||||
|
||||
inputs[| 3] = nodeValue("Mesh", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 3] = nodeValue("Mesh", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() { setTriangle(); doUpdate(); }, "Generate"] );
|
||||
|
||||
inputs[| 4] = nodeValue("Diagonal link", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Include diagonal link to prevent drastic grid deformation.");
|
||||
|
@ -51,6 +51,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
attribute_interpolation();
|
||||
|
||||
input_display_index = array_length(input_display_list);
|
||||
points = [];
|
||||
|
||||
attributes[? "iteration"] = 4;
|
||||
array_push(attributeEditors, ["Iteration", "iteration",
|
||||
|
@ -61,13 +62,10 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
new NodeTool( "Pin / unpin (+ Shift) mesh", THEME.control_pin )
|
||||
];
|
||||
|
||||
attributes[? "pin"] = ds_map_create();
|
||||
|
||||
static onValueFromUpdate = function(index) {
|
||||
if(index == 0 && ds_list_empty(data.tris)) {
|
||||
if(index == 0 && array_empty(data.tris))
|
||||
setTriangle();
|
||||
}
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
for(var i = 0; i < array_length(data.links); i++)
|
||||
|
@ -137,12 +135,14 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
xp = x;
|
||||
yp = y;
|
||||
|
||||
node.points[index] = self;
|
||||
|
||||
ndx = 0;
|
||||
ndy = 0;
|
||||
|
||||
sx = x;
|
||||
sy = y;
|
||||
pin = ds_map_exists(node.attributes[? "pin"], index);
|
||||
pin = false;
|
||||
|
||||
static reset = function() {
|
||||
x = sx;
|
||||
|
@ -196,11 +196,6 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
}
|
||||
|
||||
static setPin = function(pin) {
|
||||
if(!pin && ds_map_exists(node.attributes[? "pin"], index))
|
||||
ds_map_delete(node.attributes[? "pin"], index);
|
||||
if(pin && !ds_map_exists(node.attributes[? "pin"], index))
|
||||
ds_map_add(node.attributes[? "pin"], index, 1);
|
||||
|
||||
self.pin = pin;
|
||||
}
|
||||
}
|
||||
|
@ -301,9 +296,10 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
surface_reset_target();
|
||||
}
|
||||
|
||||
points = [];
|
||||
data.points = [[]];
|
||||
ds_list_clear(data.tris);
|
||||
ds_list_clear(data.links);
|
||||
data.tris = [];
|
||||
data.links = [];
|
||||
|
||||
var ind = 0;
|
||||
for(var i = 0; i <= sample; i++)
|
||||
|
@ -324,9 +320,9 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
if(i == 0) continue;
|
||||
|
||||
if(j && data.points[i - 1][j] != 0 && data.points[i][j - 1] != 0)
|
||||
ds_list_add(data.tris, new _Triangle(data.points[i - 1][j], data.points[i][j - 1], data.points[i][j]));
|
||||
array_push(data.tris, new _Triangle(data.points[i - 1][j], data.points[i][j - 1], data.points[i][j]));
|
||||
if(j < sample && data.points[i - 1][j] != 0 && data.points[i - 1][j + 1] != 0)
|
||||
ds_list_add(data.tris, new _Triangle(data.points[i - 1][j], data.points[i - 1][j + 1], data.points[i][j]));
|
||||
array_push(data.tris, new _Triangle(data.points[i - 1][j], data.points[i - 1][j + 1], data.points[i][j]));
|
||||
} else
|
||||
data.points[i][j] = 0;
|
||||
}
|
||||
|
@ -336,22 +332,22 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
if(data.points[i][j] == 0) continue;
|
||||
|
||||
if(i && data.points[i - 1][j] != 0) {
|
||||
ds_list_add(data.links, new link(data.points[i][j], data.points[i - 1][j]));
|
||||
array_push(data.links, new link(data.points[i][j], data.points[i - 1][j]));
|
||||
}
|
||||
if(j && data.points[i][j - 1] != 0) {
|
||||
ds_list_add(data.links, new link(data.points[i][j], data.points[i][j - 1]));
|
||||
array_push(data.links, new link(data.points[i][j], data.points[i][j - 1]));
|
||||
}
|
||||
|
||||
if(diagon) {
|
||||
if(i && j && data.points[i - 1][j - 1] != 0) {
|
||||
var l = new link(data.points[i][j], data.points[i - 1][j - 1]);
|
||||
l.k = spring;
|
||||
ds_list_add(data.links, l);
|
||||
array_push(data.links, l);
|
||||
}
|
||||
if(i && j < sample && data.points[i - 1][j + 1] != 0) {
|
||||
var l = new link(data.points[i][j], data.points[i - 1][j + 1]);
|
||||
l.k = spring;
|
||||
ds_list_add(data.links, l);
|
||||
array_push(data.links, l);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -464,19 +460,43 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _inputs = load_map[? "inputs"];
|
||||
|
||||
for(var i = control_index; i < ds_list_size(_inputs); i++) {
|
||||
createControl();
|
||||
inputs[| i].deserialize(_inputs[| i]);
|
||||
var inp = createControl();
|
||||
print(instanceof(inp))
|
||||
inp.applyDeserialize(_inputs[| i]);
|
||||
}
|
||||
}
|
||||
|
||||
static attributeSerialize = function() {
|
||||
var att = ds_map_create();
|
||||
ds_map_add_map(att, "pin", attributes[? "pin"]);
|
||||
|
||||
var pinList = ds_list_create();
|
||||
for( var j = 0; j < array_length(data.points); j++ )
|
||||
for( var k = 0; k < array_length(data.points[j]); k++ ) {
|
||||
var p = data.points[j][k];
|
||||
if(p == 0) continue;
|
||||
if(p.pin) ds_list_add(pinList, p.index);
|
||||
}
|
||||
|
||||
ds_map_add_list(att, "pin", pinList);
|
||||
return att;
|
||||
}
|
||||
|
||||
loadPin = noone;
|
||||
static attributeDeserialize = function(attr) {
|
||||
if(ds_map_exists(attr, "pin"))
|
||||
attributes[? "pin"] = ds_map_clone(attr[? "pin"]);
|
||||
loadPin = attr[? "pin"];
|
||||
}
|
||||
|
||||
static postConnect = function() {
|
||||
setTriangle();
|
||||
|
||||
if(loadPin != noone) {
|
||||
for( var i = 0; i < ds_list_size(loadPin); i++ ) {
|
||||
var ind = loadPin[| i];
|
||||
if(ind < array_length(points))
|
||||
points[ind].pin = true;
|
||||
}
|
||||
loadPin = noone;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1077,9 +1077,15 @@ function Panel_Animation() : PanelContent() constructor {
|
|||
if(stagger_mode == 1 && ds_list_exist(keyframe_selecting, keyframe))
|
||||
cc = key_hover == keyframe? COLORS.panel_animation_keyframe_selected : COLORS._main_accent;
|
||||
|
||||
draw_sprite_ui_uniform(THEME.timeline_keyframe, keyframe.ease_in_type == CURVE_TYPE.cut? 4 : 1, t, prop_y, 1, cc);
|
||||
var ind = 1;
|
||||
if(keyframe.ease_in_type == CURVE_TYPE.cut)
|
||||
ind = 4;
|
||||
if(keyframe.anim.prop.type == VALUE_TYPE.trigger)
|
||||
ind = 4;
|
||||
|
||||
draw_sprite_ui_uniform(THEME.timeline_keyframe, ind, t, prop_y, 1, cc);
|
||||
if(ds_list_exist(keyframe_selecting, keyframe))
|
||||
draw_sprite_ui_uniform(THEME.timeline_keyframe_selecting, keyframe.ease_in_type == CURVE_TYPE.cut, t, prop_y, 1, COLORS._main_accent);
|
||||
draw_sprite_ui_uniform(THEME.timeline_keyframe_selecting, ind != 1, t, prop_y, 1, COLORS._main_accent);
|
||||
|
||||
if(keyframe_boxing) {
|
||||
var box_x0 = min(keyframe_box_sx, msx);
|
||||
|
|
|
@ -522,6 +522,10 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
|
|||
|
||||
menuCall(,, menu);
|
||||
}
|
||||
|
||||
if(DRAGGING) {
|
||||
content_index = i;
|
||||
}
|
||||
}
|
||||
|
||||
var cc = foc? COLORS.panel_bg_clear_inner : COLORS._main_text_sub;
|
||||
|
@ -820,6 +824,7 @@ function PanelContent() constructor {
|
|||
showHeader = true;
|
||||
|
||||
function refresh() {
|
||||
setPanelSize(panel);
|
||||
onResize();
|
||||
}
|
||||
|
||||
|
@ -829,6 +834,7 @@ function PanelContent() constructor {
|
|||
function onFocusEnd() {}
|
||||
|
||||
function initSize() {}
|
||||
|
||||
function setPanelSize(panel) {
|
||||
x = panel.tx;
|
||||
y = panel.ty;
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
|
||||
case "Panel_Color" : return new Panel_Color();
|
||||
case "Panel_Palette" : return new Panel_Palette();
|
||||
case "Panel_Gradient" : return new Panel_Gradient();
|
||||
}
|
||||
|
||||
return noone;
|
||||
|
|
101
scripts/panel_gradient/panel_gradient.gml
Normal file
101
scripts/panel_gradient/panel_gradient.gml
Normal file
|
@ -0,0 +1,101 @@
|
|||
function Panel_Gradient() : PanelContent() constructor {
|
||||
title = "Gradient";
|
||||
showHeader = false;
|
||||
title_height = 64;
|
||||
padding = 24;
|
||||
|
||||
w = ui(320);
|
||||
h = ui(480);
|
||||
|
||||
presets = [];
|
||||
|
||||
function presetCollect() {
|
||||
presets = [];
|
||||
|
||||
var path = DIRECTORY + "Gradients/"
|
||||
var file = file_find_first(path + "*", 0);
|
||||
while(file != "") {
|
||||
array_push(presets, {
|
||||
name: filename_name(file),
|
||||
gradient: loadGradient(path + file)
|
||||
});
|
||||
|
||||
file = file_find_next();
|
||||
}
|
||||
file_find_close();
|
||||
}
|
||||
presetCollect();
|
||||
|
||||
function onResize() {
|
||||
PANEL_PADDING
|
||||
|
||||
sp_gradient.resize(w - ui(padding + padding), h - ui(title_height + padding));
|
||||
}
|
||||
|
||||
sp_gradient = new scrollPane(w - ui(padding + padding), h - ui(title_height + padding), function(_y, _m) {
|
||||
draw_clear_alpha(COLORS.panel_bg_clear, 0);
|
||||
var ww = sp_gradient.surface_w;
|
||||
var hh = 0;
|
||||
|
||||
var amo = array_length(presets);
|
||||
var col = floor(ww / ui(160));
|
||||
var row = ceil(amo / col);
|
||||
|
||||
var gw = (ww + ui(8)) / col;
|
||||
var gh = ui(16);
|
||||
|
||||
var hg = ui(24 + 8) + gh;
|
||||
var yy = _y;
|
||||
|
||||
for(var i = 0; i < row; i++) {
|
||||
for(var j = 0; j < col; j++) {
|
||||
var ind = i * col + j;
|
||||
if(ind >= amo) break;
|
||||
|
||||
var xx = j * gw;
|
||||
var preset = presets[ind];
|
||||
var isHover = pHOVER && point_in_rectangle(_m[0], _m[1], xx, max(0, yy), xx + gw - ui(8), min(sp_gradient.h, yy + hg));
|
||||
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, in_dialog, xx, yy, gw - ui(8), hg);
|
||||
if(isHover)
|
||||
draw_sprite_stretched_ext(THEME.node_active, 1, xx, yy, gw - ui(8), hg, COLORS._main_accent, 1);
|
||||
|
||||
draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub);
|
||||
draw_text(xx + ui(10), yy + ui(2), preset.name);
|
||||
preset.gradient.draw(xx + ui(10), yy + ui(24), gw - ui(28), gh);
|
||||
|
||||
if(isHover && mouse_press(mb_left, pFOCUS)) {
|
||||
DRAGGING = {
|
||||
type: "Gradient",
|
||||
data: preset.gradient
|
||||
}
|
||||
}
|
||||
}
|
||||
yy += hg + ui(8);
|
||||
hh += hg + ui(8);
|
||||
}
|
||||
|
||||
return hh;
|
||||
});
|
||||
|
||||
function drawContent(panel) {
|
||||
PANEL_PADDING
|
||||
PANEL_TITLE
|
||||
|
||||
var px = ui(padding);
|
||||
var py = ui(title_height);
|
||||
var pw = w - ui(padding + padding);
|
||||
var ph = h - ui(title_height + padding);
|
||||
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, !in_dialog, px - ui(8), py - ui(8), pw + ui(16), ph + ui(16));
|
||||
|
||||
sp_gradient.setActiveFocus(pFOCUS, pHOVER);
|
||||
sp_gradient.draw(px, py, mx - px, my - py);
|
||||
|
||||
var bx = w - ui(32 + 16);
|
||||
var by = title_height / 2 - ui(16 + !in_dialog * 2);
|
||||
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Refresh", THEME.refresh, 1, COLORS._main_icon) == 2)
|
||||
presetCollect();
|
||||
}
|
||||
}
|
11
scripts/panel_gradient/panel_gradient.yy
Normal file
11
scripts/panel_gradient/panel_gradient.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "panel_gradient",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "colors",
|
||||
"path": "folders/panels/colors.yy",
|
||||
},
|
||||
}
|
|
@ -614,9 +614,6 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
}
|
||||
//print("Node selection time: " + string(current_time - t)); t = current_time;
|
||||
|
||||
if(node_hovering && node_hovering.on_dragdrop_file != -1)
|
||||
node_hovering.drawActive(gr_x, gr_y, graph_s, 1);
|
||||
|
||||
if(node_focus)
|
||||
node_focus.drawActive(gr_x, gr_y, graph_s);
|
||||
|
||||
|
@ -1328,9 +1325,12 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
}
|
||||
}
|
||||
|
||||
var drawCorner = value_dragging.type == VALUE_TYPE.action;
|
||||
if(target != noone) {
|
||||
_mx = target.x;
|
||||
_my = target.y;
|
||||
|
||||
drawCorner |= target.type == VALUE_TYPE.action;
|
||||
}
|
||||
|
||||
var col = value_color(value_dragging.type);
|
||||
|
@ -1338,24 +1338,47 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
draw_set_color(col);
|
||||
var th = PREF_MAP[? "connection_line_width"] * graph_s;
|
||||
switch(PREF_MAP[? "curve_connection_line"]) {
|
||||
case 0 : draw_line_width(xx, yy, _mx, _my, th); break;
|
||||
case 0 :
|
||||
draw_line_width(xx, yy, _mx, _my, th);
|
||||
break;
|
||||
case 1 :
|
||||
if(drawCorner) {
|
||||
if(value_dragging.type == VALUE_TYPE.action)
|
||||
draw_line_curve_corner(_mx, _my, xx, yy, graph_s, th, col, col);
|
||||
else
|
||||
draw_line_curve_corner(xx, yy, _mx, _my, graph_s, th, col, col);
|
||||
} else {
|
||||
if(value_dragging.connect_type == JUNCTION_CONNECT.output)
|
||||
draw_line_curve_color(_mx, _my, xx, yy,,, graph_s, th, col, col);
|
||||
else
|
||||
draw_line_curve_color(xx, yy, _mx, _my,,, graph_s, th, col, col);
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
if(drawCorner) {
|
||||
if(value_dragging.type == VALUE_TYPE.action)
|
||||
draw_line_elbow_corner(_mx, _my, xx, yy, graph_s, th, col, col, corner);
|
||||
else
|
||||
draw_line_elbow_corner(xx, yy, _mx, _my, graph_s, th, col, col, corner);
|
||||
} else {
|
||||
if(value_dragging.connect_type == JUNCTION_CONNECT.output)
|
||||
draw_line_elbow_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner);
|
||||
else
|
||||
draw_line_elbow_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner);
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
if(drawCorner) {
|
||||
if(value_dragging.type == VALUE_TYPE.action)
|
||||
draw_line_elbow_diag_corner(_mx, _my, xx, yy, graph_s, th, col, col, corner);
|
||||
else
|
||||
draw_line_elbow_diag_corner(xx, yy, _mx, _my, graph_s, th, col, col, corner);
|
||||
} else {
|
||||
if(value_dragging.connect_type == JUNCTION_CONNECT.output)
|
||||
draw_line_elbow_diag_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner);
|
||||
else
|
||||
draw_line_elbow_diag_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1366,7 +1389,7 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
if(mouse_release(mb_left)) {
|
||||
if(value_focus && value_focus != value_dragging) {
|
||||
if(value_focus.connect_type == JUNCTION_CONNECT.input)
|
||||
value_focus.setFrom(value_dragging);
|
||||
var res = value_focus.setFrom(value_dragging);
|
||||
else
|
||||
value_dragging.setFrom(value_focus);
|
||||
} else if(target != noone && value_dragging.connect_type == JUNCTION_CONNECT.input) {
|
||||
|
|
|
@ -554,10 +554,10 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
var bx = w - ui(44);
|
||||
var by = ui(12);
|
||||
|
||||
if(inspecting.hasInspectorUpdate(true)) {
|
||||
var icon = inspecting.inspUpdateIcon;
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, inspecting.inspUpdateTooltip, icon[0], icon[1], icon[2]) == 2)
|
||||
inspecting.inspectorUpdate();
|
||||
if(inspecting.hasInspector1Update(true)) {
|
||||
var icon = inspecting.insp1UpdateIcon;
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, inspecting.insp1UpdateTooltip, icon[0], icon[1], icon[2]) == 2)
|
||||
inspecting.inspector1Update();
|
||||
} else
|
||||
draw_sprite_ui(THEME.sequence_control, 1, bx + ui(16), by + ui(16),,,, COLORS._main_icon_dark);
|
||||
|
||||
|
|
|
@ -190,6 +190,7 @@ function Panel_Menu() : PanelContent() constructor {
|
|||
return submenuCall(_x, _y, _depth, [
|
||||
menuItem(get_text("panel_menu_color", "Color"), function() { panelAdd("Panel_Color", true) },,, function() { return findPanel("Panel_Color") != noone; } ),
|
||||
menuItem(get_text("panel_menu_palette", "Palette"), function() { panelAdd("Panel_Palette", true) },,, function() { return findPanel("Panel_Palette") != noone; } ),
|
||||
menuItem(get_text("panel_menu_gradient", "Gradient"),function() { panelAdd("Panel_Gradient", true) },,, function() { return findPanel("Panel_Gradient") != noone; } ),
|
||||
]);
|
||||
} ).setIsShelf(),
|
||||
]],
|
||||
|
|
|
@ -117,7 +117,7 @@ function Panel_Nodes() : PanelContent() constructor {
|
|||
sc_nodes.draw(px, py + ui(40), mx - px, my - (py + ui(40)));
|
||||
|
||||
//var bx = w - ui(32 + 16);
|
||||
//var by = title_height / 2 - ui(14);
|
||||
//var by = title_height / 2 - ui(16 + !in_dialog * 2);
|
||||
|
||||
//if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, "Create tunnel", THEME.tunnel, 1, c_white) == 2) {
|
||||
// nodeBuild("Node_Tunnel_In", build_x, build_y);
|
||||
|
|
|
@ -139,14 +139,12 @@ function Panel_Notification() : PanelContent() constructor {
|
|||
|
||||
function drawContent(panel) {
|
||||
PANEL_PADDING
|
||||
|
||||
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_title);
|
||||
draw_text_over(in_dialog? ui(56) : ui(24), title_height / 2, title);
|
||||
PANEL_TITLE
|
||||
|
||||
var ww = ui(28);
|
||||
var hh = ui(28);
|
||||
var bx = w - ui(in_dialog? padding - 8 : padding) - ww;
|
||||
var by = title_height / 2 - ui(14);
|
||||
var by = title_height / 2 - ui(16 + !in_dialog * 2);
|
||||
|
||||
var error = !!(filter & NOTI_TYPE.error);
|
||||
var toolt = error? get_text("noti_hide_error", "Hide error") : get_text("noti_show_error", "Show error");
|
||||
|
|
|
@ -8,6 +8,8 @@ function Panel_Workspace() : PanelContent() constructor {
|
|||
scroll_max = 0;
|
||||
hori = false;
|
||||
|
||||
layout_selecting = "";
|
||||
|
||||
function refreshContent() {
|
||||
workspaces = [];
|
||||
|
||||
|
@ -33,12 +35,14 @@ function Panel_Workspace() : PanelContent() constructor {
|
|||
var y0 = hori? ui(6) : ui(6) + scroll, y1;
|
||||
var ww = 0;
|
||||
var hh = 0;
|
||||
var amo = array_length(workspaces);
|
||||
|
||||
draw_set_text(f_p1, hori? fa_left : fa_center, fa_top, COLORS._main_text_sub);
|
||||
|
||||
for( var i = 0; i < array_length(workspaces); i++ ) {
|
||||
var tw = hori? string_width(workspaces[i]) + ui(16) : w - ui(16);
|
||||
var th = string_height(workspaces[i]) + ui(8);
|
||||
for( var i = 0; i <= amo; i++ ) {
|
||||
var str = i == amo? "+" : workspaces[i];
|
||||
var tw = hori? string_width(str) + ui(16) : w - ui(16);
|
||||
var th = string_height(str) + ui(8);
|
||||
|
||||
x1 = x0 + tw;
|
||||
y1 = y0 + th;
|
||||
|
@ -47,14 +51,47 @@ function Panel_Workspace() : PanelContent() constructor {
|
|||
draw_sprite_stretched(THEME.button_hide_fill, 1, x0, y0, x1 - x0, y1 - y0);
|
||||
|
||||
if(mouse_press(mb_left, pFOCUS)) {
|
||||
PREF_MAP[? "panel_layout_file"] = workspaces[i];
|
||||
if(i == amo) {
|
||||
var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8));
|
||||
dia.name = PREF_MAP[? "panel_layout_file"];
|
||||
dia.onModify = function(name) {
|
||||
var cont = panelSerialize();
|
||||
json_save_struct(DIRECTORY + "layouts/" + name + ".json", cont);
|
||||
|
||||
PREF_MAP[? "panel_layout_file"] = name;
|
||||
PREF_SAVE();
|
||||
refreshContent();
|
||||
};
|
||||
} else {
|
||||
PREF_MAP[? "panel_layout_file"] = str;
|
||||
PREF_SAVE();
|
||||
setPanel();
|
||||
}
|
||||
}
|
||||
|
||||
draw_set_color(PREF_MAP[? "panel_layout_file"] == workspaces[i]? COLORS._main_text : COLORS._main_text_sub)
|
||||
draw_text_add(hori? x0 + ui(8) : (x0 + x1) / 2, y0 + ui(4), workspaces[i]);
|
||||
if(mouse_press(mb_right, pFOCUS)) {
|
||||
layout_selecting = str;
|
||||
menuCall(,, [
|
||||
menuItem("Select", function() {
|
||||
PREF_MAP[? "panel_layout_file"] = layout_selecting;
|
||||
PREF_SAVE();
|
||||
setPanel();
|
||||
}),
|
||||
menuItem("Replace with current", function() {
|
||||
var cont = panelSerialize();
|
||||
json_save_struct(DIRECTORY + "layouts/" + layout_selecting + ".json", cont);
|
||||
|
||||
}),
|
||||
menuItem("Delete", function() {
|
||||
file_delete(DIRECTORY + "layouts/" + layout_selecting + ".json");
|
||||
refreshContent();
|
||||
}, THEME.cross),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
draw_set_color(PREF_MAP[? "panel_layout_file"] == str? COLORS._main_text : COLORS._main_text_sub)
|
||||
draw_text_add(hori? x0 + ui(8) : (x0 + x1) / 2, y0 + ui(4), str);
|
||||
|
||||
if(hori) {
|
||||
x0 += tw + ui(4);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
PREF_MAP[? "connection_line_sample"] = 1;
|
||||
PREF_MAP[? "connection_line_corner"] = 8;
|
||||
PREF_MAP[? "connection_line_aa"] = 2;
|
||||
PREF_MAP[? "connection_line_transition"] = true;
|
||||
PREF_MAP[? "curve_connection_line"] = 1;
|
||||
|
||||
PREF_MAP[? "default_surface_side"] = 32;
|
||||
|
@ -204,8 +205,8 @@
|
|||
file_text_write_all(path, json_encode_minify(map));
|
||||
ds_map_destroy(map);
|
||||
|
||||
var path = DIRECTORY + "Nodes/fav.json";
|
||||
json_save_struct(path, global.FAV_NODES);
|
||||
json_save_struct(DIRECTORY + "Nodes/fav.json", global.FAV_NODES);
|
||||
json_save_struct(DIRECTORY + "Nodes/recent.json", global.RECENT_NODES);
|
||||
}
|
||||
|
||||
function PREF_LOAD() {
|
||||
|
|
|
@ -4,10 +4,16 @@ enum RENDER_TYPE {
|
|||
full = 2
|
||||
}
|
||||
|
||||
#region globalvar
|
||||
global.RENDER_DEBUG = false;
|
||||
|
||||
global.RENDER_LOG = false;
|
||||
global.group_inputs = [ "Node_Group_Input", "Node_Feedback_Input", "Node_Iterator_Input", "Node_Iterator_Each_Input" ];
|
||||
#endregion
|
||||
|
||||
function __nodeLeafList(_list) {
|
||||
var nodes = [];
|
||||
|
||||
function __nodeLeafList(_list, _queue) {
|
||||
for( var i = 0; i < ds_list_size(_list); i++ ) {
|
||||
var _node = _list[| i];
|
||||
if(!_node.active) continue;
|
||||
|
@ -16,10 +22,12 @@ function __nodeLeafList(_list, _queue) {
|
|||
_node.triggerRender();
|
||||
var _startNode = _node.isRenderable();
|
||||
if(_startNode) {
|
||||
ds_queue_enqueue(_queue, _node);
|
||||
array_push(nodes, _node);
|
||||
printIf(global.RENDER_LOG, "Push node " + _node.name + " to stack");
|
||||
}
|
||||
}
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
function __nodeIsLoop(_node) {
|
||||
|
@ -43,11 +51,12 @@ function __nodeInLoop(_node) {
|
|||
}
|
||||
|
||||
function Render(partial = false, runAction = false) {
|
||||
var t = current_time;
|
||||
printIf(global.RENDER_LOG, "=== RENDER START [frame " + string(ANIMATOR.current_frame) + "] ===");
|
||||
|
||||
try {
|
||||
var rendering = noone;
|
||||
var error = 0;
|
||||
var t = current_time;
|
||||
printIf(global.RENDER_LOG, "=== RENDER START [frame " + string(ANIMATOR.current_frame) + "] ===");
|
||||
|
||||
if(!partial || ALWAYS_FULL) {
|
||||
var _key = ds_map_find_first(NODE_MAP);
|
||||
|
@ -78,11 +87,13 @@ function Render(partial = false, runAction = false) {
|
|||
if(__nodeInLoop(_node)) continue;
|
||||
|
||||
var _startNode = _node.isRenderable();
|
||||
printIf(global.RENDER_LOG, " > Check leaf " + _node.name + " (" + _node.display_name + "): " + string(_startNode));
|
||||
if(_startNode) {
|
||||
printIf(global.RENDER_LOG, " > Found leaf " + _node.name + " (" + _node.display_name + ")");
|
||||
|
||||
if(_startNode)
|
||||
_node.triggerRender();
|
||||
ds_queue_enqueue(RENDER_QUEUE, _node);
|
||||
}
|
||||
}
|
||||
|
||||
// render forward
|
||||
while(!ds_queue_empty(RENDER_QUEUE)) {
|
||||
|
@ -90,20 +101,23 @@ function Render(partial = false, runAction = false) {
|
|||
|
||||
if(!rendering.rendered) {
|
||||
rendering.doUpdate();
|
||||
rendering.setRenderStatus(true);
|
||||
printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "] (Update)");
|
||||
|
||||
rendering.getNextNodes();
|
||||
var nextNodes = rendering.getNextNodes();
|
||||
for( var i = 0; i < array_length(nextNodes); i++ ) {
|
||||
if(!nextNodes[i].isRenderable()) continue;
|
||||
ds_queue_enqueue(RENDER_QUEUE, nextNodes[i]);
|
||||
}
|
||||
|
||||
if(runAction && rendering.hasInspectorUpdate())
|
||||
rendering.inspectorUpdate();
|
||||
if(runAction && rendering.hasInspector1Update())
|
||||
rendering.inspector1Update();
|
||||
} else
|
||||
printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "] (Skip)");
|
||||
}
|
||||
|
||||
printIf(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n");
|
||||
} catch(e)
|
||||
noti_warning(exception_print(e));
|
||||
|
||||
printIf(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n");
|
||||
}
|
||||
|
||||
function __renderListReset(list) {
|
||||
|
@ -151,13 +165,16 @@ function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) {
|
|||
var txt = rendering.rendered? " [Skip]" : " [Update]";
|
||||
if(!rendering.rendered) {
|
||||
rendering.doUpdate();
|
||||
if(rendering.hasInspectorUpdate()) {
|
||||
rendering.inspectorUpdate();
|
||||
if(rendering.hasInspector1Update()) {
|
||||
rendering.inspector1Update();
|
||||
printIf(global.RENDER_LOG, " > Toggle manual execution " + rendering.name + " (" + rendering.display_name + ")");
|
||||
}
|
||||
|
||||
rendering.setRenderStatus(true);
|
||||
rendering.getNextNodes();
|
||||
var nextNodes = rendering.getNextNodes();
|
||||
for( var i = 0; i < array_length(nextNodes); i++ ) {
|
||||
if(!nextNodes[i].isRenderable()) continue;
|
||||
ds_queue_enqueue(RENDER_QUEUE, nextNodes[i]);
|
||||
}
|
||||
}
|
||||
printIf(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "]" + txt);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue