diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 4292bbda2..ecacd0e27 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -959,6 +959,7 @@ {"name":"node_palette","order":4,"path":"scripts/node_palette/node_palette.yy",}, {"name":"node_noise_bubble","order":17,"path":"scripts/node_noise_bubble/node_noise_bubble.yy",}, {"name":"buttonColor","order":1,"path":"scripts/buttonColor/buttonColor.yy",}, + {"name":"sh_rim","order":54,"path":"shaders/sh_rim/sh_rim.yy",}, {"name":"notification_system","order":7,"path":"scripts/notification_system/notification_system.yy",}, {"name":"buffer_object","order":1,"path":"scripts/buffer_object/buffer_object.yy",}, {"name":"node_3d_mesh_sphere_uv","order":4,"path":"scripts/node_3d_mesh_sphere_uv/node_3d_mesh_sphere_uv.yy",}, @@ -1760,6 +1761,7 @@ {"name":"addon","order":1,"path":"objects/addon/addon.yy",}, {"name":"_f_h3","order":3,"path":"fonts/_f_h3/_f_h3.yy",}, {"name":"s_node_math","order":1,"path":"sprites/s_node_math/s_node_math.yy",}, + {"name":"node_rim","order":22,"path":"scripts/node_rim/node_rim.yy",}, {"name":"s_node_kuwahara","order":59,"path":"sprites/s_node_kuwahara/s_node_kuwahara.yy",}, {"name":"panel_text_editor","order":11,"path":"scripts/panel_text_editor/panel_text_editor.yy",}, {"name":"node_path_bake","order":15,"path":"scripts/node_path_bake/node_path_bake.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 566ebbe18..f99d20f70 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -1243,6 +1243,7 @@ {"id":{"name":"vct_button","path":"scripts/vct_button/vct_button.yy",},}, {"id":{"name":"node_noise_bubble","path":"scripts/node_noise_bubble/node_noise_bubble.yy",},}, {"id":{"name":"buttonColor","path":"scripts/buttonColor/buttonColor.yy",},}, + {"id":{"name":"sh_rim","path":"shaders/sh_rim/sh_rim.yy",},}, {"id":{"name":"notification_system","path":"scripts/notification_system/notification_system.yy",},}, {"id":{"name":"buffer_object","path":"scripts/buffer_object/buffer_object.yy",},}, {"id":{"name":"node_3d_mesh_sphere_uv","path":"scripts/node_3d_mesh_sphere_uv/node_3d_mesh_sphere_uv.yy",},}, @@ -2157,6 +2158,7 @@ {"id":{"name":"string_decimal","path":"scripts/string_decimal/string_decimal.yy",},}, {"id":{"name":"_f_h3","path":"fonts/_f_h3/_f_h3.yy",},}, {"id":{"name":"s_node_math","path":"sprites/s_node_math/s_node_math.yy",},}, + {"id":{"name":"node_rim","path":"scripts/node_rim/node_rim.yy",},}, {"id":{"name":"s_node_kuwahara","path":"sprites/s_node_kuwahara/s_node_kuwahara.yy",},}, {"id":{"name":"panel_text_editor","path":"scripts/panel_text_editor/panel_text_editor.yy",},}, {"id":{"name":"node_path_bake","path":"scripts/node_path_bake/node_path_bake.yy",},}, diff --git a/fonts/_f_sdf/_f_sdf.old.png b/fonts/_f_sdf/_f_sdf.old.png index 7585a8eee..5044b0ab1 100644 Binary files a/fonts/_f_sdf/_f_sdf.old.png and b/fonts/_f_sdf/_f_sdf.old.png differ diff --git a/fonts/_f_sdf/_f_sdf.png b/fonts/_f_sdf/_f_sdf.png index f91c772b9..d2beecec9 100644 Binary files a/fonts/_f_sdf/_f_sdf.png and b/fonts/_f_sdf/_f_sdf.png differ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.old.png b/fonts/_f_sdf_medium/_f_sdf_medium.old.png index 71ab563ee..86a78eda9 100644 Binary files a/fonts/_f_sdf_medium/_f_sdf_medium.old.png and b/fonts/_f_sdf_medium/_f_sdf_medium.old.png differ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.png b/fonts/_f_sdf_medium/_f_sdf_medium.png index 9d68de87e..216fdd2c9 100644 Binary files a/fonts/_f_sdf_medium/_f_sdf_medium.png and b/fonts/_f_sdf_medium/_f_sdf_medium.png differ diff --git a/objects/o_dialog_assetbox/Create_0.gml b/objects/o_dialog_assetbox/Create_0.gml index 0a6a1b2c6..6636f119c 100644 --- a/objects/o_dialog_assetbox/Create_0.gml +++ b/objects/o_dialog_assetbox/Create_0.gml @@ -11,7 +11,7 @@ event_inherited(); dialog_h = ui(360); title_height = 48; - anchor = ANCHOR.top | ANCHOR.right; + anchor = ANCHOR.top | ANCHOR.left; dialog_resizable = true; dialog_w_min = ui(200); diff --git a/scripts/__node_3d_mesh/__node_3d_mesh.gml b/scripts/__node_3d_mesh/__node_3d_mesh.gml index c2174e057..d9717fa8f 100644 --- a/scripts/__node_3d_mesh/__node_3d_mesh.gml +++ b/scripts/__node_3d_mesh/__node_3d_mesh.gml @@ -1,6 +1,5 @@ function Node_3D_Mesh(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group) constructor { name = "3D Mesh"; - min_h = 128; in_mesh = ds_list_size(inputs); diff --git a/scripts/__node_VFX_effector/__node_VFX_effector.gml b/scripts/__node_VFX_effector/__node_VFX_effector.gml index 5fa337ea5..da4127af8 100644 --- a/scripts/__node_VFX_effector/__node_VFX_effector.gml +++ b/scripts/__node_VFX_effector/__node_VFX_effector.gml @@ -16,10 +16,8 @@ function Node_VFX_effector(_x, _y, _group = noone) : Node(_x, _y, _group) constr manual_ungroupable = false; node_draw_icon = s_node_vfx_accel; - - w = 96; - h = 80; - min_h = h; + + setDimension(96, 80); seed = 1; inputs[| 0] = nodeValue("Particles", self, JUNCTION_CONNECT.input, VALUE_TYPE.particle, -1 ) diff --git a/scripts/__node_shader/__node_shader.gml b/scripts/__node_shader/__node_shader.gml index 42d5a88cd..eb3d933bf 100644 --- a/scripts/__node_shader/__node_shader.gml +++ b/scripts/__node_shader/__node_shader.gml @@ -2,6 +2,7 @@ enum SHADER_UNIFORM { integer, float, color, + texture, } function addShaderProp(_type = undefined, _key = undefined) { @@ -33,13 +34,14 @@ function Node_Shader(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co else shader_set_f(_dat.key, _data[i]); break; + case SHADER_UNIFORM.color : shader_set_color(_dat.key, _data[i]); break; + + case SHADER_UNIFORM.texture : shader_set_surface(_dat.key, _data[i]); break; } } } #endregion - static processData = function(_outSurf, _data, _output_index, _array_index) { #region - return _outSurf; - } #endregion + static processData = function(_outSurf, _data, _output_index, _array_index) { return _outSurf; } } \ No newline at end of file diff --git a/scripts/__node_shader_processor/__node_shader_processor.gml b/scripts/__node_shader_processor/__node_shader_processor.gml index 2827f88f8..6337620e4 100644 --- a/scripts/__node_shader_processor/__node_shader_processor.gml +++ b/scripts/__node_shader_processor/__node_shader_processor.gml @@ -1,13 +1,12 @@ function Node_Shader_Processor(_x, _y, _group = noone) : Node_Shader(_x, _y, _group) constructor { name = ""; - inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF ) - .setDisplay(VALUE_DISPLAY.vector); + inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone ); addShaderProp(); attribute_surface_depth(); - static processData = function(_outSurf, _data, _output_index, _array_index) { #region + static processShader = function(_outSurf, _data) { #region var _surf = _data[0]; if(!is_surface(_surf)) return _outSurf; @@ -17,10 +16,16 @@ function Node_Shader_Processor(_x, _y, _group = noone) : Node_Shader(_x, _y, _gr _outSurf = surface_verify(_outSurf, _sw, _sh, attrDepth()); surface_set_shader(_outSurf, shader); + shader_set_f("u_resolution", _sw, _sh); setShader(_data); + draw_surface_safe(_surf); surface_reset_shader(); return _outSurf; } #endregion + + static processData = function(_outSurf, _data, _output_index, _array_index) { #region + return processShader(_outSurf, _data); + } #endregion } \ No newline at end of file diff --git a/scripts/areaBox/areaBox.gml b/scripts/areaBox/areaBox.gml index 7811dba9d..074c7f651 100644 --- a/scripts/areaBox/areaBox.gml +++ b/scripts/areaBox/areaBox.gml @@ -126,6 +126,11 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { unit.triggerButton.register(parent); } #endregion + static isHovering = function() { + for( var i = 0, n = array_length(tb); i < n; i++ ) if(tb[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { #region setParam(params); for(var i = 0; i < 4; i++) tb[i].setParam(params); @@ -146,15 +151,8 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { var _bact = adjust_shape && active; var _bhov = adjust_shape && hover; var _bind = array_safe_get(_data, 4); - - if(!is_array(_bind) && buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, _bact, _bhov,, THEME.inspector_area, _bind) == 2) { - var val = (array_safe_get(_data, 4) + 1) % 2; - onModify(4, val); - } - - var _tx =_x + _bs + ui(4); - - if(onSurfaceSize != -1) { + + if(_w - _bs > ui(100) && onSurfaceSize != -1) { tooltip.index = mode; var _bx = _x + _w - _bs; @@ -237,23 +235,33 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { _w -= _bs + ui(4); } - _w -= _bs + ui(4); - - if(mode == AREA_MODE.padding) { #region - var cc = link_value? COLORS._main_accent : COLORS._main_icon; - var _bx = _x; - var _by = _y + _h + ui(4) + _h / 2 - _bs / 2; - var _btxt = __txt("Link values"); + if(_w - _bs > ui(100)) { #region + + if(!is_array(_bind) && buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, _bact, _bhov,, THEME.inspector_area, _bind) == 2) { + var val = (array_safe_get(_data, 4) + 1) % 2; + onModify(4, val); + } + + if(mode == AREA_MODE.padding) { + var cc = link_value? COLORS._main_accent : COLORS._main_icon; + var _bx = _x; + var _by = _y + _h + ui(4) + _h / 2 - _bs / 2; + var _btxt = __txt("Link values"); + + if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, active, hover, _btxt, THEME.value_link, link_value, cc) == 2) + link_value = !link_value; + } + + _w -= _bs + ui(4); + _x +=_bs + ui(4); - if(buttonInstant(THEME.button_hide, _bx, _by, _bs, _bs, _m, active, hover, _btxt, THEME.value_link, link_value, cc) == 2) - link_value = !link_value; } #endregion - draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y, _w, _h, c_white, 1); - draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y, _w, _h, c_white, 0.5 + 0.5 * interactable); + draw_sprite_stretched_ext(THEME.textbox, 3, _x, _y, _w, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, c_white, 0.5 + 0.5 * interactable); - draw_sprite_stretched_ext(THEME.textbox, 3, _tx, _y + _h + ui(4), _w, _h, c_white, 1); - draw_sprite_stretched_ext(THEME.textbox, 0, _tx, _y + _h + ui(4), _w, _h, c_white, 0.5 + 0.5 * interactable); + draw_sprite_stretched_ext(THEME.textbox, 3, _x, _y + _h + ui(4), _w, _h, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y + _h + ui(4), _w, _h, c_white, 0.5 + 0.5 * interactable); for(var i = 0; i < 4; i++) tb[i].setFocusHover(active, hover); @@ -264,10 +272,10 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { var tb_h = _h; if(mode == AREA_MODE.area) { #region - var tb_x0 = _tx; + var tb_x0 = _x; var tb_y0 = _y; - var tb_x1 = _tx + tb_w; + var tb_x1 = _x + tb_w; var tb_y1 = _y + _h + ui(4); tb[0].label = "x"; @@ -284,16 +292,16 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { #endregion } else if(mode == AREA_MODE.padding) { #region - var tb_lx = _tx; + var tb_lx = _x; var tb_ly = _y; - var tb_rx = _tx + tb_w; + var tb_rx = _x + tb_w; var tb_ry = _y; - var tb_tx = _tx; + var tb_tx = _x; var tb_ty = _y + _h + ui(4); - var tb_bx = _tx + tb_w; + var tb_bx = _x + tb_w; var tb_by = _y + _h + ui(4); tb[2].label = "l"; @@ -310,10 +318,10 @@ function areaBox(_onModify, _unit = noone) : widget() constructor { #endregion } else if(mode == AREA_MODE.two_point) { #region - var tb_x0 = _tx; + var tb_x0 = _x; var tb_y0 = _y; - var tb_x1 = _tx + tb_w; + var tb_x1 = _x + tb_w; var tb_y1 = _y + _h + ui(4); tb[0].label = "x0"; diff --git a/scripts/button/button.gml b/scripts/button/button.gml index da67ed0a1..ec82f1b98 100644 --- a/scripts/button/button.gml +++ b/scripts/button/button.gml @@ -68,12 +68,14 @@ function buttonClass(_onClick, _icon = noone) : widget() constructor { w = _w; h = _h; - clicked = false; + clicked = false; + hovering = hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h); var b = colorMultiply(self.blend, blend); if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h)) { draw_sprite_stretched_ext(spr, toggled? 2 : 1, _x, _y, _w, _h, b, 1); + if(!activate_on_press && pressed && mouse_release(mb_left, active)) trigger(); diff --git a/scripts/buttonAnchor/buttonAnchor.gml b/scripts/buttonAnchor/buttonAnchor.gml index ec0283389..2fc2e0036 100644 --- a/scripts/buttonAnchor/buttonAnchor.gml +++ b/scripts/buttonAnchor/buttonAnchor.gml @@ -14,6 +14,7 @@ function buttonAnchor(_onClick) : widget() constructor { var cx = x + w / 2; var cy = y + h / 2; + hovering = false; for( var i = -1; i <= 1; i++ ) for( var j = -1; j <= 1; j++ ) { @@ -27,7 +28,11 @@ function buttonAnchor(_onClick) : widget() constructor { draw_sprite_ext(THEME.prop_anchor, _in == index, _bx, _by, 1, 1, 0, cc, aa); - if(hov && mouse_click(mb_left, active)) onClick(_in); + if(hov) { + hovering = true; + if(mouse_click(mb_left, active)) + onClick(_in); + } } resetFocus(); diff --git a/scripts/buttonColor/buttonColor.gml b/scripts/buttonColor/buttonColor.gml index 56338c9b3..217ea65c3 100644 --- a/scripts/buttonColor/buttonColor.gml +++ b/scripts/buttonColor/buttonColor.gml @@ -67,11 +67,12 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor { w = _w; h = _h; current_color = _color; + hovering = hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h); var _cw = _w; var _bs = min(_h, ui(32)); - if(interactable) { + if(_w - _bs > ui(64) && interactable) { var bx = _x + _cw - ui(32); _cw -= ui(32); @@ -103,6 +104,7 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor { var click = false; if(ihover && hoverRect) { draw_sprite_stretched(THEME.button, 1, _x, _y, _cw, _h); + if(mouse_press(mb_left, iactive)) { trigger(); click = true; diff --git a/scripts/buttonGradient/buttonGradient.gml b/scripts/buttonGradient/buttonGradient.gml index ec968ab07..65b18efb2 100644 --- a/scripts/buttonGradient/buttonGradient.gml +++ b/scripts/buttonGradient/buttonGradient.gml @@ -27,10 +27,13 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { y = _y; w = _w; - if(side_button && instanceof(side_button) == "buttonClass") { + var _bs = min(_h, ui(32)); + hovering = hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h); + + if(_w - _bs > ui(100) && side_button && instanceof(side_button) == "buttonClass") { side_button.setFocusHover(active, hover); - side_button.draw(_x + _w - ui(32), _y + _h / 2 - ui(32 / 2), ui(32), ui(32), _m, THEME.button_hide); - _w -= ui(40); + side_button.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); + _w -= _bs + ui(8); } var _gw = _w - ui(8); diff --git a/scripts/buttonGroup/buttonGroup.gml b/scripts/buttonGroup/buttonGroup.gml index f4970a900..80f29ab3f 100644 --- a/scripts/buttonGroup/buttonGroup.gml +++ b/scripts/buttonGroup/buttonGroup.gml @@ -54,6 +54,7 @@ function buttonGroup(_data, _onClick) : widget() constructor { current_selecting = _selecting; while(is_array(current_selecting)) current_selecting = array_safe_get(current_selecting, 0); + hovering = hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h); var amo = array_length(data); var ww = _w / amo; diff --git a/scripts/buttonPalette/buttonPalette.gml b/scripts/buttonPalette/buttonPalette.gml index aa3d8a24f..6731c0dd9 100644 --- a/scripts/buttonPalette/buttonPalette.gml +++ b/scripts/buttonPalette/buttonPalette.gml @@ -28,10 +28,13 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor { w = _w; h = _h; - if(side_button && instanceof(side_button) == "buttonClass") { + var _bs = min(_h, ui(32)); + hovering = hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h); + + if(_w - _bs > ui(100) && side_button && instanceof(side_button) == "buttonClass") { side_button.setFocusHover(active, hover); - side_button.draw(_x + _w - ui(32), _y + _h / 2 - ui(32 / 2), ui(32), ui(32), _m, THEME.button_hide); - _w -= ui(40); + side_button.draw(_x + _w -_bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); + _w -= _bs + ui(8); } var _pw = _w - ui(8); diff --git a/scripts/controlPointBox/controlPointBox.gml b/scripts/controlPointBox/controlPointBox.gml index 1659ea875..8791b9817 100644 --- a/scripts/controlPointBox/controlPointBox.gml +++ b/scripts/controlPointBox/controlPointBox.gml @@ -56,6 +56,11 @@ function controlPointBox(_onModify) : widget() constructor { widgets[i].register(parent); } + static isHovering = function() { + for( var i = 0, n = array_length(widgets); i < n; i++ ) if(widgets[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { #region setParam(params); tbCx.setParam(params); diff --git a/scripts/cornerBox/cornerBox.gml b/scripts/cornerBox/cornerBox.gml index 432257e17..bfc80a908 100644 --- a/scripts/cornerBox/cornerBox.gml +++ b/scripts/cornerBox/cornerBox.gml @@ -51,6 +51,11 @@ function cornerBox(_onModify, _unit = noone) : widget() constructor { tb[3].register(parent); } + static isHovering = function() { + for( var i = 0, n = array_length(tb); i < n; i++ ) if(tb[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { setParam(params); for(var i = 0; i < 4; i++) tb[i].setParam(params); diff --git a/scripts/curveBox/curveBox.gml b/scripts/curveBox/curveBox.gml index 3e7f02aaf..5f0f30430 100644 --- a/scripts/curveBox/curveBox.gml +++ b/scripts/curveBox/curveBox.gml @@ -44,6 +44,7 @@ function curveBox(_onModify) : widget() constructor { h = _h; var cw = _w - ui(32); + hovering = false; if(!is_array(_data) || array_length(_data) == 0) return 0; if(is_array(_data[0])) return 0; @@ -304,6 +305,7 @@ function curveBox(_onModify) : widget() constructor { if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + cw, _y + _h)) { #region show_coord = true; + hovering = true; if(mouse_press(mb_left, active)) { if(node_hovering == -1) { diff --git a/scripts/matrixGrid/matrixGrid.gml b/scripts/matrixGrid/matrixGrid.gml index 813ce600a..d6fedd472 100644 --- a/scripts/matrixGrid/matrixGrid.gml +++ b/scripts/matrixGrid/matrixGrid.gml @@ -76,6 +76,11 @@ function matrixGrid(_type, _size, _onModify, _unit = noone) : widget() construct tb[i].setSlidable(speed); } + static isHovering = function() { + for( var i = 0, n = array_length(tb); i < n; i++ ) if(tb[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { setParam(params); for(var i = 0; i < inputs; i++) diff --git a/scripts/node_3d_repeat/node_3d_repeat.gml b/scripts/node_3d_repeat/node_3d_repeat.gml index 594d3cacf..237dbfefb 100644 --- a/scripts/node_3d_repeat/node_3d_repeat.gml +++ b/scripts/node_3d_repeat/node_3d_repeat.gml @@ -1,7 +1,6 @@ function Node_3D_Repeat(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor { name = "3D Repeat"; - min_h = 128; - + inputs[| 0] = nodeValue("Objects", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3Mesh, noone ) .setArrayDepth(1) .setVisible(true, true); diff --git a/scripts/node_FFT/node_FFT.gml b/scripts/node_FFT/node_FFT.gml index f1d07acb7..2e025f740 100644 --- a/scripts/node_FFT/node_FFT.gml +++ b/scripts/node_FFT/node_FFT.gml @@ -1,9 +1,6 @@ function Node_FFT(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { - name = "FFT"; - - w = 96; - h = 72; - min_h = h; + name = "FFT"; + setDimension(96, 72); inputs[| 0] = nodeValue("Data", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, []) .setArrayDepth(1) diff --git a/scripts/node_FLIP_add_rigidbody/node_FLIP_add_rigidbody.gml b/scripts/node_FLIP_add_rigidbody/node_FLIP_add_rigidbody.gml index b721337fd..450d927fe 100644 --- a/scripts/node_FLIP_add_rigidbody/node_FLIP_add_rigidbody.gml +++ b/scripts/node_FLIP_add_rigidbody/node_FLIP_add_rigidbody.gml @@ -2,8 +2,7 @@ function Node_FLIP_Add_Rigidbody(_x, _y, _group = noone) : Node(_x, _y, _group) name = "Add Rigidbody"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_FLIP_apply_force/node_FLIP_apply_force.gml b/scripts/node_FLIP_apply_force/node_FLIP_apply_force.gml index c1fb4f7db..a01fe940c 100644 --- a/scripts/node_FLIP_apply_force/node_FLIP_apply_force.gml +++ b/scripts/node_FLIP_apply_force/node_FLIP_apply_force.gml @@ -18,8 +18,7 @@ function Node_FLIP_Apply_Force(_x, _y, _group = noone) : Node(_x, _y, _group) co name = "Add Collider"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_FLIP_apply_velocity/node_FLIP_apply_velocity.gml b/scripts/node_FLIP_apply_velocity/node_FLIP_apply_velocity.gml index 951494b08..ad7a441e6 100644 --- a/scripts/node_FLIP_apply_velocity/node_FLIP_apply_velocity.gml +++ b/scripts/node_FLIP_apply_velocity/node_FLIP_apply_velocity.gml @@ -2,8 +2,7 @@ function Node_FLIP_Apply_Velocity(_x, _y, _group = noone) : Node(_x, _y, _group) name = "Apply Velocity"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_FLIP_destroy/node_FLIP_destroy.gml b/scripts/node_FLIP_destroy/node_FLIP_destroy.gml index 3e33a1da4..8f313d930 100644 --- a/scripts/node_FLIP_destroy/node_FLIP_destroy.gml +++ b/scripts/node_FLIP_destroy/node_FLIP_destroy.gml @@ -2,8 +2,7 @@ function Node_FLIP_Destroy(_x, _y, _group = noone) : Node(_x, _y, _group) constr name = "Destroy Fluid"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_FLIP_domain/node_FLIP_domain.gml b/scripts/node_FLIP_domain/node_FLIP_domain.gml index 187667d92..ce55a7545 100644 --- a/scripts/node_FLIP_domain/node_FLIP_domain.gml +++ b/scripts/node_FLIP_domain/node_FLIP_domain.gml @@ -2,8 +2,7 @@ function Node_FLIP_Domain(_x, _y, _group = noone) : Node(_x, _y, _group) constru name = "Domain"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; update_on_frame = true; diff --git a/scripts/node_FLIP_repel/node_FLIP_repel.gml b/scripts/node_FLIP_repel/node_FLIP_repel.gml index d8e79df88..9d6a27fb8 100644 --- a/scripts/node_FLIP_repel/node_FLIP_repel.gml +++ b/scripts/node_FLIP_repel/node_FLIP_repel.gml @@ -2,8 +2,7 @@ function Node_FLIP_Repel(_x, _y, _group = noone) : Node(_x, _y, _group) construc name = "Repel"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_FLIP_spawner/node_FLIP_spawner.gml b/scripts/node_FLIP_spawner/node_FLIP_spawner.gml index c188fb9b7..8aa192f4b 100644 --- a/scripts/node_FLIP_spawner/node_FLIP_spawner.gml +++ b/scripts/node_FLIP_spawner/node_FLIP_spawner.gml @@ -2,8 +2,7 @@ function Node_FLIP_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group) constr name = "Spawner"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_FLIP_to_VFX/node_FLIP_to_VFX.gml b/scripts/node_FLIP_to_VFX/node_FLIP_to_VFX.gml index e8d73c45e..356eb6095 100644 --- a/scripts/node_FLIP_to_VFX/node_FLIP_to_VFX.gml +++ b/scripts/node_FLIP_to_VFX/node_FLIP_to_VFX.gml @@ -2,8 +2,7 @@ function Node_FLIP_to_VFX(_x, _y, _group = noone) : Node(_x, _y, _group) constru name = "FLIP to VFX"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_FLIP_update/node_FLIP_update.gml b/scripts/node_FLIP_update/node_FLIP_update.gml index 700a86417..447c1d61e 100644 --- a/scripts/node_FLIP_update/node_FLIP_update.gml +++ b/scripts/node_FLIP_update/node_FLIP_update.gml @@ -2,8 +2,7 @@ function Node_FLIP_Update(_x, _y, _group = noone) : Node(_x, _y, _group) constru name = "Update"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_FLIP_vortex/node_FLIP_vortex.gml b/scripts/node_FLIP_vortex/node_FLIP_vortex.gml index 20cfeb172..10472baf5 100644 --- a/scripts/node_FLIP_vortex/node_FLIP_vortex.gml +++ b/scripts/node_FLIP_vortex/node_FLIP_vortex.gml @@ -2,8 +2,7 @@ function Node_FLIP_Vortex(_x, _y, _group = noone) : Node(_x, _y, _group) constru name = "Vortex"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_FLIP_wall/node_FLIP_wall.gml b/scripts/node_FLIP_wall/node_FLIP_wall.gml index bfec41355..9ae6f6797 100644 --- a/scripts/node_FLIP_wall/node_FLIP_wall.gml +++ b/scripts/node_FLIP_wall/node_FLIP_wall.gml @@ -2,8 +2,7 @@ function Node_FLIP_Wall(_x, _y, _group = noone) : Node(_x, _y, _group) construct name = "Wall"; color = COLORS.node_blend_fluid; icon = THEME.fluid_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_VFX_override/node_VFX_override.gml b/scripts/node_VFX_override/node_VFX_override.gml index f153cec21..2bca1e5f7 100644 --- a/scripts/node_VFX_override/node_VFX_override.gml +++ b/scripts/node_VFX_override/node_VFX_override.gml @@ -5,10 +5,7 @@ function Node_VFX_Override(_x, _y, _group = noone) : Node(_x, _y, _group) constr node_draw_icon = s_node_vfx_override; manual_ungroupable = false; - - w = 96; - h = 80; - min_h = h; + setDimension(96, 80); inputs[| 0] = nodeValue("Particles", self, JUNCTION_CONNECT.input, VALUE_TYPE.particle, -1 ) .setVisible(true, true); diff --git a/scripts/node_VFX_renderer_output/node_VFX_renderer_output.gml b/scripts/node_VFX_renderer_output/node_VFX_renderer_output.gml index 7b0c936b7..f362a8745 100644 --- a/scripts/node_VFX_renderer_output/node_VFX_renderer_output.gml +++ b/scripts/node_VFX_renderer_output/node_VFX_renderer_output.gml @@ -4,11 +4,7 @@ function Node_VFX_Renderer_Output(_x, _y, _group = noone) : Node_Group_Output(_x icon = THEME.vfx; use_cache = CACHE_USE.auto; - manual_ungroupable = false; - - w = 128; - h = 128; - min_h = h; + manual_ungroupable = false; previewable = true; inputs[| 0] = nodeValue("Output dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF) diff --git a/scripts/node_VFX_variable/node_VFX_variable.gml b/scripts/node_VFX_variable/node_VFX_variable.gml index e44f83427..a386e84ee 100644 --- a/scripts/node_VFX_variable/node_VFX_variable.gml +++ b/scripts/node_VFX_variable/node_VFX_variable.gml @@ -3,12 +3,10 @@ function Node_VFX_Variable(_x, _y, _group = noone) : Node(_x, _y, _group) constr color = COLORS.node_blend_vfx; icon = THEME.vfx; node_draw_icon = s_node_vfx_variable; + setDimension(96, 80); manual_ungroupable = false; - w = 96; - h = 80; - min_h = h; inputs[| 0] = nodeValue("Particles", self, JUNCTION_CONNECT.input, VALUE_TYPE.particle, -1 ) .setVisible(true, true); diff --git a/scripts/node_animation_control/node_animation_control.gml b/scripts/node_animation_control/node_animation_control.gml index 22a7dd173..44c72dc61 100644 --- a/scripts/node_animation_control/node_animation_control.gml +++ b/scripts/node_animation_control/node_animation_control.gml @@ -1,9 +1,6 @@ function Node_Animation_Control(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Animation Control"; - - w = 96; - h = 96; - min_h = h; + name = "Animation Control"; + setDimension(96, 96); inputs[| 0] = nodeValue("Toggle Play / Pause", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, 0); diff --git a/scripts/node_argument/node_argument.gml b/scripts/node_argument/node_argument.gml index 99327ef6c..bf8bf3cc7 100644 --- a/scripts/node_argument/node_argument.gml +++ b/scripts/node_argument/node_argument.gml @@ -1,7 +1,6 @@ function Node_Argument(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Argument"; - w = 96; - min_h = 32 + 24 * 1; + setDimension(96, 32 + 24 * 1); draw_padding = 8; diff --git a/scripts/node_armature/node_armature.gml b/scripts/node_armature/node_armature.gml index d5dc27b7d..7b42b1fb6 100644 --- a/scripts/node_armature/node_armature.gml +++ b/scripts/node_armature/node_armature.gml @@ -1,9 +1,6 @@ function Node_Armature(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Armature Create"; - - w = 96; - h = 72; - min_h = h; + setDimension(96, 72); //inputs[| 0] = nodeValue("Axis", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0); diff --git a/scripts/node_armature_path/node_armature_path.gml b/scripts/node_armature_path/node_armature_path.gml index 0c9705a34..db1c2f6f6 100644 --- a/scripts/node_armature_path/node_armature_path.gml +++ b/scripts/node_armature_path/node_armature_path.gml @@ -1,8 +1,6 @@ function Node_Armature_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Armature Path"; - w = 96; - h = 72; - min_h = h; + name = "Armature Path"; + setDimension(96, 72); inputs[| 0] = nodeValue("Armature", self, JUNCTION_CONNECT.input, VALUE_TYPE.armature, noone) .setVisible(true, true) diff --git a/scripts/node_armature_pose/node_armature_pose.gml b/scripts/node_armature_pose/node_armature_pose.gml index e5d210748..ce5c949d5 100644 --- a/scripts/node_armature_pose/node_armature_pose.gml +++ b/scripts/node_armature_pose/node_armature_pose.gml @@ -1,9 +1,6 @@ function Node_Armature_Pose(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Armature Pose"; - - w = 96; - h = 72; - min_h = h; + setDimension(96, 72); inputs[| 0] = nodeValue("Armature", self, JUNCTION_CONNECT.input, VALUE_TYPE.armature, noone) .setVisible(true, true); diff --git a/scripts/node_armature_sample/node_armature_sample.gml b/scripts/node_armature_sample/node_armature_sample.gml index 627351494..6aae8b4e3 100644 --- a/scripts/node_armature_sample/node_armature_sample.gml +++ b/scripts/node_armature_sample/node_armature_sample.gml @@ -1,8 +1,6 @@ function Node_Armature_Sample(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Armature Sample"; - w = 96; - h = 72; - min_h = h; + name = "Armature Sample"; + setDimension(96, 72); inputs[| 0] = nodeValue("Armature", self, JUNCTION_CONNECT.input, VALUE_TYPE.armature, noone) .setVisible(true, true) diff --git a/scripts/node_array_add/node_array_add.gml b/scripts/node_array_add/node_array_add.gml index c75593949..ca5a56fa5 100644 --- a/scripts/node_array_add/node_array_add.gml +++ b/scripts/node_array_add/node_array_add.gml @@ -1,8 +1,6 @@ function Node_Array_Add(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Add"; - - w = 96; - h = 32 + 24; + setDimension(96, 32 + 24); min_h = h; inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) diff --git a/scripts/node_array_composite/node_array_composite.gml b/scripts/node_array_composite/node_array_composite.gml index 12b09f2a1..d71e3a55a 100644 --- a/scripts/node_array_composite/node_array_composite.gml +++ b/scripts/node_array_composite/node_array_composite.gml @@ -1,9 +1,6 @@ function Node_Array_Composite(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Composite"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Composite"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, []) .setArrayDepth(1) diff --git a/scripts/node_array_convolute/node_array_convolute.gml b/scripts/node_array_convolute/node_array_convolute.gml index 255daf643..486860878 100644 --- a/scripts/node_array_convolute/node_array_convolute.gml +++ b/scripts/node_array_convolute/node_array_convolute.gml @@ -1,9 +1,6 @@ function Node_Array_Convolute(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Convolute"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Convolute"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setArrayDepth(1) diff --git a/scripts/node_array_copy/node_array_copy.gml b/scripts/node_array_copy/node_array_copy.gml index b36d94bda..5e8d39c0e 100644 --- a/scripts/node_array_copy/node_array_copy.gml +++ b/scripts/node_array_copy/node_array_copy.gml @@ -1,9 +1,6 @@ function Node_Array_Copy(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Copy"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Copy"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setArrayDepth(1) diff --git a/scripts/node_array_csv_parse/node_array_csv_parse.gml b/scripts/node_array_csv_parse/node_array_csv_parse.gml index da02cb6e5..829c92136 100644 --- a/scripts/node_array_csv_parse/node_array_csv_parse.gml +++ b/scripts/node_array_csv_parse/node_array_csv_parse.gml @@ -1,9 +1,6 @@ function Node_Array_CSV_Parse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "CSV Parse"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "CSV Parse"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("CSV string", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, 0) .setVisible(true, true); diff --git a/scripts/node_array_find/node_array_find.gml b/scripts/node_array_find/node_array_find.gml index d8454d983..912817383 100644 --- a/scripts/node_array_find/node_array_find.gml +++ b/scripts/node_array_find/node_array_find.gml @@ -1,9 +1,6 @@ function Node_Array_Find(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Find"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Find"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setVisible(true, true); diff --git a/scripts/node_array_get/node_array_get.gml b/scripts/node_array_get/node_array_get.gml index be2f80a01..bc296695f 100644 --- a/scripts/node_array_get/node_array_get.gml +++ b/scripts/node_array_get/node_array_get.gml @@ -1,9 +1,6 @@ function Node_Array_Get(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Get"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Get"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setVisible(true, true); diff --git a/scripts/node_array_insert/node_array_insert.gml b/scripts/node_array_insert/node_array_insert.gml index 9e64cd491..2af23287b 100644 --- a/scripts/node_array_insert/node_array_insert.gml +++ b/scripts/node_array_insert/node_array_insert.gml @@ -1,9 +1,6 @@ function Node_Array_Insert(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Insert"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Insert"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setVisible(true, true); diff --git a/scripts/node_array_length/node_array_length.gml b/scripts/node_array_length/node_array_length.gml index 18509e857..fab080e44 100644 --- a/scripts/node_array_length/node_array_length.gml +++ b/scripts/node_array_length/node_array_length.gml @@ -1,9 +1,6 @@ function Node_Array_Length(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Length"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Length"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setVisible(true, true); diff --git a/scripts/node_array_rearrange/node_array_rearrange.gml b/scripts/node_array_rearrange/node_array_rearrange.gml index 275c61cc7..eb1cc631b 100644 --- a/scripts/node_array_rearrange/node_array_rearrange.gml +++ b/scripts/node_array_rearrange/node_array_rearrange.gml @@ -116,15 +116,11 @@ function Node_Array_Rearrange(_x, _y, _group = noone) : Node(_x, _y, _group) con outputs[| 0].setType(_typ); if(type != _typ) { - if(_typ == VALUE_TYPE.surface) { - w = 128; - h = 128; - min_h = h; - } else { - w = 96; - h = 32 + 24; - min_h = h; - } + if(_typ == VALUE_TYPE.surface) + setDimension(128, 128); + else + setDimension(96, 32 + 24); + type = _typ; will_setHeight = true; } diff --git a/scripts/node_array_remove/node_array_remove.gml b/scripts/node_array_remove/node_array_remove.gml index bd1c48981..5fdc2896c 100644 --- a/scripts/node_array_remove/node_array_remove.gml +++ b/scripts/node_array_remove/node_array_remove.gml @@ -1,9 +1,6 @@ function Node_Array_Remove(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Remove"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Remove"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setVisible(true, true); diff --git a/scripts/node_array_reverse/node_array_reverse.gml b/scripts/node_array_reverse/node_array_reverse.gml index 78b73157f..516112abf 100644 --- a/scripts/node_array_reverse/node_array_reverse.gml +++ b/scripts/node_array_reverse/node_array_reverse.gml @@ -1,9 +1,6 @@ function Node_Array_Reverse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Reverse"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Reverse"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setVisible(true, true); diff --git a/scripts/node_array_sample/node_array_sample.gml b/scripts/node_array_sample/node_array_sample.gml index 0a4be49ec..8b1d133f8 100644 --- a/scripts/node_array_sample/node_array_sample.gml +++ b/scripts/node_array_sample/node_array_sample.gml @@ -1,9 +1,6 @@ function Node_Array_Sample(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Sample"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Sample"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, []) .setArrayDepth(1) diff --git a/scripts/node_array_set/node_array_set.gml b/scripts/node_array_set/node_array_set.gml index 1088fedad..e65794ef4 100644 --- a/scripts/node_array_set/node_array_set.gml +++ b/scripts/node_array_set/node_array_set.gml @@ -1,9 +1,6 @@ function Node_Array_Set(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Set"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Set"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setVisible(true, true); diff --git a/scripts/node_array_shift/node_array_shift.gml b/scripts/node_array_shift/node_array_shift.gml index 1d4b1e99b..e7ba31aa4 100644 --- a/scripts/node_array_shift/node_array_shift.gml +++ b/scripts/node_array_shift/node_array_shift.gml @@ -1,9 +1,6 @@ function Node_Array_Shift(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Array Shift"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "Array Shift"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setVisible(true, true); diff --git a/scripts/node_array_zip/node_array_zip.gml b/scripts/node_array_zip/node_array_zip.gml index ae2f8ec05..40551e929 100644 --- a/scripts/node_array_zip/node_array_zip.gml +++ b/scripts/node_array_zip/node_array_zip.gml @@ -1,9 +1,6 @@ function Node_Array_Zip(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Zip"; - - w = 96; - h = 32 + 24; - min_h = h; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Array", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, 0) .setVisible(true, true); diff --git a/scripts/node_audio_loudness/node_audio_loudness.gml b/scripts/node_audio_loudness/node_audio_loudness.gml index abe0ea6f0..feb87fd0a 100644 --- a/scripts/node_audio_loudness/node_audio_loudness.gml +++ b/scripts/node_audio_loudness/node_audio_loudness.gml @@ -1,9 +1,6 @@ function Node_Audio_Loudness(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { - name = "Audio Loudness"; - - w = 96; - h = 72; - min_h = h; + name = "Audio Loudness"; + setDimension(96, 72); inputs[| 0] = nodeValue("Audio Data", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, []) .setArrayDepth(1) diff --git a/scripts/node_audio_window/node_audio_window.gml b/scripts/node_audio_window/node_audio_window.gml index 325efd432..26fa96496 100644 --- a/scripts/node_audio_window/node_audio_window.gml +++ b/scripts/node_audio_window/node_audio_window.gml @@ -1,9 +1,5 @@ function Node_Audio_Window(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Audio Window"; - - w = 128; - h = 128; - min_h = h; + name = "Audio Window"; inputs[| 0] = nodeValue("Audio data", self, JUNCTION_CONNECT.input, VALUE_TYPE.audioBit, noone) .setVisible(true, true); diff --git a/scripts/node_boolean/node_boolean.gml b/scripts/node_boolean/node_boolean.gml index 2d0affc28..6c05f4feb 100644 --- a/scripts/node_boolean/node_boolean.gml +++ b/scripts/node_boolean/node_boolean.gml @@ -1,10 +1,9 @@ function Node_Boolean(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Boolean"; color = COLORS.node_blend_number; + setDimension(64, 64); - w = 64; - min_h = 64; - hover_state = 0; + hover_state = 0; hover_state_to = 0; wd_checkBox = new checkBox( function() { inputs[| 0].setValue(!getInputData(0)); } ); diff --git a/scripts/node_collection/node_collection.gml b/scripts/node_collection/node_collection.gml index bd3850a17..1635a3a0e 100644 --- a/scripts/node_collection/node_collection.gml +++ b/scripts/node_collection/node_collection.gml @@ -144,10 +144,6 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc combine_render_time = true; previewable = true; - w = 128; - h = 128; - min_h = 128; - reset_all_child = false; isInstancer = false; instanceBase = noone; diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index a06154521..9fefee6be 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -80,8 +80,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { w = 128; h = 128; - min_w = 0; - min_h = 0; + min_w = w; + min_h = h; will_setHeight = false; selectable = true; @@ -103,6 +103,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { draw_droppable = false; junction_draw_pad_y = 32; + junction_draw_hei_y = 24; branch_drawing = false; #endregion @@ -175,6 +176,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { #endregion #region ---- preview ---- + show_parameter = false; + show_input_name = false; show_output_name = false; @@ -337,11 +340,28 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { outputs_index = array_create_ext(outputs_amount, function(index) { return getOutputJunctionIndex(index); }); } #endregion - static setHeight = function() { #region - if(!auto_height) return; + static setDimension = function(_w = 128, _h = 128, _apply = true) { #region + INLINE + + min_w = _w; + min_h = _h; + + if(_apply) { + w = _w; + h = _h; + } + } #endregion + + static setHeight = function() { #region + w = show_parameter? 192 : min_w; + + if(!auto_height) return; + junction_draw_hei_y = show_parameter? 32 : 24; + junction_draw_pad_y = show_parameter? min_h : 32; + + var _hi = junction_draw_pad_y + show_parameter * 4; + var _ho = junction_draw_pad_y + show_parameter * 4; - var _hi = ui(junction_draw_pad_y); - var _ho = ui(junction_draw_pad_y); var _prev_surf = previewable && preview_draw && ( is_surface(getGraphPreviewSurface()) || (preview_channel >= 0 && preview_channel < ds_list_size(outputs) && outputs[| preview_channel].type == VALUE_TYPE.surface) @@ -349,15 +369,12 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { for( var i = 0; i < ds_list_size(inputs); i++ ) { var _inp = inputs[| i]; - if(is_instanceof(_inp, NodeValue) && _inp.isVisible()) _hi += 24; - if(is_instanceof(_inp, NodeModule)) { - for( var j = 0, m = ds_list_size(_inp.inputs); j < m; j++ ) - if(_inp.inputs[| j].isVisible()) _hi += 24; - } + if(is_instanceof(_inp, NodeValue) && _inp.isVisible()) + _hi += show_parameter && _inp.graphWidgetH? _inp.graphWidgetH + 4 : junction_draw_hei_y; } for( var i = 0; i < ds_list_size(outputs); i++ ) - if(outputs[| i].isVisible()) _ho += 24; + if(outputs[| i].isVisible()) _ho += junction_draw_hei_y; h = max(min_h, _prev_surf * 128, _hi, _ho, attributes.node_height); } run_in(1, function() { setHeight(); }); #endregion @@ -903,7 +920,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { out_cache_len = ds_list_size(outputs); } - var _iny = yy + ui(junction_draw_pad_y) * _s; + var _iny = yy + (junction_draw_pad_y + junction_draw_hei_y * 0.5 * show_parameter) * _s; for(var i = 0; i < inputs_amount; i++) { var idx = inputs_index[i]; @@ -911,18 +928,19 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { jun.x = xx; jun.y = _iny; - _iny += 24 * _s * jun.isVisible(); + _iny += junction_draw_hei_y * _s * jun.isVisible(); } xx = xx + w * _s; - var _outy = yy + ui(junction_draw_pad_y) * _s; + var _outy = yy + (junction_draw_pad_y + junction_draw_hei_y * 0.5 * show_parameter) * _s; + for(var i = 0; i < outputs_amount; i++) { var idx = outputs_index[i]; jun = outputs[| idx]; jun.x = xx; jun.y = _outy; - _outy += 24 * _s * jun.isVisible(); + _outy += junction_draw_hei_y * _s * jun.isVisible(); } onPreDraw(_x, _y, _s, _iny, _outy); @@ -956,16 +974,19 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { var pad_label = draw_name && display_parameter.avoid_label; var _w = w; - var _h = h; + var _h = show_parameter? min_h : h; - _w *= display_parameter.preview_scale / 100 * _s; - _h *= display_parameter.preview_scale / 100 * _s; + _w *= _s; + _h *= _s; _w -= draw_padding * 2; _h -= draw_padding * 2 + 20 * pad_label; var _xc = xx + w * _s / 2; - var _yc = yy + (h * _s + 20 * pad_label) / 2; + var _yc = yy + _h / 2 + pad_label * 20 + draw_padding; + + _w *= display_parameter.preview_scale / 100; + _h *= display_parameter.preview_scale / 100; var x0 = _xc - _w / 2; var x1 = _xc + _w / 2; @@ -1014,6 +1035,66 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { draw_set_alpha(1); } #endregion + static drawJunctionWidget = function(_x, _y, _mx, _my, _s, _hover, _focus) { #region + if(!active) return; + var hover = noone; + var amo = input_display_list == -1? ds_list_size(inputs) : array_length(input_display_list); + + var wh = 28 * _s; + var ww = w * _s * 0.5; + var wx = _x + w * _s - ww - 8; + var lx = _x + 12 * _s; + + var _m = [ _mx, _my ]; + var rx = PANEL_GRAPH.x; + var ry = PANEL_GRAPH.y; + + var jy = 0; + var y1 = _y + h * _s; + var ay = 0; + + if(wh > line_get_height(f_p2)) + for(var i = 0; i < amo; i++) { + var ind = getInputJunctionIndex(i); + if(ind == noone) continue; + + var jun = ds_list_get(inputs, ind, noone); + if(jun == noone || is_undefined(jun)) continue; + if(!jun.isVisible()) continue; + + if(jy == 0) jy = jun.y - wh / 2; + + var _param = new widgetParam(wx, jy, ww, wh, jun.showValue(),, _m, rx, ry); + _param.s = wh; + _param.font = f_p2; + + jun.y = jy + wh / 2; + + if(is_instanceof(jun, checkBox)) + _param.halign = fa_center; + + draw_set_text(f_sdf, fa_left, fa_center, jun.color_display); + draw_text_add(lx, jun.y, jun.getName(), _s * 0.25); + + var wd = jun.graphWidget; + if(wd == noone) { + jy += wh + 4 * _s; + continue; + } + + wd.setFocusHover(_focus, _hover); + var _h = wd.drawParam(_param); + + jun.graphWidgetH = _h / _s; + jy += _h + 4 * _s; + + if(wd.isHovering()) draggable = false; + } + + ay = jy + 2 * _s; + h += max(0, (ay - y1) / _s); + } #endregion + static drawJunctions = function(_x, _y, _mx, _my, _s) { #region if(!active) return; var hover = noone; @@ -1167,11 +1248,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { jun.draw_blend = -1; } - if(is_instanceof(jun, NodeModule)) { - jun.drawConnections(params, _inputs); - continue; - } - if(jun.isLeaf()) continue; if(!jun.value_from.node.active) continue; if(!jun.isVisible()) continue; @@ -1333,16 +1409,22 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { drawNodeBase(xx, yy, _s); drawDimension(xx, yy, _s); + draggable = true; + if(previewable) { if(preview_draw) drawPreview(xx, yy, _s); - try { onDrawNode(xx, yy, _mx, _my, _s, PANEL_GRAPH.node_hovering == self, PANEL_GRAPH.getFocusingNode() == self); } + try { + var _hover = PANEL_GRAPH.node_hovering == self; + var _focus = PANEL_GRAPH.getFocusingNode() == self; + + onDrawNode(xx, yy, _mx, _my, _s, _hover, _focus); + } catch(e) { log_warning("NODE onDrawNode", exception_print(e)); } - - } else { - var bbox = drawGetBbox(xx, yy, _s); - draw_sprite_ext(THEME.preview_hide, 0, bbox.xc, bbox.yc, _s, _s, 0, c_white, 0.25); - } + } + + if(show_parameter) + drawJunctionWidget(xx, yy, _mx, _my, _s, _hover, _focus); drawNodeName(xx, yy, _s); @@ -1762,7 +1844,9 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { _map.type = instanceof(self); _map.group = group == noone? group : group.node_id; _map.tool = isTool; - _map.previewable = previewable; + + _map.previewable = previewable; + _map.show_parameter = show_parameter; } _map.attri = attributeSerialize(); @@ -1833,9 +1917,10 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { x = struct_try_get(load_map, "x"); y = struct_try_get(load_map, "y"); - renderActive = struct_try_get(load_map, "render", true); - previewable = struct_try_get(load_map, "previewable", previewable); - isTool = struct_try_get(load_map, "tool"); + renderActive = struct_try_get(load_map, "render", true); + previewable = struct_try_get(load_map, "previewable", previewable); + isTool = struct_try_get(load_map, "tool"); + show_parameter = struct_try_get(load_map, "show_parameter"); } if(struct_has(load_map, "attri")) diff --git a/scripts/node_feedback_input/node_feedback_input.gml b/scripts/node_feedback_input/node_feedback_input.gml index 4354e93d2..aa04536d7 100644 --- a/scripts/node_feedback_input/node_feedback_input.gml +++ b/scripts/node_feedback_input/node_feedback_input.gml @@ -2,10 +2,7 @@ function Node_Feedback_Input(_x, _y, _group = noone) : Node_Group_Input(_x, _y, name = "Feedback Input"; color = COLORS.node_blend_feedback; is_group_io = true; - - w = 96; - h = 32 + 24 * 2; - min_h = h; + setDimension(96, 32 + 24 * 2); outputs[| 0].getValueDefault = method(outputs[| 0], outputs[| 0].getValueRecursive); //Get value from outside loop outputs[| 0].getValueRecursive = function(_time) { diff --git a/scripts/node_feedback_output/node_feedback_output.gml b/scripts/node_feedback_output/node_feedback_output.gml index 6fb1b3c69..3f3c133cb 100644 --- a/scripts/node_feedback_output/node_feedback_output.gml +++ b/scripts/node_feedback_output/node_feedback_output.gml @@ -2,10 +2,7 @@ function Node_Feedback_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y name = "Feedback Output"; color = COLORS.node_blend_feedback; is_group_io = true; - - w = 96; - h = 32 + 24 * 2; - min_h = h; + setDimension(96, 32 + 24 * 2); inputs[| 1] = nodeValue("Feedback loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.node, -1) .setVisible(true, true); diff --git a/scripts/node_gradient_extract/node_gradient_extract.gml b/scripts/node_gradient_extract/node_gradient_extract.gml index 101cb6311..4b767750e 100644 --- a/scripts/node_gradient_extract/node_gradient_extract.gml +++ b/scripts/node_gradient_extract/node_gradient_extract.gml @@ -1,6 +1,6 @@ function Node_Gradient_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Gradient Data"; - w = 96; + setDimension(96); inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(c_white) ) .setVisible(true, true); diff --git a/scripts/node_gradient_out/node_gradient_out.gml b/scripts/node_gradient_out/node_gradient_out.gml index 1873c1136..0f9a3562f 100644 --- a/scripts/node_gradient_out/node_gradient_out.gml +++ b/scripts/node_gradient_out/node_gradient_out.gml @@ -1,6 +1,6 @@ function Node_Gradient_Out(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Gradient"; - w = 96; + setDimension(96); inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject([ cola(c_black), cola(c_white) ]) ); diff --git a/scripts/node_gradient_shift/node_gradient_shift.gml b/scripts/node_gradient_shift/node_gradient_shift.gml index 54134993c..3117ba387 100644 --- a/scripts/node_gradient_shift/node_gradient_shift.gml +++ b/scripts/node_gradient_shift/node_gradient_shift.gml @@ -1,6 +1,6 @@ function Node_Gradient_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Gradient Shift"; - w = 96; + setDimension(96); inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(c_white) ) .setVisible(true, true); diff --git a/scripts/node_graph_preview/node_graph_preview.gml b/scripts/node_graph_preview/node_graph_preview.gml index 1a1e7c396..e15ab5051 100644 --- a/scripts/node_graph_preview/node_graph_preview.gml +++ b/scripts/node_graph_preview/node_graph_preview.gml @@ -2,8 +2,6 @@ function Node_Graph_Preview(_x, _y, _group = noone) : Node(_x, _y, _group) const name = "Graph Preview"; preview_draw = true; - min_h = 128; - inputs[| 0] = nodeValue("Surface", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone) .rejectArray(); diff --git a/scripts/node_group_input/node_group_input.gml b/scripts/node_group_input/node_group_input.gml index 1985fce6d..6568ab1d6 100644 --- a/scripts/node_group_input/node_group_input.gml +++ b/scripts/node_group_input/node_group_input.gml @@ -6,10 +6,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru destroy_when_upgroup = true; inParent = undefined; - - w = 96; - h = 32 + 24; - min_h = h; + setDimension(96, 32 + 24); #region data data_type_list = [ "Integer", "Float", "Boolean", "Color", "Surface", diff --git a/scripts/node_group_output/node_group_output.gml b/scripts/node_group_output/node_group_output.gml index b9f4ee6ee..7d7f5abaf 100644 --- a/scripts/node_group_output/node_group_output.gml +++ b/scripts/node_group_output/node_group_output.gml @@ -5,10 +5,7 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr is_group_io = true; destroy_when_upgroup = true; - - w = 96; - h = 32 + 24; - min_h = h; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1) .uncache() diff --git a/scripts/node_iterator_each_size/node_iterator_each_size.gml b/scripts/node_iterator_each_size/node_iterator_each_size.gml index 53cd7d18d..4d32e3bd4 100644 --- a/scripts/node_iterator_each_size/node_iterator_each_size.gml +++ b/scripts/node_iterator_each_size/node_iterator_each_size.gml @@ -3,8 +3,7 @@ function Node_Iterator_Each_Length(_x, _y, _group = noone) : Node(_x, _y, _group color = COLORS.node_blend_loop; destroy_when_upgroup = true; - w = 96; - min_h = 80; + setDimension(96, 80); outputs[| 0] = nodeValue("Length", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0); diff --git a/scripts/node_iterator_index/node_iterator_index.gml b/scripts/node_iterator_index/node_iterator_index.gml index 18d37535c..20caf2d85 100644 --- a/scripts/node_iterator_index/node_iterator_index.gml +++ b/scripts/node_iterator_index/node_iterator_index.gml @@ -4,8 +4,7 @@ function Node_Iterator_Index(_x, _y, _group = noone) : Node(_x, _y, _group) cons destroy_when_upgroup = true; manual_ungroupable = false; - w = 96; - min_h = 80; + setDimension(96, 80); outputs[| 0] = nodeValue("Loop index", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0); diff --git a/scripts/node_iterator_input/node_iterator_input.gml b/scripts/node_iterator_input/node_iterator_input.gml index 36dfe0901..509e4892c 100644 --- a/scripts/node_iterator_input/node_iterator_input.gml +++ b/scripts/node_iterator_input/node_iterator_input.gml @@ -5,10 +5,7 @@ function Node_Iterator_Input(_x, _y, _group = noone) : Node_Group_Input(_x, _y, local_output = noone; manual_ungroupable = false; - - w = 96; - h = 32 + 24 * 2; - min_h = h; + setDimension(96, 32 + 24 * 2); outputs[| 0].getValueDefault = method(outputs[| 0], outputs[| 0].getValueRecursive); //Get value from outside loop diff --git a/scripts/node_iterator_length/node_iterator_length.gml b/scripts/node_iterator_length/node_iterator_length.gml index eff4d4770..002972ea6 100644 --- a/scripts/node_iterator_length/node_iterator_length.gml +++ b/scripts/node_iterator_length/node_iterator_length.gml @@ -3,9 +3,7 @@ function Node_Iterator_Length(_x, _y, _group = noone) : Node(_x, _y, _group) con color = COLORS.node_blend_loop; destroy_when_upgroup = true; manual_ungroupable = false; - - w = 96; - min_h = 80; + setDimension(96, 80); outputs[| 0] = nodeValue("Length", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, 0); diff --git a/scripts/node_iterator_output/node_iterator_output.gml b/scripts/node_iterator_output/node_iterator_output.gml index 026f4536e..faf9bf890 100644 --- a/scripts/node_iterator_output/node_iterator_output.gml +++ b/scripts/node_iterator_output/node_iterator_output.gml @@ -3,11 +3,8 @@ function Node_Iterator_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y color = COLORS.node_blend_loop; is_group_io = true; - manual_ungroupable = false; - - w = 96; - h = 32 + 24 * 2; - min_h = h; + manual_ungroupable = false; + setDimension(96, 32 + 24 * 2); inputs[| 0].setFrom_condition = function(_valueFrom) { #region if(instanceof(_valueFrom.node) != "Node_Iterator_Input") return true; diff --git a/scripts/node_midi_in/node_midi_in.gml b/scripts/node_midi_in/node_midi_in.gml index a534aa82f..dd0749cd0 100644 --- a/scripts/node_midi_in/node_midi_in.gml +++ b/scripts/node_midi_in/node_midi_in.gml @@ -4,10 +4,7 @@ MIDI_INPORT = noone; function Node_MIDI_In(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "MIDI In"; update_on_frame = true; - - w = 128; - min_h = 128; - + rtmidi_init(); rtmidi_ignore_messages(true, true, true); diff --git a/scripts/node_number/node_number.gml b/scripts/node_number/node_number.gml index 99f5793e7..f06bc340f 100644 --- a/scripts/node_number/node_number.gml +++ b/scripts/node_number/node_number.gml @@ -1,10 +1,8 @@ -function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { #region +function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Number"; color = COLORS.node_blend_number; - w = 96; - min_h = 32 + 24 * 1; - draw_padding = 4; + setDimension(96, 32 + 24 * 1); display_output = 0; wd_slider = slider(0, 1, 0.01, function(val) { inputs[| 0].setValue(val); } ); @@ -51,10 +49,7 @@ function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co var int = getInputData(1); var disp = getInputData(2); - var _h = min_h; - - w = 96; - min_h = 56; + if(!show_parameter) setDimension(96, 56, false); switch(disp) { case 0 : @@ -63,27 +58,21 @@ function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co inputs[| 5].setVisible(false); break; case 1 : - if(inputs[| 0].isLeaf()) { - w = 160; - min_h = 96; - } + if(inputs[| 0].isLeaf() && !show_parameter) setDimension(160, 96, false); + inputs[| 3].setVisible(true); inputs[| 4].setVisible(true); inputs[| 5].setVisible(true); break; case 2 : - if(inputs[| 0].isLeaf()) { - w = 128; - min_h = 128; - } + if(inputs[| 0].isLeaf() && !show_parameter) setDimension(128, 128, false); + inputs[| 3].setVisible(false); inputs[| 4].setVisible(false); inputs[| 5].setVisible(false); break; } - if(_h != min_h) setHeight(); - for( var i = 0; i < 1; i++ ) { inputs[| i].setType(int? VALUE_TYPE.integer : VALUE_TYPE.float); inputs[| i].editWidget.setSlidable(int? 0.1 : 0.01); @@ -121,6 +110,7 @@ function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co } switch(disp) { + case 1 : #region draw_set_text(f_sdf, fa_center, fa_center, _col); draw_text_transformed(bbox.xc, bbox.y0 + 16 * _s, _int? round(val) : val, _s * 0.5, _s * 0.5, 0); @@ -172,7 +162,6 @@ function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co } else slider_m = lerp_float(slider_m, 0, 5); - draggable = true; if(_hover && point_in_rectangle(_mx, _my, sl_x0, sl_y0, sl_x1, sl_y1)) { if(mouse_press(mb_left, _focus) && is_real(val)) { slider_dragging = true; @@ -222,7 +211,6 @@ function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co } else rotator_m = lerp_float(rotator_m, 0, 5); - draggable = true; if(_hover && point_in_circle(_mx, _my, bbox.xc, bbox.yc, _ss / 2)) { if(mouse_press(mb_left, _focus) && is_real(val)) { rotator_dragging = true; @@ -238,4 +226,5 @@ function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co break; #endregion } } #endregion -} #endregion \ No newline at end of file + +} \ No newline at end of file diff --git a/scripts/node_palette/node_palette.gml b/scripts/node_palette/node_palette.gml index 3799ffe25..0b9545f1d 100644 --- a/scripts/node_palette/node_palette.gml +++ b/scripts/node_palette/node_palette.gml @@ -1,6 +1,6 @@ function Node_Palette(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Palette"; - w = 96; + setDimension(96); inputs[| 0] = nodeValue("Palette", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, DEF_PALETTE) .setDisplay(VALUE_DISPLAY.palette); diff --git a/scripts/node_palette_replace/node_palette_replace.gml b/scripts/node_palette_replace/node_palette_replace.gml index 6a654faab..855a494d6 100644 --- a/scripts/node_palette_replace/node_palette_replace.gml +++ b/scripts/node_palette_replace/node_palette_replace.gml @@ -1,7 +1,6 @@ function Node_Palette_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Palette Replace"; - - w = 96; + setDimension(96); inputs[| 0] = nodeValue("Palette in", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, DEF_PALETTE ) .setDisplay(VALUE_DISPLAY.palette) diff --git a/scripts/node_palette_sort/node_palette_sort.gml b/scripts/node_palette_sort/node_palette_sort.gml index 839cc4a4c..56be556b2 100644 --- a/scripts/node_palette_sort/node_palette_sort.gml +++ b/scripts/node_palette_sort/node_palette_sort.gml @@ -1,6 +1,6 @@ function Node_Palette_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Sort Palette"; - w = 96; + setDimension(96); inputs[| 0] = nodeValue("Palette in", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, DEF_PALETTE ) .setDisplay(VALUE_DISPLAY.palette) diff --git a/scripts/node_pb/node_pb.gml b/scripts/node_pb/node_pb.gml index 0dffb3aaf..cf2f8279b 100644 --- a/scripts/node_pb/node_pb.gml +++ b/scripts/node_pb/node_pb.gml @@ -2,11 +2,7 @@ function Node_PB(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constr name = "PB Element"; icon = THEME.pixel_builder; fullUpdate = true; - - w = 128; - h = 128; - min_h = h; - + static getNextNodesRaw = getNextNodes; static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { diff --git a/scripts/node_pb_layer/node_pb_layer.gml b/scripts/node_pb_layer/node_pb_layer.gml index dd5e617db..d8de6a689 100644 --- a/scripts/node_pb_layer/node_pb_layer.gml +++ b/scripts/node_pb_layer/node_pb_layer.gml @@ -2,10 +2,6 @@ function Node_PB_Layer(_x, _y, _group = noone) : Node(_x, _y, _group) constructo name = "PB Layer"; icon = THEME.pixel_builder; - w = 128; - h = 128; - min_h = h; - inputs[| 0] = nodeValue("Layer", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 ); outputs[| 0] = nodeValue("pBox", self, JUNCTION_CONNECT.output, VALUE_TYPE.pbBox, noone ); diff --git a/scripts/node_print/node_print.gml b/scripts/node_print/node_print.gml index 2c5acf021..71ff49d14 100644 --- a/scripts/node_print/node_print.gml +++ b/scripts/node_print/node_print.gml @@ -1,7 +1,6 @@ function Node_Print(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Print"; - w = 96; - min_h = 32 + 24 * 1; + setDimension(96, 32 + 24 * 1); draw_padding = 8; diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index b0264e931..92b7f5794 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -597,6 +597,7 @@ function __initNodes() { addNodeObject(filter, "Vignette", s_node_vignette, "Node_Vignette", [1, Node_Vignette],, "Apply vignette effect to the border.").setVersion(11630); addNodeObject(filter, "FXAA", s_node_FXAA, "Node_FXAA", [1, Node_FXAA],, "Apply fast approximate anti-aliasing to the image."); addNodeObject(filter, "Kuwahara", s_node_kuwahara, "Node_Kuwahara", [1, Node_Kuwahara]).setVersion(11660); + //addNodeObject(filter, "Rim", s_node_kuwahara, "Node_Rim", [1, Node_Rim]).setVersion(11690); //addNodeObject(filter, "Blend Edge", s_node_FXAA, "Node_Blend_Edge", [1, Node_Blend_Edge]).setVersion(11640); ds_list_add(filter, "Colors"); diff --git a/scripts/node_rigid_activate/node_rigid_activate.gml b/scripts/node_rigid_activate/node_rigid_activate.gml index 2817331af..f71349a6a 100644 --- a/scripts/node_rigid_activate/node_rigid_activate.gml +++ b/scripts/node_rigid_activate/node_rigid_activate.gml @@ -2,8 +2,7 @@ function Node_Rigid_Activate(_x, _y, _group = noone) : Node(_x, _y, _group) cons name = "Activate Physics"; color = COLORS.node_blend_simulation; icon = THEME.rigidSim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_rigid_force_apply/node_rigid_force_apply.gml b/scripts/node_rigid_force_apply/node_rigid_force_apply.gml index 42bcc76f3..cae01aae1 100644 --- a/scripts/node_rigid_force_apply/node_rigid_force_apply.gml +++ b/scripts/node_rigid_force_apply/node_rigid_force_apply.gml @@ -2,8 +2,7 @@ function Node_Rigid_Force_Apply(_x, _y, _group = noone) : Node(_x, _y, _group) c name = "Apply Force"; color = COLORS.node_blend_simulation; icon = THEME.rigidSim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_rigid_global/node_rigid_global.gml b/scripts/node_rigid_global/node_rigid_global.gml index fdd19e561..951bcd71d 100644 --- a/scripts/node_rigid_global/node_rigid_global.gml +++ b/scripts/node_rigid_global/node_rigid_global.gml @@ -2,8 +2,7 @@ function Node_Rigid_Global(_x, _y, _group = noone) : Node(_x, _y, _group) constr name = "RigidSim Global"; color = COLORS.node_blend_simulation; icon = THEME.rigidSim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_rigid_object/node_rigid_object.gml b/scripts/node_rigid_object/node_rigid_object.gml index 0cbb4093c..3e037f4cc 100644 --- a/scripts/node_rigid_object/node_rigid_object.gml +++ b/scripts/node_rigid_object/node_rigid_object.gml @@ -8,8 +8,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr name = "Object"; color = COLORS.node_blend_simulation; icon = THEME.rigidSim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_rigid_object_spawner/node_rigid_object_spawner.gml b/scripts/node_rigid_object_spawner/node_rigid_object_spawner.gml index 80a9135f2..508205b47 100644 --- a/scripts/node_rigid_object_spawner/node_rigid_object_spawner.gml +++ b/scripts/node_rigid_object_spawner/node_rigid_object_spawner.gml @@ -2,8 +2,7 @@ function Node_Rigid_Object_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group name = "Object Spawner"; color = COLORS.node_blend_simulation; icon = THEME.rigidSim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_rigid_override/node_rigid_override.gml b/scripts/node_rigid_override/node_rigid_override.gml index cbe391c56..2d2e7f994 100644 --- a/scripts/node_rigid_override/node_rigid_override.gml +++ b/scripts/node_rigid_override/node_rigid_override.gml @@ -5,10 +5,7 @@ function Node_Rigid_Override(_x, _y, _group = noone) : Node(_x, _y, _group) cons node_draw_icon = s_node_rigid_override; manual_ungroupable = false; - - w = 96; - h = 80; - min_h = h; + setDimension(96, 80); inputs[| 0] = nodeValue("Object", self, JUNCTION_CONNECT.input, VALUE_TYPE.rigid, noone ) .setVisible(true, true); diff --git a/scripts/node_rigid_render_output/node_rigid_render_output.gml b/scripts/node_rigid_render_output/node_rigid_render_output.gml index c12e7dd0b..c1f73373b 100644 --- a/scripts/node_rigid_render_output/node_rigid_render_output.gml +++ b/scripts/node_rigid_render_output/node_rigid_render_output.gml @@ -6,9 +6,6 @@ function Node_Rigid_Render_Output(_x, _y, _group = noone) : Node_Group_Output(_x manual_ungroupable = false; - w = 128; - h = 128; - min_h = h; previewable = true; inputs[| 0] = nodeValue("Render dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, DEF_SURF) diff --git a/scripts/node_rigid_variable/node_rigid_variable.gml b/scripts/node_rigid_variable/node_rigid_variable.gml index 4e7185080..f8edfcd69 100644 --- a/scripts/node_rigid_variable/node_rigid_variable.gml +++ b/scripts/node_rigid_variable/node_rigid_variable.gml @@ -6,9 +6,7 @@ function Node_Rigid_Variable(_x, _y, _group = noone) : Node(_x, _y, _group) cons manual_ungroupable = false; - w = 96; - h = 80; - min_h = h; + setDimension(96, 80); inputs[| 0] = nodeValue("Object", self, JUNCTION_CONNECT.input, VALUE_TYPE.rigid, noone ) .setVisible(true, true); diff --git a/scripts/node_rigid_wall/node_rigid_wall.gml b/scripts/node_rigid_wall/node_rigid_wall.gml index b65fd0a90..56bf7eafe 100644 --- a/scripts/node_rigid_wall/node_rigid_wall.gml +++ b/scripts/node_rigid_wall/node_rigid_wall.gml @@ -2,8 +2,7 @@ function Node_Rigid_Wall(_x, _y, _group = noone) : Node(_x, _y, _group) construc name = "Wall"; color = COLORS.node_blend_simulation; icon = THEME.rigidSim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_rim/node_rim.gml b/scripts/node_rim/node_rim.gml new file mode 100644 index 000000000..58efb8cf9 --- /dev/null +++ b/scripts/node_rim/node_rim.gml @@ -0,0 +1,9 @@ +function Node_Rim(_x, _y, _group = noone) : Node_Shader_Processor(_x, _y, _group) constructor { + name = "Rim"; + shader = sh_rim; + + inputs[| 1] = nodeValue("Angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 ) + .setDisplay(VALUE_DISPLAY.rotation); + addShaderProp(SHADER_UNIFORM.float, "rotation"); + +} \ No newline at end of file diff --git a/scripts/node_rim/node_rim.yy b/scripts/node_rim/node_rim.yy new file mode 100644 index 000000000..689b3007f --- /dev/null +++ b/scripts/node_rim/node_rim.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_rim", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "effects", + "path": "folders/nodes/data/filter/effects.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_shell/node_shell.gml b/scripts/node_shell/node_shell.gml index 3328ba868..58292a38e 100644 --- a/scripts/node_shell/node_shell.gml +++ b/scripts/node_shell/node_shell.gml @@ -1,9 +1,6 @@ function Node_Shell(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Execute Shell"; - - w = 96; - min_h = 32 + 24 * 1; - draw_padding = 8; + name = "Execute Shell"; + setDimension(96, 32 + 24 * 1); inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, ""); diff --git a/scripts/node_smoke_add/node_smoke_add.gml b/scripts/node_smoke_add/node_smoke_add.gml index 6f224ac58..6896fa372 100644 --- a/scripts/node_smoke_add/node_smoke_add.gml +++ b/scripts/node_smoke_add/node_smoke_add.gml @@ -2,8 +2,7 @@ function Node_Smoke_Add(_x, _y, _group = noone) : Node_Smoke(_x, _y, _group) con name = "Add Emitter"; color = COLORS.node_blend_smoke; icon = THEME.smoke_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_smoke_apply_velocity/node_smoke_apply_velocity.gml b/scripts/node_smoke_apply_velocity/node_smoke_apply_velocity.gml index 09291255f..08339a6f5 100644 --- a/scripts/node_smoke_apply_velocity/node_smoke_apply_velocity.gml +++ b/scripts/node_smoke_apply_velocity/node_smoke_apply_velocity.gml @@ -1,7 +1,6 @@ function Node_Smoke_Apply_Velocity(_x, _y, _group = noone) : Node_Smoke(_x, _y, _group) constructor { name = "Apply Velocity"; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_smoke_domain/node_smoke_domain.gml b/scripts/node_smoke_domain/node_smoke_domain.gml index 1d121f70e..cbd47e1d7 100644 --- a/scripts/node_smoke_domain/node_smoke_domain.gml +++ b/scripts/node_smoke_domain/node_smoke_domain.gml @@ -2,7 +2,6 @@ function Node_Smoke_Domain(_x, _y, _group = noone) : Node_Smoke(_x, _y, _group) name = "Domain"; color = COLORS.node_blend_smoke; icon = THEME.smoke_sim; - min_h = 128; manual_ungroupable = false; diff --git a/scripts/node_smoke_render_output/node_smoke_render_output.gml b/scripts/node_smoke_render_output/node_smoke_render_output.gml index f2a1923cf..1a622e290 100644 --- a/scripts/node_smoke_render_output/node_smoke_render_output.gml +++ b/scripts/node_smoke_render_output/node_smoke_render_output.gml @@ -2,11 +2,8 @@ function Node_Smoke_Render_Output(_x, _y, _group = noone) : Node_Group_Output(_x name = "Render Domain"; color = COLORS.node_blend_smoke; icon = THEME.smoke_sim; - use_cache = CACHE_USE.auto; - w = 128; - h = 128; - min_h = h; + use_cache = CACHE_USE.auto; previewable = true; manual_ungroupable = false; diff --git a/scripts/node_smoke_repulse/node_smoke_repulse.gml b/scripts/node_smoke_repulse/node_smoke_repulse.gml index 56e162276..dc5687201 100644 --- a/scripts/node_smoke_repulse/node_smoke_repulse.gml +++ b/scripts/node_smoke_repulse/node_smoke_repulse.gml @@ -1,7 +1,6 @@ function Node_Smoke_Repulse(_x, _y, _group = noone) : Node_Smoke(_x, _y, _group) constructor { name = "Repulse"; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_smoke_turbulence/node_smoke_turbulence.gml b/scripts/node_smoke_turbulence/node_smoke_turbulence.gml index ceb694644..59cbf6c22 100644 --- a/scripts/node_smoke_turbulence/node_smoke_turbulence.gml +++ b/scripts/node_smoke_turbulence/node_smoke_turbulence.gml @@ -1,7 +1,6 @@ function Node_Smoke_Turbulence(_x, _y, _group = noone) : Node_Smoke(_x, _y, _group) constructor { name = "Turbulence"; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_smoke_update/node_smoke_update.gml b/scripts/node_smoke_update/node_smoke_update.gml index 95eb9aa75..927cfd222 100644 --- a/scripts/node_smoke_update/node_smoke_update.gml +++ b/scripts/node_smoke_update/node_smoke_update.gml @@ -2,8 +2,7 @@ function Node_Smoke_Update(_x, _y, _group = noone) : Node_Smoke(_x, _y, _group) name = "Update Fluid"; color = COLORS.node_blend_smoke; icon = THEME.smoke_sim; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_smoke_vortex/node_smoke_vortex.gml b/scripts/node_smoke_vortex/node_smoke_vortex.gml index 0bddd1196..0df7e68dc 100644 --- a/scripts/node_smoke_vortex/node_smoke_vortex.gml +++ b/scripts/node_smoke_vortex/node_smoke_vortex.gml @@ -1,7 +1,6 @@ function Node_Smoke_Vortex(_x, _y, _group = noone) : Node_Smoke(_x, _y, _group) constructor { name = "Vortex"; - w = 96; - min_h = 96; + setDimension(96, 96); manual_ungroupable = false; diff --git a/scripts/node_struct_json_parse/node_struct_json_parse.gml b/scripts/node_struct_json_parse/node_struct_json_parse.gml index ab4241af4..68bb6f347 100644 --- a/scripts/node_struct_json_parse/node_struct_json_parse.gml +++ b/scripts/node_struct_json_parse/node_struct_json_parse.gml @@ -1,9 +1,6 @@ function Node_Struct_JSON_Parse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "JSON Parse"; - - w = 96; - h = 32 + 24; - min_h = h; + name = "JSON Parse"; + setDimension(96, 32 + 24); inputs[| 0] = nodeValue("JSON string", self, JUNCTION_CONNECT.input, VALUE_TYPE.text, 0) .setVisible(true, true); diff --git a/scripts/node_terminal_trigger/node_terminal_trigger.gml b/scripts/node_terminal_trigger/node_terminal_trigger.gml index 59f9df2ec..ddf5c38bd 100644 --- a/scripts/node_terminal_trigger/node_terminal_trigger.gml +++ b/scripts/node_terminal_trigger/node_terminal_trigger.gml @@ -1,7 +1,6 @@ function Node_Terminal_Trigger(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Terminal Trigger"; - w = 96; - min_h = 32 + 24 * 1; + setDimension(96, 32 + 24 * 1); draw_padding = 8; diff --git a/scripts/node_trigger/node_trigger.gml b/scripts/node_trigger/node_trigger.gml index a0c37e24c..658597646 100644 --- a/scripts/node_trigger/node_trigger.gml +++ b/scripts/node_trigger/node_trigger.gml @@ -1,9 +1,7 @@ function Node_Trigger(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Trigger"; update_on_frame = true; - - w = 96; - min_h = 32 + 24 * 1; + setDimension(96, 32 + 24 * 1); inputs[| 0] = nodeValue("Trigger", self, JUNCTION_CONNECT.input, VALUE_TYPE.trigger, false) .setVisible(false, false); diff --git a/scripts/node_trigger_bool/node_trigger_bool.gml b/scripts/node_trigger_bool/node_trigger_bool.gml index 7fe79f05e..8a61d153b 100644 --- a/scripts/node_trigger_bool/node_trigger_bool.gml +++ b/scripts/node_trigger_bool/node_trigger_bool.gml @@ -1,9 +1,7 @@ function Node_Trigger_Bool(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Boolean Trigger"; update_on_frame = true; - - w = 96; - min_h = 32 + 24 * 1; + setDimension(96, 32 + 24 * 1); inputs[| 0] = nodeValue("Boolean", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index f648a47ad..e0e1e8863 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -556,6 +556,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru editWidget = noone; editWidgetRaw = noone; graphWidget = noone; + graphWidgetH = 0; mapWidget = noone; active_tooltip = ""; @@ -1279,7 +1280,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } editWidgetRaw = editWidget; - //graphWidget = variable_clone(editWidget); + graphWidget = variable_clone(editWidget); for( var i = 0, n = ds_list_size(animator.values); i < n; i++ ) { animator.values[| i].ease_in_type = key_inter; diff --git a/scripts/node_vector2/node_vector2.gml b/scripts/node_vector2/node_vector2.gml index 8db983093..d88790a91 100644 --- a/scripts/node_vector2/node_vector2.gml +++ b/scripts/node_vector2/node_vector2.gml @@ -1,10 +1,8 @@ function Node_Vector2(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { #region - name = "Vector2"; + name = "Vector2"; color = COLORS.node_blend_number; - w = 96; - min_h = 32 + 24 * 2; - draw_padding = 4; + setDimension(96, 32 + 24 * 2); inputs[| 0] = nodeValue("x", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setVisible(true, true); @@ -116,16 +114,10 @@ function Node_Vector2(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c outputs[| 0].setType(int? VALUE_TYPE.integer : VALUE_TYPE.float); - var _h = min_h; - w = 96; - min_h = 80; + setDimension(96, 80, false); - if(disp == 1 && inputs[| 0].isLeaf() && inputs[| 1].isLeaf()) { - w = 160; - min_h = 160; - } - - if(min_h != _h) setHeight(); + if(disp == 1 && inputs[| 0].isLeaf() && inputs[| 1].isLeaf()) + setDimension(160, 160, false); } #endregion static processData = function(_output, _data, _output_index, _array_index = 0) { #region diff --git a/scripts/node_vector3/node_vector3.gml b/scripts/node_vector3/node_vector3.gml index 705b640ea..b3cb748cd 100644 --- a/scripts/node_vector3/node_vector3.gml +++ b/scripts/node_vector3/node_vector3.gml @@ -1,10 +1,7 @@ function Node_Vector3(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { #region name = "Vector3"; color = COLORS.node_blend_number; - - w = 96; - min_h = 32 + 24 * 3; - draw_padding = 4; + setDimension(96, 32 + 24 * 3); inputs[| 0] = nodeValue("x", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setVisible(true, true); diff --git a/scripts/node_vector4/node_vector4.gml b/scripts/node_vector4/node_vector4.gml index 5d823878f..1d4cea588 100644 --- a/scripts/node_vector4/node_vector4.gml +++ b/scripts/node_vector4/node_vector4.gml @@ -1,10 +1,7 @@ function Node_Vector4(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { #region name = "Vector4"; color = COLORS.node_blend_number; - - w = 96; - min_h = 32 + 24 * 4; - draw_padding = 4; + setDimension(96, 32 + 24 * 4); inputs[| 0] = nodeValue("x", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setVisible(true, true); diff --git a/scripts/node_vector_split/node_vector_split.gml b/scripts/node_vector_split/node_vector_split.gml index 7a13aad9e..1b3c9fb97 100644 --- a/scripts/node_vector_split/node_vector_split.gml +++ b/scripts/node_vector_split/node_vector_split.gml @@ -1,9 +1,8 @@ function Node_Vector_Split(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { #region name = "Vector Split"; color = COLORS.node_blend_number; + setDimension(96, 32); - w = 96; - min_h = 32; draw_padding = 4; inputs[| 0] = nodeValue("Vector", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0 ]) diff --git a/scripts/node_wav_file_read/node_wav_file_read.gml b/scripts/node_wav_file_read/node_wav_file_read.gml index 3016f33ee..b8780dbbf 100644 --- a/scripts/node_wav_file_read/node_wav_file_read.gml +++ b/scripts/node_wav_file_read/node_wav_file_read.gml @@ -27,10 +27,6 @@ function Node_WAV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const name = "WAV File In"; color = COLORS.node_blend_input; - w = 128; - h = 128; - min_h = h; - inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_load, { filter: "audio|*.wav" }) .rejectArray(); diff --git a/scripts/node_wav_file_write/node_wav_file_write.gml b/scripts/node_wav_file_write/node_wav_file_write.gml index ad752eadd..7a06fc782 100644 --- a/scripts/node_wav_file_write/node_wav_file_write.gml +++ b/scripts/node_wav_file_write/node_wav_file_write.gml @@ -1,9 +1,7 @@ function Node_WAV_File_Write(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "WAV File Out"; color = COLORS.node_blend_input; - - h = 72; - min_h = h; + setDimension(, 72); inputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_save, { filter: "audio file|*.wav" }) diff --git a/scripts/node_websocket_receiver/node_websocket_receiver.gml b/scripts/node_websocket_receiver/node_websocket_receiver.gml index 6fae80cc7..9af7f4b8d 100644 --- a/scripts/node_websocket_receiver/node_websocket_receiver.gml +++ b/scripts/node_websocket_receiver/node_websocket_receiver.gml @@ -1,10 +1,6 @@ function Node_Websocket_Receiver(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Websocket Receiver"; - - w = 128; - h = 128; - min_h = h; - + inputs[| 0] = nodeValue("Port", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 22400); inputs[| 1] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true); diff --git a/scripts/node_websocket_sender/node_websocket_sender.gml b/scripts/node_websocket_sender/node_websocket_sender.gml index 1e6f2621f..7bd55e77e 100644 --- a/scripts/node_websocket_sender/node_websocket_sender.gml +++ b/scripts/node_websocket_sender/node_websocket_sender.gml @@ -1,10 +1,6 @@ function Node_Websocket_Sender(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Websocket Sender"; - w = 128; - h = 128; - min_h = h; - inputs[| 0] = nodeValue("Port", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 22800); inputs[| 1] = nodeValue("Data type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) diff --git a/scripts/node_widget_test/node_widget_test.gml b/scripts/node_widget_test/node_widget_test.gml index b598e81f4..32c379a58 100644 --- a/scripts/node_widget_test/node_widget_test.gml +++ b/scripts/node_widget_test/node_widget_test.gml @@ -1,8 +1,6 @@ function Node_Widget_Test(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { - name = "Widget Test"; - - w = 96; - min_h = 32 + 24 * 1; + name = "Widget Test"; + setDimension(96, 32 + 24 * 1); draw_padding = 8; inputs[| 0] = nodeValue("textBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setDisplay(VALUE_DISPLAY._default) diff --git a/scripts/node_wiggler/node_wiggler.gml b/scripts/node_wiggler/node_wiggler.gml index 66b0fa023..f2118e487 100644 --- a/scripts/node_wiggler/node_wiggler.gml +++ b/scripts/node_wiggler/node_wiggler.gml @@ -1,8 +1,7 @@ function Node_Wiggler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Wiggler"; update_on_frame = true; - - w = 96; + setDimension(96, 96); inputs[| 0] = nodeValue("Range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ]) .setDisplay(VALUE_DISPLAY.vector); @@ -53,22 +52,15 @@ function Node_Wiggler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c if(!is_array(ran)) return; - var _h = min_h; - switch(disp) { case 0 : - w = 96; - _h = 0; - draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text); var str = getWiggle(ran[0], ran[1], TOTAL_FRAMES / fre, time, sed, 0, TOTAL_FRAMES); var ss = string_scale(str, (w - 16) * _s, (h - 16) * _s - 20 * draw_name); draw_text_transformed(xx + w / 2 * _s, yy + 10 + h / 2 * _s, str, ss, ss, 0); break; - case 1 : - w = 128; - _h = 96; + case 1 : var _min = ran[0]; var _max = ran[1]; var val = (_min + _max) / 2; @@ -106,11 +98,6 @@ function Node_Wiggler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c draw_rectangle(x0, y0, x1, y1, true); break; } - - if(min_h != _h) { - min_h = _h; - will_setHeight = true; - } } #endregion static doApplyDeserialize = function() { onValueUpdate(); } diff --git a/scripts/paddingBox/paddingBox.gml b/scripts/paddingBox/paddingBox.gml index 5733f3e2a..b119af9b4 100644 --- a/scripts/paddingBox/paddingBox.gml +++ b/scripts/paddingBox/paddingBox.gml @@ -62,6 +62,11 @@ function paddingBox(_onModify, _unit = noone) : widget() constructor { tb[3].register(parent); } #endregion + static isHovering = function() { + for( var i = 0, n = array_length(tb); i < n; i++ ) if(tb[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { setParam(params); for(var i = 0; i < 4; i++) tb[i].setParam(params); diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 3595c9f27..1bf09c8ca 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -56,6 +56,7 @@ function panel_graph_select_all() { CALL("graph_select_all"); PANEL_GRAPH.nodes_selecting = ds_list_to_array(PANEL_GRAPH.nodes_list); } function panel_graph_toggle_grid() { CALL("graph_toggle_grid"); PANEL_GRAPH.display_parameter.show_grid = !PANEL_GRAPH.display_parameter.show_grid; } function panel_graph_toggle_preview() { CALL("graph_toggle_preview"); PANEL_GRAPH.setTriggerPreview(); } + function panel_graph_toggle_parameter() { CALL("graph_toggle_parameter"); PANEL_GRAPH.setTriggerParameter(); } function panel_graph_toggle_render() { CALL("graph_toggle_render"); PANEL_GRAPH.setTriggerRender(); } function panel_graph_export() { CALL("graph_export"); PANEL_GRAPH.setCurrentExport(); } @@ -145,7 +146,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { show_dimension : true, show_compute : true, - avoid_label : false, + avoid_label : true, preview_scale : 100, highlight : false, } @@ -362,6 +363,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { addHotkey("Graph", "Toggle grid", "G", MOD_KEY.none, panel_graph_toggle_grid); addHotkey("Graph", "Toggle preview", "H", MOD_KEY.none, panel_graph_toggle_preview); addHotkey("Graph", "Toggle render", "R", MOD_KEY.none, panel_graph_toggle_render); + addHotkey("Graph", "Toggle parameters", "M", MOD_KEY.none, panel_graph_toggle_parameter); if(!DEMO) addHotkey("Graph", "Export", "E", MOD_KEY.ctrl, panel_graph_export); @@ -455,6 +457,15 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { }); } #endregion + function setTriggerParameter() { #region + __temp_show = false; + array_foreach(nodes_selecting, function(node, index) { + if(index == 0) __temp_show = !node.show_parameter; + node.show_parameter = __temp_show; + node.setHeight(); + }); + } #endregion + function setTriggerRender() { #region __temp_active = false; array_foreach(nodes_selecting, function(node, index) { diff --git a/scripts/panel_graph_export_image/panel_graph_export_image.gml b/scripts/panel_graph_export_image/panel_graph_export_image.gml index e0fd79b76..28d938e1e 100644 --- a/scripts/panel_graph_export_image/panel_graph_export_image.gml +++ b/scripts/panel_graph_export_image/panel_graph_export_image.gml @@ -97,7 +97,7 @@ function graph_export_image(allList, nodeList, settings = {}) { param.show_dimension = true; param.show_compute = true; - param.avoid_label = false; + param.avoid_label = true; param.preview_scale = 100; for(var i = 0; i < ds_list_size(nodeList); i++) diff --git a/scripts/pathAnchorBox/pathAnchorBox.gml b/scripts/pathAnchorBox/pathAnchorBox.gml index a2baf6a52..aa8b0b039 100644 --- a/scripts/pathAnchorBox/pathAnchorBox.gml +++ b/scripts/pathAnchorBox/pathAnchorBox.gml @@ -38,6 +38,11 @@ function pathAnchorBox(_onModify) : widget() constructor { tb[i].register(parent); } + static isHovering = function() { + for( var i = 0, n = array_length(tb); i < n; i++ ) if(tb[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { setParam(params); for(var i = 0; i < 6; i++) tb[i].setParam(params); diff --git a/scripts/pathArrayBox/pathArrayBox.gml b/scripts/pathArrayBox/pathArrayBox.gml index 1571e5f5a..fce67614e 100644 --- a/scripts/pathArrayBox/pathArrayBox.gml +++ b/scripts/pathArrayBox/pathArrayBox.gml @@ -29,6 +29,8 @@ function pathArrayBox(_target, _data, _onClick) : widget() constructor { w = _w; h = _h; + hovering = false; + var _bs = min(_h, ui(32)); openPath.setFocusHover(active, hover); openPath.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); @@ -38,6 +40,7 @@ function pathArrayBox(_target, _data, _onClick) : widget() constructor { draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h); if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h)) { + hovering = true; draw_sprite_stretched(THEME.textbox, 1, _x, _y, _w, _h); if(mouse_press(mb_left, active)) { diff --git a/scripts/quarternionBox/quarternionBox.gml b/scripts/quarternionBox/quarternionBox.gml index 5cdc3fb3a..91cdf88ab 100644 --- a/scripts/quarternionBox/quarternionBox.gml +++ b/scripts/quarternionBox/quarternionBox.gml @@ -50,6 +50,11 @@ function quarternionBox(_onModify) : widget() constructor { tb[i].register(parent); } + static isHovering = function() { + for( var i = 0, n = array_length(tb); i < n; i++ ) if(tb[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { setParam(params); for(var i = 0; i < 4; i++) tb[i].setParam(params); diff --git a/scripts/rangeBox/rangeBox.gml b/scripts/rangeBox/rangeBox.gml index 92d52f231..af1284689 100644 --- a/scripts/rangeBox/rangeBox.gml +++ b/scripts/rangeBox/rangeBox.gml @@ -53,6 +53,11 @@ function rangeBox(_type, _onModify) : widget() constructor { tb[1].register(parent); } + static isHovering = function() { + for( var i = 0, n = array_length(tb); i < n; i++ ) if(tb[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { setParam(params); for(var i = 0; i < 2; i++) tb[i].setParam(params); @@ -71,7 +76,7 @@ function rangeBox(_type, _onModify) : widget() constructor { var _icon_blend = linked? COLORS._main_accent : COLORS._main_icon; var _bs = min(_h, ui(32)); - if(side_button) { + if(_w - _bs > ui(100) && side_button) { side_button.setFocusHover(active, hover); side_button.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); _w -= _bs + ui(4); diff --git a/scripts/rotator/rotator.gml b/scripts/rotator/rotator.gml index 720bb59c5..cfabf9fe6 100644 --- a/scripts/rotator/rotator.gml +++ b/scripts/rotator/rotator.gml @@ -26,6 +26,8 @@ function rotator(_onModify, _step = -1) : widget() constructor { tb_value.register(parent); } #endregion + static isHovering = function() { return dragging || tb_value.hovering; } + static drawParam = function(params) { #region setParam(params); tb_value.setParam(params); @@ -43,7 +45,7 @@ function rotator(_onModify, _step = -1) : widget() constructor { var _bs = min(_h, ui(32)); - if(side_button) { + if(_w - _bs > ui(100) && side_button) { side_button.setFocusHover(active, hover); side_button.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); _w -= _bs + ui(4); diff --git a/scripts/rotatorRandom/rotatorRandom.gml b/scripts/rotatorRandom/rotatorRandom.gml index 5a89a4137..a7d82d8ce 100644 --- a/scripts/rotatorRandom/rotatorRandom.gml +++ b/scripts/rotatorRandom/rotatorRandom.gml @@ -38,6 +38,8 @@ function rotatorRandom(_onModify) : widget() constructor { if(mode == 2) tb_max_1.register(parent); } #endregion + static isHovering = function() { return dragging || tb_min_0.hovering || tb_max_0.hovering || tb_min_1.hovering || tb_max_1.hovering; } + static drawParam = function(params) { #region setParam(params); tb_min_0.setParam(params); diff --git a/scripts/rotatorRange/rotatorRange.gml b/scripts/rotatorRange/rotatorRange.gml index 7e47d096d..9fa516fc2 100644 --- a/scripts/rotatorRange/rotatorRange.gml +++ b/scripts/rotatorRange/rotatorRange.gml @@ -22,6 +22,8 @@ function rotatorRange(_onModify) : widget() constructor { tb_max.register(parent); } #endregion + static isHovering = function() { return dragging || tb_min.hovering || tb_max.hovering; } + static drawParam = function(params) { #region setParam(params); tb_min.setParam(params); diff --git a/scripts/sliderRange/sliderRange.gml b/scripts/sliderRange/sliderRange.gml index f64a63ca9..0b868edb5 100644 --- a/scripts/sliderRange/sliderRange.gml +++ b/scripts/sliderRange/sliderRange.gml @@ -28,6 +28,8 @@ function sliderRange(_step, _int, _range, _onModify) : widget() constructor { tb_value_max.register(parent); } #endregion + static isHovering = function() { return tb_value_min.hovering || tb_value_max.hovering; } + static drawParam = function(params) { #region setParam(params); tb_value_min.setParam(params); diff --git a/scripts/surfaceBox/surfaceBox.gml b/scripts/surfaceBox/surfaceBox.gml index 9e4dc5b8a..fc4e7332f 100644 --- a/scripts/surfaceBox/surfaceBox.gml +++ b/scripts/surfaceBox/surfaceBox.gml @@ -16,7 +16,7 @@ function surfaceBox(_onModify, def_path = "") : widget() constructor { static trigger = function() { open = true; - with(dialogCall(o_dialog_assetbox, x + w + open_rx, y + open_ry)) { + with(dialogCall(o_dialog_assetbox, x + open_rx, y + open_ry)) { target = other; gotoDir(other.def_path); } diff --git a/scripts/textArea/textArea.gml b/scripts/textArea/textArea.gml index f9328ddad..dbc4f991a 100644 --- a/scripts/textArea/textArea.gml +++ b/scripts/textArea/textArea.gml @@ -763,6 +763,8 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor w = _w; h = _h; + hovering = false; + autocomplete_delay += delta_time / 1000; _stretch_width = _w < 0; _text = string_real(_text); @@ -772,13 +774,12 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor if(_stretch_width) _w = string_width(self == WIDGET_CURRENT? _input_text : _text) + ui(16); w = _w; + var _bs = min(h, ui(32)); - if(side_button && instanceof(side_button) == "buttonClass") { - var bs = min(h, ui(32)); - + if(_w - _bs > ui(100) && side_button && instanceof(side_button) == "buttonClass") { side_button.setFocusHover(active, hover); - side_button.draw(_x + _w - bs, _y + _h / 2 - bs / 2, bs, bs, _m, THEME.button_hide); - _w -= bs + ui(8); + side_button.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); + _w -= _bs + ui(8); } var tx = ui(8); @@ -963,6 +964,8 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor BLEND_NORMAL if(hover && hoverRect) { + hovering = true; + if(hide) draw_sprite_stretched_ext(THEME.textbox, 1, _x, _y, _w, hh, boxColor, 0.5); else diff --git a/scripts/textBox/textBox.gml b/scripts/textBox/textBox.gml index 2ced60a03..0511624d4 100644 --- a/scripts/textBox/textBox.gml +++ b/scripts/textBox/textBox.gml @@ -392,6 +392,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { w = _w; h = _h; + hovering = false; _x += irandom_range(-shake_amount, shake_amount); _y += irandom_range(-shake_amount, shake_amount); if(shake_amount) shake_amount--; @@ -408,12 +409,12 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { case fa_bottom: _y = _y - _h; break; } - if(side_button && instanceof(side_button) == "buttonClass") { - var bs = min(h, ui(32)); - + var _bs = min(h, ui(32)); + + if(_w - _bs > ui(100) && side_button && instanceof(side_button) == "buttonClass") { side_button.setFocusHover(active, hover); - side_button.draw(_x + _w - bs, _y + _h / 2 - bs / 2, bs, bs, _m, THEME.button_hide); - _w -= bs + ui(4); + side_button.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); + _w -= _bs + ui(4); } draw_set_font(font == noone? f_p0 : font); @@ -594,6 +595,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { } if(hover && hoverRect) { + hovering = true; draw_sprite_stretched_ext(THEME.textbox, 1, _x, _y, _w, _h, boxColor, 0.5 + (0.5 * interactable)); if(mouse_press(mb_left, active)) diff --git a/scripts/toggleGroup/toggleGroup.gml b/scripts/toggleGroup/toggleGroup.gml index 150e1dfd7..362a340b8 100644 --- a/scripts/toggleGroup/toggleGroup.gml +++ b/scripts/toggleGroup/toggleGroup.gml @@ -22,6 +22,11 @@ function toggleGroup(_data, _onClick) : widget() constructor { self.parent = parent; } + static isHovering = function() { + for( var i = 0, n = array_length(buttons); i < n; i++ ) if(buttons[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { setParam(params); for(var i = 0; i < array_length(data); i++) @@ -51,6 +56,7 @@ function toggleGroup(_data, _onClick) : widget() constructor { buttons[i].toggled = tog; buttons[i].draw(bx, _y, ww, _h, _m, spr); + if(buttons[i].clicked) { value ^= (1 << i); onClick(value); diff --git a/scripts/transformBox/transformBox.gml b/scripts/transformBox/transformBox.gml index 63c712415..e72820093 100644 --- a/scripts/transformBox/transformBox.gml +++ b/scripts/transformBox/transformBox.gml @@ -41,6 +41,11 @@ function transformBox(_onModify) : widget() constructor { tb[TRANSFORM.sca_y].register(parent); } + static isHovering = function() { + for( var i = 0, n = array_length(tb); i < n; i++ ) if(tb[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { setParam(params); rot.setParam(params); diff --git a/scripts/vectorBox/vectorBox.gml b/scripts/vectorBox/vectorBox.gml index fc0adb9a8..b83e7c7a7 100644 --- a/scripts/vectorBox/vectorBox.gml +++ b/scripts/vectorBox/vectorBox.gml @@ -65,7 +65,7 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor { static setInteract = function(interactable) { #region self.interactable = interactable; - if(side_button != noone) + if(side_button) side_button.interactable = interactable; for( var i = 0; i < size; i++ ) @@ -83,6 +83,11 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor { unit.triggerButton.register(parent); } #endregion + static isHovering = function() { + for( var i = 0, n = array_length(tb); i < n; i++ ) if(tb[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { #region setParam(params); for(var i = 0; i < 4; i++) tb[i].setParam(params); @@ -108,7 +113,7 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor { var _bs = min(_h, ui(32)); - if(side_button) { + if(_w - _bs > ui(100) && side_button) { side_button.setFocusHover(active, hover); side_button.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); _w -= _bs + ui(4); diff --git a/scripts/vectorRangeBox/vectorRangeBox.gml b/scripts/vectorRangeBox/vectorRangeBox.gml index 66c8ea469..de8134a77 100644 --- a/scripts/vectorRangeBox/vectorRangeBox.gml +++ b/scripts/vectorRangeBox/vectorRangeBox.gml @@ -55,6 +55,11 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const tb[i].register(parent); } #endregion + static isHovering = function() { + for( var i = 0, n = array_length(tb); i < n; i++ ) if(tb[i].isHovering()) return true; + return false; + } + static drawParam = function(params) { #region setParam(params); for(var i = 0; i < size; i++) tb[i].setParam(params); diff --git a/scripts/widget/widget.gml b/scripts/widget/widget.gml index 1988cf132..63f425cea 100644 --- a/scripts/widget/widget.gml +++ b/scripts/widget/widget.gml @@ -1,12 +1,15 @@ function widget() constructor { active = false; hover = false; + hovering= false; iactive = false; ihover = false; parent = noone; interactable = true; side_button = noone; + hide = false; + lua_thread = noone; lua_thread_key = ""; @@ -54,6 +57,8 @@ function widget() constructor { parent.scroll_y_to -= abs(parent.surface_h - y) + h + ui(16); } + static isHovering = function() { return hovering; } + static activate = function() { if(!interactable) return; diff --git a/shaders/sh_rim/sh_rim.fsh b/shaders/sh_rim/sh_rim.fsh new file mode 100644 index 000000000..b118674d4 --- /dev/null +++ b/shaders/sh_rim/sh_rim.fsh @@ -0,0 +1,33 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec2 u_resolution; +uniform float rotation; + +float d(vec4 c) { return (c.r + c.g + c.b) / 3. * c.a; } + +void main() { + vec2 tx = 1. / u_resolution; + vec4 cc = texture2D( gm_BaseTexture, v_vTexcoord ); + int emp = 0; + + vec2 px = v_vTexcoord * u_resolution; + + gl_FragColor = vec4(0.); + + if(d(cc) > 0.) { + float ang = radians(rotation); + vec2 sx = vec2(cos(ang), -sin(ang)) * tx; + vec4 c; + + for(float i = 1.; i <= 1.; i++) { + vec2 ss = v_vTexcoord + sx * float(i); + + c = texture2D( gm_BaseTexture, ss ); + if(d(c) == 0.) emp++; + else break; + } + } + + if(emp >= 1) gl_FragColor = cc; +} diff --git a/shaders/sh_rim/sh_rim.vsh b/shaders/sh_rim/sh_rim.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_rim/sh_rim.vsh @@ -0,0 +1,19 @@ +// +// Simple passthrough vertex shader +// +attribute vec3 in_Position; // (x,y,z) +//attribute vec3 in_Normal; // (x,y,z) unused in this shader. +attribute vec4 in_Colour; // (r,g,b,a) +attribute vec2 in_TextureCoord; // (u,v) + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0); + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos; + + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} diff --git a/shaders/sh_rim/sh_rim.yy b/shaders/sh_rim/sh_rim.yy new file mode 100644 index 000000000..8539b6c0c --- /dev/null +++ b/shaders/sh_rim/sh_rim.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_rim", + "parent": { + "name": "filter", + "path": "folders/shader/filter.yy", + }, + "type": 1, +} \ No newline at end of file