From 87295a5f882a51ae27314678df5f84bb58ebd171 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Wed, 3 Jul 2024 10:32:12 +0700 Subject: [PATCH] separating value --- scripts/nodeValue_drawer/nodeValue_drawer.gml | 1 + scripts/textBox/textBox.gml | 5 +++-- scripts/vectorBox/vectorBox.gml | 6 ++++-- scripts/widget/widget.gml | 7 ++++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index 14b7cd45b..2619b0243 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -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 : diff --git a/scripts/textBox/textBox.gml b/scripts/textBox/textBox.gml index f70a0546b..8d33867ab 100644 --- a/scripts/textBox/textBox.gml +++ b/scripts/textBox/textBox.gml @@ -32,7 +32,8 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { slider_def_val = 0; slider_cur_val = 0; - label = ""; + 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); diff --git a/scripts/vectorBox/vectorBox.gml b/scripts/vectorBox/vectorBox.gml index 298e0c314..6f37f9a62 100644 --- a/scripts/vectorBox/vectorBox.gml +++ b/scripts/vectorBox/vectorBox.gml @@ -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].hide = !per_line; - tb[i].label = axis[i]; + 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); } diff --git a/scripts/widget/widget.gml b/scripts/widget/widget.gml index f511432d7..b483991f6 100644 --- a/scripts/widget/widget.gml +++ b/scripts/widget/widget.gml @@ -18,7 +18,8 @@ function widget() constructor { lua_thread = noone; lua_thread_key = ""; - font = f_p0; + 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; } \ No newline at end of file