- [Wiggler] Fix random seed button reset the wrong value.

This commit is contained in:
Tanasart 2024-06-20 09:32:07 +07:00
parent 1e77dcc18d
commit 35753e22e8
2 changed files with 13 additions and 7 deletions

View file

@ -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] }); .setDisplay(VALUE_DISPLAY.slider, { range: [1, 32, 0.1] });
inputs[| inl + 2] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, seed_random(6)) 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 ) inputs[| inl + 3] = nodeValue("Clip", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b11 )
.setDisplay(VALUE_DISPLAY.toggle, { data : [ "Start", "End" ] }); .setDisplay(VALUE_DISPLAY.toggle, { data : [ "Start", "End" ] });

View file

@ -457,9 +457,15 @@ function Panel_Collection() : PanelContent() constructor {
var bh = line_get_height(f_p0b, 8); var bh = line_get_height(f_p0b, 8);
var rootx = 0; var rootx = 0;
draw_set_font(f_p0b);
for( var i = 0, n = array_length(roots); i < n; i++ ) { for( var i = 0, n = array_length(roots); i < n; i++ ) {
var r = roots[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 _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; mode = i;
root = r[1]; root = r[1];
context = root; context = root;