From 6bf76469510eb656ed55553dcfa4f37109590715 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Sun, 26 May 2024 09:51:14 +0700 Subject: [PATCH] 1.17.1.1 --- scripts/buttonGradient/buttonGradient.gml | 26 +++++++++++++++++++ scripts/buttonPalette/buttonPalette.gml | 6 +++-- scripts/globals/globals.gml | 6 ++--- scripts/nodeValue_drawer/nodeValue_drawer.gml | 4 ++- .../node_ase_file_read/node_ase_file_read.gml | 8 +++--- scripts/node_registry/node_registry.gml | 2 +- scripts/node_value/node_value.gml | 2 +- scripts/panel_menu/panel_menu.gml | 1 + scripts/preferences/preferences.gml | 1 + scripts/widget/widget.gml | 2 ++ 10 files changed, 46 insertions(+), 12 deletions(-) diff --git a/scripts/buttonGradient/buttonGradient.gml b/scripts/buttonGradient/buttonGradient.gml index 51978c111..4ff951e19 100644 --- a/scripts/buttonGradient/buttonGradient.gml +++ b/scripts/buttonGradient/buttonGradient.gml @@ -51,6 +51,8 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { y = _y; w = _w; + right_click_block = true; + var _bs = min(_h, ui(32)); hovering = hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h); @@ -129,6 +131,7 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { var _cw = _w - ui(4); var _ch = h - _ggh - ui(4 + 2); var _ks = ui(16); + var _hv = noone; draw_sprite_stretched_ext(THEME.menu_button_mask, 0, _ggx, _cy, _ggw, _ch, CDEF.main_mdblack, 1); @@ -154,6 +157,7 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { if(hover && point_in_rectangle(_m[0], _m[1], _kx - _ks / 2, _ky - _ks / 2, _kx + _ks / 2, _ky + _ks / 2)) { _ka = 1; + _hv = _k; if(mouse_press(mb_left, active)) { drag_color_index = _k; @@ -174,6 +178,28 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { BLEND_NORMAL } } + + if(_hv != noone) { + right_click_block = false; + if(array_length(_gradient.keys) > 1 && mouse_press(mb_right, active)) { + array_remove(_gradient.keys, _hv); + _gradient.refresh(); + apply(_gradient); + } + + } else if(point_in_rectangle(_m[0], _m[1], _ggx, _cy, _ggx + _ggw, _cy + _ch)) { + if(mouse_press(mb_left, active)) { + var _ti = clamp((_m[0] - _ggx) / _ggw, 0, 1); + var _va = _gradient.eval(_ti); + var _nk = new gradientKey(_ti, _va); + + _gradient.add(_nk); + + drag_color_index = _nk; + edit_color_mx = _m[0]; + edit_color_sx = _ti; + } + } } if(drag_color_index != -1) { diff --git a/scripts/buttonPalette/buttonPalette.gml b/scripts/buttonPalette/buttonPalette.gml index 8e8c85869..b81979d25 100644 --- a/scripts/buttonPalette/buttonPalette.gml +++ b/scripts/buttonPalette/buttonPalette.gml @@ -125,6 +125,8 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor { var _cy = _y + _pph + ui(4); var _cw = _w - ui(4); var _ch = h - _pph - ui(4 + 2); + var _pd = ui(2); + var _pd2 = _pd / 2; draw_sprite_stretched_ext(THEME.menu_button_mask, 0, _cx, _cy, _cw, _ch, CDEF.main_mdblack, 1); @@ -135,11 +137,11 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor { var _ccw = _cw; var _cch = _colr_h; - draw_sprite_stretched_ext(THEME.palette_mask, 1, _ccx + ui(2), _ccy + ui(2), _ccw - ui(4), _cch - ui(4), _c, 1); + draw_sprite_stretched_ext(THEME.palette_mask, 1, _ccx + _pd2, _ccy + _pd2, _ccw - _pd, _cch - _pd, _c, 1); if(hover && point_in_rectangle(_m[0], _m[1], _ccx, _ccy, _ccx + _ccw, _ccy + _cch - 1)) { BLEND_ADD - draw_sprite_stretched_ext(THEME.menu_button_mask, 1, _ccx + ui(2), _ccy + ui(2), _ccw - ui(4), _cch - ui(4), c_white, .3); + draw_sprite_stretched_ext(THEME.menu_button_mask, 1, _ccx + _pd2, _ccy + _pd2, _ccw - _pd, _cch - _pd, c_white, .3); BLEND_NORMAL if(mouse_press(mb_left, active)) diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 4db6a2651..d6e2c5d35 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -36,10 +36,10 @@ globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION; LATEST_VERSION = 11700; - VERSION = 11710; + VERSION = 11711; SAVE_VERSION = 11690; - VERSION_STRING = "1.17.1.0"; - BUILD_NUMBER = 11710; + VERSION_STRING = "1.17.1.1"; + BUILD_NUMBER = 11711; globalvar HOTKEYS, HOTKEY_CONTEXT; HOTKEYS = ds_map_create(); diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index 8993d346e..314a82807 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -332,7 +332,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc case VALUE_TYPE.surface : param.h = breakLine? ui(96) : ui(48); break; - + case VALUE_TYPE.curve : param.h = breakLine? ui(160) : ui(100); if(point_in_rectangle(_m[0], _m[1], ui(32), _hsy, ui(32) + ww - ui(16), _hsy + param.h)) @@ -342,6 +342,8 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc var _widH = wid.drawParam(param) ?? 0; widH = _widH - (TEXTBOX_HEIGHT * !breakLine); + + mbRight &= wid.right_click_block; #endregion } else if(jun.display_type == VALUE_DISPLAY.label) { #region label draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub); diff --git a/scripts/node_ase_file_read/node_ase_file_read.gml b/scripts/node_ase_file_read/node_ase_file_read.gml index 54c25bd6e..b2f60646d 100644 --- a/scripts/node_ase_file_read/node_ase_file_read.gml +++ b/scripts/node_ase_file_read/node_ase_file_read.gml @@ -128,8 +128,6 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const txt = $"{rn}"; } - - txt += string(rn); if(_hover && point_in_rectangle(_m[0], _m[1], _x + 8, _yy, _x + _w - 8, _yy + hh)) { draw_sprite_stretched_ext(THEME.timeline_node, 0, _x + 8, _tgy, _w - 16, _tgh, c_white, 0.1); @@ -226,12 +224,12 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const read_ase(path, content); - layers = []; + layers = []; var vis = attributes.layer_visible; var frames = content[? "Frames"]; for( var i = 0, n = array_length(frames); i < n; i++ ) { - var frame = frames[i]; + var frame = frames[i]; var chunks = frame[? "Chunks"]; for( var j = 0; j < array_length(chunks); j++ ) { @@ -255,11 +253,13 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const array_push(p_arr, make_color_rgb(plt[k][0], plt[k][1], plt[k][2])); outputs[| 3].setValue(p_arr); break; + case 0x2004: //layer var name = chunk[? "Name"]; array_push(layers, new ase_layer(name)); array_push(vis, true); break; + case 0x2005: //cel var _layer = chunk[? "Layer index"]; var cel = new ase_cel(layers[_layer], chunk, content); diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 3000a2d16..887470ff7 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -726,7 +726,7 @@ function __initNodes() { addNodeObject(generator, "Grid", s_node_grid, "Node_Grid", [1, Node_Grid], ["tile"], "Generate grid pattern."); addNodeObject(generator, "Triangular Grid", s_node_grid_tri, "Node_Grid_Tri", [1, Node_Grid_Tri],, "Generate triangular grid pattern."); addNodeObject(generator, "Hexagonal Grid", s_node_grid_hex, "Node_Grid_Hex", [1, Node_Grid_Hex],, "Generate hexagonal grid pattern."); - addNodeObject(generator, "Pentagonal Grid", s_node_grid_pentagonal, "Node_Grid_Pentagonal", [1, Node_Grid_Pentagonal],, "Generate Pentagonal grid pattern.").patreonExtra(); + addNodeObject(generator, "Pentagonal Grid", s_node_grid_pentagonal, "Node_Grid_Pentagonal", [1, Node_Grid_Pentagonal],, "Generate Pentagonal grid pattern.").patreonExtra(); addNodeObject(generator, "Pytagorean Tile", s_node_pytagorean_tile, "Node_Pytagorean_Tile", [1, Node_Pytagorean_Tile],, "Generate Pytagorean tile pattern.").patreonExtra(); addNodeObject(generator, "Herringbone Tile", s_node_herringbone_tile, "Node_Herringbone_Tile", [1, Node_Herringbone_Tile],, "Generate Herringbone tile pattern.").patreonExtra(); addNodeObject(generator, "Random Tile", s_node_random_tile, "Node_Random_Tile", [1, Node_Random_Tile],, "Generate Random tile pattern.").patreonExtra(); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 7207a3de2..f432ecb54 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -873,7 +873,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion } - if(struct_has(display_data, "side_button") && editWidget.side_button == noone) + if(is_struct(display_data) && struct_has(display_data, "side_button") && editWidget.side_button == noone) editWidget.side_button = display_data.side_button; editWidgetRaw = editWidget; diff --git a/scripts/panel_menu/panel_menu.gml b/scripts/panel_menu/panel_menu.gml index 173d240e0..0d50e85c1 100644 --- a/scripts/panel_menu/panel_menu.gml +++ b/scripts/panel_menu/panel_menu.gml @@ -149,6 +149,7 @@ function Panel_Menu() : PanelContent() constructor { menuItem(__txtx("panel_menu_render_all_nodes", "Render all nodes"), function() { RENDER_ALL_REORDER }, [ THEME.sequence_control, 1 ], ["", "Render all"]), + menuItem(__txtx("panel_menu_execute_exports", "Execute all export nodes"), function() { var key = ds_map_find_first(PROJECT.nodeMap); repeat(ds_map_size(PROJECT.nodeMap)) { diff --git a/scripts/preferences/preferences.gml b/scripts/preferences/preferences.gml index 8b0717368..f312be4ca 100644 --- a/scripts/preferences/preferences.gml +++ b/scripts/preferences/preferences.gml @@ -72,6 +72,7 @@ PREFERENCES.panel_preview_dragging = MOD_KEY.alt; PREFERENCES.panel_preview_show_real_fps = false; + // PREFERENCES.panel_preview_tran_colors = [ ]; PREFERENCES.panel_menu_resource_monitor = false; PREFERENCES.panel_menu_right_control = os_type == os_windows; diff --git a/scripts/widget/widget.gml b/scripts/widget/widget.gml index 6922b186e..a34a27865 100644 --- a/scripts/widget/widget.gml +++ b/scripts/widget/widget.gml @@ -7,6 +7,8 @@ function widget() constructor { parent = noone; interactable = true; + right_click_block = true; + side_button = noone; front_button = noone;