separating value

This commit is contained in:
Tanasart 2024-07-03 10:32:12 +07:00
parent b8f12c43b7
commit 87295a5f88
4 changed files with 14 additions and 5 deletions

View file

@ -320,6 +320,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
var _show = jun.showValue();
var param = new widgetParam(editBoxX, editBoxY, editBoxW, editBoxH, _show, jun.display_data, _m, rx, ry);
param.font = viewMode == INSP_VIEW_MODE.spacious? f_p0 : f_p2;
param.sep_axis = jun.sep_axis;
switch(jun.type) {
case VALUE_TYPE.float :

View file

@ -33,6 +33,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
slider_cur_val = 0;
label = "";
labelColor = COLORS._main_text_sub;
highlight_color = -1;
highlight_alpha = 1;
@ -501,7 +502,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
draw_sprite_ui_uniform(THEME.arrow, 0, _ax1, _ay, 1, COLORS._main_accent, 1);
} else if(label != "") {
draw_set_text(font, fa_left, fa_center, COLORS._main_text_sub);
draw_set_text(font, fa_left, fa_center, labelColor);
draw_set_alpha(0.5);
draw_text_add(_x + padding, _y + _h / 2, label);

View file

@ -164,8 +164,10 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor {
var by = per_line? _y + (_h + ui(4)) * i : _y;
tb[i].setFocusHover(active, hover);
tb[i].labelColor = sep_axis? COLORS.axis[i] : COLORS._main_text_sub;
tb[i].hide = !per_line;
tb[i].label = axis[i];
tb[i].draw(bx, by, ww, _h, _data[i], _m);
}

View file

@ -19,6 +19,7 @@ function widget() constructor {
lua_thread_key = "";
font = f_p0;
sep_axis = false;
x = 0;
y = 0;
@ -49,6 +50,8 @@ function widget() constructor {
font = params.font;
rx = params.rx;
ry = params.ry;
sep_axis = params.sep_axis;
} #endregion
static trigger = function() { }
@ -114,4 +117,6 @@ function widgetParam(x, y, w, h, data, display_data = {}, m = mouse_ui, rx = 0,
self.display_data = display_data;
self.font = f_p0;
sep_axis = false;
}