This commit is contained in:
Tanasart 2024-05-26 09:51:14 +07:00
parent 394549d490
commit 6bf7646951
10 changed files with 46 additions and 12 deletions

View file

@ -51,6 +51,8 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor {
y = _y;
w = _w;
right_click_block = true;
var _bs = min(_h, ui(32));
hovering = hover && point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h);
@ -129,6 +131,7 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor {
var _cw = _w - ui(4);
var _ch = h - _ggh - ui(4 + 2);
var _ks = ui(16);
var _hv = noone;
draw_sprite_stretched_ext(THEME.menu_button_mask, 0, _ggx, _cy, _ggw, _ch, CDEF.main_mdblack, 1);
@ -154,6 +157,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;
if(mouse_press(mb_left, active)) {
drag_color_index = _k;
@ -174,6 +178,28 @@ function buttonGradient(_onApply, dialog = noone) : widget() constructor {
BLEND_NORMAL
}
}
if(_hv != noone) {
right_click_block = false;
if(array_length(_gradient.keys) > 1 && mouse_press(mb_right, active)) {
array_remove(_gradient.keys, _hv);
_gradient.refresh();
apply(_gradient);
}
} else if(point_in_rectangle(_m[0], _m[1], _ggx, _cy, _ggx + _ggw, _cy + _ch)) {
if(mouse_press(mb_left, active)) {
var _ti = clamp((_m[0] - _ggx) / _ggw, 0, 1);
var _va = _gradient.eval(_ti);
var _nk = new gradientKey(_ti, _va);
_gradient.add(_nk);
drag_color_index = _nk;
edit_color_mx = _m[0];
edit_color_sx = _ti;
}
}
}
if(drag_color_index != -1) {

View file

@ -125,6 +125,8 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor {
var _cy = _y + _pph + ui(4);
var _cw = _w - ui(4);
var _ch = h - _pph - ui(4 + 2);
var _pd = ui(2);
var _pd2 = _pd / 2;
draw_sprite_stretched_ext(THEME.menu_button_mask, 0, _cx, _cy, _cw, _ch, CDEF.main_mdblack, 1);
@ -135,11 +137,11 @@ function buttonPalette(_onApply, dialog = noone) : widget() constructor {
var _ccw = _cw;
var _cch = _colr_h;
draw_sprite_stretched_ext(THEME.palette_mask, 1, _ccx + ui(2), _ccy + ui(2), _ccw - ui(4), _cch - ui(4), _c, 1);
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 + ui(2), _ccy + ui(2), _ccw - ui(4), _cch - ui(4), c_white, .3);
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))

View file

@ -36,10 +36,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
LATEST_VERSION = 11700;
VERSION = 11710;
VERSION = 11711;
SAVE_VERSION = 11690;
VERSION_STRING = "1.17.1.0";
BUILD_NUMBER = 11710;
VERSION_STRING = "1.17.1.1";
BUILD_NUMBER = 11711;
globalvar HOTKEYS, HOTKEY_CONTEXT;
HOTKEYS = ds_map_create();

View file

@ -342,6 +342,8 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
var _widH = wid.drawParam(param) ?? 0;
widH = _widH - (TEXTBOX_HEIGHT * !breakLine);
mbRight &= wid.right_click_block;
#endregion
} else if(jun.display_type == VALUE_DISPLAY.label) { #region label
draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub);

View file

@ -129,8 +129,6 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
txt = $"{rn}";
}
txt += string(rn);
if(_hover && point_in_rectangle(_m[0], _m[1], _x + 8, _yy, _x + _w - 8, _yy + hh)) {
draw_sprite_stretched_ext(THEME.timeline_node, 0, _x + 8, _tgy, _w - 16, _tgh, c_white, 0.1);
if(mouse_press(mb_left, _focus)) {
@ -255,11 +253,13 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
array_push(p_arr, make_color_rgb(plt[k][0], plt[k][1], plt[k][2]));
outputs[| 3].setValue(p_arr);
break;
case 0x2004: //layer
var name = chunk[? "Name"];
array_push(layers, new ase_layer(name));
array_push(vis, true);
break;
case 0x2005: //cel
var _layer = chunk[? "Layer index"];
var cel = new ase_cel(layers[_layer], chunk, content);

View file

@ -873,7 +873,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break; #endregion
}
if(struct_has(display_data, "side_button") && editWidget.side_button == noone)
if(is_struct(display_data) && struct_has(display_data, "side_button") && editWidget.side_button == noone)
editWidget.side_button = display_data.side_button;
editWidgetRaw = editWidget;

View file

@ -149,6 +149,7 @@ function Panel_Menu() : PanelContent() constructor {
menuItem(__txtx("panel_menu_render_all_nodes", "Render all nodes"), function() {
RENDER_ALL_REORDER
}, [ THEME.sequence_control, 1 ], ["", "Render all"]),
menuItem(__txtx("panel_menu_execute_exports", "Execute all export nodes"), function() {
var key = ds_map_find_first(PROJECT.nodeMap);
repeat(ds_map_size(PROJECT.nodeMap)) {

View file

@ -72,6 +72,7 @@
PREFERENCES.panel_preview_dragging = MOD_KEY.alt;
PREFERENCES.panel_preview_show_real_fps = false;
// PREFERENCES.panel_preview_tran_colors = [ ];
PREFERENCES.panel_menu_resource_monitor = false;
PREFERENCES.panel_menu_right_control = os_type == os_windows;

View file

@ -7,6 +7,8 @@ function widget() constructor {
parent = noone;
interactable = true;
right_click_block = true;
side_button = noone;
front_button = noone;