diff --git a/datafiles/data/Theme.zip b/datafiles/data/Theme.zip index 61fe8d2c4..1bd648088 100644 Binary files a/datafiles/data/Theme.zip and b/datafiles/data/Theme.zip differ diff --git a/objects/o_main/Draw_75.gml b/objects/o_main/Draw_75.gml index b3642ce99..9f324cf8d 100644 --- a/objects/o_main/Draw_75.gml +++ b/objects/o_main/Draw_75.gml @@ -108,23 +108,31 @@ if(winMan_isMinimized()) exit; #region dragging if(DRAGGING != noone) { + var mx = mouse_mx + ui(8); + var my = mouse_my + ui(8); + switch(DRAGGING.type) { case "Color" : - draw_sprite_stretched_ext(THEME.color_picker_box, 1, mouse_mx + ui(-16), mouse_my + ui(-16), ui(32), ui(32), DRAGGING.data, 0.5); + draw_sprite_stretched_ext(THEME.menu_button_mask, 0, mx, my, ui(32), ui(32), DRAGGING.data, 1); + draw_sprite_stretched_add(THEME.menu_button_mask, 1, mx, my, ui(32), ui(32), c_white, 0.3); break; case "Palette" : - drawPalette(DRAGGING.data, mouse_mx - ui(64), mouse_my - ui(12), ui(128), ui(24), 0.5); + var _l = array_safe_length(DRAGGING.data); + var _w = max(ui(128), _l * ui(10)); + drawPalette(DRAGGING.data, mx, my, _w, ui(24), 1); + draw_sprite_stretched_add(THEME.menu_button_mask, 1, mx, my, _w, ui(24), c_white, 0.3); break; case "Gradient" : - DRAGGING.data.draw(mouse_mx - ui(64), mouse_my - ui(12), ui(128), ui(24), 0.5); + DRAGGING.data.draw(mx, my, ui(128), ui(24), 1); + draw_sprite_stretched_add(THEME.menu_button_mask, 1, mx, my, ui(128), ui(24), c_white, 0.3); break; case "Bool" : draw_set_alpha(0.5); draw_set_text(f_h3, fa_center, fa_center, COLORS._main_text); - draw_text_bbox({ xc: mouse_mx, yc: mouse_my, w: ui(128), h: ui(24) }, __txt(DRAGGING.data? "True" : "False")); + draw_text_bbox({ xc: mx, yc: my, w: ui(128), h: ui(24) }, __txt(DRAGGING.data? "True" : "False")); draw_set_alpha(1); break; @@ -133,14 +141,14 @@ if(winMan_isMinimized()) exit; case "Collection" : if(DRAGGING.data.spr) { var ss = ui(48) / max(sprite_get_width(DRAGGING.data.spr), sprite_get_height(DRAGGING.data.spr)) - draw_sprite_ext(DRAGGING.data.spr, 0, mouse_mx + ui(8), mouse_my + ui(8), ss, ss, 0, c_white, 0.5); + draw_sprite_ext(DRAGGING.data.spr, 0, mx, my, ss, ss, 0, c_white, 1); } break; default: draw_set_alpha(0.5); draw_set_text(f_h3, fa_center, fa_center, COLORS._main_text); - draw_text_bbox({ xc: mouse_mx, yc: mouse_my, w: ui(128), h: ui(24) }, DRAGGING.data); + draw_text_bbox({ xc: mx, yc: my, w: ui(128), h: ui(24) }, DRAGGING.data); draw_set_alpha(1); } diff --git a/scripts/buttonGradient/buttonGradient.gml b/scripts/buttonGradient/buttonGradient.gml index 4ff951e19..1eb3b163b 100644 --- a/scripts/buttonGradient/buttonGradient.gml +++ b/scripts/buttonGradient/buttonGradient.gml @@ -11,6 +11,8 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { edit_color_mx = 0; edit_color_sx = 0; + hover_index = 0; + function apply(value) { #region if(!interactable) return; onApply(value); @@ -132,6 +134,8 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { var _ch = h - _ggh - ui(4 + 2); var _ks = ui(16); var _hv = noone; + var _hi = noone; + var _hover_index = hover_index; draw_sprite_stretched_ext(THEME.menu_button_mask, 0, _ggx, _cy, _ggw, _ch, CDEF.main_mdblack, 1); @@ -158,6 +162,7 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { if(hover && point_in_rectangle(_m[0], _m[1], _kx - _ks / 2, _ky - _ks / 2, _kx + _ks / 2, _ky + _ks / 2)) { _ka = 1; _hv = _k; + _hi = i; if(mouse_press(mb_left, active)) { drag_color_index = _k; @@ -169,13 +174,18 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { triggerSingle(_k); } - if(drag_color_index == _k || edit_color_index == _k) { - draw_sprite_stretched_ext(THEME.menu_button_mask, 1, _kx - _ks / 2, _ky - _ks / 2, _ks, _ks, COLORS._main_accent, 1); + if(_hover_index == i && DRAGGING && DRAGGING.type == "Color") { + draw_sprite_stretched_ext(THEME.menu_button_mask, 1, _kx - _ks / 2, _ky - _ks / 2, _ks, _ks, COLORS._main_value_positive, 1); + if(mouse_release(mb_left)) { + _k.value = DRAGGING.data; + apply(current_gradient); + } } else { - BLEND_ADD - draw_sprite_stretched_ext(THEME.menu_button_mask, 1, _kx - _ks / 2, _ky - _ks / 2, _ks, _ks, c_white, _ka); - BLEND_NORMAL + if(drag_color_index == _k || edit_color_index == _k) + draw_sprite_stretched_ext(THEME.menu_button_mask, 1, _kx - _ks / 2, _ky - _ks / 2, _ks, _ks, COLORS._main_accent, 1); + else + draw_sprite_stretched_add(THEME.menu_button_mask, 1, _kx - _ks / 2, _ky - _ks / 2, _ks, _ks, c_white, _ka); } } @@ -200,6 +210,8 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor { edit_color_sx = _ti; } } + + hover_index = _hi; } if(drag_color_index != -1) { diff --git a/scripts/buttonPalette/buttonPalette.gml b/scripts/buttonPalette/buttonPalette.gml index b81979d25..40b370bcd 100644 --- a/scripts/buttonPalette/buttonPalette.gml +++ b/scripts/buttonPalette/buttonPalette.gml @@ -140,12 +140,19 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor { draw_sprite_stretched_ext(THEME.palette_mask, 1, _ccx + _pd2, _ccy + _pd2, _ccw - _pd, _cch - _pd, _c, 1); if(hover && point_in_rectangle(_m[0], _m[1], _ccx, _ccy, _ccx + _ccw, _ccy + _cch - 1)) { - BLEND_ADD - draw_sprite_stretched_ext(THEME.menu_button_mask, 1, _ccx + _pd2, _ccy + _pd2, _ccw - _pd, _cch - _pd, c_white, .3); - BLEND_NORMAL - - if(mouse_press(mb_left, active)) - triggerSingle(i); + if(DRAGGING && DRAGGING.type == "Color") { + draw_sprite_stretched_ext(THEME.menu_button_mask, 1, _ccx + _pd2, _ccy + _pd2, _ccw - _pd, _cch - _pd, COLORS._main_value_positive, 1); + if(mouse_release(mb_left)) { + current_palette[i] = DRAGGING.data; + apply(current_palette); + } + + } else { + draw_sprite_stretched_add(THEME.menu_button_mask, 1, _ccx + _pd2, _ccy + _pd2, _ccw - _pd, _cch - _pd, c_white, .3); + + if(mouse_press(mb_left, active)) + triggerSingle(i); + } } } } @@ -218,21 +225,40 @@ function drawPalette(_pal, _x, _y, _w, _h, _a = 1) { #region } } #endregion - function drawPaletteGrid(_pal, _x, _y, _w, _gs = 24, c_color = -1) { #region var amo = array_length(_pal); var col = floor(_w / _gs); var row = ceil(amo / col); var cx = -1, cy = -1; - var _pd = ui(5); var _h = row * _gs; - for(var i = 0; i < array_length(_pal); i++) { - draw_set_color(_pal[i]); - var _x0 = _x + safe_mod(i, col) * _gs; - var _y0 = _y + floor(i / col) * _gs; + for(var i = 0; i < amo; i++) { + var _cc = safe_mod(i, col); + var _rr = floor(i / col); + var _x0 = _x + _cc * _gs; + var _y0 = _y + _rr * _gs; + var _i = 0; - draw_rectangle(_x0, _y0 + 1, _x0 + _gs, _y0 + _gs, false); + if(amo == 1) { + _i = 1; + } else { + if(row == 1) { + if(i == 0) _i = 2; + else if(i == amo - 1) _i = 3; + } else { + if(i == 0) _i = 6; + else if(_cc == col - 1 && i + col > amo) { + if(_rr == 0) _i = 3; + else _i = 9; + } + else if(_rr == 0 && _cc == col - 1) _i = 7; + else if(_rr == row - 1 && _cc == 0) _i = 8; + else if(i == amo - 1) _i = 9; + + } + } + + draw_sprite_stretched_ext(THEME.palette_mask, _i, _x0, _y0 + 1, _gs, _gs, _pal[i], 1); if(c_color >= 0 && color_diff(c_color, _pal[i]) <= 0) { cx = _x0; @@ -240,8 +266,10 @@ function drawPaletteGrid(_pal, _x, _y, _w, _gs = 24, c_color = -1) { #region } } - if(cx == -1) return _h; + if(cx != -1) { + var _pd = ui(5); + draw_sprite_stretched_ext(THEME.palette_selecting, 0, cx - _pd, cy + 1 - _pd, _gs + _pd * 2, _gs + _pd * 2); + } - draw_sprite_stretched_ext(THEME.palette_selecting, 0, cx - _pd, cy + 1 - _pd, _gs + _pd * 2, _gs + _pd * 2); return _h; } #endregion \ No newline at end of file diff --git a/scripts/color_selector/color_selector.gml b/scripts/color_selector/color_selector.gml index 27b1e4750..126952531 100644 --- a/scripts/color_selector/color_selector.gml +++ b/scripts/color_selector/color_selector.gml @@ -17,10 +17,11 @@ function colorSelector(onApply = noone) constructor { disp_mode = 0; - palette = []; + palette = PROJECT.attributes.palette; discretize_pal = true; - color_surface = surface_create_valid(ui(256), ui(256)); + content_surface = surface_create_valid(1, 1); + side_surface = surface_create_valid(1, 1); tb_hue = slider(0, 255, 1, function(_val) { if(!interactable) return; @@ -164,96 +165,118 @@ function colorSelector(onApply = noone) constructor { } static draw = function(_x, _y, focus, hover) { - var col_x = _x + ui(8); - var col_y = _y + ui(8); + var cont_x = _x + ui(8); + var cont_y = _y + ui(8); + var cont_w = ui(256); + var cont_h = ui(256); - draw_sprite_stretched(THEME.ui_panel_bg, 1, col_x - ui(8), col_y - ui(8), ui(256 + 16), ui(256 + 16)); - - color_surface = surface_verify(color_surface, ui(256), ui(256)); - surface_set_target(color_surface); - if(disp_mode == 0) { - shader_set(sh_color_picker_hue); - shader_set_f("hue", hue / 256); - shader_set_i("usePalette", NODE_COLOR_SHOW_PALETTE && discretize_pal); - shader_set_palette(palette); - } else if(disp_mode == 1) { - shader_set(sh_color_picker_value); - shader_set_f("value", val / 256); - shader_set_i("usePalette", NODE_COLOR_SHOW_PALETTE && discretize_pal); - shader_set_palette(palette); - } + var sel_x = cont_x + ui(280); + var sel_y = cont_y; + var sel_w = ui(16); + var sel_h = cont_h; + var discr = NODE_COLOR_SHOW_PALETTE && discretize_pal; + + content_surface = surface_verify(content_surface, cont_w, cont_h); + side_surface = surface_verify(side_surface, sel_w, sel_h); + + surface_set_target(content_surface); + DRAW_CLEAR - draw_sprite_uniform(s_fx_pixel, 0, 0, 0, ui(256)); + draw_sprite_stretched(THEME.menu_button_mask, 0, 0, 0, cont_w, cont_h); + gpu_set_colorwriteenable(1, 1, 1, 0); + shader_set(sh_color_select_content); + shader_set_i("mode", disp_mode); + shader_set_f("hue", hue / 256); + shader_set_f("sat", sat / 256); + shader_set_f("val", val / 256); + + shader_set_i("discretize", discr); + shader_set_palette(palette); + + draw_sprite_stretched(s_fx_pixel, 0, 0, 0, cont_w, cont_h); shader_reset(); + gpu_set_colorwriteenable(1, 1, 1, 1); surface_reset_target(); - draw_surface_ext_safe(color_surface, col_x, col_y,,,,, interactable * 0.5 + 0.5); - - #region side control - var hue_x = col_x + ui(280); - var hue_y = col_y; - - draw_sprite_stretched(THEME.ui_panel_bg, 1, hue_x - ui(8), hue_y - ui(8), ui(32), ui(256 + 16)); + surface_set_target(side_surface); + DRAW_CLEAR - if(disp_mode == 0) { - shader_set(sh_color_picker_side_hue); - shader_set_i("usePalette", NODE_COLOR_SHOW_PALETTE && discretize_pal); - shader_set_palette(palette); - shader_set_f("sat", sat / 256); - shader_set_f("value", val / 256); - - draw_sprite_stretched_ext(s_fx_pixel, 0, hue_x, hue_y, ui(16), ui(256), c_white, interactable * 0.5 + 0.5); - shader_reset(); - } else if(disp_mode == 1) { - shader_set(sh_color_picker_side_value); - shader_set_i("usePalette", NODE_COLOR_SHOW_PALETTE && discretize_pal); - shader_set_palette(palette); - shader_set_f("hue", hue / 256); - shader_set_f("sat", sat / 256); - - draw_sprite_stretched_ext(s_fx_pixel, 0, hue_x, hue_y, ui(16), ui(256), c_white, interactable * 0.5 + 0.5) - shader_reset(); - } - - var _sy = disp_mode == 0? hue_y + ui(hue) : hue_y + ui(256 - val); - - if(NODE_COLOR_SHOW_PALETTE) { - draw_sprite_stretched_ext(s_ui_base_white, 0, hue_x - ui(3), _sy - ui(6), ui(24), ui(10), current_color, 1); + draw_sprite_stretched(THEME.menu_button_mask, 0, 0, 0, sel_w, sel_h); + gpu_set_colorwriteenable(1, 1, 1, 0); + shader_set(sh_color_select_side); + shader_set_i("mode", disp_mode); + shader_set_f("hue", hue / 256); + shader_set_f("sat", sat / 256); + shader_set_f("val", val / 256); - if(disp_mode == 0) - draw_sprite_stretched_ext(s_ui_base_white, 0, col_x + ui(sat - 6), col_y + ui(256 - val - 6), ui(12), ui(12), current_color, 1); - else if(disp_mode == 1) - draw_sprite_stretched_ext(s_ui_base_white, 0, col_x + ui(hue - 6), col_y + ui(256 - sat - 6), ui(12), ui(12), current_color, 1); - - } else { - if(disp_mode == 0) { - draw_sprite_stretched_ext(s_ui_base_white, 0, hue_x - ui(3), _sy - ui(6), ui(24), ui(10), make_color_hsv(hue, 255, 255), 1); - draw_sprite_stretched_ext(s_ui_base_white, 0, col_x + ui(sat - 6), col_y + ui(256 - val - 6), ui(12), ui(12), current_color, 1); - } else if(disp_mode == 1) { - draw_sprite_stretched_ext(s_ui_base_white, 0, hue_x - ui(3), _sy - ui(6), ui(24), ui(10), make_color_hsv(hue, 255, val), 1); - draw_sprite_stretched_ext(s_ui_base_white, 0, col_x + ui(hue - 6), col_y + ui(256 - sat - 6), ui(12), ui(12), current_color, 1); - } - } + shader_set_i("discretize", discr); + shader_set_palette(palette); + + draw_sprite_stretched(s_fx_pixel, 0, 0, 0, sel_w, sel_h); + shader_reset(); + gpu_set_colorwriteenable(1, 1, 1, 1); + surface_reset_target(); + + draw_sprite_stretched(THEME.ui_panel_bg, 1, cont_x - ui(8), cont_y - ui(8), cont_w + ui(16), cont_h + ui(16)); + draw_sprite_stretched(THEME.ui_panel_bg, 1, sel_x - ui(8), sel_y - ui(8), sel_w + ui(16), sel_h + ui(16)); + + draw_surface(content_surface, cont_x, cont_y); + draw_surface(side_surface, sel_x, sel_y); + + BLEND_ADD + draw_sprite_stretched_ext(THEME.menu_button_mask, 1, cont_x, cont_y, cont_w, cont_h, c_white, 0.2); + draw_sprite_stretched_ext(THEME.menu_button_mask, 1, sel_x, sel_y, sel_w, sel_h, c_white, 0.2); + BLEND_NORMAL + + #region control + var _cs = ui(12); + var _p2 = _cs / 2; + var _p = _p2 / 2; + var _sc; + + var _cx = disp_mode == 0? cont_x + ui(sat) - _p2 : cont_x + ui(hue) - _p2; + var _cy = disp_mode == 0? cont_y + ui(256 - val) - _p2 : cont_y + ui(256 - sat) - _p2; + + var _sw = _p2 + sel_w; + var _sh = _cs; + var _sx = sel_x - _p; + var _sy = (disp_mode == 0? sel_y + ui(hue) : sel_y + ui(256 - val)) - _sh / 2; + + + if(discr) _sc = current_color; + else _sc = disp_mode == 0? make_color_hsv(hue, 255, 255) : make_color_hsv(hue, 255, val); + + draw_sprite_stretched_ext(THEME.menu_button_mask, 0, _cx - 1, _cy - 1, _cs + 2, _cs + 2, c_black, 0.5); + draw_sprite_stretched_ext(THEME.menu_button_mask, 0, _sx - 1, _sy - 1, _sw + 2, _sh + 2, c_black, 0.5); + + draw_sprite_stretched_ext(THEME.menu_button_mask, 0, _sx, _sy, _sw, _sh, _sc, 1); + draw_sprite_stretched_ext(THEME.menu_button_mask, 0, _cx, _cy, _cs, _cs, current_color, 1); + + BLEND_ADD + draw_sprite_stretched_ext(THEME.menu_button_mask, 1, _sx, _sy, _sw, _sh, c_white, 0.75); + draw_sprite_stretched_ext(THEME.menu_button_mask, 1, _cx, _cy, _cs, _cs, c_white, 0.75); + BLEND_NORMAL + if(mouse_press(mb_left, interactable && focus)) { - if(point_in_rectangle(mouse_mx, mouse_my, hue_x, hue_y, hue_x + ui(16), hue_y + ui(256))) + if(point_in_rectangle(mouse_mx, mouse_my, sel_x, sel_y, sel_x + ui(16), sel_y + ui(256))) side_dragging = true; - else if(point_in_rectangle(mouse_mx, mouse_my, col_x, col_y, col_x + ui(256), col_y + ui(256))) + else if(point_in_rectangle(mouse_mx, mouse_my, cont_x, cont_y, cont_x + ui(256), cont_y + ui(256))) area_dragging = true; } if(side_dragging) { if(disp_mode == 0) { - hue = clamp((mouse_my - hue_y) / UI_SCALE, 0, 256); + hue = clamp((mouse_my - sel_y) / UI_SCALE, 0, 256); } else if(disp_mode == 1) { - val = 256 - clamp((mouse_my - hue_y) / UI_SCALE, 0, 256); + val = 256 - clamp((mouse_my - sel_y) / UI_SCALE, 0, 256); } setHSV(); - if(NODE_COLOR_SHOW_PALETTE) { - current_color = disp_mode == 0? surface_getpixel(color_surface, sat, 256 - val) : - surface_getpixel(color_surface, hue, 256 - sat); + if(discr) { + current_color = disp_mode == 0? surface_getpixel(content_surface, sat, 256 - val) : + surface_getpixel(content_surface, hue, 256 - sat); current_color = cola(current_color, 1); if(onApply != noone) onApply(current_color); } @@ -264,18 +287,18 @@ function colorSelector(onApply = noone) constructor { if(area_dragging) { if(disp_mode == 0) { - sat = clamp((mouse_mx - col_x) / UI_SCALE, 0, 256); - val = 256 - clamp((mouse_my - col_y) / UI_SCALE, 0, 256); + sat = clamp((mouse_mx - cont_x) / UI_SCALE, 0, 256); + val = 256 - clamp((mouse_my - cont_y) / UI_SCALE, 0, 256); } else if(disp_mode == 1) { - hue = clamp((mouse_mx - col_x) / UI_SCALE, 0, 256); - sat = 256 - clamp((mouse_my - col_y) / UI_SCALE, 0, 256); + hue = clamp((mouse_mx - cont_x) / UI_SCALE, 0, 256); + sat = 256 - clamp((mouse_my - cont_y) / UI_SCALE, 0, 256); } setHSV(); - if(NODE_COLOR_SHOW_PALETTE) { - current_color = disp_mode == 0? surface_getpixel(color_surface, sat, 256 - val) : - surface_getpixel(color_surface, hue, 256 - sat); + if(discr) { + current_color = disp_mode == 0? surface_getpixel(content_surface, sat, 256 - val) : + surface_getpixel(content_surface, hue, 256 - sat); current_color = cola(current_color, 1); if(onApply != noone) onApply(current_color); } @@ -286,7 +309,7 @@ function colorSelector(onApply = noone) constructor { #endregion #region type - var tx = hue_x + ui(36); + var tx = sel_x + ui(36); var ty = _y + ui(4); scr_disp.setFocusHover(focus, hover); @@ -308,8 +331,8 @@ function colorSelector(onApply = noone) constructor { #endregion #region data - var data_x = hue_x + ui(40); - var data_y = col_y + ui(40); + var data_x = sel_x + ui(40); + var data_y = cont_y + ui(40); var wdw = ui(160); var wdh = ui( 27); var txh = wdh + ui(4); @@ -348,11 +371,11 @@ function colorSelector(onApply = noone) constructor { ////////////////////////////////////////////////////////////////// tb_hex.active = focus; tb_hex.hover = hover; - tb_hex.draw(hue_x - ui(128), col_y + ui(256 + 24), ui(108), TEXTBOX_HEIGHT, color_get_hex(current_color), mouse_ui); + tb_hex.draw(sel_x - ui(128), cont_y + ui(256 + 24), ui(108), TEXTBOX_HEIGHT, color_get_hex(current_color), mouse_ui); #endregion - var cx = col_x + ui(16); - var cy = col_y + ui(296); + var cx = cont_x + ui(16); + var cy = cont_y + ui(296); var aa = _color_get_alpha(current_color); draw_sprite_stretched_ext(THEME.color_picker_box, 0, cx - ui(20), cy - ui(20), ui(40), ui(40), COLORS._main_icon_dark, 1); diff --git a/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml b/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml index 3c32bed39..c9c0f5ce5 100644 --- a/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml +++ b/scripts/draw_sprite_ext_override/draw_sprite_ext_override.gml @@ -14,6 +14,13 @@ function draw_sprite_stretched_ext_override(spr, ind, _x, _y, w = 1, h = 1, colo __draw_sprite_stretched_ext(spr, ind, round(_x), round(_y), round(w), round(h), color, alpha); } #endregion +function draw_sprite_stretched_add(spr, ind, _x, _y, w = 1, h = 1, color = c_white, alpha = 1) { #region + INLINE + BLEND_ADD + __draw_sprite_stretched_ext(spr, ind, round(_x), round(_y), round(w), round(h), color, alpha); + BLEND_NORMAL +} #endregion + #macro draw_sprite_stretched draw_sprite_stretched_override #macro __draw_sprite_stretched draw_sprite_stretched diff --git a/scripts/node_path/node_path.gml b/scripts/node_path/node_path.gml index 42faf7a9c..973902d50 100644 --- a/scripts/node_path/node_path.gml +++ b/scripts/node_path/node_path.gml @@ -819,9 +819,12 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { var sg = array_create(sample); for(var j = 0; j <= sample; j++) { - p = eval_bezier(j / sample, _a0[0], _a0[1], _a1[0], _a1[1], - _a0[0] + _a0[4], _a0[1] + _a0[5], - _a1[0] + _a1[2], _a1[1] + _a1[3]); + if(_a0[4] == 0 && _a0[5] == 0 && _a1[2] == 0 && _a1[3] == 0) + p = [ lerp(_a0[0], _a1[0], j / sample), lerp(_a0[1], _a1[1], j / sample) ]; + else + p = eval_bezier(j / sample, _a0[0], _a0[1], _a1[0], _a1[1], + _a0[0] + _a0[4], _a0[1] + _a0[5], + _a1[0] + _a1[2], _a1[1] + _a1[3]); sg[j] = p; _nx = p[0]; _ny = p[1]; diff --git a/scripts/panel_color/panel_color.gml b/scripts/panel_color/panel_color.gml index 5c13fac64..a929738c7 100644 --- a/scripts/panel_color/panel_color.gml +++ b/scripts/panel_color/panel_color.gml @@ -80,7 +80,9 @@ function Panel_Color() : PanelContent() constructor { var cx = ui(padding) + ui(24 + 4) * i; if(i == 0) { - draw_sprite_stretched_ext(s_ui_base_white, 0, cx + ui(4), cy + ui(4), ui(16), ui(16), CURRENT_COLOR, _color_get_alpha(CURRENT_COLOR)); + draw_sprite_stretched_ext(THEME.menu_button_mask, 0, cx + ui(4), cy + ui(4), ui(16), ui(16), CURRENT_COLOR, _color_get_alpha(CURRENT_COLOR)); + draw_sprite_stretched_add(THEME.menu_button_mask, 1, cx + ui(4), cy + ui(4), ui(16), ui(16), c_white, 0.3); + draw_sprite_stretched_ext(THEME.ui_panel_active, 0, cx, cy, ui(24), ui(24), c_white, 0.5); if(pHOVER && point_in_rectangle(mx, my, cx, cy, cx + ui(24), cy + ui(24))) { @@ -99,15 +101,21 @@ function Panel_Color() : PanelContent() constructor { } var c = colors[i - 1]; - draw_sprite_stretched_ext(s_ui_base_white, 0, cx, cy, ui(24), ui(24), c, 1); + var aa = 0.3; + draw_sprite_stretched_ext(THEME.menu_button_mask, 0, cx, cy, ui(24), ui(24), c, 1); - if(mouse_press(mb_left, pFOCUS) && point_in_rectangle(mx, my, cx, cy, cx + ui(24), cy + ui(24))) { - DRAGGING = { - type: "Color", - data: c + if(point_in_rectangle(mx, my, cx, cy, cx + ui(24), cy + ui(24))) { + aa = 0.5; + if(mouse_press(mb_left, pFOCUS)) { + DRAGGING = { + type: "Color", + data: c + } + MESSAGE = DRAGGING; } - MESSAGE = DRAGGING; } + + draw_sprite_stretched_add(THEME.menu_button_mask, 1, cx, cy, ui(24), ui(24), c_white, aa); } _y1 = cy - ui(8); @@ -121,9 +129,20 @@ function Panel_Color() : PanelContent() constructor { var alp_y = _y1 - alp_h; draw_sprite_stretched_ext(THEME.menu_button_mask, 0, ui(padding), alp_y, alp_h, alp_h, CURRENT_COLOR, alp); - BLEND_ADD - draw_sprite_stretched_ext(THEME.menu_button_mask, 1, ui(padding), alp_y, alp_h, alp_h, c_white, 0.3); - BLEND_NORMAL + + aa = 0.3; + if(point_in_rectangle(mx, my, ui(padding), alp_y, ui(padding) + alp_h, alp_y + alp_h)) { + aa = 0.5; + if(mouse_press(mb_left, pFOCUS)) { + DRAGGING = { + type: "Color", + data: CURRENT_COLOR + } + MESSAGE = DRAGGING; + } + } + + draw_sprite_stretched_add(THEME.menu_button_mask, 1, ui(padding), alp_y, alp_h, alp_h, c_white, aa); hex_tb.setFocusHover(pFOCUS, pHOVER); hex_tb.setFont(f_p2); @@ -208,8 +227,8 @@ function Panel_Color() : PanelContent() constructor { draw_surface(side_surface, sel_x, sel_y); BLEND_ADD - draw_sprite_stretched_ext(THEME.menu_button_mask, 1, cont_x, cont_y, cont_w, cont_h, c_white, 0.3); - draw_sprite_stretched_ext(THEME.menu_button_mask, 1, sel_x, sel_y, sel_w, sel_h, c_white, 0.3); + draw_sprite_stretched_ext(THEME.menu_button_mask, 1, cont_x, cont_y, cont_w, cont_h, c_white, 0.2); + draw_sprite_stretched_ext(THEME.menu_button_mask, 1, sel_x, sel_y, sel_w, sel_h, c_white, 0.2); BLEND_NORMAL if(drag_con) { @@ -289,8 +308,8 @@ function Panel_Color() : PanelContent() constructor { sc = make_color_hsv(hue * 255, sat * 255, 255); } - draw_sprite_stretched_ext(THEME.menu_button_mask, 0, cx - 1, cy - 1, bs + 2, bs + 2, c_black, 0.1); - draw_sprite_stretched_ext(THEME.menu_button_mask, 0, sx - 1, sy - 1, sw + 2, bs + 2, c_black, 0.1); + draw_sprite_stretched_ext(THEME.menu_button_mask, 0, cx - 1, cy - 1, bs + 2, bs + 2, c_black, 0.5); + draw_sprite_stretched_ext(THEME.menu_button_mask, 0, sx - 1, sy - 1, sw + 2, bs + 2, c_black, 0.5); draw_sprite_stretched_ext(THEME.menu_button_mask, 0, sx, sy, sw, bs, sc, 1); draw_sprite_stretched_ext(THEME.menu_button_mask, 0, cx, cy, bs, bs, cc, 1); diff --git a/scripts/panel_palette/panel_palette.gml b/scripts/panel_palette/panel_palette.gml index d9b973fdd..c4112fc20 100644 --- a/scripts/panel_palette/panel_palette.gml +++ b/scripts/panel_palette/panel_palette.gml @@ -93,7 +93,7 @@ function Panel_Palette() : PanelContent() constructor { DRAGGING = { type: "Color", data: array_safe_get_fast(preset.palette, _index) - } + } MESSAGE = DRAGGING; } } else if(point_in_rectangle(_m[0], _m[1], ui(10), yy, ww - ui(10), yy + ui(24))) { diff --git a/scripts/panel_palette_mixer/panel_palette_mixer.gml b/scripts/panel_palette_mixer/panel_palette_mixer.gml index 8c16b7089..e044163b6 100644 --- a/scripts/panel_palette_mixer/panel_palette_mixer.gml +++ b/scripts/panel_palette_mixer/panel_palette_mixer.gml @@ -233,9 +233,6 @@ function Panel_Palette_Mixer() : PanelContent() constructor { connect_surf = surface_verify(connect_surf, pw, ph); content_surf = surface_verify(content_surf, pw, ph); - // for (var i = 0, n = array_length(atlas_surfs); i < n; i++) - // atlas_surfs = surface_verify(atlas_surfs, pw, ph); - var _mx_x = pw / 2 + mixer_x; var _mx_y = ph / 2 + mixer_y; diff --git a/scripts/panel_workspace/panel_workspace.gml b/scripts/panel_workspace/panel_workspace.gml index 23fcc63a8..6d21b3cf7 100644 --- a/scripts/panel_workspace/panel_workspace.gml +++ b/scripts/panel_workspace/panel_workspace.gml @@ -26,7 +26,7 @@ function Panel_Workspace() : PanelContent() constructor { function onFocusBegin() { refreshContent(); } function drawContent(panel) { - draw_clear_alpha(COLORS.panel_bg_clear, 0); + draw_clear_alpha(COLORS.panel_bg_clear, 1); var _hori = hori; hori = w > h; @@ -92,7 +92,7 @@ function Panel_Workspace() : PanelContent() constructor { } } - draw_set_color(PREFERENCES.panel_layout_file == str? COLORS._main_text : COLORS._main_text_sub) + draw_set_color(PREFERENCES.panel_layout_file == str? COLORS._main_text : COLORS._main_text_sub); draw_text_add(hori? x0 + ui(8) : (x0 + x1) / 2, y0 + ui(4), str); if(hori) { diff --git a/shaders/sh_color_select_side/sh_color_select_side.fsh b/shaders/sh_color_select_side/sh_color_select_side.fsh index dd3c89b5d..957cb030b 100644 --- a/shaders/sh_color_select_side/sh_color_select_side.fsh +++ b/shaders/sh_color_select_side/sh_color_select_side.fsh @@ -21,11 +21,11 @@ vec3 hsv2rgb(vec3 c) { void main() { vec4 c; - if(mode == 0) c = vec4(hsv2rgb(vec3(v_vTexcoord.y, 1., 1.)), 1.); - else if(mode == 1) c = vec4(hsv2rgb(vec3(hue, 1., 1. - v_vTexcoord.y)), 1.); - else if(mode == 2) c = vec4(hsv2rgb(vec3(hue, 1. - v_vTexcoord.y, 1.)), 1.); - if(discretize == 1) { + if(mode == 0) c = vec4(hsv2rgb(vec3(v_vTexcoord.y, sat, val)), 1.); + else if(mode == 1) c = vec4(hsv2rgb(vec3(hue, sat, 1. - v_vTexcoord.y)), 1.); + else if(mode == 2) c = vec4(hsv2rgb(vec3(hue, 1. - v_vTexcoord.y, val)), 1.); + int index = 0; float minDist = 999.; for(int i = 0; i < paletteAmount; i++) { @@ -38,6 +38,11 @@ void main() { } c = palette[index]; + + } else { + if(mode == 0) c = vec4(hsv2rgb(vec3(v_vTexcoord.y, 1., 1.)), 1.); + else if(mode == 1) c = vec4(hsv2rgb(vec3(hue, 1., 1. - v_vTexcoord.y)), 1.); + else if(mode == 2) c = vec4(hsv2rgb(vec3(hue, 1. - v_vTexcoord.y, 1.)), 1.); } gl_FragColor = c;