From 35753e22e86cbb1483f4d7ade85761d7c624c481 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Thu, 20 Jun 2024 09:32:07 +0700 Subject: [PATCH] - [Wiggler] Fix random seed button reset the wrong value. --- scripts/node_fn_wiggler/node_fn_wiggler.gml | 2 +- scripts/panel_collection/panel_collection.gml | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/node_fn_wiggler/node_fn_wiggler.gml b/scripts/node_fn_wiggler/node_fn_wiggler.gml index 91724680b..7ab59c53c 100644 --- a/scripts/node_fn_wiggler/node_fn_wiggler.gml +++ b/scripts/node_fn_wiggler/node_fn_wiggler.gml @@ -8,7 +8,7 @@ function Node_Wiggler(_x, _y, _group = noone) : Node_Fn(_x, _y, _group) construc .setDisplay(VALUE_DISPLAY.slider, { range: [1, 32, 0.1] }); inputs[| inl + 2] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, seed_random(6)) - .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[| 2].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); + .setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[| inl + 2].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) }); inputs[| inl + 3] = nodeValue("Clip", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b11 ) .setDisplay(VALUE_DISPLAY.toggle, { data : [ "Start", "End" ] }); diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index 3873c0b58..252138e98 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -451,15 +451,21 @@ function Panel_Collection() : PanelContent() constructor { #endregion } - - var _x = ui(20); - var _y = ui(24); - var bh = line_get_height(f_p0b, 8); + + var _x = ui(20); + var _y = ui(24); + var bh = line_get_height(f_p0b, 8); var rootx = 0; + draw_set_font(f_p0b); + for( var i = 0, n = array_length(roots); i < n; i++ ) { - var r = roots[i]; - if(buttonInstant(THEME.button_hide_fill, _x - ui(8), _y - bh / 2, string_width(r[0]) + ui(20), bh, [mx, my], pFOCUS, pHOVER) == 2) { + var r = roots[i]; + var _bx = _x - ui(8); + var _by = _y - bh / 2; + var _bw = string_width(r[0]) + ui(20); + + if(buttonInstant(THEME.button_hide_fill, _bx, _by, _bw, bh, [ mx, my ], pFOCUS, pHOVER) == 2) { mode = i; root = r[1]; context = root;