diff --git a/fonts/_f_sdf/_f_sdf.old.png b/fonts/_f_sdf/_f_sdf.old.png index 15da35441..3b77f12d6 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 3b77f12d6..ea62b56ae 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 fcaf06e27..9044032b0 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 9044032b0..89ca6a387 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/scripts/buttonColor/buttonColor.gml b/scripts/buttonColor/buttonColor.gml index 590e5fec9..56338c9b3 100644 --- a/scripts/buttonColor/buttonColor.gml +++ b/scripts/buttonColor/buttonColor.gml @@ -69,13 +69,14 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor { current_color = _color; var _cw = _w; + var _bs = min(_h, ui(32)); if(interactable) { var bx = _x + _cw - ui(32); _cw -= ui(32); b_picker.setFocusHover(active && !instance_exists(o_dialog_color_quick_pick), hover); - b_picker.draw(bx, _y + _h / 2 - ui(16), ui(32), ui(32), _m, THEME.button_hide); + b_picker.draw(bx, _y + _h / 2 - _bs / 2, ui(32), _bs, _m, THEME.button_hide); b_picker.icon_blend = c_white; b_picker.icon_index = 0; if(instance_exists(o_dialog_color_selector) && o_dialog_color_selector.selector.dropper_active && o_dialog_color_selector.drop_target != noone) { @@ -91,7 +92,7 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor { _cw -= ui(32 + 4); b_quick_pick.setFocusHover(active, hover); - b_quick_pick.draw(bx, _y + _h / 2 - ui(16), ui(32), ui(32), _m, THEME.button_hide); + b_quick_pick.draw(bx, _y + _h / 2 - _bs / 2, ui(32), _bs, _m, THEME.button_hide); } _cw -= ui(8); diff --git a/scripts/controlPointBox/controlPointBox.gml b/scripts/controlPointBox/controlPointBox.gml index d773e6f97..85f81003b 100644 --- a/scripts/controlPointBox/controlPointBox.gml +++ b/scripts/controlPointBox/controlPointBox.gml @@ -18,19 +18,16 @@ function controlPointBox(_onModify) : widget() constructor { onModify = _onModify; onSurfaceSize = -1; - tbCx = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.cx, toNumber(val)); }); - tbCy = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.cy, toNumber(val)); }); - tbFx = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.fx, toNumber(val)); }); - tbFy = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.fy, toNumber(val)); }); - tbW = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.width, max(0, toNumber(val))); }); - tbH = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.height, max(0, toNumber(val))); }); + tbCx = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.cx, toNumber(val)); }); tbCx.hide = true; tbCx.slidable = true; + tbCy = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.cy, toNumber(val)); }); tbCy.hide = true; tbCy.slidable = true; + tbFx = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.fx, toNumber(val)); }); tbFx.hide = true; tbFx.slidable = true; + tbFy = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.fy, toNumber(val)); }); tbFy.hide = true; tbFy.slidable = true; + tbW = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.width, max(0, toNumber(val))); }); tbW.hide = true; tbW.slidable = true; + tbH = new textBox(TEXTBOX_INPUT.number, function(val) { return onModify(PUPPET_CONTROL.height, max(0, toNumber(val))); }); tbH.hide = true; tbH.slidable = true; rot = new rotator(function(val) { return onModify(PUPPET_CONTROL.fy, toNumber(val)); }); - tbFx.slidable = true; - tbFy.slidable = true; - tbW.slidable = true; - tbH.slidable = true; - sW = new slider(0, 32, 0.1, function(val) { onModify(PUPPET_CONTROL.width, toNumber(val)); }); + sW = new textBox(TEXTBOX_INPUT.number, function(val) { onModify(PUPPET_CONTROL.width, toNumber(val)); }) + .setSlidable(0.01, false, [ 1, 32 ]); sMode = [ __txtx("widget_control_point_move", "Move"), @@ -42,7 +39,7 @@ function controlPointBox(_onModify) : widget() constructor { function(val) { onModify(PUPPET_CONTROL.mode, toNumber(val)); } ); - widgets = [ scMode, tbCx, tbCy, tbFx, tbFy, tbW, tbH, rot ]; + widgets = [ scMode, tbCx, tbCy, tbFx, tbFy, tbW, tbH, rot, sW ]; static setInteract = function(interactable = noone) { self.interactable = interactable; @@ -82,43 +79,65 @@ function controlPointBox(_onModify) : widget() constructor { scMode.draw(_x, yy, _w, TEXTBOX_HEIGHT, sMode[_mode], _m, _rx, _ry); yy += TEXTBOX_HEIGHT + ui(8); - var lw = ui(80); - var w = _w / 2 - lw; + var _ww = _w / 2; + var _wh = TEXTBOX_HEIGHT; - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); - draw_text(_x, yy + ui(17), "cx"); - draw_text(_x + _w / 2 + ui(10), yy + ui(17), "cy"); - tbCx.draw(_x + lw, yy, w, TEXTBOX_HEIGHT, _cx, _m); - tbCy.draw(_x + _w / 2 + lw, yy, w, TEXTBOX_HEIGHT, _cy, _m); - yy += TEXTBOX_HEIGHT + ui(8); + draw_sprite_stretched_ext(THEME.textbox, 3, _x, yy, _w, _wh, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _x, yy, _w, _wh, c_white, 0.5 + 0.5 * interactable); + + draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); + draw_set_alpha(0.5); + draw_text(_x + ui(8), yy + _wh / 2, "cx"); + draw_text(_x + _ww + ui(8), yy + _wh / 2, "cy"); + draw_set_alpha(1); + + tbCx.draw(_x, yy, _ww, _wh, _cx, _m); + tbCy.draw(_x + _ww, yy, _ww, _wh, _cy, _m); + yy += _wh + ui(8); switch(_mode) { case PUPPET_FORCE_MODE.move: case PUPPET_FORCE_MODE.puppet: - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); - draw_text(_x, yy + ui(17), "fx"); - draw_text(_x + _w / 2 + ui(10), yy + ui(17), "fy"); - tbFx.draw(_x + lw, yy, w, TEXTBOX_HEIGHT, _fx, _m); - tbFy.draw(_x + _w / 2 + lw, yy, w, TEXTBOX_HEIGHT, _fy, _m); - yy += TEXTBOX_HEIGHT + ui(8); + + draw_sprite_stretched_ext(THEME.textbox, 3, _x, yy, _w, _wh, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _x, yy, _w, _wh, c_white, 0.5 + 0.5 * interactable); + + draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); + draw_set_alpha(0.5); + draw_text(_x + ui(8), yy + _wh / 2, "fx"); + draw_text(_x + _ww + ui(8), yy + _wh / 2, "fy"); + draw_set_alpha(1); + + tbFx.draw(_x, yy, _ww, _wh, _fx, _m); + tbFy.draw(_x + _ww, yy, _ww, _wh, _fy, _m); + yy += _wh + ui(8); if(_mode == PUPPET_FORCE_MODE.move) { + sW.draw(_x, yy, _w, _wh, _wid, _m); + draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); - draw_text(_x, yy + ui(17), __txt("radius")); - sW.draw(_x + lw, yy, _w - lw, TEXTBOX_HEIGHT, _wid, _m); - yy += TEXTBOX_HEIGHT + ui(8); + draw_set_alpha(0.5); + draw_text(_x + ui(8), yy + _wh / 2, __txt("radius")); + draw_set_alpha(1); + + yy += _wh + ui(8); } break; - case PUPPET_FORCE_MODE.wind: - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); - draw_text(_x, yy + ui(17), __txt("strength")); - tbFx.draw(_x + lw, yy, _w - lw, TEXTBOX_HEIGHT, _fx, _m); - yy += TEXTBOX_HEIGHT + ui(8); - draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); - draw_text(_x, yy + ui(17), __txt("width")); - tbW.draw(_x + lw, yy, _w - lw, TEXTBOX_HEIGHT, _wid, _m); - yy += TEXTBOX_HEIGHT + ui(8); + case PUPPET_FORCE_MODE.wind: + + draw_sprite_stretched_ext(THEME.textbox, 3, _x, yy, _w, _wh, c_white, 1); + draw_sprite_stretched_ext(THEME.textbox, 0, _x, yy, _w, _wh, c_white, 0.5 + 0.5 * interactable); + + draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub); + draw_set_alpha(0.5); + draw_text(_x + ui(8), yy + _wh / 2, __txt("strength")); + draw_text(_x + _ww + ui(8), yy + _wh / 2, __txt("width")); + draw_set_alpha(1); + + tbFx.draw(_x, yy, _ww, _wh, _fx, _m); + tbW.draw( _x + _ww, yy, _ww, _wh, _wid, _m); + yy += _wh + ui(8); var _rh = rot.draw(_x, yy, _w, _fy, _m); yy += _rh + ui(8); diff --git a/scripts/fontScrollBox/fontScrollBox.gml b/scripts/fontScrollBox/fontScrollBox.gml index fbbc3ac04..4f01b172f 100644 --- a/scripts/fontScrollBox/fontScrollBox.gml +++ b/scripts/fontScrollBox/fontScrollBox.gml @@ -34,12 +34,13 @@ function fontScrollBox(_onModify) : widget() constructor { open_rx = _rx; open_ry = _ry; h = _h; - w = _w; + + var _bs = min(_h, ui(32)); if(extra_button != noone) { extra_button.setFocusHover(active, hover); - extra_button.draw(_x + _w - ui(32), _y + _h / 2 - ui(32 / 2), ui(32), ui(32), _m, THEME.button_hide); - w -= ui(40); + extra_button.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); + w -= _bs + ui(4); } if(open) { diff --git a/scripts/matrixGrid/matrixGrid.gml b/scripts/matrixGrid/matrixGrid.gml index aad1d0fe9..856113e27 100644 --- a/scripts/matrixGrid/matrixGrid.gml +++ b/scripts/matrixGrid/matrixGrid.gml @@ -86,7 +86,7 @@ function matrixGrid(_type, _size, _onModify, _unit = noone) : widget() construct w = _w; var hh = TEXTBOX_HEIGHT; - h = hh * size - ui(8); + h = hh * size; if(extras && instanceof(extras) == "buttonClass") { extras.setFocusHover(active, hover); diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index b03c246d1..d530f6652 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -35,6 +35,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc case "rotator" : case "rotatorRandom" : case "rotatorRange" : + case "transformBox" : breakLine = true; } #endregion diff --git a/scripts/node_FLIP_render/node_FLIP_render.gml b/scripts/node_FLIP_render/node_FLIP_render.gml index ebdb8da08..291fc0414 100644 --- a/scripts/node_FLIP_render/node_FLIP_render.gml +++ b/scripts/node_FLIP_render/node_FLIP_render.gml @@ -29,7 +29,7 @@ function Node_FLIP_Render(_x, _y, _group = noone) : Node(_x, _y, _group) constru inputs[| 8] = nodeValue("Additive", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true); inputs[| 9] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ]) - .setDisplay(VALUE_DISPLAY.range); + .setDisplay(VALUE_DISPLAY.slider_range); inputs[| 10] = nodeValue("Segments", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1); diff --git a/scripts/node_gradient_points/node_gradient_points.gml b/scripts/node_gradient_points/node_gradient_points.gml index 5b7423792..f5e54e6e7 100644 --- a/scripts/node_gradient_points/node_gradient_points.gml +++ b/scripts/node_gradient_points/node_gradient_points.gml @@ -20,7 +20,7 @@ function Node_Gradient_Points(_x, _y, _group = noone) : Node_Processor(_x, _y, _ inputs[| 6] = nodeValue("Color 3", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white ); inputs[| 7] = nodeValue("Center 4", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, DEF_SURF ) - .setDisplay(VALUE_DISPLAY.vector) + .setDisplay(VALUE_DISPLAY.vector, { useGlobal : false }) .setUnitRef(function(index) { return getDimension(index); }); inputs[| 8] = nodeValue("Color 4", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white ); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 5c3120fee..3d4b06848 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -922,9 +922,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1 / 10); if(len == 2) { + var _dim = struct_try_get(display_data, "useGlobal", true); extract_node = [ "Node_Vector2", "Node_Path" ]; - if(def_val == DEF_SURF) { + if(_dim && def_val == DEF_SURF) { value_tag = "dimension"; node.attributes.use_project_dimension = true; editWidget.side_button = button(function() { diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index be2e80f91..28fc784c3 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -126,26 +126,36 @@ function Panel_Inspector() : PanelContent() constructor { #endregion #region ++++ menus ++++ + static nodeExpandAll = function(node) { + if(node.input_display_list == -1) return; + + var dlist = node.input_display_list; + for( var i = 0, n = array_length(dlist); i < n; i++ ) { + if(!is_array(dlist[i])) continue; + dlist[i][@ 1] = false; + } + } + + static nodeCollapseAll = function(node) { + if(node.input_display_list == -1) return; + + var dlist = node.input_display_list; + for( var i = 0, n = array_length(dlist); i < n; i++ ) { + if(!is_array(dlist[i])) continue; + dlist[i][@ 1] = true; + } + } + group_menu = [ menuItem(__txt("Expand all"), function() { - if(inspecting == noone) return; - if(inspecting.input_display_list == -1) return; - - var dlist = inspecting.input_display_list; - for( var i = 0, n = array_length(dlist); i < n; i++ ) { - if(!is_array(dlist[i])) continue; - dlist[i][@ 1] = false; - } + if(inspecting != noone) nodeExpandAll(inspecting); + for( var i = 0, n = array_length(inspectings); i < n; i++ ) + nodeExpandAll(inspectings[i]); }), menuItem(__txt("Collapse all"), function() { - if(inspecting == noone) return; - if(inspecting.input_display_list == -1) return; - - var dlist = inspecting.input_display_list; - for( var i = 0, n = array_length(dlist); i < n; i++ ) { - if(!is_array(dlist[i])) continue; - dlist[i][@ 1] = true; - } + if(inspecting != noone) nodeCollapseAll(inspecting); + for( var i = 0, n = array_length(inspectings); i < n; i++ ) + nodeCollapseAll(inspectings[i]); }), ] diff --git a/scripts/pathArrayBox/pathArrayBox.gml b/scripts/pathArrayBox/pathArrayBox.gml index 5d514df58..70c7bf9b8 100644 --- a/scripts/pathArrayBox/pathArrayBox.gml +++ b/scripts/pathArrayBox/pathArrayBox.gml @@ -27,9 +27,10 @@ function pathArrayBox(_target, _data, _onClick) : widget() constructor { w = _w; h = _h; + var _bs = min(_h, ui(32)); openPath.setFocusHover(active, hover); - openPath.draw(_x + _w - ui(32), _y + _h / 2 - ui(32 / 2), ui(32), ui(32), _m, THEME.button_hide); - _w -= ui(40); + openPath.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); + _w -= _bs + ui(4); var click = false; draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h); diff --git a/scripts/quarternionBox/quarternionBox.gml b/scripts/quarternionBox/quarternionBox.gml index 42719d19b..eb1821791 100644 --- a/scripts/quarternionBox/quarternionBox.gml +++ b/scripts/quarternionBox/quarternionBox.gml @@ -65,7 +65,7 @@ function quarternionBox(_onModify) : widget() constructor { current_value = _data; - var bs = ui(32); + var bs = min(_h, ui(32)); var bx = _x + _w - bs; var by = _y + _h / 2 - bs / 2; var _disp = struct_try_get(_display_data, "angle_display"); @@ -97,7 +97,7 @@ function quarternionBox(_onModify) : widget() constructor { tb[i].hide = true; tb[i].setFocusHover(clickable && active, hover); - tb[i].draw(bx + ui(24), _y, disp_w - ui(24), _h, _a, _m); + tb[i].draw(bx, _y, disp_w, _h, _a, _m); bx += disp_w; } diff --git a/scripts/rangeBox/rangeBox.gml b/scripts/rangeBox/rangeBox.gml index d71d583c8..fda1bfbaa 100644 --- a/scripts/rangeBox/rangeBox.gml +++ b/scripts/rangeBox/rangeBox.gml @@ -2,6 +2,8 @@ function rangeBox(_type, _onModify) : widget() constructor { onModify = _onModify; linked = false; + disp_w = 0; + tooltip = new tooltipSelector("Value Type", [ __txtx("widget_range_random", "Random Range"), __txtx("widget_range_constant", "Constant"), @@ -28,6 +30,7 @@ function rangeBox(_type, _onModify) : widget() constructor { for(var i = 0; i < 2; i++) { tb[i] = new textBox(_type, onModifySingle[i]); tb[i].slidable = true; + tb[i].hide = true; } static setSlideSpeed = function(speed) { @@ -62,9 +65,11 @@ function rangeBox(_type, _onModify) : widget() constructor { tooltip.index = linked; var _icon_blend = linked? COLORS._main_accent : COLORS._main_icon; - var bx = _x; - var by = _y + _h / 2 - ui(24 / 2); - if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, active, hover, tooltip, THEME.value_link, linked, _icon_blend) == 2) { + var _bs = min(_h, ui(32)); + var bx = _x; + var by = _y + _h / 2 - _bs / 2; + + if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, active, hover, tooltip, THEME.value_link, linked, _icon_blend) == 2) { linked = !linked; _display_data.linked = linked; @@ -74,26 +79,25 @@ function rangeBox(_type, _onModify) : widget() constructor { } } - _x += ui(28); - _w -= ui(28); + _x += _bs + ui(4); + _w -= _bs + ui(4); - tb[0].hide = !linked; - tb[1].hide = !linked; + var ww = linked? _w : _w / 2; + disp_w = disp_w == 0? ww : lerp_float(disp_w, ww, 5); + 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); + if(linked) { tb[0].setFocusHover(active, hover); - tb[0].draw(_x + ui(8), _y, _w - ui(8), _h, _data[0], _m); + tb[0].draw(_x, _y, disp_w, _h, _data[0], _m); } else if(is_array(_data) && array_length(_data) >= 2) { - 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); - - var ww = _w / 2; for(var i = 0; i < 2; i++) { tb[i].setFocusHover(active, hover); - var bx = _x + ww * i; - tb[i].draw(bx, _y, ww, _h, _data[i], _m); + var bx = _x + disp_w * i; + tb[i].draw(bx, _y, disp_w, _h, _data[i], _m); } } diff --git a/scripts/textBox/textBox.gml b/scripts/textBox/textBox.gml index 17b3da015..e02972376 100644 --- a/scripts/textBox/textBox.gml +++ b/scripts/textBox/textBox.gml @@ -380,7 +380,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { 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); + _w -= bs + ui(4); } draw_set_font(font == noone? f_p0 : font); @@ -434,10 +434,9 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { #region multiplier if(_w > ui(80) && input == TEXTBOX_INPUT.number) { - draw_set_text(f_p0b, fa_left, fa_center, COLORS._main_text_sub); draw_set_alpha(0.5); - if(hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + ui(32), _y + _h)) { + if(hover && point_in_rectangle(_m[0], _m[1], _x + _w - ui(32), _y, _x + _w, _y + _h)) { draw_set_alpha(1); if(mouse_press(mb_left, active)) { @@ -446,11 +445,10 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { apply(); } } - - if(key_mod_press(ALT)) - draw_text_add(_x + ui(8), _y + _h / 2, "/2"); - else - draw_text_add(_x + ui(8), _y + _h / 2, "x2"); + + draw_set_text(f_p0b, fa_center, fa_center, COLORS._main_text_sub); + if(key_mod_press(ALT)) draw_text_add(_x + _w - ui(16), _y + _h / 2, "/2"); + else draw_text_add(_x + _w - ui(16), _y + _h / 2, "x2"); draw_set_alpha(1); } #endregion @@ -544,10 +542,8 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { } if(hover && hoverRect) { - if(hide) - draw_sprite_stretched_ext(THEME.textbox, 1, _x, _y, _w, _h, boxColor, 0.5); - else - draw_sprite_stretched_ext(THEME.textbox, 1, _x, _y, _w, _h, boxColor, 0.5 + 0.5 * interactable); + draw_sprite_stretched_ext(THEME.textbox, 1, _x, _y, _w, _h, boxColor, 0.5 + (0.5 * interactable)); + if(mouse_press(mb_left, active)) activate(); diff --git a/scripts/vectorBox/vectorBox.gml b/scripts/vectorBox/vectorBox.gml index 11eb0be17..a1883c720 100644 --- a/scripts/vectorBox/vectorBox.gml +++ b/scripts/vectorBox/vectorBox.gml @@ -109,26 +109,26 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor { current_value = _data; + var _bs = min(_h, ui(32)); + if(side_button) { 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(4); } if(unit != noone && unit.reference != noone) { - _w += ui(4); - unit.triggerButton.setFocusHover(iactive, ihover); - unit.draw(_x + _w - ui(32), _y + _h / 2 - ui(32 / 2), ui(32), ui(32), _m); - _w -= ui(40); + unit.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m); + _w -= _bs + ui(4); } if(linkable) { var _icon_blend = linked? COLORS._main_accent : (link_inactive_color == noone? COLORS._main_icon : link_inactive_color); var bx = _x; - var by = _y + _h / 2 - ui(24 / 2); + var by = _y + _h / 2 - _bs / 2; - if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, active, hover, tooltip, THEME.value_link, linked, _icon_blend) == 2) { + if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, active, hover, tooltip, THEME.value_link, linked, _icon_blend) == 2) { linked = !linked; _display_data.linked = linked; @@ -138,8 +138,8 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor { } } - _x += ui(28); - _w -= ui(28); + _x += _bs + ui(4); + _w -= _bs + ui(4); } var sz = min(size, array_length(_data)); diff --git a/scripts/vectorRangeBox/vectorRangeBox.gml b/scripts/vectorRangeBox/vectorRangeBox.gml index 5fa1f82e7..761270dee 100644 --- a/scripts/vectorRangeBox/vectorRangeBox.gml +++ b/scripts/vectorRangeBox/vectorRangeBox.gml @@ -4,6 +4,8 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const unit = _unit; linked = false; + disp_h = 0; + tooltip = new tooltipSelector("Value Type", [ __txtx("widget_range_random", "Random Range"), __txtx("widget_range_constant", "Constant"), @@ -63,14 +65,17 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const w = _w; if(struct_has(_display_data, "linked")) linked = _display_data.linked; - h = linked? _h : _h * 2 + ui(4); + var _hh = linked? _h : _h * 2 + ui(4); + h = h == 0? _hh : lerp_float(h, _hh, 5); tooltip.index = linked; var _icon_blend = linked? COLORS._main_accent : COLORS._main_icon; - var bx = _x; - var by = _y + _h / 2 - ui(24 / 2); - if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, active, hover, tooltip, THEME.value_link, linked, _icon_blend) == 2) { + var _bs = min(_h, ui(32)); + var bx = _x; + var by = _y + _h / 2 - _bs / 2; + + if(buttonInstant(THEME.button_hide, bx, by, _bs, _bs, _m, active, hover, tooltip, THEME.value_link, linked, _icon_blend) == 2) { linked = !linked; _display_data.linked = linked; @@ -82,8 +87,8 @@ function vectorRangeBox(_size, _type, _onModify, _unit = noone) : widget() const } } - _x += ui(28); - _w -= ui(28); + _x += _bs + ui(4); + _w -= _bs + ui(4); var ww = _w / 2;