From 83d6f87ade8ff06d06be62c92a6de6c71eada8cd Mon Sep 17 00:00:00 2001 From: Tanasart Date: Tue, 4 Feb 2025 11:39:46 +0700 Subject: [PATCH] node chords --- datafiles/data/Nodes/Internal.zip | Bin 9100580 -> 9100580 bytes datafiles/data/Theme.zip | Bin 2863384 -> 2863391 bytes objects/o_dialog_add_node/Create_0.gml | 8 +- .../Create_0.gml | 3 + objects/o_main/Other_75.gml | 1 - objects/o_main/Step_0.gml | 10 +- .../__node_3d_extrude/__node_3d_extrude.gml | 2 +- scripts/__node_3d_plane/__node_3d_plane.gml | 2 +- .../__node_shader_processor.gml | 2 +- .../__node_surface_filter.gml | 2 +- scripts/__node_template/__node_template.gml | 12 +- scripts/array_functions/array_functions.gml | 6 + scripts/distance_to_line/distance_to_line.gml | 30 ++- .../draw_connect_curve/draw_connect_curve.gml | 20 +- .../draw_connect_elbow/draw_connect_elbow.gml | 38 ++-- .../draw_connect_elbow_diag.gml | 70 +++---- .../draw_connect_line/draw_connect_line.gml | 7 +- .../draw_connect_linear.gml | 12 +- .../function_register/function_register.gml | 2 +- scripts/globals/globals.gml | 4 +- scripts/hotkey_data/hotkey_data.gml | 31 +-- scripts/key_press/key_press.gml | 45 ++++- scripts/node_2d_light/node_2d_light.gml | 2 +- scripts/node_9slice/node_9slice.gml | 2 +- scripts/node_FXAA/node_FXAA.gml | 2 +- .../node_alpha_cutoff/node_alpha_cutoff.gml | 8 +- scripts/node_alpha_grey/node_alpha_grey.gml | 2 +- scripts/node_alpha_hash/node_alpha_hash.gml | 2 +- scripts/node_anim_curve/node_anim_curve.gml | 6 +- scripts/node_atlas/node_atlas.gml | 2 +- .../node_audio_window/node_audio_window.gml | 12 +- scripts/node_average/node_average.gml | 2 +- scripts/node_bend/node_bend.gml | 2 +- scripts/node_bevel/node_bevel.gml | 2 +- scripts/node_blend/node_blend.gml | 19 +- scripts/node_blend_edge/node_blend_edge.gml | 9 +- scripts/node_blobify/node_blobify.gml | 2 +- scripts/node_bloom/node_bloom.gml | 8 +- scripts/node_blur/node_blur.gml | 8 +- scripts/node_blur_bokeh/node_blur_bokeh.gml | 8 +- scripts/node_blur_box/node_blur_box.gml | 8 +- .../node_blur_contrast/node_blur_contrast.gml | 8 +- .../node_blur_directional.gml | 8 +- scripts/node_blur_path/node_blur_path.gml | 2 +- scripts/node_blur_radial/node_blur_radial.gml | 8 +- scripts/node_blur_shape/node_blur_shape.gml | 2 +- scripts/node_blur_simple/node_blur_simple.gml | 8 +- scripts/node_blur_slope/node_blur_slope.gml | 8 +- scripts/node_blur_zoom/node_blur_zoom.gml | 8 +- .../node_brush_linear/node_brush_linear.gml | 2 +- scripts/node_bw/node_bw.gml | 2 +- scripts/node_cache/node_cache.gml | 2 +- scripts/node_cache_array/node_cache_array.gml | 2 +- .../node_chromatic_aberration.gml | 2 +- .../node_color_adjust/node_color_adjust.gml | 2 +- .../node_color_remove/node_color_remove.gml | 8 +- .../node_color_replace/node_color_replace.gml | 2 +- scripts/node_colorize/node_colorize.gml | 2 +- .../node_colors_replace.gml | 2 +- scripts/node_convolution/node_convolution.gml | 2 +- scripts/node_corner/node_corner.gml | 8 +- scripts/node_crop/node_crop.gml | 2 +- .../node_crop_content/node_crop_content.gml | 2 +- .../node_cross_section/node_cross_section.gml | 2 +- scripts/node_curve/node_curve.gml | 2 +- scripts/node_curve_hsv/node_curve_hsv.gml | 2 +- scripts/node_data/node_data.gml | 10 +- scripts/node_de_corner/node_de_corner.gml | 2 +- scripts/node_de_stray/node_de_stray.gml | 2 +- scripts/node_delay/node_delay.gml | 6 + scripts/node_dilate/node_dilate.gml | 2 +- scripts/node_displace/node_displace.gml | 17 +- scripts/node_dither/node_dither.gml | 12 +- .../node_dither_diffuse.gml | 2 +- scripts/node_edge_detect/node_edge_detect.gml | 10 +- scripts/node_edge_shade/node_edge_shade.gml | 2 +- scripts/node_erode/node_erode.gml | 14 +- scripts/node_find_pixel/node_find_pixel.gml | 2 +- scripts/node_flip/node_flip.gml | 2 +- scripts/node_flood_fill/node_flood_fill.gml | 2 +- scripts/node_fn_math/node_fn_math.gml | 10 +- scripts/node_gamma_map/node_gamma_map.gml | 2 +- scripts/node_glow/node_glow.gml | 13 +- scripts/node_gradient/node_gradient.gml | 20 ++ scripts/node_grain/node_grain.gml | 2 +- scripts/node_grey_alpha/node_grey_alpha.gml | 2 +- scripts/node_greyscale/node_greyscale.gml | 2 +- scripts/node_grid_warp/node_grid_warp.gml | 2 +- scripts/node_high_pass/node_high_pass.gml | 10 +- scripts/node_hsv_channel/node_hsv_channel.gml | 2 +- scripts/node_image_grid/node_image_grid.gml | 6 + scripts/node_image_sheet/node_image_sheet.gml | 2 +- scripts/node_interlaced/node_interlaced.gml | 11 +- scripts/node_invert/node_invert.gml | 2 +- scripts/node_jpeg/node_jpeg.gml | 2 +- scripts/node_kuwahara/node_kuwahara.gml | 9 +- scripts/node_level/node_level.gml | 2 +- .../node_level_selector.gml | 2 +- scripts/node_liquefy/node_liquefy.gml | 2 +- .../node_local_analyze/node_local_analyze.gml | 10 +- scripts/node_lovify/node_lovify.gml | 2 +- .../node_matrix_color_apply.gml | 2 +- scripts/node_mesh_warp/node_mesh_warp.gml | 2 +- scripts/node_mirror/node_mirror.gml | 2 +- .../node_mirror_polar/node_mirror_polar.gml | 2 +- scripts/node_mk_blinker/node_mk_blinker.gml | 2 +- scripts/node_mk_fracture/node_mk_fracture.gml | 2 +- .../node_mk_gridballs/node_mk_gridballs.gml | 2 +- scripts/node_mk_rain/node_mk_rain.gml | 2 +- scripts/node_normal/node_normal.gml | 2 +- .../node_normal_light/node_normal_light.gml | 2 +- scripts/node_normalize/node_normalize.gml | 9 +- scripts/node_offset/node_offset.gml | 2 +- scripts/node_onion_skin/node_onion_skin.gml | 2 +- scripts/node_outline/node_outline.gml | 18 +- scripts/node_padding/node_padding.gml | 2 +- .../node_palette_extract.gml | 9 +- .../node_palette_shift/node_palette_shift.gml | 2 +- scripts/node_pixel_cloud/node_pixel_cloud.gml | 2 +- .../node_pixel_extract/node_pixel_extract.gml | 2 +- scripts/node_pixel_math/node_pixel_math.gml | 35 ++-- scripts/node_pixel_sort/node_pixel_sort.gml | 9 +- scripts/node_polar/node_polar.gml | 2 +- scripts/node_posterize/node_posterize.gml | 11 +- scripts/node_region_fill/node_region_fill.gml | 2 +- scripts/node_repeat/node_repeat.gml | 2 +- .../node_repeat_texture.gml | 2 +- scripts/node_revert/node_revert.gml | 2 +- scripts/node_sampler/node_sampler.gml | 2 +- scripts/node_scale/node_scale.gml | 2 +- scripts/node_scale_algo/node_scale_algo.gml | 2 +- scripts/node_scatter/node_scatter.gml | 2 +- scripts/node_sdf/node_sdf.gml | 10 +- .../node_separate_color.gml | 2 +- .../node_seperate_shape.gml | 2 +- .../node_sequence_anim/node_sequence_anim.gml | 2 +- scripts/node_shadow/node_shadow.gml | 2 +- scripts/node_shape/node_shape.gml | 65 +++--- scripts/node_shape_map/node_shape_map.gml | 2 +- scripts/node_shuffle/node_shuffle.gml | 7 + scripts/node_skew/node_skew.gml | 2 +- scripts/node_smear/node_smear.gml | 12 +- scripts/node_spherize/node_spherize.gml | 18 +- scripts/node_stack/node_stack.gml | 7 + scripts/node_surface_tag/node_surface_tag.gml | 2 +- scripts/node_test_blur/node_test_blur.gml | 2 +- .../node_texture_remap/node_texture_remap.gml | 2 +- scripts/node_threshold/node_threshold.gml | 9 +- scripts/node_tile_random/node_tile_random.gml | 2 +- scripts/node_time_remap/node_time_remap.gml | 11 +- scripts/node_tonemap_ace/node_tonemap_ace.gml | 2 +- scripts/node_trail/node_trail.gml | 21 +- scripts/node_transform/node_transform.gml | 2 +- .../node_transform_single.gml | 2 +- scripts/node_twirl/node_twirl.gml | 14 +- scripts/node_value/node_value.gml | 38 ++-- scripts/node_vignette/node_vignette.gml | 2 +- scripts/node_warp/node_warp.gml | 2 +- scripts/node_wrap_area/node_wrap_area.gml | 2 +- .../node_wrap_perspective.gml | 2 +- scripts/panel_data/panel_data.gml | 13 +- scripts/panel_graph/panel_graph.gml | 189 +++++++++++------- scripts/panel_preference/panel_preference.gml | 58 +++++- scripts/scrollBox/scrollBox.gml | 23 ++- scripts/textBox/textBox.gml | 2 - scripts/theme_definition/theme_definition.gml | 1 + 166 files changed, 964 insertions(+), 420 deletions(-) diff --git a/datafiles/data/Nodes/Internal.zip b/datafiles/data/Nodes/Internal.zip index a596ab8ad334a2c08c7273995a3d1d4baa2eff10..04030789965a3818529a39b6868dfd240f8031d3 100644 GIT binary patch delta 1413 zcmZA0TTE0(7zc3cvM#IwVrkV~QK3~(6hW;B$W4w{#9FQF1utl;t+y7bcv-x){kz*U zMiX9~7gEM#LMaxe)WA{QUwV@$>rOob1AOhX=~V+Lj- z9|iaXpJEnfqYy=ygSjZiJj_Q47N8VmScpYfjL)zHmYYq7L;~j)v<- zL%{X#MngXh8a~|`FfwJ-7BEUA^aPB#67C0#c@ka*jQJAIhqANAjH_!FyXD^VU zpTAS`|Hsmdu)T^G_vt_T%?aaOX}M#pKkMP7I(*=aH*-Vd+jTxdv7C21Y#%JAR5!;m zV%`>mR?tdXMXPBIt))gr%I2x2SH~N?!o9?w;V7q6fKj$cOzf7cB_ncww4Y@ zOW#cYeNB1v+2N>HN}S`4?3i2MaZ1vpE&g5;scugx&wCHC&pPr>c`RLT8?k$`w8&~6 z;~t77dPaUJdSty!7y3-Ue)6k1P2Q|=NwY@6s-#&d0ZDV2gsTHwIFd9AWaLVjRTAn` zX6>8#c*>qnrbhR(eYs3m_L&t<@awKVbGnRr`^=>h%DR3nh92iBwQmr$hf(s~$P!|M5K#nV-whFV*D&1?{5JhEh!S;2g=Wj6K z#{Wjfka%ZI3^9%|Mw89}@j|?5OHzS&(P&~~H1WF2dp^!koaC9j-~Mms#{HWqH%KR@ zVj3JsffLi=LMqbW#th6vI%XjQnaILye1L3xh&h;xk1!7&crhP2Sb&9Cgk0odF_vH{ zmLVSnSdJAa#7e9}5muuZCHNR?uommE9;MiTGL)kN8&Qc(s6sVruo<;?j9Q@(8EYVjFGB6@ws3K2s-W2K0{ea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xb&c@6(B>Vub1} zQq$Wa3?%oGi3lpj#eS6{5ggc4jQzETu3~)t3YrJ^im|=Ob=WuWg+$~m6e+`rb=bG; zOhUNp(T~rGNhK=FM4GUu0zGWydUQ`gmINz8$9il!aXBH&)`~b_vjN+;&z2%fvvG-F z16KcP6~UexX(jMnEs`N?kdY&j4%cxx5-WG=%o<5ea=^FTqd!&4p6rdlw6>kmgd63cLsO zoXk=Q(T2&TXmfY7gs8&NQVb@k6@>6M;T2J|jfnoPWNyN2UX>JytU`b2|1F|xE#6W7 zuKr~T&Q?pA@@jDYJj$@ifE`kJT^ZInW2Y49EyKlFP%A|OHsd~*tCJ%8H)AQ)y%Hh= z+;VjBCh#gpU;Em?WavX*J#K{G$}t)&+DAz278)-eYONk|Qt4V@gDeD6gAp$rn?VmIZ$-CO-HN_(<*M#nt1oQRXzXgsAF8(E0|7J_w zSYYTXLQ-nbX#_RsnD19hh$9uaRw88KQVmwIHBX9I?ZA0kkuOEs^Gy_(nt4#Y1Aiav zfs;EhO1vy$Oa_AMPF#@98;O1KPAvRK2@%ThZ#i}?uJTj-!IbIfkWD6B2&~19?kXeX zWtoXG)FEN7FYh0@KKxUQKTC5eeyCBqXg79#wF&I2HlbnPE-c$t12%QENl6{vDn`MO zI-FH*9fOP@sLn(cj@4mxZFN5?kl$^hNq)Y&j(?MSsyMqFUoopK(f4-KBiQ4JUVl;A%C?@iWrueBM8nzXmwu?AtCmXepq{p7t6lwxG+{&oHulH$A81Vj?Zr;J z|3fw2x738sjDh^Cexv~&uPpUJHx^xc^=nJ%FZB$_YNR9BW54_~R4>^_>vHCQv&7e% F{{vyNZO#Ay diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index acdae9f98..aaff7fd1e 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -244,7 +244,13 @@ event_inherited(); array_push(_outputs, _new_node.outputs[i]); if(PANEL_INSPECTOR) PANEL_INSPECTOR.setInspecting(_new_node); - if(PANEL_GRAPH) PANEL_GRAPH.selectDragNode(_new_node, PREFERENCES.node_add_select); + + if(PANEL_GRAPH) { + if(PREFERENCES.node_add_select) + PANEL_GRAPH.selectDragNode(_new_node, junction_called == noone); + var _ins = instanceof(_new_node); + if(struct_has(HOTKEYS, _ins)) FOCUS_STR = _ins; + } } else if(is_instanceof(_node, NodeAction)) { // NOT IMPLEMENTED var _dat = _node.build(node_target_x, node_target_y,, _param); diff --git a/objects/o_dialog_scrollbox_horizontal/Create_0.gml b/objects/o_dialog_scrollbox_horizontal/Create_0.gml index 0514e6b01..aad493f71 100644 --- a/objects/o_dialog_scrollbox_horizontal/Create_0.gml +++ b/objects/o_dialog_scrollbox_horizontal/Create_0.gml @@ -9,6 +9,7 @@ event_inherited(); align = fa_center; text_pad = ui(8); item_pad = ui(8); + minWidth = 0; widths = []; draggable = false; @@ -85,6 +86,7 @@ event_inherited(); if(_emp) { array_push(widths, 0); } else { + lw = max(minWidth, lw); array_push(widths, lw); ww += lw; hh = max(hh, lh); @@ -106,6 +108,7 @@ event_inherited(); lh += hght; } + lw = max(minWidth, lw); array_push(widths, _emp? 0 : lw); ww += lw; hh = max(hh, lh); diff --git a/objects/o_main/Other_75.gml b/objects/o_main/Other_75.gml index c32222ed3..714ebfca8 100644 --- a/objects/o_main/Other_75.gml +++ b/objects/o_main/Other_75.gml @@ -1,7 +1,6 @@ /// @description var ev_id = async_load[? "id"]; var ev_type = async_load[? "event_type"]; -print(ev_type) switch(ev_type) { diff --git a/objects/o_main/Step_0.gml b/objects/o_main/Step_0.gml index 5bf61b8ea..6abcaabe4 100644 --- a/objects/o_main/Step_0.gml +++ b/objects/o_main/Step_0.gml @@ -25,8 +25,9 @@ if(!LOADING && PROJECT.active && !PROJECT.safeMode) { //node step #region hotkey if(!HOTKEY_BLOCK) { - if(ds_map_exists(HOTKEYS, "")) { - var l = HOTKEYS[? ""]; + + if(struct_has(HOTKEYS, 0)) { + var l = HOTKEYS[$ 0]; for(var i = 0, n = ds_list_size(l); i < n; i++) { var hotkey = l[| i]; if(hotkey.key == 0 && hotkey.modi == MOD_KEY.none) continue; @@ -36,8 +37,8 @@ if(!LOADING && PROJECT.active && !PROJECT.safeMode) { //node step } } - if(ds_map_exists(HOTKEYS, FOCUS_STR)) { - var list = HOTKEYS[? FOCUS_STR]; + if(struct_has(HOTKEYS, FOCUS_STR)) { + var list = HOTKEYS[$ FOCUS_STR]; for(var i = 0, n = ds_list_size(list); i < n; i++) { var hotkey = list[| i]; if(hotkey.key == 0 && hotkey.modi == MOD_KEY.none) continue; @@ -46,6 +47,7 @@ if(!LOADING && PROJECT.active && !PROJECT.safeMode) { //node step hotkey.action(); } } + } HOTKEY_BLOCK = false; diff --git a/scripts/__node_3d_extrude/__node_3d_extrude.gml b/scripts/__node_3d_extrude/__node_3d_extrude.gml index f783e6dbf..bc8409834 100644 --- a/scripts/__node_3d_extrude/__node_3d_extrude.gml +++ b/scripts/__node_3d_extrude/__node_3d_extrude.gml @@ -2,7 +2,7 @@ function __Node_3D_Extrude(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro name = "3D Extrude"; batch_output = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Dimension(self)); diff --git a/scripts/__node_3d_plane/__node_3d_plane.gml b/scripts/__node_3d_plane/__node_3d_plane.gml index 6b49aeed8..71e29c455 100644 --- a/scripts/__node_3d_plane/__node_3d_plane.gml +++ b/scripts/__node_3d_plane/__node_3d_plane.gml @@ -2,7 +2,7 @@ function __Node_3D_Plane(_x, _y, _group = noone) : Node_Processor(_x, _y, _group name = "3D Plane"; batch_output = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Render position", self, [ 0.5, 0.5 ])) .setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference); diff --git a/scripts/__node_shader_processor/__node_shader_processor.gml b/scripts/__node_shader_processor/__node_shader_processor.gml index 0b1aa6db2..2144cfffd 100644 --- a/scripts/__node_shader_processor/__node_shader_processor.gml +++ b/scripts/__node_shader_processor/__node_shader_processor.gml @@ -1,7 +1,7 @@ function Node_Shader_Processor(_x, _y, _group = noone) : Node_Shader(_x, _y, _group) constructor { name = ""; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); addShaderProp(); attribute_surface_depth(); diff --git a/scripts/__node_surface_filter/__node_surface_filter.gml b/scripts/__node_surface_filter/__node_surface_filter.gml index 60556abe9..d26d13449 100644 --- a/scripts/__node_surface_filter/__node_surface_filter.gml +++ b/scripts/__node_surface_filter/__node_surface_filter.gml @@ -2,7 +2,7 @@ function Node_(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = ""; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/__node_template/__node_template.gml b/scripts/__node_template/__node_template.gml index 62d999798..529fae9ec 100644 --- a/scripts/__node_template/__node_template.gml +++ b/scripts/__node_template/__node_template.gml @@ -12,4 +12,14 @@ function Node_Template(_x, _y, _group = noone) : Node(_x, _y, _group) constructo static step = function() {} static update = function() {} -} \ No newline at end of file +} + +/* +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("", " > Set", KEY_GROUP.numeric, MOD_KEY.none, () => { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + addHotkey("", " > ", "", MOD_KEY.none, () => { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(); }); + addHotkey("", " > Toggle", "", MOD_KEY.none, () => { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue((_n.inputs[1].getValue() + 1) % 2); }); + }); +#endregion + diff --git a/scripts/array_functions/array_functions.gml b/scripts/array_functions/array_functions.gml index 79a8f518b..d0d972263 100644 --- a/scripts/array_functions/array_functions.gml +++ b/scripts/array_functions/array_functions.gml @@ -343,6 +343,12 @@ array_push(arr, value); } + function array_push_to_back_index(arr, index) { + var _val = arr[index]; + array_delete(arr, index, 1); + array_push(arr, _val); + } + function array_spread(arr, _arr = [], _minDepth = 0) { INLINE diff --git a/scripts/distance_to_line/distance_to_line.gml b/scripts/distance_to_line/distance_to_line.gml index ef7cca252..c329d5ea1 100644 --- a/scripts/distance_to_line/distance_to_line.gml +++ b/scripts/distance_to_line/distance_to_line.gml @@ -1,10 +1,14 @@ -function point_to_line(_px, _py, _x0, _y0, _x1, _y1) { +function point_to_line(_px, _py, _x0, _y0, _x1, _y1, _p = undefined) { var l2 = sqr(_x0 - _x1) + sqr(_y0 - _y1); if (l2 == 0) return [ _x0, _y0 ]; var t = ((_px - _x0) * (_x1 - _x0) + (_py - _y0) * (_y1 - _y0)) / l2; t = clamp(t, 0, 1); - return [ lerp(_x0, _x1, t), lerp(_y0, _y1, t) ]; + + _p ??= [ 0, 0 ]; + _p[@ 0] = lerp(_x0, _x1, t); + _p[@ 1] = lerp(_y0, _y1, t); + return _p; } function distance_to_line(_px, _py, _x0, _y0, _x1, _y1) { @@ -18,10 +22,28 @@ function distance_to_line(_px, _py, _x0, _y0, _x1, _y1) { return dd; } -function distance_to_line_infinite(px, py, x0, y0, x1, y1) { - return abs((x1 - x0) * (y0 - py) - (x0 - px) * (y1 - y0)) / sqrt(sqr(x1 - x0) + sqr(y1 - y0)); +function point_closer(_p, _dist, _px, _py, _x0, _y0, _x1, _y1) { + var l2 = sqr(_x0 - _x1) + sqr(_y0 - _y1); + if (l2 == 0) return point_distance(_px, _py, _x0, _y0); + + var t = ((_px - _x0) * (_x1 - _x0) + (_py - _y0) * (_y1 - _y0)) / l2; + t = clamp(t, 0, 1); + + var cx = lerp(_x0, _x1, t); + var cy = lerp(_y0, _y1, t); + var dx = _px - cx; + var dy = _py - cy; + var dd = dx * dx + dy * dy; + + if(dd >= _dist) return _dist; + + _p[@ 0] = cx; + _p[@ 1] = cy; + return dd; } +function distance_to_line_infinite(px, py, x0, y0, x1, y1) { return abs((x1 - x0) * (y0 - py) - (x0 - px) * (y1 - y0)) / sqrt(sqr(x1 - x0) + sqr(y1 - y0)); } + function point_project_line(px, py, l0x, l0y, l1x, l1y) { var mag = point_distance(l0x, l0y, l1x, l1y); var dir = point_direction(l0x, l0y, l1x, l1y); diff --git a/scripts/draw_connect_curve/draw_connect_curve.gml b/scripts/draw_connect_curve/draw_connect_curve.gml index 6f3a6cec6..7ee21cbb9 100644 --- a/scripts/draw_connect_curve/draw_connect_curve.gml +++ b/scripts/draw_connect_curve/draw_connect_curve.gml @@ -86,11 +86,11 @@ function draw_line_curve_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_whit } } -function distance_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s) { +function point_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s, _p = undefined) { var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 32 * PROJECT.graphConnection.line_sample); sample = clamp(sample, 2, 128); - var dist = 999999; + var dist = infinity; var ox, oy, nx, ny, t, it; var x2 = lerp(x0, x1, 0. - sign(x1 - x0) * 0.2); @@ -114,21 +114,20 @@ function distance_to_curve(mx, my, x0, y0, x1, y1, xc, yc, _s) { + 4 * y3 * power(it, 3) * power(t, 1) + y1 * power(it, 4); - if(i) - dist = min(dist, distance_to_line(mx, my, ox, oy, nx, ny)); + if(i) dist = point_closer(_p, dist, mx, my, ox, oy, nx, ny); ox = nx; oy = ny; } - return dist; + return _p; } -function distance_to_curve_corner(mx, my, x0, y0, x1, y1, _s) { +function point_to_curve_corner(mx, my, x0, y0, x1, y1, _s, _p = undefined) { var sample = ceil((abs(x0 - x1) + abs(y0 - y1)) / 32 * PROJECT.graphConnection.line_sample); sample = clamp(sample, 2, 128); - var dist = 999999; + var dist = infinity; var ox, oy, nx, ny, t, it; var x2 = lerp(x0, x1, 0.9); @@ -149,13 +148,12 @@ function distance_to_curve_corner(mx, my, x0, y0, x1, y1, _s) { + 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)); + + if(i) dist = point_closer(_p, dist, mx, my, ox, oy, nx, ny); ox = nx; oy = ny; } - return dist; + return _p; } \ No newline at end of file diff --git a/scripts/draw_connect_elbow/draw_connect_elbow.gml b/scripts/draw_connect_elbow/draw_connect_elbow.gml index 9218f2651..9d0b3da1d 100644 --- a/scripts/draw_connect_elbow/draw_connect_elbow.gml +++ b/scripts/draw_connect_elbow/draw_connect_elbow.gml @@ -94,29 +94,29 @@ function draw_line_elbow_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c_whit draw_corner(x1 - corner * sx, y0, x1, y0, x1, y0 + corner * sy, thick, colc, sample); } -function distance_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s) { - var inv = x1 <= x0; - var xx0 = x0; - var xx1 = x1; +function point_to_elbow(mx, my, x0, y0, x1, y1, cx, cy, _s, _p = undefined) { + var inv = x1 <= x0; + var xx0 = x0; + var xx1 = x1; + var dist = infinity; if(y0 != y1 && inv) { - var dist = distance_to_line(mx, my, xx0, y0, xx0, cy); - dist = min(dist, distance_to_line(mx, my, xx0, cy, xx1, cy)); - dist = min(dist, distance_to_line(mx, my, xx1, cy, xx1, y1)); - - return dist; + dist = point_closer(_p, dist, mx, my, xx0, y0, xx0, cy); + dist = point_closer(_p, dist, mx, my, xx0, cy, xx1, cy); + dist = point_closer(_p, dist, mx, my, xx1, cy, xx1, y1); + return _p; + } else { - var dist = distance_to_line(mx, my, cx, y0, cx, y1); - dist = min(dist, distance_to_line(mx, my, x0, y0, cx, y0)); - dist = min(dist, distance_to_line(mx, my, cx, y1, x1, y1)); - - return dist; + dist = point_closer(_p, dist, mx, my, cx, y0, cx, y1); + dist = point_closer(_p, dist, mx, my, x0, y0, cx, y0); + dist = point_closer(_p, dist, mx, my, cx, y1, x1, y1); + return _p; } } -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)); - - return dist; +function point_to_elbow_corner(mx, my, x0, y0, x1, y1, _p = undefined) { + var dist = infinity; + dist = point_closer(_p, dist, mx, my, x0, y0, x1, y0); + dist = point_closer(_p, dist, mx, my, x1, y0, x1, y1); + return _p; } \ No newline at end of file diff --git a/scripts/draw_connect_elbow_diag/draw_connect_elbow_diag.gml b/scripts/draw_connect_elbow_diag/draw_connect_elbow_diag.gml index 032c4a774..9157de6d9 100644 --- a/scripts/draw_connect_elbow_diag/draw_connect_elbow_diag.gml +++ b/scripts/draw_connect_elbow_diag/draw_connect_elbow_diag.gml @@ -244,7 +244,7 @@ function draw_line_elbow_diag_corner(x0, y0, x1, y1, _s = 1, thick = 1, col1 = c } -function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, indexIn, indexOut) { +function point_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, indexIn, indexOut, _p = undefined) { var iy = sign(y1 - y0); var xx0 = x0 + extend * _s; var xx1 = x1 - extend * _s; @@ -263,7 +263,8 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, inde xx0 = x0 + extend * _s * indexIn; xx1 = x1 - extend * _s * indexOut; - var dist = 9999999; + var dist = infinity; + if(inv) { var ofl = cy < _y0 || cy > _y1; var iy = sign(y1 - y0); @@ -272,8 +273,8 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, inde var ix = sign(xx0 - xx1); var rrx = abs(xx0 - xx1); - dist = min(dist, distance_to_line(mx, my, x0, y0, xx0, y0)); - dist = min(dist, distance_to_line(mx, my, xx1, y1, x1, y1)); + dist = point_closer(_p, dist, mx, my, x0, y0, xx0, y0); + dist = point_closer(_p, dist, mx, my, xx1, y1, x1, y1); if(xx1 > xx0 && !ofl) { var top = abs(cy - y0) < rrx / 2; @@ -282,23 +283,23 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, inde if(top) { var cor = (cy - y0) * 2; - dist = min(dist, distance_to_line(mx, my, xx0, y0, xx1 - cor * iy, y0)); - dist = min(dist, distance_to_line(mx, my, xx1, y0 + cor, xx1, y1)); + dist = point_closer(_p, dist, mx, my, xx0, y0, xx1 - cor * iy, y0); + dist = point_closer(_p, dist, mx, my, xx1, y0 + cor, xx1, y1); - dist = min(dist, distance_to_line(mx, my, xx1 - cor * iy, y0, xx1, y0 + cor)); + dist = point_closer(_p, dist, mx, my, xx1 - cor * iy, y0, xx1, y0 + cor); } else if(bot) { var cor = (y1 - cy) * 2; - dist = min(dist, distance_to_line(mx, my, xx0, y0, xx0, y1 - cor)); - dist = min(dist, distance_to_line(mx, my, xx0 + cor * iy, y1, xx1, y1)); + dist = point_closer(_p, dist, mx, my, xx0, y0, xx0, y1 - cor); + dist = point_closer(_p, dist, mx, my, xx0 + cor * iy, y1, xx1, y1); - dist = min(dist, distance_to_line(mx, my, xx0, y1 - cor, xx0 + cor * iy, y1)); + dist = point_closer(_p, dist, mx, my, xx0, y1 - cor, xx0 + cor * iy, y1); } else { var cor = rrx / 2; - dist = min(dist, distance_to_line(mx, my, xx0, y0, xx0, cy - cor * iy0)); - dist = min(dist, distance_to_line(mx, my, xx1, cy + cor * iy1, xx1, y1)); + dist = point_closer(_p, dist, mx, my, xx0, y0, xx0, cy - cor * iy0); + dist = point_closer(_p, dist, mx, my, xx1, cy + cor * iy1, xx1, y1); - dist = min(dist, distance_to_line(mx, my, xx0, cy - cor * sign(y1 - y0), xx1, cy + cor * sign(y1 - y0))); + dist = point_closer(_p, dist, mx, my, xx0, cy - cor * sign(y1 - y0), xx1, cy + cor * sign(y1 - y0)); } } else { var cut0 = min(abs(cy - yy0) / 2, abs(xx1 - xx0) / 2, ofl? 16 * _s : 9999); @@ -313,23 +314,24 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, inde var crX3 = xx1; var crY3 = cy + cut1 * iy1; - dist = min(dist, distance_to_line(mx, my, x0, y0, xx0, y0)); - dist = min(dist, distance_to_line(mx, my, xx1, y1, x1, y1)); + dist = point_closer(_p, dist, mx, my, x0, y0, xx0, y0); + dist = point_closer(_p, dist, mx, my, xx1, y1, x1, y1); if(abs(crX0 - crX3) == abs(crY0 - crY3)) { - dist = min(dist, distance_to_line(mx, my, crX0, y0, crX0, crY0)); - dist = min(dist, distance_to_line(mx, my, crX3, y1, crX3, crY3)); - dist = min(dist, distance_to_line(mx, my, crX0, crY0, crX3, crY3)); + dist = point_closer(_p, dist, mx, my, crX0, y0, crX0, crY0); + dist = point_closer(_p, dist, mx, my, crX3, y1, crX3, crY3); + dist = point_closer(_p, dist, mx, my, crX0, crY0, crX3, crY3); } else { - dist = min(dist, distance_to_line(mx, my, crX0, y0, crX0, crY0)); - dist = min(dist, distance_to_line(mx, my, crX1, crY1, crX2, crY2)); - dist = min(dist, distance_to_line(mx, my, crX3, crY3, crX3, y1)); + dist = point_closer(_p, dist, mx, my, crX0, y0, crX0, crY0); + dist = point_closer(_p, dist, mx, my, crX1, crY1, crX2, crY2); + dist = point_closer(_p, dist, mx, my, crX3, crY3, crX3, y1); - dist = min(dist, distance_to_line(mx, my, crX0, crY0, crX1, crY1)); - dist = min(dist, distance_to_line(mx, my, crX2, crY2, crX3, crY3)); + dist = point_closer(_p, dist, mx, my, crX0, crY0, crX1, crY1); + dist = point_closer(_p, dist, mx, my, crX2, crY2, crX3, crY3); } } - return dist; + return _p; + } else { cx = clamp(cx, _x0 + abs(ry) / 2, _x1 - abs(ry) / 2); cy = clamp(cy, _y0 + abs(rx) / 2, _y1 - abs(rx) / 2); @@ -338,23 +340,23 @@ function distance_to_elbow_diag(mx, my, x0, y0, x1, y1, cx, cy, _s, extend, inde var _xc0 = clamp(cx - (ry / 2) * sign(x1 - x0), _x0, _x1); var _xc1 = clamp(cx + (ry / 2) * sign(x1 - x0), _x0, _x1); - dist = min(dist, distance_to_line(mx, my, x0, y0, _xc0, y0)); - dist = min(dist, distance_to_line(mx, my, _xc0, y0, _xc1, y1)); - dist = min(dist, distance_to_line(mx, my, _xc1, y1, x1, y1)); + dist = point_closer(_p, dist, mx, my, x0, y0, _xc0, y0); + dist = point_closer(_p, dist, mx, my, _xc0, y0, _xc1, y1); + dist = point_closer(_p, dist, mx, my, _xc1, y1, x1, y1); - return dist; + return _p; } } -function distance_to_elbow_diag_corner(mx, my, x0, y0, x1, y1) { +function point_to_elbow_diag_corner(mx, my, x0, y0, x1, y1, _p = undefined) { var sx = sign(x1 - x0); var sy = sign(y1 - y0); var diag = min(abs(x0 - x1) / 2, abs(y0 - y1) / 2); + var dist = infinity; - 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)); + dist = point_closer(_p, dist, mx, my, x0, y0, x1 - diag * sx, y0); + dist = point_closer(_p, dist, mx, my, x1 - diag * sx, y0, x1, y0 + diag * sy); + dist = point_closer(_p, dist, mx, my, x1, y0 + diag * sy, x1, y1); - return dist; + return _p; } \ No newline at end of file diff --git a/scripts/draw_connect_line/draw_connect_line.gml b/scripts/draw_connect_line/draw_connect_line.gml index d41411dc0..73f21d590 100644 --- a/scripts/draw_connect_line/draw_connect_line.gml +++ b/scripts/draw_connect_line/draw_connect_line.gml @@ -33,6 +33,11 @@ function draw_line_connect(x0, y0, x1, y1, _s = 1, thick = 1, c1 = c_white, c2 = function distance_to_linear_connection(mx, my, x0, y0, x1, y1, _s, extend) { var xx0 = x0 + extend * _s; var xx1 = x1 - extend * _s; - return distance_to_line(mx, my, xx0, y0, xx1, y1); +} + +function point_to_linear_connection(mx, my, x0, y0, x1, y1, _s, extend, _p = undefined) { + var xx0 = x0 + extend * _s; + var xx1 = x1 - extend * _s; + return point_to_line(mx, my, xx0, y0, xx1, y1, _p); } \ No newline at end of file diff --git a/scripts/draw_connect_linear/draw_connect_linear.gml b/scripts/draw_connect_linear/draw_connect_linear.gml index ed675ec07..7fbf334ea 100644 --- a/scripts/draw_connect_linear/draw_connect_linear.gml +++ b/scripts/draw_connect_linear/draw_connect_linear.gml @@ -44,10 +44,14 @@ function draw_line_feedback(x0, y0, x1, y1, th, c1, c0, _s) { function distance_line_feedback(mx, my, x0, y0, x1, y1, _s) { var _y0 = y0 - 12 * _s; var _y1 = y1 - 12 * _s; - - var dd = 99999999; - - dd = min(dd, distance_to_line(mx, my, x0, _y0, x1, _y1)); + var dd = distance_to_line(mx, my, x0, _y0, x1, _y1); + return dd; +} + +function point_to_line_feedback(mx, my, x0, y0, x1, y1, _s, _p = undefined) { + var _y0 = y0 - 12 * _s; + var _y1 = y1 - 12 * _s; + var dd = point_to_line(mx, my, x0, _y0, x1, _y1, _p); return dd; } \ No newline at end of file diff --git a/scripts/function_register/function_register.gml b/scripts/function_register/function_register.gml index c3ad7fa0d..56083e638 100644 --- a/scripts/function_register/function_register.gml +++ b/scripts/function_register/function_register.gml @@ -50,7 +50,7 @@ function functionObjectLite(_context, _name, _action, _param = noone) constructo function registerFunction(_context, _name, _key, _mod, _action, _param = noone) { return new functionObject(_context, _name, _key, _mod, _action, _param); } function functionObject(_context, _name, _key, _mod, _action, _param = noone) constructor { - hotkey = addHotkey(_context, _name, _key, _mod, _action); + hotkey = addHotkey(_context == ""? 0 : _context, _name, _key, _mod, _action); context = _context; name = _name; dkey = _key; diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 4217a6c2d..bd7cc9f91 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -51,9 +51,9 @@ var _lsp = _vsp[array_length(_vsp) - 1]; NIGHTLY = string_length(_lsp) == 3; - HOTKEYS = ds_map_create(); + HOTKEYS = {}; HOTKEY_CONTEXT = ds_list_create(); - HOTKEY_CONTEXT[| 0] = ""; + HOTKEY_CONTEXT[| 0] = 0; globalvar TOOLTIP, DRAGGING, DIALOG_DEPTH_HOVER; global.KEYS = { download_links: "" }; diff --git a/scripts/hotkey_data/hotkey_data.gml b/scripts/hotkey_data/hotkey_data.gml index c4c9caad5..c5dddc432 100644 --- a/scripts/hotkey_data/hotkey_data.gml +++ b/scripts/hotkey_data/hotkey_data.gml @@ -111,9 +111,10 @@ function hotkeyObject(_context, _name, _key, _mod = MOD_KEY.none, _action = noon dKey = _key; dModi = _mod; - static full_name = function() /*=>*/ {return string_to_var(context == ""? $"global.{name}" : $"{context}.{name}")}; + static full_name = function() /*=>*/ {return string_to_var(context == ""? $"global.{name}" : $"{context}.{name}")}; + static get_key_name = function() /*=>*/ {return key_get_name(key, modi)}; - static serialize = function() /*=>*/ { return { context, name, key, modi } } + static serialize = function( ) /*=>*/ { return { context, name, key, modi } } static deserialize = function(l) /*=>*/ { if(!is_struct(l)) return; key = l.key; modi = l.modi; } if(struct_has(HOTKEYS_DATA, $"{context}_{name}")) deserialize(HOTKEYS_DATA[$ $"{context}_{name}"]); } @@ -123,33 +124,33 @@ function addHotkey(_context, _name, _key, _mod, _action) { var key = new hotkeyObject(_context, _name, _key, _mod, _action); - if(!ds_map_exists(HOTKEYS, _context)) { - HOTKEYS[? _context] = ds_list_create(); + if(!struct_has(HOTKEYS, _context)) { + HOTKEYS[$ _context] = ds_list_create(); if(!ds_list_exist(HOTKEY_CONTEXT, _context)) ds_list_add(HOTKEY_CONTEXT, _context); } - for(var i = 0; i < ds_list_size(HOTKEYS[? _context]); i++) { - var hotkey = HOTKEYS[? _context][| i]; + for(var i = 0; i < ds_list_size(HOTKEYS[$ _context]); i++) { + var hotkey = HOTKEYS[$ _context][| i]; if(hotkey.name == key.name) { - delete HOTKEYS[? _context][| i]; - HOTKEYS[? _context][| i] = key; + delete HOTKEYS[$ _context][| i]; + HOTKEYS[$ _context][| i] = key; return; } } - if(_context == "") ds_list_insert(HOTKEYS[? _context], 0, key); - else ds_list_add(HOTKEYS[? _context], key); + if(_context == "") ds_list_insert(HOTKEYS[$ _context], 0, key); + else ds_list_add(HOTKEYS[$ _context], key); return key; } function find_hotkey(_context, _name) { - if(!ds_map_exists(HOTKEYS, _context)) return getToolHotkey(_context, _name); + if(!struct_has(HOTKEYS, _context)) return getToolHotkey(_context, _name); - for(var j = 0; j < ds_list_size(HOTKEYS[? _context]); j++) { - if(HOTKEYS[? _context][| j].name == _name) - return HOTKEYS[? _context][| j]; + for(var j = 0; j < ds_list_size(HOTKEYS[$ _context]); j++) { + if(HOTKEYS[$ _context][| j].name == _name) + return HOTKEYS[$ _context][| j]; } } @@ -223,7 +224,7 @@ function hotkey_draw(keyStr, _x, _y, _status = 0) { function hotkey_serialize() { var _context = []; for(var i = 0, n = ds_list_size(HOTKEY_CONTEXT); i < n; i++) { - var ll = HOTKEYS[? HOTKEY_CONTEXT[| i]]; + var ll = HOTKEYS[$ HOTKEY_CONTEXT[| i]]; for(var j = 0, m = ds_list_size(ll); j < m; j++) { var _hk = ll[| j]; diff --git a/scripts/key_press/key_press.gml b/scripts/key_press/key_press.gml index c07c6d3bc..339bf4139 100644 --- a/scripts/key_press/key_press.gml +++ b/scripts/key_press/key_press.gml @@ -5,10 +5,31 @@ shift = 1 << 1, alt = 1 << 2 } + + enum KEY_GROUP { + base = 10000, + numeric = 10001, + } global.KEY_STRING_MAP = ds_map_create(); global.KEY_STRING_MAP[? 0] = "" + global.KEY_STRING_MAP[? 33] = "!" + global.KEY_STRING_MAP[? 34] = "\"" + global.KEY_STRING_MAP[? 35] = "#" + global.KEY_STRING_MAP[? 36] = "$" + global.KEY_STRING_MAP[? 37] = "%" + global.KEY_STRING_MAP[? 38] = "&" + global.KEY_STRING_MAP[? 39] = "'" + global.KEY_STRING_MAP[? 40] = "(" + global.KEY_STRING_MAP[? 41] = ")" + global.KEY_STRING_MAP[? 42] = "*" + global.KEY_STRING_MAP[? 43] = "+" + global.KEY_STRING_MAP[? 44] = "," + global.KEY_STRING_MAP[? 45] = "-" + global.KEY_STRING_MAP[? 46] = "." + global.KEY_STRING_MAP[? 47] = "/" + global.KEY_STRING_MAP[? 48] = "0" global.KEY_STRING_MAP[? 49] = "1" global.KEY_STRING_MAP[? 50] = "2" @@ -19,7 +40,7 @@ global.KEY_STRING_MAP[? 55] = "7" global.KEY_STRING_MAP[? 56] = "8" global.KEY_STRING_MAP[? 57] = "9" - + global.KEY_STRING_MAP[? 65] = "A" global.KEY_STRING_MAP[? 66] = "B" global.KEY_STRING_MAP[? 67] = "C" @@ -79,6 +100,8 @@ global.KEY_STRING_MAP[? 223] = "`" // actually ` but that needs to be escaped + global.KEY_STRING_MAP[? KEY_GROUP.numeric] = "0-9" + function key_get_index(key) { if(key == "") return noone; @@ -94,8 +117,7 @@ #region get name function key_get_name(_key, _mod) { - if(!is_real(_key) || (_key <= 0 && _mod == MOD_KEY.none)) - return ""; + if(!is_numeric(_key) || (_key <= 0 && _mod == MOD_KEY.none)) return ""; var dk = ""; if(_mod & MOD_KEY.ctrl) dk += "Ctrl+"; @@ -139,16 +161,25 @@ break; } - if(string_char_at(dk, string_length(dk)) == "+") - dk = string_copy(dk, 1, string_length(dk) - 1); - + dk = string_trim_end(dk, ["+"]); return dk; } + #endregion function key_press(_key, _mod = MOD_KEY.none) { if(WIDGET_CURRENT) return false; if(_mod == MOD_KEY.none && _key == noone) return false; - return (_key == noone || keyboard_check_pressed(_key)) && HOTKEY_MOD == _mod; + var _modPress = HOTKEY_MOD == _mod; + var _keyPress = false; + + switch(_key) { + case KEY_GROUP.numeric : _keyPress = keyboard_key >= ord("0") && keyboard_key <= ord("9") break; + + case noone : _keyPress = true; break; + default : _keyPress = keyboard_check_pressed(_key); break; + } + + return _keyPress && _modPress; } \ No newline at end of file diff --git a/scripts/node_2d_light/node_2d_light.gml b/scripts/node_2d_light/node_2d_light.gml index 8d3cd9825..4374aa75a 100644 --- a/scripts/node_2d_light/node_2d_light.gml +++ b/scripts/node_2d_light/node_2d_light.gml @@ -11,7 +11,7 @@ enum LIGHT_SHAPE_2D { function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "2D Light"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); typeList = [ new scrollItem("Point", s_node_2d_light_shape, 0), diff --git a/scripts/node_9slice/node_9slice.gml b/scripts/node_9slice/node_9slice.gml index 37299ef6a..6ed45e332 100644 --- a/scripts/node_9slice/node_9slice.gml +++ b/scripts/node_9slice/node_9slice.gml @@ -1,7 +1,7 @@ function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Nine Slice"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Dimension(self)); diff --git a/scripts/node_FXAA/node_FXAA.gml b/scripts/node_FXAA/node_FXAA.gml index cf17e93c6..1061eb4d8 100644 --- a/scripts/node_FXAA/node_FXAA.gml +++ b/scripts/node_FXAA/node_FXAA.gml @@ -1,7 +1,7 @@ function Node_FXAA(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "FXAA"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); diff --git a/scripts/node_alpha_cutoff/node_alpha_cutoff.gml b/scripts/node_alpha_cutoff/node_alpha_cutoff.gml index 6d55df398..2a00cb979 100644 --- a/scripts/node_alpha_cutoff/node_alpha_cutoff.gml +++ b/scripts/node_alpha_cutoff/node_alpha_cutoff.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Alpha_Cutoff", "Minimum > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); }); + }); +#endregion + function Node_Alpha_Cutoff(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Alpha Cutoff"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Minimum", self, 0.2, "Any pixel with less alpha (more transparent) than this will be removed.")) .setDisplay(VALUE_DISPLAY.slider); diff --git a/scripts/node_alpha_grey/node_alpha_grey.gml b/scripts/node_alpha_grey/node_alpha_grey.gml index fe26955b4..f62eb46b1 100644 --- a/scripts/node_alpha_grey/node_alpha_grey.gml +++ b/scripts/node_alpha_grey/node_alpha_grey.gml @@ -1,7 +1,7 @@ function Node_Alpha_Grey(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Alpha to Grey"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_alpha_hash/node_alpha_hash.gml b/scripts/node_alpha_hash/node_alpha_hash.gml index e2b40d559..9c47bd325 100644 --- a/scripts/node_alpha_hash/node_alpha_hash.gml +++ b/scripts/node_alpha_hash/node_alpha_hash.gml @@ -14,7 +14,7 @@ function Node_Alpha_Hash(_x, _y, _group = noone) : Node_Processor(_x, _y, _group 15, 47, 7, 39, 13, 45, 5, 37, 63, 31, 55, 23, 61, 29, 53, 21]; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); diff --git a/scripts/node_anim_curve/node_anim_curve.gml b/scripts/node_anim_curve/node_anim_curve.gml index 0f330e520..98c4904c5 100644 --- a/scripts/node_anim_curve/node_anim_curve.gml +++ b/scripts/node_anim_curve/node_anim_curve.gml @@ -1,10 +1,14 @@ +#region create + +#endregion + function Node_Anim_Curve(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Evaluate Curve"; update_on_frame = true; setDimension(96, 48); - newInput(0, nodeValue_Curve("Curve", self, CURVE_DEF_01)); + newInput(0, nodeValue_Curve("Curve", self, CURVE_DEF_01)); newInput(1, nodeValue_Float("Progress", self, 0)) .setDisplay(VALUE_DISPLAY.slider); diff --git a/scripts/node_atlas/node_atlas.gml b/scripts/node_atlas/node_atlas.gml index d4ad196ea..39a81e0ce 100644 --- a/scripts/node_atlas/node_atlas.gml +++ b/scripts/node_atlas/node_atlas.gml @@ -1,7 +1,7 @@ function Node_Atlas(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Pixel Expand"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_audio_window/node_audio_window.gml b/scripts/node_audio_window/node_audio_window.gml index 185ae327c..bb3585410 100644 --- a/scripts/node_audio_window/node_audio_window.gml +++ b/scripts/node_audio_window/node_audio_window.gml @@ -7,14 +7,14 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr newInput(1, nodeValue_Int("Width", self, 4096, "Amount of bits to extract.")); newInput(2, nodeValue_Float("Location", self, 0)) - .setDisplay(VALUE_DISPLAY._default, { unit: 0, side_button: button(function() { + .setDisplay(VALUE_DISPLAY._default, { side_button: button(function() /*=>*/ { inputs[2].attributes.unit = (inputs[2].attributes.unit + 1) % 3; - inputs[2].display_data.side_button.tooltip.index = inputs[2].attributes.unit; update(); }).setTooltip( new tooltipSelector("Unit", [ "Bit", "Second", "Progress" ]) ) - .setIcon( THEME.unit_audio, [ function() { return inputs[2].attributes.unit; } ], COLORS._main_icon ) + .setIcon( THEME.unit_audio, [ function() /*=>*/ {return inputs[2].attributes.unit} ], COLORS._main_icon ) } ); + inputs[2].attributes.unit = 0; newInput(3, nodeValue_Enum_Button("Cursor location", self, 1, [ "Start", "Middle", "End" ])); @@ -41,6 +41,8 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr } static update = function(frame = CURRENT_FRAME) { + inputs[2].display_data.side_button.tooltip.index = inputs[2].attributes.unit; + var _aud = getInputData(0); if(!is_instanceof(_aud, audioObject)) return; @@ -95,7 +97,7 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr outputs[0].setValue(res); } - static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { var _aud = getInputData(0); if(!is_instanceof(_aud, audioObject)) return; @@ -120,6 +122,6 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constr draw_set_color(COLORS._main_accent); draw_line(dx + cr * ss, bbox.yc - 16 * _s, dx + cr * ss, bbox.yc + 16 * _s); - } #endregion + } } \ No newline at end of file diff --git a/scripts/node_average/node_average.gml b/scripts/node_average/node_average.gml index 0349cb842..48a68de00 100644 --- a/scripts/node_average/node_average.gml +++ b/scripts/node_average/node_average.gml @@ -1,7 +1,7 @@ function Node_Average(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Average"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_bend/node_bend.gml b/scripts/node_bend/node_bend.gml index e9d765ec7..218aabc70 100644 --- a/scripts/node_bend/node_bend.gml +++ b/scripts/node_bend/node_bend.gml @@ -1,7 +1,7 @@ function Node_Bend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Bend"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_bevel/node_bevel.gml b/scripts/node_bevel/node_bevel.gml index ac8ac64d3..02b9fa68c 100644 --- a/scripts/node_bevel/node_bevel.gml +++ b/scripts/node_bevel/node_bevel.gml @@ -1,7 +1,7 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Bevel"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Int("Height", self, 4)) .setMappable(11); diff --git a/scripts/node_blend/node_blend.gml b/scripts/node_blend/node_blend.gml index ad572281a..32a04ef6a 100644 --- a/scripts/node_blend/node_blend.gml +++ b/scripts/node_blend/node_blend.gml @@ -1,5 +1,4 @@ #region create - function Node_create_Blend(_x, _y, _group = noone, _param = {}) { var node = new Node_Blend(_x, _y, _group); node.skipDefault(); @@ -23,6 +22,24 @@ stretch, tile } + + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blend", "Blend mode > Multiply", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(array_find(BLEND_TYPES, "Multiply")); }); + addHotkey("Node_Blend", "Blend mode > Add", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(array_find(BLEND_TYPES, "Add")); }); + addHotkey("Node_Blend", "Blend mode > Screen", "C", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(array_find(BLEND_TYPES, "Screen")); }); + addHotkey("Node_Blend", "Blend mode > Subtract", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(array_find(BLEND_TYPES, "Subtract")); }); + addHotkey("Node_Blend", "Preserve alpha > Toggle","P", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[9].setValue(!_n.inputs[9].getValue()); }); + + addHotkey("Node_Blend", "Inputs > Swap", "Q", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR + var _i0 = _n.inputs[0].value_from; + var _i1 = _n.inputs[1].value_from; + if(_i0 == _i1) return; + + _n.inputs[1].setFrom(_i0); + _n.inputs[0].setFrom(_i1); + }); + }); + #endregion function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { diff --git a/scripts/node_blend_edge/node_blend_edge.gml b/scripts/node_blend_edge/node_blend_edge.gml index 0e6ce601c..bc482348f 100644 --- a/scripts/node_blend_edge/node_blend_edge.gml +++ b/scripts/node_blend_edge/node_blend_edge.gml @@ -1,7 +1,14 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blend_Edge", "Width > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); }); + addHotkey("Node_Blend_Edge", "Types > Toggle", "T", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 3); }); + }); +#endregion + function Node_Blend_Edge(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Blend Edge"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Width", self, 0.1)) .setDisplay(VALUE_DISPLAY.slider) diff --git a/scripts/node_blobify/node_blobify.gml b/scripts/node_blobify/node_blobify.gml index ea8507dda..9453c21c8 100644 --- a/scripts/node_blobify/node_blobify.gml +++ b/scripts/node_blobify/node_blobify.gml @@ -1,7 +1,7 @@ function Node_Blobify(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Blobify"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); diff --git a/scripts/node_bloom/node_bloom.gml b/scripts/node_bloom/node_bloom.gml index de8220d37..59bcb0ae2 100644 --- a/scripts/node_bloom/node_bloom.gml +++ b/scripts/node_bloom/node_bloom.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Bloom", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + }); +#endregion + function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Bloom"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Size", self, 3, "Bloom blur radius.")) .setDisplay(VALUE_DISPLAY.slider, { range: [1, 32, 0.1] }); diff --git a/scripts/node_blur/node_blur.gml b/scripts/node_blur/node_blur.gml index 0bc2c679f..1e9b4efda 100644 --- a/scripts/node_blur/node_blur.gml +++ b/scripts/node_blur/node_blur.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blur", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + }); +#endregion + function Node_Blur(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Int("Size", self, 3)) .setValidator(VV_min(0)) diff --git a/scripts/node_blur_bokeh/node_blur_bokeh.gml b/scripts/node_blur_bokeh/node_blur_bokeh.gml index d03297fab..8e9a95315 100644 --- a/scripts/node_blur_bokeh/node_blur_bokeh.gml +++ b/scripts/node_blur_bokeh/node_blur_bokeh.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blur_Bokeh", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); }); + }); +#endregion + function Node_Blur_Bokeh(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Lens Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Strength", self, 0.2)) .setMappable(8); diff --git a/scripts/node_blur_box/node_blur_box.gml b/scripts/node_blur_box/node_blur_box.gml index 142bf858c..bc6dd6f7f 100644 --- a/scripts/node_blur_box/node_blur_box.gml +++ b/scripts/node_blur_box/node_blur_box.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blur_Box", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + }); +#endregion + function Node_Blur_Box(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Box Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Int("Size", self, 3)) .setUnitRef(function(index) /*=>*/ {return getDimension(index)}); diff --git a/scripts/node_blur_contrast/node_blur_contrast.gml b/scripts/node_blur_contrast/node_blur_contrast.gml index 12119ced0..282dbe35a 100644 --- a/scripts/node_blur_contrast/node_blur_contrast.gml +++ b/scripts/node_blur_contrast/node_blur_contrast.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blur_Contrast", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + }); +#endregion + function Node_Blur_Contrast(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Contrast Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Size", self, 3)) .setValidator(VV_min(0)) diff --git a/scripts/node_blur_directional/node_blur_directional.gml b/scripts/node_blur_directional/node_blur_directional.gml index 4e4e4e8ec..052f38c21 100644 --- a/scripts/node_blur_directional/node_blur_directional.gml +++ b/scripts/node_blur_directional/node_blur_directional.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blur_Directional", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); }); + }); +#endregion + function Node_Blur_Directional(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Directional Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Strength", self, 0.2)) .setDisplay(VALUE_DISPLAY.slider, { range: [0, 0.5, 0.001] }) diff --git a/scripts/node_blur_path/node_blur_path.gml b/scripts/node_blur_path/node_blur_path.gml index e60710b40..37dc9024a 100644 --- a/scripts/node_blur_path/node_blur_path.gml +++ b/scripts/node_blur_path/node_blur_path.gml @@ -1,7 +1,7 @@ function Node_Blur_Path(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Path Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_PathNode("Blur Path", self, noone)) .setVisible(true, true); diff --git a/scripts/node_blur_radial/node_blur_radial.gml b/scripts/node_blur_radial/node_blur_radial.gml index 34670559f..32a5029de 100644 --- a/scripts/node_blur_radial/node_blur_radial.gml +++ b/scripts/node_blur_radial/node_blur_radial.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blur_Radial", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) * 15); }); + }); +#endregion + function Node_Blur_Radial(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Radial Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Rotation("Strength", self, 45)) .setMappable(10); diff --git a/scripts/node_blur_shape/node_blur_shape.gml b/scripts/node_blur_shape/node_blur_shape.gml index ab38b2886..f3a9a24e8 100644 --- a/scripts/node_blur_shape/node_blur_shape.gml +++ b/scripts/node_blur_shape/node_blur_shape.gml @@ -1,7 +1,7 @@ function Node_Blur_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Shape Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Blur Shape", self)); newInput(2, nodeValue_Surface("Blur mask", self)); diff --git a/scripts/node_blur_simple/node_blur_simple.gml b/scripts/node_blur_simple/node_blur_simple.gml index 4c0a59d18..84c6f0d8b 100644 --- a/scripts/node_blur_simple/node_blur_simple.gml +++ b/scripts/node_blur_simple/node_blur_simple.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blur_Simple", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + }); +#endregion + function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Non-Uniform Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Size", self, 3)) .setValidator(VV_min(0)) .setUnitRef(function(index) /*=>*/ {return getDimension(index)}); diff --git a/scripts/node_blur_slope/node_blur_slope.gml b/scripts/node_blur_slope/node_blur_slope.gml index 81fae976d..8410c06ef 100644 --- a/scripts/node_blur_slope/node_blur_slope.gml +++ b/scripts/node_blur_slope/node_blur_slope.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blur_Slope", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + }); +#endregion + function Node_Blur_Slope(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Slope Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Strength", self, 4)) .setDisplay(VALUE_DISPLAY.slider, { range: [ 1, 32, 0.1 ] }) diff --git a/scripts/node_blur_zoom/node_blur_zoom.gml b/scripts/node_blur_zoom/node_blur_zoom.gml index 34bf2d99a..a0d094c66 100644 --- a/scripts/node_blur_zoom/node_blur_zoom.gml +++ b/scripts/node_blur_zoom/node_blur_zoom.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Blur_Zoom", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); }); + }); +#endregion + function Node_Blur_Zoom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Zoom Blur"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Strength", self, 0.2)) .setMappable(12); diff --git a/scripts/node_brush_linear/node_brush_linear.gml b/scripts/node_brush_linear/node_brush_linear.gml index 3f7bb5f35..1762088b9 100644 --- a/scripts/node_brush_linear/node_brush_linear.gml +++ b/scripts/node_brush_linear/node_brush_linear.gml @@ -1,7 +1,7 @@ function Node_Brush_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Brush"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_bw/node_bw.gml b/scripts/node_bw/node_bw.gml index 49f69f3f2..188813fed 100644 --- a/scripts/node_bw/node_bw.gml +++ b/scripts/node_bw/node_bw.gml @@ -1,7 +1,7 @@ function Node_BW(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "BW"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Brightness", self, 0)) .setDisplay(VALUE_DISPLAY.slider, { range: [ -1, 1, 0.01] }) diff --git a/scripts/node_cache/node_cache.gml b/scripts/node_cache/node_cache.gml index 9ccb5ec70..9457c503e 100644 --- a/scripts/node_cache/node_cache.gml +++ b/scripts/node_cache/node_cache.gml @@ -2,7 +2,7 @@ function Node_Cache(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group) const name = "Cache"; use_cache = CACHE_USE.auto; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newOutput(0, nodeValue_Output("Cache surface", self, VALUE_TYPE.surface, noone)); diff --git a/scripts/node_cache_array/node_cache_array.gml b/scripts/node_cache_array/node_cache_array.gml index 1aeead87a..e15bc0ccf 100644 --- a/scripts/node_cache_array/node_cache_array.gml +++ b/scripts/node_cache_array/node_cache_array.gml @@ -2,7 +2,7 @@ function Node_Cache_Array(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group) name = "Cache Array"; use_cache = CACHE_USE.manual; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Int("Start frame", self, -1, "Frame index to start caching, set to -1 to start at the first frame.")); diff --git a/scripts/node_chromatic_aberration/node_chromatic_aberration.gml b/scripts/node_chromatic_aberration/node_chromatic_aberration.gml index 5620a4c01..0744dc806 100644 --- a/scripts/node_chromatic_aberration/node_chromatic_aberration.gml +++ b/scripts/node_chromatic_aberration/node_chromatic_aberration.gml @@ -1,7 +1,7 @@ function Node_Chromatic_Aberration(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Chromatic Aberration"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Center", self, [ 0.5, 0.5 ])) .setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference); diff --git a/scripts/node_color_adjust/node_color_adjust.gml b/scripts/node_color_adjust/node_color_adjust.gml index 624c5c229..1011875c7 100644 --- a/scripts/node_color_adjust/node_color_adjust.gml +++ b/scripts/node_color_adjust/node_color_adjust.gml @@ -2,7 +2,7 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro name = "Color Adjust"; batch_output = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Brightness", self, 0)) .setDisplay(VALUE_DISPLAY.slider, { range: [ -1, 1, 0.01 ] }) diff --git a/scripts/node_color_remove/node_color_remove.gml b/scripts/node_color_remove/node_color_remove.gml index b2bb37765..4abbd783c 100644 --- a/scripts/node_color_remove/node_color_remove.gml +++ b/scripts/node_color_remove/node_color_remove.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Color_Remove", "Invert > Toggle", "I", MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[6].setValue(!_n.inputs[6].getValue()); }); + }); +#endregion + function Node_Color_Remove(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Remove Color"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Palette("Colors", self, array_clone(DEF_PALETTE))); diff --git a/scripts/node_color_replace/node_color_replace.gml b/scripts/node_color_replace/node_color_replace.gml index 6d1f7663b..0c6dea73b 100644 --- a/scripts/node_color_replace/node_color_replace.gml +++ b/scripts/node_color_replace/node_color_replace.gml @@ -1,7 +1,7 @@ function Node_Color_replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Replace Palette"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Palette("From", self, array_clone(DEF_PALETTE))); newInput(2, nodeValue_Palette("To", self, array_clone(DEF_PALETTE))); diff --git a/scripts/node_colorize/node_colorize.gml b/scripts/node_colorize/node_colorize.gml index 6c343e807..ed15e6c61 100644 --- a/scripts/node_colorize/node_colorize.gml +++ b/scripts/node_colorize/node_colorize.gml @@ -1,7 +1,7 @@ function Node_Colorize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Colorize"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Gradient("Gradient", self, new gradientObject([ cola(c_black), cola(c_white) ]))) .setMappable(11); diff --git a/scripts/node_colors_replace/node_colors_replace.gml b/scripts/node_colors_replace/node_colors_replace.gml index 82f3994ae..af7ff4a73 100644 --- a/scripts/node_colors_replace/node_colors_replace.gml +++ b/scripts/node_colors_replace/node_colors_replace.gml @@ -1,7 +1,7 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Replace Colors"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Palette("Palette from", self, [])); newInput(2, nodeValue_Palette("Palette to", self, [])) diff --git a/scripts/node_convolution/node_convolution.gml b/scripts/node_convolution/node_convolution.gml index 247a13e60..b93cca2d9 100644 --- a/scripts/node_convolution/node_convolution.gml +++ b/scripts/node_convolution/node_convolution.gml @@ -1,7 +1,7 @@ function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Convolution"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Matrix("Kernel", self, new Matrix(3))); diff --git a/scripts/node_corner/node_corner.gml b/scripts/node_corner/node_corner.gml index 97ef27009..26f8cecd9 100644 --- a/scripts/node_corner/node_corner.gml +++ b/scripts/node_corner/node_corner.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Corner", "Radius > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + }); +#endregion + function Node_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Round Corner"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Radius", self, 2)) .setDisplay(VALUE_DISPLAY.slider, { range: [2, 16, 0.1] }); diff --git a/scripts/node_crop/node_crop.gml b/scripts/node_crop/node_crop.gml index f69646da1..2f6b61b63 100644 --- a/scripts/node_crop/node_crop.gml +++ b/scripts/node_crop/node_crop.gml @@ -2,7 +2,7 @@ function Node_Crop(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons name = "Crop"; preview_alpha = 0.5; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Padding("Crop", self, [ 0, 0, 0, 0 ])) .setUnitRef(function(index) { return getDimension(index); }); diff --git a/scripts/node_crop_content/node_crop_content.gml b/scripts/node_crop_content/node_crop_content.gml index bbb514ac2..da0478d80 100644 --- a/scripts/node_crop_content/node_crop_content.gml +++ b/scripts/node_crop_content/node_crop_content.gml @@ -1,7 +1,7 @@ function Node_Crop_Content(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Crop Content"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); diff --git a/scripts/node_cross_section/node_cross_section.gml b/scripts/node_cross_section/node_cross_section.gml index 1d90cf492..a7f702f86 100644 --- a/scripts/node_cross_section/node_cross_section.gml +++ b/scripts/node_cross_section/node_cross_section.gml @@ -1,7 +1,7 @@ function Node_Cross_Section(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Draw Cross Section"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Enum_Button("Axis", self, 0 , [ "X", "Y" ])); diff --git a/scripts/node_curve/node_curve.gml b/scripts/node_curve/node_curve.gml index ff36355f1..6f6b2879b 100644 --- a/scripts/node_curve/node_curve.gml +++ b/scripts/node_curve/node_curve.gml @@ -1,7 +1,7 @@ function Node_Curve(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Curve"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Curve("Brightness", self, CURVE_DEF_01)); diff --git a/scripts/node_curve_hsv/node_curve_hsv.gml b/scripts/node_curve_hsv/node_curve_hsv.gml index 6e9f7c229..a259256e2 100644 --- a/scripts/node_curve_hsv/node_curve_hsv.gml +++ b/scripts/node_curve_hsv/node_curve_hsv.gml @@ -1,7 +1,7 @@ function Node_Curve_HSV(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "HSV Curve"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Curve("Hue", self, CURVE_DEF_01)); diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index c719ca44c..b99f3c55c 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -2130,7 +2130,13 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { } if(active_draw_index > -1) { - draw_sprite_stretched_ext(bg_spr, 1, xx, yy, round(w * _s), round(h * _s), active_draw_index > 1? COLORS.node_border_file_drop : COLORS._main_accent, 1); + var cc = COLORS._main_accent; + switch(active_draw_index) { + case 1 : cc = COLORS.node_border_context; break; + case 2 : cc = COLORS.node_border_file_drop; break; + } + + draw_sprite_stretched_ext(bg_spr, 1, xx, yy, round(w * _s), round(h * _s), cc, 1); if(active_draw_anchor) draw_sprite_stretched_add(bg_spr, 1, xx, yy, round(w * _s), round(h * _s), COLORS._main_accent, 0.5); @@ -2205,7 +2211,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { } static drawActive = function(_x, _y, _s, ind = 0) { - active_draw_index = ind; + active_draw_index = ind; if(display_parameter.highlight) drawBranch(); } diff --git a/scripts/node_de_corner/node_de_corner.gml b/scripts/node_de_corner/node_de_corner.gml index 0c91d191b..a36cdfc5f 100644 --- a/scripts/node_de_corner/node_de_corner.gml +++ b/scripts/node_de_corner/node_de_corner.gml @@ -1,7 +1,7 @@ function Node_De_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "De-Corner"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_de_stray/node_de_stray.gml b/scripts/node_de_stray/node_de_stray.gml index 62a9137b5..111c5cc6c 100644 --- a/scripts/node_de_stray/node_de_stray.gml +++ b/scripts/node_de_stray/node_de_stray.gml @@ -1,7 +1,7 @@ function Node_De_Stray(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "De-Stray"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Tolerance", self, 0)) .setDisplay(VALUE_DISPLAY.slider); diff --git a/scripts/node_delay/node_delay.gml b/scripts/node_delay/node_delay.gml index 84d38f617..20c7e4e8f 100644 --- a/scripts/node_delay/node_delay.gml +++ b/scripts/node_delay/node_delay.gml @@ -1,3 +1,9 @@ +#region create + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Delay", "Overflow > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 3); }); + }); +#endregion + function Node_Delay(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Delay"; diff --git a/scripts/node_dilate/node_dilate.gml b/scripts/node_dilate/node_dilate.gml index bf1ee4869..a1eeebf62 100644 --- a/scripts/node_dilate/node_dilate.gml +++ b/scripts/node_dilate/node_dilate.gml @@ -1,7 +1,7 @@ function Node_Dilate(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Dilate"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Center", self, [ 0, 0 ])) .setUnitRef(function(index) { return getDimension(index); }); diff --git a/scripts/node_displace/node_displace.gml b/scripts/node_displace/node_displace.gml index b740153c1..bd83f8512 100644 --- a/scripts/node_displace/node_displace.gml +++ b/scripts/node_displace/node_displace.gml @@ -1,7 +1,18 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Displace", "Mode > Toggle", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 5].setValue((_n.inputs[ 5].getValue() + 1) % 4); }); + addHotkey("Node_Displace", "Oversample Mode > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 7].setValue((_n.inputs[ 7].getValue() + 1) % 3); }); + addHotkey("Node_Displace", "Blend Mode > Toggle", "B", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[11].setValue((_n.inputs[11].getValue() + 1) % 3); }); + + addHotkey("Node_Displace", "Iterate > Toggle", "I", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 6].setValue((_n.inputs[ 6].getValue() + 1) % 2); }); + addHotkey("Node_Displace", "Fade Distance > Toggle", "F", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[19].setValue((_n.inputs[19].getValue() + 1) % 2); }); + }); +#endregion + function Node_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Displace"; - newInput(0, nodeValue_Surface("Surface in", self)) + newInput(0, nodeValue_Surface("Surface In", self)) .setVisible(true, true); newInput(1, nodeValue_Surface("Displace map", self)) @@ -27,7 +38,7 @@ function Node_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(6, nodeValue_Bool("Iterate", self, false, @"If not set, then strength value is multiplied directly to the displacement. If set, then strength value control how many times the effect applies on itself.")); - newInput(7, nodeValue_Enum_Scroll("Oversample mode", self, 0, [ "Empty", "Clamp", "Repeat" ])) + newInput(7, nodeValue_Enum_Scroll("Oversample Mode", self, 0, [ "Empty", "Clamp", "Repeat" ])) .setTooltip("How to deal with pixel outside the surface.\n - Empty: Use empty pixel\n - Clamp: Repeat edge pixel\n - Repeat: Repeat texture."); newInput(8, nodeValue_Surface("Mask", self)); @@ -38,7 +49,7 @@ If set, then strength value control how many times the effect applies on itself. newInput(10, nodeValue_Bool("Active", self, true)); active_index = 10; - newInput(11, nodeValue_Enum_Scroll("Blend mode", self, 0, [ "Overwrite", "Min", "Max" ])); + newInput(11, nodeValue_Enum_Scroll("Blend Mode", self, 0, [ "Overwrite", "Min", "Max" ])); newInput(12, nodeValue_Toggle("Channel", self, 0b1111, { data: array_create(4, THEME.inspector_channel) })); diff --git a/scripts/node_dither/node_dither.gml b/scripts/node_dither/node_dither.gml index a73cae2d6..6217fbe6e 100644 --- a/scripts/node_dither/node_dither.gml +++ b/scripts/node_dither/node_dither.gml @@ -1,3 +1,11 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Dither", "Pattern > Toggle", "P", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 4); }); + addHotkey("Node_Dither", "Mode > Toggle", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[6].setValue(!_n.inputs[6].getValue()); }); + addHotkey("Node_Dither", "Contrast > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[4].setValue(toNumber(chr(keyboard_key))); }); + }); +#endregion + function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { static dither2 = [ 0, 2, 3, 1 ]; @@ -16,7 +24,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co name = "Dither"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Palette("Palette", self, array_clone(DEF_PALETTE))); @@ -30,7 +38,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co newInput(5, nodeValue_Surface("Contrast map", self)); - newInput(6, nodeValue_Enum_Button("Mode", self, 0, [ "Color", "Alpha" ])); + newInput(6, nodeValue_Enum_Button("Mode", self, 0, [ "Color", "Alpha" ])); newInput(7, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_dither_diffuse/node_dither_diffuse.gml b/scripts/node_dither_diffuse/node_dither_diffuse.gml index 97a6290e4..1b290a4c2 100644 --- a/scripts/node_dither_diffuse/node_dither_diffuse.gml +++ b/scripts/node_dither_diffuse/node_dither_diffuse.gml @@ -49,7 +49,7 @@ function Node_Dither_Diffuse(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Error Diffuse Dither"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_edge_detect/node_edge_detect.gml b/scripts/node_edge_detect/node_edge_detect.gml index bfd4d8282..1c2f9a6ee 100644 --- a/scripts/node_edge_detect/node_edge_detect.gml +++ b/scripts/node_edge_detect/node_edge_detect.gml @@ -1,3 +1,9 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Edge_Detect", "Algorithm > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue((_n.inputs[1].getValue() + 1) % 4); }); + }); +#endregion + function Node_Edge_Detect(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Edge Detect"; @@ -8,9 +14,9 @@ function Node_Edge_Detect(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou newInput(0, nodeValue_Surface("Surface in self", self)); - newInput(1, nodeValue_Enum_Scroll("Algorithm", self, 0, ["Sobel", "Prewitt", "Laplacian", "Neighbor max diff"] )); + newInput(1, nodeValue_Enum_Scroll("Algorithm", self, 0, ["Sobel", "Prewitt", "Laplacian", "Neighbor max diff"] )); - newInput(2, nodeValue_Enum_Scroll("Oversample mode", self, 0, [ "Empty", "Clamp", "Repeat" ])) + newInput(2, nodeValue_Enum_Scroll("Oversample mode", self, 0, [ "Empty", "Clamp", "Repeat" ])) .setTooltip("How to deal with pixel outside the surface.\n - Empty: Use empty pixel\n - Clamp: Repeat edge pixel\n - Repeat: Repeat texture."); newInput(3, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_edge_shade/node_edge_shade.gml b/scripts/node_edge_shade/node_edge_shade.gml index 9338dc1d1..d23e2bbfd 100644 --- a/scripts/node_edge_shade/node_edge_shade.gml +++ b/scripts/node_edge_shade/node_edge_shade.gml @@ -1,7 +1,7 @@ function Node_Edge_Shade(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Edge Shade"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_erode/node_erode.gml b/scripts/node_erode/node_erode.gml index 872e01dae..692aced5c 100644 --- a/scripts/node_erode/node_erode.gml +++ b/scripts/node_erode/node_erode.gml @@ -1,15 +1,23 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Erode", "Width > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + addHotkey("Node_Erode", "Preserve Border > Toggle", "B", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(!_n.inputs[2].getValue()); }); + addHotkey("Node_Erode", "Use Alpha > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[3].setValue(!_n.inputs[3].getValue()); }); + }); +#endregion + function Node_Erode(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Erode"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Int("Width", self, 1)) .setValidator(VV_min(0)) .setMappable(10); - newInput(2, nodeValue_Bool("Preserve border",self, false)); + newInput(2, nodeValue_Bool("Preserve Border",self, false)); - newInput(3, nodeValue_Bool("Use alpha", self, true)); + newInput(3, nodeValue_Bool("Use Alpha", self, true)); newInput(4, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_find_pixel/node_find_pixel.gml b/scripts/node_find_pixel/node_find_pixel.gml index 9f9b9fb49..3b771593b 100644 --- a/scripts/node_find_pixel/node_find_pixel.gml +++ b/scripts/node_find_pixel/node_find_pixel.gml @@ -2,7 +2,7 @@ function Node_Find_Pixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group name = "Find pixel"; setDimension(96, 48); - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Color("Search color", self, cola(c_black))); diff --git a/scripts/node_flip/node_flip.gml b/scripts/node_flip/node_flip.gml index 5ff17f0c2..e06114396 100644 --- a/scripts/node_flip/node_flip.gml +++ b/scripts/node_flip/node_flip.gml @@ -1,7 +1,7 @@ function Node_Flip(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Flip"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Enum_Button("Axis", self, 0, [ "x", "y" ])); diff --git a/scripts/node_flood_fill/node_flood_fill.gml b/scripts/node_flood_fill/node_flood_fill.gml index 6469e4c70..8643f0ef1 100644 --- a/scripts/node_flood_fill/node_flood_fill.gml +++ b/scripts/node_flood_fill/node_flood_fill.gml @@ -1,7 +1,7 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Flood Fill"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_fn_math/node_fn_math.gml b/scripts/node_fn_math/node_fn_math.gml index 2f36034b5..e1c498878 100644 --- a/scripts/node_fn_math/node_fn_math.gml +++ b/scripts/node_fn_math/node_fn_math.gml @@ -1,8 +1,16 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Fn_Math", "Operation > Add", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[_n.inl + 0].setValue(0); }); + addHotkey("Node_Fn_Math", "Operation > Minus", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[_n.inl + 0].setValue(1); }); + addHotkey("Node_Fn_Math", "Operation > Multiply", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[_n.inl + 0].setValue(2); }); + }); +#endregion + function Node_Fn_Math(_x, _y, _group = noone) : Node_Fn(_x, _y, _group) constructor { name = "Math"; time_based = false; - newInput(inl + 0, nodeValue_Enum_Scroll("Operation", self, 2 , [ "Add", "Minus", "Multiply" ] )); + newInput(inl + 0, nodeValue_Enum_Scroll("Operation", self, 2, [ "Add", "Minus", "Multiply" ] )); newInput(inl + 1, nodeValue_Float("Value 1", self, 0 )) .setVisible(true, true); diff --git a/scripts/node_gamma_map/node_gamma_map.gml b/scripts/node_gamma_map/node_gamma_map.gml index 65de1e07e..63ced7639 100644 --- a/scripts/node_gamma_map/node_gamma_map.gml +++ b/scripts/node_gamma_map/node_gamma_map.gml @@ -1,7 +1,7 @@ function Node_Gamma_Map(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Gamma Map"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Invert", self, false)); diff --git a/scripts/node_glow/node_glow.gml b/scripts/node_glow/node_glow.gml index 96eacc47f..c728f9f93 100644 --- a/scripts/node_glow/node_glow.gml +++ b/scripts/node_glow/node_glow.gml @@ -1,7 +1,16 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Glow", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(toNumber(chr(keyboard_key))); }); + addHotkey("Node_Glow", "Mode > Toggle", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[10].setValue((_n.inputs[10].getValue() + 1) % 2); }); + addHotkey("Node_Glow", "Side > Toggle", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[12].setValue((_n.inputs[12].getValue() + 1) % 2); }); + addHotkey("Node_Glow", "Draw Original > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[11].setValue((_n.inputs[11].getValue() + 1) % 2); }); + }); +#endregion + function Node_Glow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Glow"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Border", self, 0)) .setDisplay(VALUE_DISPLAY.slider, { range: [0, 4, 0.1] }); @@ -26,7 +35,7 @@ function Node_Glow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons newInput(10, nodeValue_Enum_Button("Mode", self, 0, [ "Greyscale", "Alpha" ])); - newInput(11, nodeValue_Bool("Draw original", self, true)); + newInput(11, nodeValue_Bool("Draw Original", self, true)); newInput(12, nodeValue_Enum_Button("Side", self, 0, [ "Outer", "Inner" ])); diff --git a/scripts/node_gradient/node_gradient.gml b/scripts/node_gradient/node_gradient.gml index 61ed76a63..d58907d0b 100644 --- a/scripts/node_gradient/node_gradient.gml +++ b/scripts/node_gradient/node_gradient.gml @@ -1,3 +1,23 @@ +#region create + + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Gradient", "Type > Toggle", "T", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 3); }); + addHotkey("Node_Gradient", "Angle > Rotate CCW","R", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[3].setValue((_n.inputs[3].getValue() + 90) % 360); }); + addHotkey("Node_Gradient", "Gradient > Invert", "I", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR + var _grad = _n.inputs[1].getValue(); + var _k = []; + for( var i = 0, n = array_length(_grad.keys); i < n; i++ ) { + _k[i] = _grad.keys[n - i - 1]; + _k[i].time = 1 - _k[i].time; + } + _grad.keys = _k; + _grad.refresh(); + _n.triggerRender(); + }); + }); + +#endregion + function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Draw Gradient"; diff --git a/scripts/node_grain/node_grain.gml b/scripts/node_grain/node_grain.gml index 15e0e77f4..66c2c9943 100644 --- a/scripts/node_grain/node_grain.gml +++ b/scripts/node_grain/node_grain.gml @@ -1,7 +1,7 @@ function Node_Grain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Grain"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_grey_alpha/node_grey_alpha.gml b/scripts/node_grey_alpha/node_grey_alpha.gml index 180cf8bd7..5e0b16199 100644 --- a/scripts/node_grey_alpha/node_grey_alpha.gml +++ b/scripts/node_grey_alpha/node_grey_alpha.gml @@ -1,7 +1,7 @@ function Node_Grey_Alpha(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Grey to Alpha"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Replace color", self, true, "Replace output with solid color.")); diff --git a/scripts/node_greyscale/node_greyscale.gml b/scripts/node_greyscale/node_greyscale.gml index 376ec256a..c19f46740 100644 --- a/scripts/node_greyscale/node_greyscale.gml +++ b/scripts/node_greyscale/node_greyscale.gml @@ -1,7 +1,7 @@ function Node_Greyscale(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Greyscale"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Brightness", self, 0)) .setDisplay(VALUE_DISPLAY.slider, { range: [ -1, 1, 0.01] }) diff --git a/scripts/node_grid_warp/node_grid_warp.gml b/scripts/node_grid_warp/node_grid_warp.gml index a9c944572..fff5d1cc5 100644 --- a/scripts/node_grid_warp/node_grid_warp.gml +++ b/scripts/node_grid_warp/node_grid_warp.gml @@ -1,7 +1,7 @@ function Node_Grid_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Grid Warp"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_high_pass/node_high_pass.gml b/scripts/node_high_pass/node_high_pass.gml index 1f2b7ff9e..74f6df4fc 100644 --- a/scripts/node_high_pass/node_high_pass.gml +++ b/scripts/node_high_pass/node_high_pass.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_High_Pass", "Radius > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[7].setValue(toNumber(chr(keyboard_key))); }); + }); +#endregion + function Node_High_Pass(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "High Pass"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; @@ -21,7 +27,7 @@ function Node_High_Pass(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) input_display_list = [ 1, 4, ["Surfaces", true], 0, 2, 3, 5, 6, - ["Sharpen", false], 7, 8, + ["Effect", false], 7, 8, ] newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); diff --git a/scripts/node_hsv_channel/node_hsv_channel.gml b/scripts/node_hsv_channel/node_hsv_channel.gml index e2c9d0e34..dacd57c80 100644 --- a/scripts/node_hsv_channel/node_hsv_channel.gml +++ b/scripts/node_hsv_channel/node_hsv_channel.gml @@ -2,7 +2,7 @@ function Node_HSV_Channel(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou name = "HSV Extract"; batch_output = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Output Array", self, false)); diff --git a/scripts/node_image_grid/node_image_grid.gml b/scripts/node_image_grid/node_image_grid.gml index 53defa927..0955f3884 100644 --- a/scripts/node_image_grid/node_image_grid.gml +++ b/scripts/node_image_grid/node_image_grid.gml @@ -1,3 +1,9 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Image_Grid", "Main Axis > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[0].setValue(!_n.inputs[0].getValue()); }); + }); +#endregion + function Node_Image_Grid(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Image Grid"; diff --git a/scripts/node_image_sheet/node_image_sheet.gml b/scripts/node_image_sheet/node_image_sheet.gml index 73f72ff71..5f89c1ecc 100644 --- a/scripts/node_image_sheet/node_image_sheet.gml +++ b/scripts/node_image_sheet/node_image_sheet.gml @@ -1,7 +1,7 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Splice Spritesheet"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Sprite size", self, [ 32, 32 ])); diff --git a/scripts/node_interlaced/node_interlaced.gml b/scripts/node_interlaced/node_interlaced.gml index 72b6926e6..b46845f22 100644 --- a/scripts/node_interlaced/node_interlaced.gml +++ b/scripts/node_interlaced/node_interlaced.gml @@ -1,3 +1,12 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Interlaced", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[8].setValue(toNumber(chr(keyboard_key))); }); + addHotkey("Node_Interlaced", "Axis > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 7].setValue((_n.inputs[ 7].getValue() + 1) % 2); }); + addHotkey("Node_Interlaced", "Invert > Toggle", "I", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 9].setValue((_n.inputs[ 9].getValue() + 1) % 2); }); + addHotkey("Node_Interlaced", "Loop > Toggle", "L", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[11].setValue((_n.inputs[11].getValue() + 1) % 2); }); + }); +#endregion + function Node_Interlaced(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Interlace"; @@ -5,7 +14,7 @@ function Node_Interlaced(_x, _y, _group = noone) : Node_Processor(_x, _y, _group use_cache = CACHE_USE.manual; clearCacheOnChange = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_invert/node_invert.gml b/scripts/node_invert/node_invert.gml index 7804c9494..d9be203c3 100644 --- a/scripts/node_invert/node_invert.gml +++ b/scripts/node_invert/node_invert.gml @@ -1,7 +1,7 @@ function Node_Invert(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Invert"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_jpeg/node_jpeg.gml b/scripts/node_jpeg/node_jpeg.gml index 165c1b15d..990213427 100644 --- a/scripts/node_jpeg/node_jpeg.gml +++ b/scripts/node_jpeg/node_jpeg.gml @@ -1,7 +1,7 @@ function Node_JPEG(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "JPEG"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_kuwahara/node_kuwahara.gml b/scripts/node_kuwahara/node_kuwahara.gml index 5ec21a15e..f41e6413c 100644 --- a/scripts/node_kuwahara/node_kuwahara.gml +++ b/scripts/node_kuwahara/node_kuwahara.gml @@ -1,7 +1,14 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Kuwahara", "Radius > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(toNumber(chr(keyboard_key))); }); + addHotkey("Node_Kuwahara", "Types > Toggle", "T", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[9].setValue((_n.inputs[9].getValue() + 1) % 3); }); + }); +#endregion + function Node_Kuwahara(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Kuwahara"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_level/node_level.gml b/scripts/node_level/node_level.gml index 49cc25d35..2a895a537 100644 --- a/scripts/node_level/node_level.gml +++ b/scripts/node_level/node_level.gml @@ -1,7 +1,7 @@ function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Level"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Slider_Range("White in", self, [0, 1])); diff --git a/scripts/node_level_selector/node_level_selector.gml b/scripts/node_level_selector/node_level_selector.gml index 040a37030..0a43a5739 100644 --- a/scripts/node_level_selector/node_level_selector.gml +++ b/scripts/node_level_selector/node_level_selector.gml @@ -1,7 +1,7 @@ function Node_Level_Selector(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Level Selector"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Midpoint", self, 0)) .setDisplay(VALUE_DISPLAY.slider) diff --git a/scripts/node_liquefy/node_liquefy.gml b/scripts/node_liquefy/node_liquefy.gml index 786d2592b..92a374117 100644 --- a/scripts/node_liquefy/node_liquefy.gml +++ b/scripts/node_liquefy/node_liquefy.gml @@ -8,7 +8,7 @@ enum LIQUEFY_TYPE { function Node_Liquefy(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Liquefy"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_local_analyze/node_local_analyze.gml b/scripts/node_local_analyze/node_local_analyze.gml index 63cbd1fc9..758d1065c 100644 --- a/scripts/node_local_analyze/node_local_analyze.gml +++ b/scripts/node_local_analyze/node_local_analyze.gml @@ -1,7 +1,15 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Local_Analyze", "Size > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(toNumber(chr(keyboard_key))); }); + addHotkey("Node_Local_Analyze", "Oversample mode > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[3].setValue((_n.inputs[3].getValue() + 1) % 3); }); + addHotkey("Node_Local_Analyze", "Shape > Toggle", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[4].setValue((_n.inputs[4].getValue() + 1) % 3); }); + }); +#endregion + function Node_Local_Analyze(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Local Analyze"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Enum_Scroll("Algorithm", self, 0, [ "Average (Blur)", "Maximum", "Minimum" ])); diff --git a/scripts/node_lovify/node_lovify.gml b/scripts/node_lovify/node_lovify.gml index c6e6015a1..9be738b4c 100644 --- a/scripts/node_lovify/node_lovify.gml +++ b/scripts/node_lovify/node_lovify.gml @@ -2,7 +2,7 @@ function Node_Lovify(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co name = "Lovify"; color = CDEF.red; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValueSeed(self)); diff --git a/scripts/node_matrix_color_apply/node_matrix_color_apply.gml b/scripts/node_matrix_color_apply/node_matrix_color_apply.gml index 23fd25dde..f12d65a38 100644 --- a/scripts/node_matrix_color_apply/node_matrix_color_apply.gml +++ b/scripts/node_matrix_color_apply/node_matrix_color_apply.gml @@ -1,7 +1,7 @@ function Node_Matrix_Color_Apply(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Matrix Color Apply"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Matrix("Matrix", self, new Matrix(3))) .setVisible(true, true); diff --git a/scripts/node_mesh_warp/node_mesh_warp.gml b/scripts/node_mesh_warp/node_mesh_warp.gml index eafabbb7c..f65f70d6b 100644 --- a/scripts/node_mesh_warp/node_mesh_warp.gml +++ b/scripts/node_mesh_warp/node_mesh_warp.gml @@ -208,7 +208,7 @@ function Node_Mesh_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) anchor_drag_mx = -1; anchor_drag_my = -1; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Int("Sample", self, 8, "Amount of grid subdivision. Higher number means more grid, detail.")) .setDisplay(VALUE_DISPLAY.slider, { range: [ 2, 32, 0.1 ] }); diff --git a/scripts/node_mirror/node_mirror.gml b/scripts/node_mirror/node_mirror.gml index d723e84c8..00d5156ab 100644 --- a/scripts/node_mirror/node_mirror.gml +++ b/scripts/node_mirror/node_mirror.gml @@ -2,7 +2,7 @@ function Node_Mirror(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co name = "Mirror"; batch_output = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Position", self, [ 0.5, 0.5 ])) .setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference); diff --git a/scripts/node_mirror_polar/node_mirror_polar.gml b/scripts/node_mirror_polar/node_mirror_polar.gml index dc79c1d45..3bb784fcd 100644 --- a/scripts/node_mirror_polar/node_mirror_polar.gml +++ b/scripts/node_mirror_polar/node_mirror_polar.gml @@ -1,7 +1,7 @@ function Node_Mirror_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Polar Mirror"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Position", self, [ 0.5, 0.5 ])) .setUnitRef(function(i) /*=>*/ {return getDimension(i)}, VALUE_UNIT.reference); diff --git a/scripts/node_mk_blinker/node_mk_blinker.gml b/scripts/node_mk_blinker/node_mk_blinker.gml index 0dc802958..1d8105f9e 100644 --- a/scripts/node_mk_blinker/node_mk_blinker.gml +++ b/scripts/node_mk_blinker/node_mk_blinker.gml @@ -2,7 +2,7 @@ function Node_MK_Blinker(_x, _y, _group = noone) : Node_Processor(_x, _y, _group name = "MK Blinker"; batch_output = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_mk_fracture/node_mk_fracture.gml b/scripts/node_mk_fracture/node_mk_fracture.gml index 3547f062e..825bccadc 100644 --- a/scripts/node_mk_fracture/node_mk_fracture.gml +++ b/scripts/node_mk_fracture/node_mk_fracture.gml @@ -1,7 +1,7 @@ function Node_MK_Fracture(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "MK Fracture"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Subdivision", self, [ 4, 4 ])); diff --git a/scripts/node_mk_gridballs/node_mk_gridballs.gml b/scripts/node_mk_gridballs/node_mk_gridballs.gml index f2736ee1e..e91c239b7 100644 --- a/scripts/node_mk_gridballs/node_mk_gridballs.gml +++ b/scripts/node_mk_gridballs/node_mk_gridballs.gml @@ -1,7 +1,7 @@ function Node_MK_GridBalls(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "MK GridBalls"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Dimension(self)); diff --git a/scripts/node_mk_rain/node_mk_rain.gml b/scripts/node_mk_rain/node_mk_rain.gml index 48345c04c..f49233403 100644 --- a/scripts/node_mk_rain/node_mk_rain.gml +++ b/scripts/node_mk_rain/node_mk_rain.gml @@ -2,7 +2,7 @@ function Node_MK_Rain(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c name = "MK Rain"; update_on_frame = true; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Rotation("Direction", self, 45)); diff --git a/scripts/node_normal/node_normal.gml b/scripts/node_normal/node_normal.gml index c6a6281c5..8231cb5f5 100644 --- a/scripts/node_normal/node_normal.gml +++ b/scripts/node_normal/node_normal.gml @@ -1,7 +1,7 @@ function Node_Normal(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Normal"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Height", self, 1)); diff --git a/scripts/node_normal_light/node_normal_light.gml b/scripts/node_normal_light/node_normal_light.gml index 00d8cb5cc..4b4b65c0f 100644 --- a/scripts/node_normal_light/node_normal_light.gml +++ b/scripts/node_normal_light/node_normal_light.gml @@ -1,7 +1,7 @@ function Node_Normal_Light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Normal Light"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Normal map", self)); diff --git a/scripts/node_normalize/node_normalize.gml b/scripts/node_normalize/node_normalize.gml index 424a00088..3fbadb9dc 100644 --- a/scripts/node_normalize/node_normalize.gml +++ b/scripts/node_normalize/node_normalize.gml @@ -1,7 +1,14 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Normalize", "Channels > Toggle", "C", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(!_n.inputs[1].getValue()); }); + addHotkey("Node_Normalize", "Modes > Toggle", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(!_n.inputs[2].getValue()); }); + }); +#endregion + function Node_Normalize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Normalize"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Enum_Button("Channels", self, 0, [ "BW", "RGB" ])); diff --git a/scripts/node_offset/node_offset.gml b/scripts/node_offset/node_offset.gml index d49af09eb..601bd8e38 100644 --- a/scripts/node_offset/node_offset.gml +++ b/scripts/node_offset/node_offset.gml @@ -1,7 +1,7 @@ function Node_Offset(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Offset"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("X Offset", self, 0.5)) .setDisplay(VALUE_DISPLAY.slider); diff --git a/scripts/node_onion_skin/node_onion_skin.gml b/scripts/node_onion_skin/node_onion_skin.gml index 8289856a1..758289d06 100644 --- a/scripts/node_onion_skin/node_onion_skin.gml +++ b/scripts/node_onion_skin/node_onion_skin.gml @@ -3,7 +3,7 @@ function Node_Onion_Skin(_x, _y, _group = noone) : Node(_x, _y, _group) construc use_cache = CACHE_USE.manual; clearCacheOnChange = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Slider_Range("Range", self, [-1, 1], { range: [ -16, 16, 0.1 ] })); diff --git a/scripts/node_outline/node_outline.gml b/scripts/node_outline/node_outline.gml index e2192ea23..8ea5a243c 100644 --- a/scripts/node_outline/node_outline.gml +++ b/scripts/node_outline/node_outline.gml @@ -1,3 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Outline", "Width > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + addHotkey("Node_Outline", "Position > Toggle", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 5].setValue((_n.inputs[ 5].getValue() + 1) % 2); }); + addHotkey("Node_Outline", "Blend > Toggle", "B", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 3].setValue((_n.inputs[ 3].getValue() + 1) % 2); }); + addHotkey("Node_Outline", "Profile > Toggle", "P", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[18].setValue((_n.inputs[18].getValue() + 1) % 3); }); + addHotkey("Node_Outline", "Anti-aliasing > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[ 6].setValue((_n.inputs[ 6].getValue() + 1) % 2); }); + }); +#endregion + function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Outline"; batch_output = false; @@ -12,7 +22,7 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c triggerRender(); }); - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Int("Width", self, 0)) .setDisplay(VALUE_DISPLAY._default, { front_button : filter_button }) @@ -21,7 +31,7 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c newInput(2, nodeValue_Color("Color", self, cola(c_white))); - newInput(3, nodeValue_Bool("Blend", self, 0, "Blend outline color with the original color.")); + newInput(3, nodeValue_Bool("Blend", self, false, "Blend outline color with the original color.")); newInput(4, nodeValue_Float("Blend alpha", self, 1)) .setDisplay(VALUE_DISPLAY.slider) @@ -29,12 +39,12 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c newInput(5, nodeValue_Enum_Button("Position", self, 1, ["Inside", "Outside"])); - newInput(6, nodeValue_Bool("Anti aliasing", self, 0)); + newInput(6, nodeValue_Bool("Anti-aliasing", self, 0)); newInput(7, nodeValue_Enum_Scroll("Oversample mode", self, 0, [ "Empty", "Clamp", "Repeat" ])) .setTooltip("How to deal with pixel outside the surface.\n - Empty: Use empty pixel\n - Clamp: Repeat edge pixel\n - Repeat: Repeat texture."); - newInput(8, nodeValue_Int("Start", self, 0, "Shift outline inside, outside the shape.")) + newInput(8, nodeValue_Int("Start", self, 0, "Shift outline inside, outside the shape.")) .setMappable(17); newInput(9, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_padding/node_padding.gml b/scripts/node_padding/node_padding.gml index 2ee3893a0..fe63fb947 100644 --- a/scripts/node_padding/node_padding.gml +++ b/scripts/node_padding/node_padding.gml @@ -2,7 +2,7 @@ function Node_Padding(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c name = "Padding"; dimension_index = -1; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Padding("Padding", self, [0, 0, 0, 0])) .setUnitRef(function(index) { return getDimension(index); }); diff --git a/scripts/node_palette_extract/node_palette_extract.gml b/scripts/node_palette_extract/node_palette_extract.gml index 2677a44cf..b8b1bd796 100644 --- a/scripts/node_palette_extract/node_palette_extract.gml +++ b/scripts/node_palette_extract/node_palette_extract.gml @@ -1,8 +1,15 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Palette_Extract", "Algorithm > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[3].setValue((_n.inputs[3].getValue() + 1) % 3); }); + addHotkey("Node_Palette_Extract", "Color Space > Toggle", "C", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[4].setValue((_n.inputs[4].getValue() + 1) % 2); }); + }); +#endregion + function Node_Palette_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Palette Extract"; setDimension(96, 48); - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Int("Max colors", self, 5, "Amount of color in a palette.")) .rejectArray(); diff --git a/scripts/node_palette_shift/node_palette_shift.gml b/scripts/node_palette_shift/node_palette_shift.gml index 0cbfef01c..0d8421f76 100644 --- a/scripts/node_palette_shift/node_palette_shift.gml +++ b/scripts/node_palette_shift/node_palette_shift.gml @@ -1,7 +1,7 @@ function Node_Palette_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Palette Shift"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Palette("Palette", self, array_clone(DEF_PALETTE))); diff --git a/scripts/node_pixel_cloud/node_pixel_cloud.gml b/scripts/node_pixel_cloud/node_pixel_cloud.gml index 72b9a1d21..ddf8935db 100644 --- a/scripts/node_pixel_cloud/node_pixel_cloud.gml +++ b/scripts/node_pixel_cloud/node_pixel_cloud.gml @@ -1,7 +1,7 @@ function Node_Pixel_Cloud(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Pixel Cloud"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValueSeed(self)); diff --git a/scripts/node_pixel_extract/node_pixel_extract.gml b/scripts/node_pixel_extract/node_pixel_extract.gml index 637181076..216e337fb 100644 --- a/scripts/node_pixel_extract/node_pixel_extract.gml +++ b/scripts/node_pixel_extract/node_pixel_extract.gml @@ -2,7 +2,7 @@ function Node_Pixel_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr name = "Pixel Extract"; setDimension(96, 48); - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Enum_Button("Skip", self, 0, [ "None", "Black", "Empty" ])); diff --git a/scripts/node_pixel_math/node_pixel_math.gml b/scripts/node_pixel_math/node_pixel_math.gml index fc78915da..1c8470f86 100644 --- a/scripts/node_pixel_math/node_pixel_math.gml +++ b/scripts/node_pixel_math/node_pixel_math.gml @@ -1,19 +1,30 @@ -function Node_create_Pixel_Math(_x, _y, _group = noone, _param = {}) { - var query = struct_try_get(_param, "query", ""); - var node = new Node_Pixel_Math(_x, _y, _group); - node.skipDefault(); +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Pixel_Math", "Operator > Add", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[7].setValue(array_find(global.node_math_names, "Add")); }); + addHotkey("Node_Pixel_Math", "Operator > Subtract", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[7].setValue(array_find(global.node_math_names, "Subtract")); }); + addHotkey("Node_Pixel_Math", "Operator > Multiply", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[7].setValue(array_find(global.node_math_names, "Multiply")); }); + addHotkey("Node_Pixel_Math", "Operator > Divide", "D", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[7].setValue(array_find(global.node_math_names, "Divide")); }); + + addHotkey("Node_Pixel_Math", "Operand Type > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[10].setValue(!_n.inputs[10].getValue()); }); + }); - var ind = array_find(global.node_math_keys, query); - if(ind != -1) node.inputs[7].setValue(global.node_math_keys_map[ind]); - - return node; -} + function Node_create_Pixel_Math(_x, _y, _group = noone, _param = {}) { + var query = struct_try_get(_param, "query", ""); + var node = new Node_Pixel_Math(_x, _y, _group); + node.skipDefault(); + + var ind = array_find(global.node_math_keys, query); + if(ind != -1) node.inputs[7].setValue(global.node_math_keys_map[ind]); + + return node; + } +#endregion function Node_Pixel_Math(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Pixel Math"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; @@ -35,9 +46,9 @@ function Node_Pixel_Math(_x, _y, _group = noone) : Node_Processor(_x, _y, _group newInput(9, nodeValue_Vec2("Range", self, [ 0, 0 ])); - newInput(10, nodeValue_Enum_Button("Operand type", self, 0, [ "Vec4", "Surface" ])); + newInput(10, nodeValue_Enum_Button("Operand Type", self, 0, [ "Vec4", "Surface" ])); - newInput(11, nodeValue_Surface("Operand surface", self)); + newInput(11, nodeValue_Surface("Operand Surface", self)); newInput(12, nodeValue_Float("Mix", self, .5)) .setDisplay(VALUE_DISPLAY.slider); diff --git a/scripts/node_pixel_sort/node_pixel_sort.gml b/scripts/node_pixel_sort/node_pixel_sort.gml index cfc403484..bdde3e466 100644 --- a/scripts/node_pixel_sort/node_pixel_sort.gml +++ b/scripts/node_pixel_sort/node_pixel_sort.gml @@ -1,7 +1,14 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Pixel_Sort", "Iteration > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + addHotkey("Node_Pixel_Sort", "Direction > Rotate CCW", "R", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[3].setValue((_n.inputs[3].getValue() + 90) % 360); }); + }); +#endregion + function Node_Pixel_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Pixel Sort"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Int("Iteration", self, 2)); diff --git a/scripts/node_polar/node_polar.gml b/scripts/node_polar/node_polar.gml index d32ccc765..5fa2c5a02 100644 --- a/scripts/node_polar/node_polar.gml +++ b/scripts/node_polar/node_polar.gml @@ -1,7 +1,7 @@ function Node_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Polar"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_posterize/node_posterize.gml b/scripts/node_posterize/node_posterize.gml index 04ca71357..403087a05 100644 --- a/scripts/node_posterize/node_posterize.gml +++ b/scripts/node_posterize/node_posterize.gml @@ -1,11 +1,18 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Posterize", "Use Palette > Toggle", "P", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 2); }); + addHotkey("Node_Posterize", "Space > Toggle", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[8].setValue((_n.inputs[8].getValue() + 1) % 2); }); + }); +#endregion + function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Posterize"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Palette("Palette", self, array_clone(DEF_PALETTE))); - newInput(2, nodeValue_Bool("Use palette", self, true)); + newInput(2, nodeValue_Bool("Use Palette", self, true)); newInput(3, nodeValue_Int("Steps", self, 4)) .setDisplay(VALUE_DISPLAY.slider, { range: [2, 16, 0.1] }); diff --git a/scripts/node_region_fill/node_region_fill.gml b/scripts/node_region_fill/node_region_fill.gml index e5f8d32b1..c5bf4868c 100644 --- a/scripts/node_region_fill/node_region_fill.gml +++ b/scripts/node_region_fill/node_region_fill.gml @@ -1,7 +1,7 @@ function Node_Region_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Region Fill"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_repeat/node_repeat.gml b/scripts/node_repeat/node_repeat.gml index 435e945bd..3734e985c 100644 --- a/scripts/node_repeat/node_repeat.gml +++ b/scripts/node_repeat/node_repeat.gml @@ -22,7 +22,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co name = "Repeat"; dimension_index = 1; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Dimension(self)); diff --git a/scripts/node_repeat_texture/node_repeat_texture.gml b/scripts/node_repeat_texture/node_repeat_texture.gml index fa32b205d..04ed44761 100644 --- a/scripts/node_repeat_texture/node_repeat_texture.gml +++ b/scripts/node_repeat_texture/node_repeat_texture.gml @@ -2,7 +2,7 @@ function Node_Repeat_Texture(_x, _y, _group = noone) : Node_Processor(_x, _y, _g name = "Repeat Texture"; dimension_index = 1; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Target dimension", self, DEF_SURF)); diff --git a/scripts/node_revert/node_revert.gml b/scripts/node_revert/node_revert.gml index 533a4ab4a..578f4203f 100644 --- a/scripts/node_revert/node_revert.gml +++ b/scripts/node_revert/node_revert.gml @@ -2,7 +2,7 @@ function Node_Revert(_x, _y, _group = noone) : Node(_x, _y, _group) constructor name = "Reverse"; use_cache = CACHE_USE.manual; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newOutput(0, nodeValue_Output("Output", self, VALUE_TYPE.surface, noone)); diff --git a/scripts/node_sampler/node_sampler.gml b/scripts/node_sampler/node_sampler.gml index 5af092cdd..c2d7b62ec 100644 --- a/scripts/node_sampler/node_sampler.gml +++ b/scripts/node_sampler/node_sampler.gml @@ -2,7 +2,7 @@ function Node_Sampler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c name = "Sampler"; setDimension(96, 48); - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Position", self, [ 0, 0 ])) .setUnitRef(function(index) { return getDimension(index); }); diff --git a/scripts/node_scale/node_scale.gml b/scripts/node_scale/node_scale.gml index cf011e0d0..b3fdcc32b 100644 --- a/scripts/node_scale/node_scale.gml +++ b/scripts/node_scale/node_scale.gml @@ -4,7 +4,7 @@ function Node_Scale(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con manage_atlas = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Scale", self, 1)); diff --git a/scripts/node_scale_algo/node_scale_algo.gml b/scripts/node_scale_algo/node_scale_algo.gml index 430077031..29cf8c570 100644 --- a/scripts/node_scale_algo/node_scale_algo.gml +++ b/scripts/node_scale_algo/node_scale_algo.gml @@ -16,7 +16,7 @@ function Node_Scale_Algo(_x, _y, _group = noone) : Node_Processor(_x, _y, _group name = "Scale Algorithm"; manage_atlas = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Enum_Scroll("Algorithm", self, 0, [ "Scale2x", "Scale3x", "CleanEdge" ])); diff --git a/scripts/node_scatter/node_scatter.gml b/scripts/node_scatter/node_scatter.gml index 8042ff7cc..a8e4f2d60 100644 --- a/scripts/node_scatter/node_scatter.gml +++ b/scripts/node_scatter/node_scatter.gml @@ -11,7 +11,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c name = "Scatter"; dimension_index = 1; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Dimension(self)); diff --git a/scripts/node_sdf/node_sdf.gml b/scripts/node_sdf/node_sdf.gml index e44575563..e028db578 100644 --- a/scripts/node_sdf/node_sdf.gml +++ b/scripts/node_sdf/node_sdf.gml @@ -1,7 +1,15 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_SDF", "Side > Toggle", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 3); }); + addHotkey("Node_SDF", "Keep Alpha > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[4].setValue(!_n.inputs[4].getValue()); }); + addHotkey("Node_SDF", "Invert > Toggle", "I", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[5].setValue(!_n.inputs[5].getValue()); }); + }); +#endregion + function Node_SDF(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "SDF"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_separate_color/node_separate_color.gml b/scripts/node_separate_color/node_separate_color.gml index 418daf88c..7c99dbe17 100644 --- a/scripts/node_separate_color/node_separate_color.gml +++ b/scripts/node_separate_color/node_separate_color.gml @@ -1,7 +1,7 @@ function Node_Color_Separate(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Separate Color"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("All Colors", self, true)); diff --git a/scripts/node_seperate_shape/node_seperate_shape.gml b/scripts/node_seperate_shape/node_seperate_shape.gml index a91c27452..fdbb60388 100644 --- a/scripts/node_seperate_shape/node_seperate_shape.gml +++ b/scripts/node_seperate_shape/node_seperate_shape.gml @@ -1,7 +1,7 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Separate Shape"; - newInput(0, nodeValue_Surface("Surface in", self)) + newInput(0, nodeValue_Surface("Surface In", self)) .rejectArray(); newInput(1, nodeValue_Float("Tolerance", self, 0.2)) diff --git a/scripts/node_sequence_anim/node_sequence_anim.gml b/scripts/node_sequence_anim/node_sequence_anim.gml index d267b00c6..c1c3f2cca 100644 --- a/scripts/node_sequence_anim/node_sequence_anim.gml +++ b/scripts/node_sequence_anim/node_sequence_anim.gml @@ -3,7 +3,7 @@ function Node_Sequence_Anim(_x, _y, _group = noone) : Node(_x, _y, _group) const update_on_frame = true; setAlwaysTimeline(new timelineItemNode_Sequence_Anim(self)); - newInput(0, nodeValue_Surface("Surface in", self, [])) + newInput(0, nodeValue_Surface("Surface In", self, [])) .setArrayDepth(1); newInput(1, nodeValue_Float("Speed", self, 1)) diff --git a/scripts/node_shadow/node_shadow.gml b/scripts/node_shadow/node_shadow.gml index af77631e5..ba4c72d79 100644 --- a/scripts/node_shadow/node_shadow.gml +++ b/scripts/node_shadow/node_shadow.gml @@ -1,7 +1,7 @@ function Node_Shadow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Shadow"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Color("Color", self, cola(c_black))); newInput(2, nodeValue_Float("Strength", self, .5)) diff --git a/scripts/node_shape/node_shape.gml b/scripts/node_shape/node_shape.gml index 938c1cd6b..0f6b25bd9 100644 --- a/scripts/node_shape/node_shape.gml +++ b/scripts/node_shape/node_shape.gml @@ -1,33 +1,48 @@ -global.node_shape_keys = [ - "rectangle", "square", "diamond", "trapezoid", "parallelogram", "half", - "circle", "ellipse", "arc", "donut", "crescent", "ring", "squircle", - "regular polygon", "triangle", "pentagon", "hexagon", "star", "cross", - "line", "arrow", - "teardrop", "leaf", "heart", "gear", -]; +#region create + global.node_shape_keys = [ + "rectangle", "square", "diamond", "trapezoid", "parallelogram", "half", + "circle", "ellipse", "arc", "donut", "crescent", "ring", "squircle", + "regular polygon", "triangle", "pentagon", "hexagon", "star", "cross", + "line", "arrow", + "teardrop", "leaf", "heart", "gear", + ]; -function Node_create_Shape(_x, _y, _group = noone, _param = {}) { - var query = struct_try_get(_param, "query", ""); - var node = new Node_Shape(_x, _y, _group); - node.skipDefault(); - - var ind = -1; - - switch(query) { - case "square" : ind = array_find_string(node.shape_types, "rectangle"); break; - case "circle" : ind = array_find_string(node.shape_types, "ellipse"); break; - case "ring" : ind = array_find_string(node.shape_types, "donut"); break; - case "triangle" : ind = array_find_string(node.shape_types, "regular polygon"); node.inputs[4].setValue(3); break; - case "pentagon" : ind = array_find_string(node.shape_types, "regular polygon"); node.inputs[4].setValue(5); break; - case "hexagon" : ind = array_find_string(node.shape_types, "regular polygon"); node.inputs[4].setValue(6); break; + function Node_create_Shape(_x, _y, _group = noone, _param = {}) { + var query = struct_try_get(_param, "query", ""); + var node = new Node_Shape(_x, _y, _group); + node.skipDefault(); - default : ind = array_find_string(node.shape_types, query); + var ind = -1; + + switch(query) { + case "square" : ind = array_find_string(node.shape_types, "rectangle"); break; + case "circle" : ind = array_find_string(node.shape_types, "ellipse"); break; + case "ring" : ind = array_find_string(node.shape_types, "donut"); break; + case "triangle" : ind = array_find_string(node.shape_types, "regular polygon"); node.inputs[4].setValue(3); break; + case "pentagon" : ind = array_find_string(node.shape_types, "regular polygon"); node.inputs[4].setValue(5); break; + case "hexagon" : ind = array_find_string(node.shape_types, "regular polygon"); node.inputs[4].setValue(6); break; + + default : ind = array_find_string(node.shape_types, query); + } + + if(ind >= 0) node.inputs[2].setValue(ind); + + return node; } - if(ind >= 0) node.inputs[2].setValue(ind); + function __Node_Shape_Hotkeys_set_shape(_n, _key) { _n.inputs[2].setValue(array_find(_n.shape_types, _key)); } - return node; -} + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Shape", "Shape > Rectangle", "R", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR __Node_Shape_Hotkeys_set_shape(_n, "Rectangle"); }); + addHotkey("Node_Shape", "Shape > Ellipse", "E", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR __Node_Shape_Hotkeys_set_shape(_n, "Ellipse"); }); + addHotkey("Node_Shape", "Shape > Regular polygon", "P", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR __Node_Shape_Hotkeys_set_shape(_n, "Regular polygon"); }); + addHotkey("Node_Shape", "Shape > Star", "S", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR __Node_Shape_Hotkeys_set_shape(_n, "Star"); }); + addHotkey("Node_Shape", "Anti-aliasing > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[6].setValue(!_n.inputs[6].getValue()); }); + addHotkey("Node_Shape", "Height Render > Toggle", "H", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[12].setValue(!_n.inputs[12].getValue()); }); + addHotkey("Node_Shape", "Background > Toggle", "B", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(!_n.inputs[1].getValue()); }); + }); + +#endregion function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Draw Shape"; diff --git a/scripts/node_shape_map/node_shape_map.gml b/scripts/node_shape_map/node_shape_map.gml index 2dbc4c959..18b0c92a8 100644 --- a/scripts/node_shape_map/node_shape_map.gml +++ b/scripts/node_shape_map/node_shape_map.gml @@ -1,7 +1,7 @@ function Node_Shape_Map(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Shape Map"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_shuffle/node_shuffle.gml b/scripts/node_shuffle/node_shuffle.gml index 0e91c2ca3..c4d755635 100644 --- a/scripts/node_shuffle/node_shuffle.gml +++ b/scripts/node_shuffle/node_shuffle.gml @@ -1,3 +1,10 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Shuffle", "Type > Toggle", "T", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue((_n.inputs[1].getValue() + 1) % 2); }); + addHotkey("Node_Shuffle", "Axis > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[3].setValue((_n.inputs[3].getValue() + 1) % 3); }); + }); +#endregion + function Node_Shuffle(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Shuffle"; diff --git a/scripts/node_skew/node_skew.gml b/scripts/node_skew/node_skew.gml index ffa4955cd..0f3eaf0c3 100644 --- a/scripts/node_skew/node_skew.gml +++ b/scripts/node_skew/node_skew.gml @@ -1,7 +1,7 @@ function Node_Skew(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Skew"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Enum_Button("Axis", self, 0, ["x", "y"])); newInput(2, nodeValue_Float("Strength", self, 0)) diff --git a/scripts/node_smear/node_smear.gml b/scripts/node_smear/node_smear.gml index 9ad327a55..923de422c 100644 --- a/scripts/node_smear/node_smear.gml +++ b/scripts/node_smear/node_smear.gml @@ -1,7 +1,17 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Smear", "Strength > Set", KEY_GROUP.numeric, MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key)) / 10); }); + addHotkey("Node_Smear", "Direction > Rotate CCW", "R", MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 90) % 360); }); + addHotkey("Node_Smear", "Mode > Toggle", "M", MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[11].setValue(!_n.inputs[11].getValue()); }); + addHotkey("Node_Smear", "Blend Mode > Toggle", "B", MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[15].setValue(!_n.inputs[15].getValue()); }); + addHotkey("Node_Smear", "Normalize > Toggle", "N", MOD_KEY.none, function(val) /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[16].setValue(!_n.inputs[16].getValue()); }); + }); +#endregion + function Node_Smear(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Smear"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Strength", self, 0.2)) .setDisplay(VALUE_DISPLAY.slider, { range: [0, 0.5, 0.001] }) diff --git a/scripts/node_spherize/node_spherize.gml b/scripts/node_spherize/node_spherize.gml index 0e7db5775..f8bfe1e03 100644 --- a/scripts/node_spherize/node_spherize.gml +++ b/scripts/node_spherize/node_spherize.gml @@ -1,7 +1,13 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Spherize", "Oversample Mode > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[4].setValue((_n.inputs[4].getValue() + 1) % 3); }); + }); +#endregion + function Node_Spherize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Spherize"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Center", self, [ DEF_SURF_W / 2, DEF_SURF_H / 2 ])) .setUnitRef(function(index) { return getDimension(index); }); @@ -14,7 +20,7 @@ function Node_Spherize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) .setDisplay(VALUE_DISPLAY.slider) .setMappable(12); - newInput(4, nodeValue_Enum_Scroll("Oversample mode", self, 0, [ "Empty", "Clamp", "Repeat" ])) + newInput(4, nodeValue_Enum_Scroll("Oversample Mode", self, 0, [ "Empty", "Clamp", "Repeat" ])) .setTooltip("How to deal with pixel outside the surface.\n - Empty: Use empty pixel\n - Clamp: Repeat edge pixel\n - Repeat: Repeat texture."); newInput(5, nodeValue_Surface("Mask", self)); @@ -31,18 +37,18 @@ function Node_Spherize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) ////////////////////////////////////////////////////////////////////////////////////////////////////////// - newInput(11, nodeValue_Surface("Strength map", self)) + newInput(11, nodeValue_Surface("Strength Map", self)) .setVisible(false, false); - newInput(12, nodeValue_Surface("Radius map", self)) + newInput(12, nodeValue_Surface("Radius Map", self)) .setVisible(false, false); ////////////////////////////////////////////////////////////////////////////////////////////////////////// - newInput(13, nodeValue_Float("Trim edge", self, 0)) + newInput(13, nodeValue_Float("Trim Edge", self, 0)) .setDisplay(VALUE_DISPLAY.slider) - newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); + newOutput(0, nodeValue_Output("Surface Out", self, VALUE_TYPE.surface, noone)); input_display_list = [ 7, 8, ["Surfaces", true], 0, 5, 6, 9, 10, diff --git a/scripts/node_stack/node_stack.gml b/scripts/node_stack/node_stack.gml index ad305819f..b2b4f55b8 100644 --- a/scripts/node_stack/node_stack.gml +++ b/scripts/node_stack/node_stack.gml @@ -1,3 +1,10 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Stack", "Axis > Toggle", "X", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[0].setValue((_n.inputs[0].getValue() + 1) % 3); }); + addHotkey("Node_Stack", "Align > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue((_n.inputs[1].getValue() + 1) % 3); }); + }); +#endregion + function Node_Stack(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Stack"; diff --git a/scripts/node_surface_tag/node_surface_tag.gml b/scripts/node_surface_tag/node_surface_tag.gml index fdaaa4fc3..c719f08bd 100644 --- a/scripts/node_surface_tag/node_surface_tag.gml +++ b/scripts/node_surface_tag/node_surface_tag.gml @@ -24,7 +24,7 @@ function taggedSurf(_surf = noone) : dynaSurf() constructor { function Node_Surface_Tag(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Tag Surface"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newOutput(0, nodeValue_Output("Tagged Surface", self, VALUE_TYPE.dynaSurface, noone)); diff --git a/scripts/node_test_blur/node_test_blur.gml b/scripts/node_test_blur/node_test_blur.gml index bc1adb0ca..5a0cd9336 100644 --- a/scripts/node_test_blur/node_test_blur.gml +++ b/scripts/node_test_blur/node_test_blur.gml @@ -1,7 +1,7 @@ // function Node_Blur(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { // name = "Blur"; -// newInput(0, nodeValue_Surface("Surface in", self)); +// newInput(0, nodeValue_Surface("Surface In", self)); // newInput(1, nodeValue_Int("Size", self, 3)) // .setValidator(VV_min(0)) diff --git a/scripts/node_texture_remap/node_texture_remap.gml b/scripts/node_texture_remap/node_texture_remap.gml index 2d41dbe71..dee2d18be 100644 --- a/scripts/node_texture_remap/node_texture_remap.gml +++ b/scripts/node_texture_remap/node_texture_remap.gml @@ -4,7 +4,7 @@ function Node_Texture_Remap(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr shader = sh_texture_remap; uniform_map = shader_get_sampler_index(shader, "map"); - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("RG Map", self, "Displacement map where red retermine the X position, and green determine the Y position.")); diff --git a/scripts/node_threshold/node_threshold.gml b/scripts/node_threshold/node_threshold.gml index 3eff21e51..e36970430 100644 --- a/scripts/node_threshold/node_threshold.gml +++ b/scripts/node_threshold/node_threshold.gml @@ -1,7 +1,14 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Threshold", "Brightness > Toggle", "B", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(!_n.inputs[1].getValue()); }); + addHotkey("Node_Threshold", "Alpha > Toggle", "A", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[7].setValue(!_n.inputs[7].getValue()); }); + }); +#endregion + function Node_Threshold(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Threshold"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Brightness", self, false)); diff --git a/scripts/node_tile_random/node_tile_random.gml b/scripts/node_tile_random/node_tile_random.gml index 4d0179163..b0b2e2157 100644 --- a/scripts/node_tile_random/node_tile_random.gml +++ b/scripts/node_tile_random/node_tile_random.gml @@ -2,7 +2,7 @@ function Node_Tile_Random(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou name = "Tile Random"; dimension_index = -1; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Dimension(self)); diff --git a/scripts/node_time_remap/node_time_remap.gml b/scripts/node_time_remap/node_time_remap.gml index ed81caac4..690a28e69 100644 --- a/scripts/node_time_remap/node_time_remap.gml +++ b/scripts/node_time_remap/node_time_remap.gml @@ -1,15 +1,22 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Time_Remap", "Max Life > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue(toNumber(chr(keyboard_key))); }); + addHotkey("Node_Time_Remap", "Loop > Toggle", "L", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[3].setValue((_n.inputs[3].getValue() + 1) % 2); }); + }); +#endregion + function Node_Time_Remap(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Time Remap"; use_cache = CACHE_USE.manual; update_on_frame = true; - newInput(0, nodeValue_Surface("Surface in", self)) + newInput(0, nodeValue_Surface("Surface In", self)) .rejectArray(); newInput(1, nodeValue_Surface("Map", self)) .rejectArray(); - newInput(2, nodeValue_Int("Max life", self, 3)) + newInput(2, nodeValue_Int("Max Life", self, 3)) .rejectArray(); newInput(3, nodeValue_Bool("Loop", self, false)) diff --git a/scripts/node_tonemap_ace/node_tonemap_ace.gml b/scripts/node_tonemap_ace/node_tonemap_ace.gml index 8fc2da002..ea50d2cde 100644 --- a/scripts/node_tonemap_ace/node_tonemap_ace.gml +++ b/scripts/node_tonemap_ace/node_tonemap_ace.gml @@ -1,7 +1,7 @@ function Node_Tonemap_ACE(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "ACE"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_trail/node_trail.gml b/scripts/node_trail/node_trail.gml index f55888e75..69fd2f8de 100644 --- a/scripts/node_trail/node_trail.gml +++ b/scripts/node_trail/node_trail.gml @@ -1,21 +1,30 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Trail", "Max Life > Set", KEY_GROUP.numeric, MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[1].setValue(toNumber(chr(keyboard_key))); }); + addHotkey("Node_Trail", "Loop > Toggle", "L", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[2].setValue((_n.inputs[2].getValue() + 1) % 2); }); + addHotkey("Node_Trail", "Match Color > Toggle", "M", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[4].setValue((_n.inputs[4].getValue() + 1) % 2); }); + addHotkey("Node_Trail", "Blend Color > Toggle", "B", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[5].setValue((_n.inputs[5].getValue() + 1) % 2); }); + }); +#endregion + function Node_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Trail"; use_cache = CACHE_USE.manual; clearCacheOnChange = false; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); - newInput(1, nodeValue_Int("Max life", self, 5)); + newInput(1, nodeValue_Int("Max Life", self, 5)); newInput(2, nodeValue_Bool("Loop", self, false)); - newInput(3, nodeValue_Int("Max distance", self, -1, "Maximum distance to search for movement, set to -1 to search the entire image.")); + newInput(3, nodeValue_Int("Max Distance", self, -1, "Maximum distance to search for movement, set to -1 to search the entire image.")); - newInput(4, nodeValue_Bool("Match color", self, true, "Make trail track pixels of the same color, instead of the closet pixels.")); + newInput(4, nodeValue_Bool("Match Color", self, true, "Make trail track pixels of the same color, instead of the closet pixels.")); - newInput(5, nodeValue_Bool("Blend color", self, true, "Blend color between two pixel smoothly.")); + newInput(5, nodeValue_Bool("Blend Color", self, true, "Blend color between two pixel smoothly.")); - newInput(6, nodeValue_Curve("Alpha over life", self, CURVE_DEF_11)); + newInput(6, nodeValue_Curve("Alpha Over Life", self, CURVE_DEF_11)); newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone)); diff --git a/scripts/node_transform/node_transform.gml b/scripts/node_transform/node_transform.gml index 3bdee2125..8c9bb5d06 100644 --- a/scripts/node_transform/node_transform.gml +++ b/scripts/node_transform/node_transform.gml @@ -9,7 +9,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) name = "Transform"; dimension_index = -1; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Output dimension", self, [ 1, 1 ])) .setVisible(false); diff --git a/scripts/node_transform_single/node_transform_single.gml b/scripts/node_transform_single/node_transform_single.gml index 7fc4c3c5e..69386e895 100644 --- a/scripts/node_transform_single/node_transform_single.gml +++ b/scripts/node_transform_single/node_transform_single.gml @@ -1,7 +1,7 @@ function Node_Transform_Single(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Transform single"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Float("Position x", self, 0)); newInput(2, nodeValue_Float("Position y", self, 0)); diff --git a/scripts/node_twirl/node_twirl.gml b/scripts/node_twirl/node_twirl.gml index cd2d5e23c..d4bd1914c 100644 --- a/scripts/node_twirl/node_twirl.gml +++ b/scripts/node_twirl/node_twirl.gml @@ -1,10 +1,16 @@ +#region + FN_NODE_CONTEXT_INVOKE { + addHotkey("Node_Twirl", "Oversample Mode > Toggle", "O", MOD_KEY.none, function() /*=>*/ { PANEL_GRAPH_FOCUS_STR _n.inputs[4].setValue((_n.inputs[4].getValue() + 1) % 3); }); + }); +#endregion + function Node_Twirl(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Twirl"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); - newInput(1, nodeValue_Vec2("Center", self, [ 0, 0 ])) - .setUnitRef(function(index) { return getDimension(index); }); + newInput(1, nodeValue_Vec2("Center", self, [ .5, .5 ])) + .setUnitRef(function(index) /*=>*/ {return getDimension(index)}, VALUE_UNIT.reference); newInput(2, nodeValue_Float("Strength", self, 3)) .setDisplay(VALUE_DISPLAY.slider, { range: [-10, 10, 0.01] }) @@ -13,7 +19,7 @@ function Node_Twirl(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con newInput(3, nodeValue_Float("Radius", self, 16)) .setMappable(12); - newInput(4, nodeValue_Enum_Scroll("Oversample mode", self, 0, [ "Empty", "Clamp", "Repeat" ])) + newInput(4, nodeValue_Enum_Scroll("Oversample Mode", self, 0, [ "Empty", "Clamp", "Repeat" ])) .setTooltip("How to deal with pixel outside the surface.\n - Empty: Use empty pixel\n - Clamp: Repeat edge pixel\n - Repeat: Repeat texture."); newInput(5, nodeValue_Surface("Mask", self)); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index be3e4be5f..52d9bad37 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -2467,45 +2467,53 @@ function checkJuncConnection(from, to, params) { var _x1 = max(jx, cx, frx) + hovDist + max(_fin, _tin) * PROJECT.graphConnection.line_extend; var _y1 = max(jy, cy, fry) + hovDist; - if(!point_in_rectangle(mx, my, _x0, _y0, _x1, _y1)) return noone; var downDirection = to.type == VALUE_TYPE.action || from.type == VALUE_TYPE.action; - var _loop = struct_try_get(params, "loop"); + var _loop = params[$ "loop"] ?? false; + var _chNode = params[$ "checkNode"] ?? noone; + var _hPoint = [ 0, 0 ]; + + if(_chNode == noone && !point_in_rectangle(mx, my, _x0, _y0, _x1, _y1)) return noone; if(_loop || from.node == to.node) { - hover = distance_line_feedback(mx, my, jx, jy, frx, fry, _s) < hovDist; + point_to_line_feedback(mx, my, jx, jy, frx, fry, _s, _hPoint); } else { - var _hdist; switch(PROJECT.graphConnection.type) { case 0 : - if(downDirection) _hdist = distance_to_line(mx, my, jx, jy, frx, fry); - else _hdist = distance_to_linear_connection(mx, my, frx, fry, jx, jy, _s, PROJECT.graphConnection.line_extend); + if(downDirection) point_to_line(mx, my, jx, jy, frx, fry, _hPoint); + else point_to_linear_connection(mx, my, frx, fry, jx, jy, _s, PROJECT.graphConnection.line_extend, _hPoint); break; case 1 : - if(downDirection) _hdist = distance_to_curve_corner(mx, my, jx, jy, frx, fry, _s); - else _hdist = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s); + if(downDirection) point_to_curve_corner(mx, my, jx, jy, frx, fry, _s, _hPoint); + else point_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s, _hPoint); break; case 2 : - if(downDirection) _hdist = distance_to_elbow_corner(mx, my, frx, fry, jx, jy); - else _hdist = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s); + if(downDirection) point_to_elbow_corner(mx, my, frx, fry, jx, jy, _hPoint); + else point_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, _hPoint); break; case 3 : - if(downDirection) _hdist = distance_to_elbow_diag_corner(mx, my, frx, fry, jx, jy); - else _hdist = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, PROJECT.graphConnection.line_extend, _fin, _tin); + if(downDirection) point_to_elbow_diag_corner(mx, my, frx, fry, jx, jy, _hPoint); + else point_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, PROJECT.graphConnection.line_extend, _fin, _tin, _hPoint); break; default : return noone; } - - hover = _hdist < hovDist; } + if(_chNode == noone) { + var _dx = _hPoint[0] - mx; + var _dy = _hPoint[1] - my; + hover = _dx * _dx + _dy * _dy < hovDist * hovDist; + + } else + hover = _chNode.pointIn(params.x, params.y, _hPoint[0], _hPoint[1], params.s); + if(PANEL_GRAPH.value_focus == noone) to.draw_line_shift_hover = hover; return hover? self : noone; } @@ -2579,7 +2587,7 @@ function drawJuncConnection(from, to, params, _hover = 0) { corner *= aa; th = max(1, round(th * aa)); - var _loop = struct_try_get(params, "loop"); + var _loop = params[$ "loop"] ?? false; if(_loop) { draw_line_feedback(jx, jy, frx, fry, th, c1, c0, ss); return; } var down = to.type == VALUE_TYPE.action || from.type == VALUE_TYPE.action; diff --git a/scripts/node_vignette/node_vignette.gml b/scripts/node_vignette/node_vignette.gml index 752cfac41..9c73d58b2 100644 --- a/scripts/node_vignette/node_vignette.gml +++ b/scripts/node_vignette/node_vignette.gml @@ -1,7 +1,7 @@ function Node_Vignette(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Vignette"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/node_warp/node_warp.gml b/scripts/node_warp/node_warp.gml index 7dc685ed9..c251ad3b2 100644 --- a/scripts/node_warp/node_warp.gml +++ b/scripts/node_warp/node_warp.gml @@ -1,7 +1,7 @@ function Node_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Warp"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Vec2("Top left", self, [ 0, 0 ] )) .setUnitRef(function(index) { return getDimension(index); }); diff --git a/scripts/node_wrap_area/node_wrap_area.gml b/scripts/node_wrap_area/node_wrap_area.gml index 0945c9183..894d33620 100644 --- a/scripts/node_wrap_area/node_wrap_area.gml +++ b/scripts/node_wrap_area/node_wrap_area.gml @@ -1,7 +1,7 @@ function Node_Wrap_Area(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Area Warp"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); onSurfaceSize = function() { return surface_get_dimension(getInputData(0)); }; newInput(1, nodeValue_Area("Area", self, DEF_AREA_REF, { onSurfaceSize, useShape : false })) diff --git a/scripts/node_wrap_perspective/node_wrap_perspective.gml b/scripts/node_wrap_perspective/node_wrap_perspective.gml index 0187eedea..d63395aab 100644 --- a/scripts/node_wrap_perspective/node_wrap_perspective.gml +++ b/scripts/node_wrap_perspective/node_wrap_perspective.gml @@ -1,7 +1,7 @@ function Node_Warp_Perspective(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Perspective Warp"; - newInput(0, nodeValue_Surface("Surface in", self)); + newInput(0, nodeValue_Surface("Surface In", self)); newInput(1, nodeValue_Bool("Active", self, true)); active_index = 1; diff --git a/scripts/panel_data/panel_data.gml b/scripts/panel_data/panel_data.gml index 389f15c6b..add7a2a01 100644 --- a/scripts/panel_data/panel_data.gml +++ b/scripts/panel_data/panel_data.gml @@ -402,14 +402,10 @@ function Panel(_parent, _x, _y, _w, _h) constructor { if(con && point_in_rectangle(_mx, _my, x + ui(2), y + ui(2), x + w - ui(4), y + h - ui(4))) { HOVER = self; - // print($"Hovering {instanceof(con)} : {mouse_press(mb_any)} : {random(1)}") - if(mouse_press(mb_any)) - setFocus(self); - - if(FOCUS == self && con) - FOCUS_STR = con.context_str; - + if(mouse_press(mb_any)) + setFocus(self, con.context_str); + } else { for(var i = 0; i < array_length(childs); i++) childs[i].stepBegin(); @@ -995,8 +991,7 @@ function setFocus(target, fstring = noone) { FOCUS.onFocusEnd(); FOCUS = target; - if(fstring != noone) - FOCUS_STR = fstring; + if(fstring != noone) FOCUS_STR = fstring; if((instance_exists(FOCUS) && variable_instance_exists(FOCUS, "onFocusBegin")) || (is_struct(FOCUS) && struct_has(FOCUS, "onFocusBegin"))) diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 6c44de37e..148362b18 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -1,6 +1,9 @@ #region function calls #macro PANEL_GRAPH_PROJECT_CHECK if(PANEL_GRAPH.project == noone || !PANEL_GRAPH.project.active) return; - + #macro PANEL_GRAPH_FOCUS_STR var _n = PANEL_GRAPH.getFocusStr(); if(_n == noone) return; + #macro FN_NODE_CONTEXT_INVOKE if(!variable_global_exists("__FN_NODE_CONTEXT") || variable_global_get("__FN_NODE_CONTEXT") == undefined) variable_global_set("__FN_NODE_CONTEXT", []); \ + array_push(global.__FN_NODE_CONTEXT, function() + function panel_graph_add_node() { CALL("graph_add_node"); PANEL_GRAPH.callAddDialog(); } function panel_graph_focus_content() { CALL("graph_focus_content"); PANEL_GRAPH.fullView(); } function panel_graph_preview_focus() { CALL("graph_preview_focus"); PANEL_GRAPH.setCurrentPreview(); } @@ -146,22 +149,25 @@ registerFunction("Graph", "Grid Settings", "", MOD_KEY.none, function() /*=>*/ { dialogPanelCall(new Panel_Graph_Grid_Setting()) }).setMenu("graph_grid_settings") registerFunction("Graph", "View Settings", "", MOD_KEY.none, function() /*=>*/ { dialogPanelCall(new Panel_Graph_View_Setting(PANEL_GRAPH, PANEL_GRAPH.display_parameter)) }).setMenu("graph_view_settings") - __fnGroupInit_Graph() + __fnGroupInit_Graph(); + + for( var i = 0, n = array_length(global.__FN_NODE_CONTEXT); i < n; i++ ) + global.__FN_NODE_CONTEXT[i](); } function __fnGroupInit_Graph() { MENU_ITEMS.graph_group_align = menuItemGroup(__txtx("panel_graph_align_nodes", "Align"), [ - [ [THEME.inspector_surface_halign, 0], function() { node_halign(PANEL_GRAPH.nodes_selecting, fa_left); } ], - [ [THEME.inspector_surface_halign, 1], function() { node_halign(PANEL_GRAPH.nodes_selecting, fa_center); } ], - [ [THEME.inspector_surface_halign, 2], function() { node_halign(PANEL_GRAPH.nodes_selecting, fa_right); } ], + [ [THEME.inspector_surface_halign, 0], function() /*=>*/ {return node_halign(PANEL_GRAPH.nodes_selecting, fa_left)} ], + [ [THEME.inspector_surface_halign, 1], function() /*=>*/ {return node_halign(PANEL_GRAPH.nodes_selecting, fa_center)} ], + [ [THEME.inspector_surface_halign, 2], function() /*=>*/ {return node_halign(PANEL_GRAPH.nodes_selecting, fa_right)} ], - [ [THEME.inspector_surface_valign, 0], function() { node_valign(PANEL_GRAPH.nodes_selecting, fa_top); } ], - [ [THEME.inspector_surface_valign, 1], function() { node_valign(PANEL_GRAPH.nodes_selecting, fa_middle); } ], - [ [THEME.inspector_surface_valign, 2], function() { node_valign(PANEL_GRAPH.nodes_selecting, fa_bottom); } ], + [ [THEME.inspector_surface_valign, 0], function() /*=>*/ {return node_valign(PANEL_GRAPH.nodes_selecting, fa_top)} ], + [ [THEME.inspector_surface_valign, 1], function() /*=>*/ {return node_valign(PANEL_GRAPH.nodes_selecting, fa_middle)} ], + [ [THEME.inspector_surface_valign, 2], function() /*=>*/ {return node_valign(PANEL_GRAPH.nodes_selecting, fa_bottom)} ], - [ [THEME.obj_distribute_h, 0], function() { node_hdistribute(PANEL_GRAPH.nodes_selecting); } ], - [ [THEME.obj_distribute_v, 0], function() { node_vdistribute(PANEL_GRAPH.nodes_selecting); } ], + [ [THEME.obj_distribute_h, 0], function() /*=>*/ {return node_hdistribute(PANEL_GRAPH.nodes_selecting)} ], + [ [THEME.obj_distribute_v, 0], function() /*=>*/ {return node_vdistribute(PANEL_GRAPH.nodes_selecting)} ], ], ["Graph", "Align Nodes"]); registerFunction("Graph", "Align Nodes", "", MOD_KEY.none, function() /*=>*/ { menuCall("", [ MENU_ITEMS.graph_group_align ]); }); @@ -221,7 +227,8 @@ function connectionParameter() constructor { max_layer = 0; highlight = 0; - + checkNode = noone; + static setPos = function(_x, _y, _s, _mx, _my) { self.x = _x; self.y = _y; @@ -1540,7 +1547,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { printIf(log, $"Node selection time: {get_timer() - t}"); t = get_timer(); // draw active - array_foreach(nodes_selecting, function(_n) /*=>*/ { _n.drawActive(__gr_x, __gr_y, __gr_s); }); + array_foreach(nodes_selecting, function(_n) /*=>*/ { _n.drawActive(__gr_x, __gr_y, __gr_s, instanceof(_n) == FOCUS_STR); }); if(nodes_select_anchor) nodes_select_anchor.active_draw_anchor = true; printIf(log, $"Draw active: {get_timer() - t}"); t = get_timer(); @@ -1560,10 +1567,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { surface_set_target(connection_surface_cc); if(connection_draw_update) { DRAW_CLEAR } - var hoverable = pHOVER; - hoverable &= !node_dragging || node_drag_add; - - connection_param.active = hoverable; + connection_param.active = pHOVER && (node_dragging == noone || node_drag_add); + connection_param.checkNode = node_dragging != noone && node_drag_add? node_dragging : noone; connection_param.setPos(gr_x, gr_y, graph_s, mx, my); connection_param.setBoundary(-64, -64, w + 64, h + 64); connection_param.setProp(array_length(_node_active), display_parameter.highlight); @@ -1630,7 +1635,9 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { draw_surface_safe(connection_surface_aa); BLEND_NORMAL - junction_hovering = node_hovering == noone? hov : noone; + junction_hovering = hov; + if(node_hovering != noone && node_hovering != node_dragging) + junction_hovering = noone; printIf(log, $"Draw connection: {get_timer() - t}"); t = get_timer(); @@ -1698,10 +1705,6 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { } } - if(_shy != undefined) { - node_dragging.x -= node_dragging.w / 2; - node_dragging.y = _shy; - } } if(node_dragging) nodes_selecting = [ node_dragging ]; @@ -2067,8 +2070,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { } else { target = node_hovering.getInput(my, value_dragging, 0); - if(target != noone) - node_hovering.active_draw_index = 1; + if(target != noone) node_hovering.active_draw_index = 1; } } @@ -2613,6 +2615,90 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { } } + function drawTooltipHints() { + if(!display_parameter.show_tooltip) { tooltip_overlay = {}; return; } + + var _over = variable_struct_get_names(tooltip_overlay); + var _tx = ui(16); + var _ty = h - toolbar_height - ui(10); + + for( var j = 0, m = array_length(_over); j < m; j++ ) { + var _title = _over[j]; + var _keys = tooltip_overlay[$ _title]; + + draw_set_text(f_p2, fa_left, fa_bottom, COLORS._main_text, .75); + var _tw = 0; + for( var i = 0, n = array_length(_keys); i < n; i++ ) + _tw = max(_tw, string_width(_keys[i][0])); + + var _ttx = _tx + _tw + ui(16); + + for( var i = array_length(_keys) - 1; i >= 0; i-- ) { + draw_set_color(COLORS._main_icon); + draw_text_add(_tx, _ty, _keys[i][0]); + + draw_set_color(COLORS._main_text); + draw_text_add(_ttx, _ty, _keys[i][1]); + + _ty -= line_get_height(); + } + + _ty -= ui(4); + draw_set_text(f_p1b, fa_left, fa_bottom, COLORS._main_text, .75); + draw_text_add(_tx, _ty, _title); + + _ty -= line_get_height() + ui(8); + } + + if(getFocusStr() != noone) { + var list = HOTKEYS[$ FOCUS_STR]; + + draw_set_text(f_p2, fa_left, fa_bottom, COLORS._main_text, .75); + var _tw = 0; + for( var i = 0, n = ds_list_size(list); i < n; i++ ) + _tw = max(_tw, string_width(list[| i].get_key_name())); + + var _ttx = _tx + _tw + ui(16); + + for(var i = ds_list_size(list) - 1; i >= 0; i--) { + var hotkey = list[| i]; + var _title = hotkey.name; + var _key = hotkey.get_key_name(); + + draw_set_color(COLORS._main_icon); + draw_text_add(_tx, _ty, _key); + + var _ttxx = _ttx; + if(string_pos(">", _title)) { + var _sp = string_split(_title, ">"); + + draw_set_color(CDEF.main_mdwhite); + draw_text_add(_ttxx, _ty, _sp[0]); + _ttxx += string_width(_sp[0]); + + draw_set_color(COLORS._main_text); + draw_text_add(_ttxx, _ty, _sp[1]); + + } else { + draw_set_color(COLORS._main_text); + draw_text_add(_ttxx, _ty, _title); + } + + _ty -= line_get_height(); + } + + _ty -= ui(4); + draw_set_text(f_p1b, fa_left, fa_bottom, COLORS._main_text, .75); + draw_text_add(_tx, _ty, string_replace_all(FOCUS_STR, "_", " ")); + + _ty -= line_get_height() + ui(8); + } + + draw_set_alpha(1); + + tooltip_overlay = {}; + } + function drawContent(panel) { ////- Main Draw if(!project.active) return; @@ -2747,50 +2833,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { if(_tip != "") TOOLTIP = _tip; } - ////////////////////////////////// Tooltip Overlay ////////////////////////////////// - - if(display_parameter.show_tooltip) { - var _over = variable_struct_get_names(tooltip_overlay); - if(!array_empty(_over)) { - var _tx = ui(16); - var _ty = h - toolbar_height - ui(10); - - for( var j = 0, m = array_length(_over); j < m; j++ ) { - var _title = _over[j]; - var _keys = tooltip_overlay[$ _title]; - - draw_set_text(f_p2, fa_left, fa_bottom, COLORS._main_text); - - var _tw = 0; - for( var i = 0, n = array_length(_keys); i < n; i++ ) - _tw = max(_tw, string_width(_keys[i][0])); - var _ttx = _tx + _tw + ui(16); - - for( var i = array_length(_keys) - 1; i >= 0; i-- ) { - draw_set_color(COLORS._main_icon); - draw_set_alpha(0.5); - draw_text_add(_tx, _ty, _keys[i][0]); - - draw_set_color(COLORS._main_text); - draw_set_alpha(0.5); - draw_text_add(_ttx, _ty, _keys[i][1]); - - _ty -= line_get_height(); - } - - _ty -= ui(4); - draw_set_text(f_p1b, fa_left, fa_bottom, COLORS._main_text); - draw_set_alpha(0.5); - draw_text_add(_tx, _ty, _title); - - _ty -= line_get_height() + ui(8); - } - - draw_set_alpha(1); - } - } - - tooltip_overlay = {}; + drawTooltipHints(); if(LOADING) { draw_set_color(CDEF.main_dkblack); @@ -2853,6 +2896,11 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { value_dragging = noone; } + function getFocusStr() { + var _n = array_safe_get(nodes_selecting, 0); + return instanceof(_n) == FOCUS_STR? _n : noone; + } + function doTransform() { for( var i = 0; i < array_length(nodes_selecting); i++ ) { var node = nodes_selecting[i]; @@ -3106,7 +3154,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { } - nodes_selecting = []; + nodes_selecting = [ _blend ]; + FOCUS_STR = instanceof(_blend); } function doCompose() { // @@ -3291,8 +3340,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { nodes_selecting = [ _node ]; node_dragging = _node; - _node.x = mouse_graph_x - _node.y = mouse_graph_y + _node.x = mouse_graph_x - _node.w / 2; + _node.y = mouse_graph_y - _node.h / 2; node_drag_mx = mouse_graph_x; node_drag_my = mouse_graph_y; diff --git a/scripts/panel_preference/panel_preference.gml b/scripts/panel_preference/panel_preference.gml index df73e7e4d..9177c1321 100644 --- a/scripts/panel_preference/panel_preference.gml +++ b/scripts/panel_preference/panel_preference.gml @@ -496,7 +496,7 @@ function Panel_Preference() : PanelContent() constructor { pref_node = ds_list_create(); ds_list_add(pref_node, __txt("Defaults")); - + ds_list_add(pref_node, new __Panel_Linear_Setting_Item_Preference( __txtx("pref_node_default_depth", "Default surface depth"), "node_default_depth", @@ -521,6 +521,14 @@ function Panel_Preference() : PanelContent() constructor { new textBox(TEXTBOX_INPUT.number, function(val) /*=>*/ { PREFERENCES.node_param_width = val; PREF_SAVE(); }) )); + ds_list_add(pref_node, __txt("Add node")); + + ds_list_add(pref_node, new __Panel_Linear_Setting_Item_Preference( + __txtx("pref_node_add_select", "Select node on add"), + "node_add_select", + new checkBox(function() /*=>*/ { PREFERENCES.node_add_select = !PREFERENCES.node_add_select; PREF_SAVE(); }) + )); + ds_list_add(pref_node, __txt("Display")); ds_list_add(pref_node, new __Panel_Linear_Setting_Item_Preference( @@ -1136,18 +1144,32 @@ function Panel_Preference() : PanelContent() constructor { var ctx = HOTKEY_CONTEXT[| j]; var _lst = []; - var ll = HOTKEYS[? ctx]; + var ll = HOTKEYS[$ ctx]; for(var i = 0; i < ds_list_size(ll); i++) array_push(_lst, ll[| i]); array_sort(_lst, function(s1, s2) /*=>*/ {return string_compare(s1.name, s2.name)}); array_push(hotkeyContext, { context: ctx, list: _lst }); - var _title = ctx == ""? "Global" : ctx; + var _title = ctx == 0? "Global" : ctx; _title = string_replace_all(_title, "_", " "); array_push(hotkeyArray, _title); } + array_push(hotkeyContext, -1); + array_push(hotkeyArray, -1); + + for( var i = array_length(hotkeyArray) - 2; i >= 0; i-- ) { + var _t = hotkeyArray[i]; + if(string_starts_with(_t, "Node")) { + array_push_to_back_index(hotkeyContext, i); + array_push_to_back_index(hotkeyArray, i); + } + } + + array_push(hotkeyContext, -1); + array_push(hotkeyArray, -1); + var keys = struct_get_names(HOTKEYS_CUSTOM); for( var i = 0, n = array_length(keys); i < n; i++ ) { var ctx = keys[i]; @@ -1168,12 +1190,18 @@ function Panel_Preference() : PanelContent() constructor { array_sort(_lst, function(s1, s2) /*=>*/ {return string_compare(s1.name, s2.name)}); array_push(hotkeyContext, { context: ctx, list: _lst }); - array_push(hotkeyArray, $" {ctx}"); + + var _title = ctx == 0? "Global" : ctx; + _title = string_replace_all(_title, "_", " "); + array_push(hotkeyArray, _title); } hk_page = 0; - hk_scroll = new scrollBox(hotkeyArray, function(val) /*=>*/ { hk_page = val; sp_hotkey.scroll_y_to = 0; }); - hk_scroll.align = fa_left; + hk_scroll = new scrollBox(hotkeyArray, function(val) /*=>*/ { hk_page = val; sp_hotkey.scroll_y_to = 0; }) + .setFont(f_p2) + .setHorizontal(true) + .setAlign(fa_left) + .setMinWidth(ui(128)) sp_hotkey = new scrollPane(panel_width, hotkey_height, function(_y, _m) { draw_clear_alpha(COLORS.panel_bg_clear_inner, 1); @@ -1221,8 +1249,21 @@ function Panel_Preference() : PanelContent() constructor { if(ind++ % 2 == 0) draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _yy - padd, _ww, th + padd * 2, COLORS.dialog_preference_prop_bg, 1); if(hotkey_focus_highlight == key) draw_sprite_stretched_add(THEME.ui_panel, 0, 0, _yy - padd, _ww, th + padd * 2, COLORS._main_accent, min(1, hotkey_focus_high_bg) * .5); - draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text); - draw_text_add(ui(24), _lb_y, name); + if(string_pos(">", name)) { + var _sp = string_split(name, ">"); + var _tx = ui(24); + + draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub); + draw_text_add(_tx, _lb_y, _sp[0]); + _tx += string_width(_sp[0]) + ui(8); + + draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text); + draw_text_add(_tx, _lb_y, _sp[1]); + + } else { + draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text); + draw_text_add(ui(24), _lb_y, name); + } var kw = string_width(dk); @@ -1745,7 +1786,6 @@ function Panel_Preference() : PanelContent() constructor { var _ppy = py + hotkey_cont_h; - hk_scroll.font = f_p2; hk_scroll.setFocusHover(pFOCUS, pHOVER); hk_scroll.draw(px, _ppy, ui(200), ui(24), hk_page, [ mx, my ], x, y); diff --git a/scripts/scrollBox/scrollBox.gml b/scripts/scrollBox/scrollBox.gml index 84538ff55..6dff16e67 100644 --- a/scripts/scrollBox/scrollBox.gml +++ b/scripts/scrollBox/scrollBox.gml @@ -28,18 +28,24 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor open_rx = 0; open_ry = 0; - align = fa_center; - horizontal = false; - extra_button = noone; - padding = ui(8); - item_pad = ui(8); - text_color = COLORS._main_text; + align = fa_center; + horizontal = false; + extra_button = noone; + padding = ui(8); + padding_scroll = ui(8); + item_pad = ui(8); + text_color = COLORS._main_text; + minWidth = 0; type = 0; hide = 0; - static setTextColor = function(_l = noone) { text_color = _l; return self; } - static setUpdateHover = function(_l = noone) { update_hover = _l; return self; } + static setHorizontal = function(_l) /*=>*/ { horizontal = _l; return self; } + static setAlign = function(_l) /*=>*/ { align = _l; return self; } + static setTextColor = function(_l) /*=>*/ { text_color = _l; return self; } + static setUpdateHover = function(_l) /*=>*/ { update_hover = _l; return self; } + static setMinWidth = function(_l) /*=>*/ { minWidth = _l; return self; } + static setPaddingScroll = function(_l) /*=>*/ { padding_scroll = _l; return self; } static trigger = function() { data = is_method(data_list)? data_list() : data_list; @@ -55,6 +61,7 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor text_pad = other.padding; item_pad = other.item_pad; update_hover = other.update_hover; + minWidth = other.minWidth; initScroll(other); } diff --git a/scripts/textBox/textBox.gml b/scripts/textBox/textBox.gml index 027c5e3cf..9d6d5cf0d 100644 --- a/scripts/textBox/textBox.gml +++ b/scripts/textBox/textBox.gml @@ -847,8 +847,6 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { } else { if(hover && hoverRect) { - print("Hover|"); - hovering = true; if(hide < 3) draw_sprite_stretched_ext(THEME.textbox, 1, _x, _y, _w, _h, boxColor, 0.5 + (0.5 * interactable)); diff --git a/scripts/theme_definition/theme_definition.gml b/scripts/theme_definition/theme_definition.gml index 679efb7e2..1f0becefd 100644 --- a/scripts/theme_definition/theme_definition.gml +++ b/scripts/theme_definition/theme_definition.gml @@ -104,6 +104,7 @@ function ThemeColor() constructor { node_path_overlay_control_line = CDEF.main_grey; node_wiggler_frame = CDEF.main_grey; node_border_file_drop = CDEF.cyan; + node_border_context = CDEF.yellow; scrollbar_bg = CDEF.main_dkblack; scrollbar_idle = CDEF.main_grey;