diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index 814e293a1..40fbbece3 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -337,6 +337,8 @@ event_inherited(); var _hov = false; if(sHOVER && catagory_pane.hover && point_in_rectangle(_m[0], _m[1], 0, _y + hh, ww, _y + hh + hg - 1)) { + catagory_pane.hover_content = true; + BLEND_OVERRIDE draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y + hh, ww, hg, CDEF.main_white, 1); BLEND_NORMAL @@ -522,6 +524,8 @@ event_inherited(); } if(_hoverContent && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) { + content_pane.hover_content = true; + draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_size, grid_size, COLORS._main_accent, 1); if(mouse_release(mb_left, sFOCUS)) buildNode(_node); @@ -531,6 +535,8 @@ event_inherited(); if(_node.getTooltip() != "" || _node.tooltip_spr != noone) { if(point_in_rectangle(_m[0], _m[1], _boxx, yy, _boxx + ui(16), yy + ui(16))) { + content_pane.hover_content = true; + draw_sprite_ui_uniform(THEME.info, 0, _boxx + ui(8), yy + ui(8), 0.7, COLORS._main_icon, 1.0); node_tooltip = _node; node_tooltip_x = content_pane.x + _nx; @@ -644,6 +650,8 @@ event_inherited(); } if(_hoverContent && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) { + content_pane.hover_content = true; + if(_node.getTooltip() != "" || _node.tooltip_spr != noone) { node_tooltip = _node; node_tooltip_x = content_pane.x + ui(16); @@ -894,6 +902,7 @@ event_inherited(); } if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_size, yy + grid_size)) { + search_pane.hover_content = true; node_selecting = i; if(mouse_release(mb_left, sFOCUS)) buildNode(_node, _param); @@ -910,6 +919,8 @@ event_inherited(); if(struct_has(_node, "tooltip") && (_node.getTooltip() != "" || _node.tooltip_spr != noone)) { if(point_in_rectangle(_m[0], _m[1], _boxx, yy, _boxx + ui(16), yy + ui(16))) { + search_pane.hover_content = true; + draw_sprite_ui_uniform(THEME.info, 0, _boxx + ui(8), yy + ui(8), 0.7, COLORS._main_icon, 1.0); node_tooltip = _node; node_tooltip_x = search_pane.x + _nx; @@ -1024,6 +1035,8 @@ event_inherited(); } if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) { + search_pane.hover_content = true; + if(struct_has(_node, "tooltip") && (_node.getTooltip() != "" || _node.tooltip_spr != noone)) { node_tooltip = _node; node_tooltip_x = search_pane.x + 0; diff --git a/objects/o_dialog_arrayBox/Create_0.gml b/objects/o_dialog_arrayBox/Create_0.gml index 21af11c08..020687ca2 100644 --- a/objects/o_dialog_arrayBox/Create_0.gml +++ b/objects/o_dialog_arrayBox/Create_0.gml @@ -31,8 +31,10 @@ event_inherited(); var ind = 0; - if(sHOVER && sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly + 1, _dw, _ly + hght - 1)) + if(sHOVER && sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly + 1, _dw, _ly + hght - 1)) { selecting = i; + sc_content.hover_content = true; + } if(selecting == i) { draw_sprite_stretched_ext(THEME.textbox, 3, 0, _ly, _dw, hght, COLORS.dialog_menubox_highlight, 1); diff --git a/objects/o_dialog_arrayBox/o_dialog_arrayBox.yy b/objects/o_dialog_arrayBox/o_dialog_arrayBox.yy index 5ebd8ca69..7b0c3b8bd 100644 --- a/objects/o_dialog_arrayBox/o_dialog_arrayBox.yy +++ b/objects/o_dialog_arrayBox/o_dialog_arrayBox.yy @@ -2,10 +2,10 @@ "$GMObject":"", "%Name":"o_dialog_arrayBox", "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":2,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_arrayBox", diff --git a/objects/o_dialog_assetbox/Create_0.gml b/objects/o_dialog_assetbox/Create_0.gml index 6636f119c..51fcdf684 100644 --- a/objects/o_dialog_assetbox/Create_0.gml +++ b/objects/o_dialog_assetbox/Create_0.gml @@ -70,6 +70,8 @@ event_inherited(); _y += hg; } + folderPane.hover_content = true; + return hh + 8; }); folderPane.always_scroll = true; @@ -127,6 +129,7 @@ event_inherited(); } if(sHOVER && contentPane.hover && point_in_rectangle(_m[0], _m[1], xx, yy, xx + grid_size, yy + grid_size)) { + contentPane.hover_content = true; TOOLTIP = [ spr, "sprite" ]; draw_sprite_stretched_ext(THEME.node_active, 0, xx, yy, grid_size, grid_size, COLORS._main_accent, 1); diff --git a/objects/o_dialog_assetbox/o_dialog_assetbox.yy b/objects/o_dialog_assetbox/o_dialog_assetbox.yy index 998151f58..a564c6b0c 100644 --- a/objects/o_dialog_assetbox/o_dialog_assetbox.yy +++ b/objects/o_dialog_assetbox/o_dialog_assetbox.yy @@ -2,9 +2,9 @@ "$GMObject":"", "%Name":"o_dialog_assetbox", "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_assetbox", diff --git a/objects/o_dialog_color_selector/Create_0.gml b/objects/o_dialog_color_selector/Create_0.gml index 0d8cb8303..7d2b41153 100644 --- a/objects/o_dialog_color_selector/Create_0.gml +++ b/objects/o_dialog_color_selector/Create_0.gml @@ -65,7 +65,10 @@ event_inherited(); var isHover = _hover && point_in_rectangle(_m[0], _m[1], ui(4), yy, ui(4) + sp_preset_w - ui(16), yy + _height); draw_sprite_stretched(THEME.ui_panel_bg, 3, ui(4), yy, sp_preset_w - ui(16), _height); - if(isHover) draw_sprite_stretched_ext(THEME.ui_panel_fg, 1, ui(4), yy, sp_preset_w - ui(16), _height, COLORS._main_accent, 1); + if(isHover) { + draw_sprite_stretched_ext(THEME.ui_panel_fg, 1, ui(4), yy, sp_preset_w - ui(16), _height, COLORS._main_accent, 1); + sp_presets.hover_content = true; + } var x0 = ui(16) + (i == -1) * ui(8 + 6); var cc = i == preset_selecting? COLORS._main_accent : COLORS._main_text_sub; diff --git a/objects/o_dialog_color_selector/o_dialog_color_selector.yy b/objects/o_dialog_color_selector/o_dialog_color_selector.yy index c24b00e06..df008a45d 100644 --- a/objects/o_dialog_color_selector/o_dialog_color_selector.yy +++ b/objects/o_dialog_color_selector/o_dialog_color_selector.yy @@ -2,10 +2,10 @@ "$GMObject":"", "%Name":"o_dialog_color_selector", "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":75,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":75,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_color_selector", diff --git a/objects/o_dialog_fontscrollbox/Create_0.gml b/objects/o_dialog_fontscrollbox/Create_0.gml index be86931df..fe4555472 100644 --- a/objects/o_dialog_fontscrollbox/Create_0.gml +++ b/objects/o_dialog_fontscrollbox/Create_0.gml @@ -20,6 +20,8 @@ event_inherited(); var _h = array_length(data) * hght; var _dw = sc_content.surface_w; + sc_content.hover_content = true; + for(var i = 0; i < array_length(data); i++) { var _ly = _y + i * hght; var fullpath = data[i]; diff --git a/objects/o_dialog_gradient/Create_0.gml b/objects/o_dialog_gradient/Create_0.gml index 575fbef66..4dd83d838 100644 --- a/objects/o_dialog_gradient/Create_0.gml +++ b/objects/o_dialog_gradient/Create_0.gml @@ -101,8 +101,10 @@ event_inherited(); var isHover = point_in_rectangle(_m[0], _m[1], ui(4), yy, ui(4) + sp_preset_w - ui(16), yy + hg); draw_sprite_stretched(THEME.ui_panel_bg, 3, ui(4), yy, sp_preset_w - ui(16), hg); - if(_hover && isHover) + if(_hover && isHover) { + sp_presets.hover_content = true; draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_preset_w - ui(16), hg, COLORS._main_accent, 1); + } draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub); draw_text(ui(16), yy + ui(8), _gradient.name); @@ -177,8 +179,10 @@ event_inherited(); var isHover = _hover && point_in_rectangle(_m[0], _m[1], ui(4), yy, ui(4) + sp_palette_w - ui(16), yy + _height); draw_sprite_stretched(THEME.ui_panel_bg, 3, ui(4), yy, sp_palette_w - ui(16), _height); - if(isHover) + if(isHover) { + sp_palettes.hover_content = true; draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_palette_w - ui(16), _height, COLORS._main_accent, 1); + } var x0 = ui(16) + (i == -1) * ui(8 + 6); var cc = i == palette_selecting? COLORS._main_accent : COLORS._main_text_sub; diff --git a/objects/o_dialog_gradient/o_dialog_gradient.yy b/objects/o_dialog_gradient/o_dialog_gradient.yy index fae95603b..4ff6a2130 100644 --- a/objects/o_dialog_gradient/o_dialog_gradient.yy +++ b/objects/o_dialog_gradient/o_dialog_gradient.yy @@ -2,10 +2,10 @@ "$GMObject":"", "%Name":"o_dialog_gradient", "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":75,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":75,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_gradient", diff --git a/objects/o_dialog_group_input_order/Create_0.gml b/objects/o_dialog_group_input_order/Create_0.gml index a7ac4ca8c..4f10b024a 100644 --- a/objects/o_dialog_group_input_order/Create_0.gml +++ b/objects/o_dialog_group_input_order/Create_0.gml @@ -55,6 +55,7 @@ event_inherited(); if(dragging == noone) { var aa = 0.5; if(sHOVER && point_in_rectangle(_m[0], _m[1], 0 + padd, _y + padd, hg - padd, _y + hg - padd)) { + sc_group.hover_content = true; aa = 1; if(mouse_press(mb_left, sFOCUS)) dragging = display_list[i]; } @@ -102,6 +103,7 @@ event_inherited(); } if(dragging != noone) { + sc_group.hover_content = true; array_remove(display_list, dragging); array_insert(display_list, hovr, dragging); diff --git a/objects/o_dialog_group_input_order/o_dialog_group_input_order.yy b/objects/o_dialog_group_input_order/o_dialog_group_input_order.yy index 9c259a2cd..2235ba0d3 100644 --- a/objects/o_dialog_group_input_order/o_dialog_group_input_order.yy +++ b/objects/o_dialog_group_input_order/o_dialog_group_input_order.yy @@ -2,8 +2,8 @@ "$GMObject":"", "%Name":"o_dialog_group_input_order", "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_group_input_order", diff --git a/objects/o_dialog_group_output_order/Create_0.gml b/objects/o_dialog_group_output_order/Create_0.gml index 3bb357a95..53b7129e6 100644 --- a/objects/o_dialog_group_output_order/Create_0.gml +++ b/objects/o_dialog_group_output_order/Create_0.gml @@ -40,6 +40,7 @@ event_inherited(); if(dragging == noone) { var aa = 0.5; if(sHOVER && point_in_rectangle(_m[0], _m[1], 0 + padd, _y + padd, hg - padd, _y + hg - padd)) { + sc_group.hover_content = true; aa = 1; if(mouse_press(mb_left, sFOCUS)) dragging = display_list[i]; } @@ -64,6 +65,7 @@ event_inherited(); } if(dragging != noone) { + sc_group.hover_content = true; array_remove(display_list, dragging); array_insert(display_list, hovr, dragging); diff --git a/objects/o_dialog_group_output_order/o_dialog_group_output_order.yy b/objects/o_dialog_group_output_order/o_dialog_group_output_order.yy index a163051a1..8168d1978 100644 --- a/objects/o_dialog_group_output_order/o_dialog_group_output_order.yy +++ b/objects/o_dialog_group_output_order/o_dialog_group_output_order.yy @@ -2,8 +2,8 @@ "$GMObject":"", "%Name":"o_dialog_group_output_order", "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_group_output_order", diff --git a/objects/o_dialog_image_array_edit/Create_0.gml b/objects/o_dialog_image_array_edit/Create_0.gml index 75ce5ab07..6a55c1748 100644 --- a/objects/o_dialog_image_array_edit/Create_0.gml +++ b/objects/o_dialog_image_array_edit/Create_0.gml @@ -60,6 +60,7 @@ event_inherited(); draw_sprite_stretched_add(THEME.ui_panel_fg, 0, xx, yy, ww, hh, c_white, 0.3); if(sHOVER && sp_content.hover && point_in_rectangle(_m[0], _m[1], xx, yy, xx + ww, yy + hh)) { + sp_content.hover_content = true; inb_hover = index; if(dragging == -1 || dragging == index) draw_sprite_stretched_ext(THEME.ui_panel_active, 0, xx, yy, ww, hh, COLORS._main_accent, 1); diff --git a/objects/o_dialog_image_array_edit/o_dialog_image_array_edit.yy b/objects/o_dialog_image_array_edit/o_dialog_image_array_edit.yy index 03df52c1f..033344f40 100644 --- a/objects/o_dialog_image_array_edit/o_dialog_image_array_edit.yy +++ b/objects/o_dialog_image_array_edit/o_dialog_image_array_edit.yy @@ -2,8 +2,8 @@ "$GMObject":"", "%Name":"o_dialog_image_array_edit", "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_image_array_edit", diff --git a/objects/o_dialog_lua_reference/Create_0.gml b/objects/o_dialog_lua_reference/Create_0.gml index 51f34b7d1..decc07dc1 100644 --- a/objects/o_dialog_lua_reference/Create_0.gml +++ b/objects/o_dialog_lua_reference/Create_0.gml @@ -53,14 +53,14 @@ event_inherited(); BLEND_OVERRIDE; if(sp_note.hover && point_in_rectangle(_m[0], _m[1], 0, yy, sp_note.surface_w, yy + hh)) { - draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy, - sp_note.surface_w, hh, COLORS.dialog_lua_ref_bg_hover, 1); + sp_note.hover_content = true; + + draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy, sp_note.surface_w, hh, COLORS.dialog_lua_ref_bg_hover, 1); if(mouse_press(mb_left, sFOCUS)) is_open[i] = !array_get(is_open, i); } else - draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy, - sp_note.surface_w, hh, COLORS.dialog_lua_ref_bg, 1); + draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy, sp_note.surface_w, hh, COLORS.dialog_lua_ref_bg, 1); BLEND_NORMAL; draw_sprite_ui(THEME.arrow, is_open[i]? 3 : 0, ui(16), yy + pad + line_get_height() / 2,,,, COLORS._main_icon); diff --git a/objects/o_dialog_lua_reference/o_dialog_lua_reference.yy b/objects/o_dialog_lua_reference/o_dialog_lua_reference.yy index d0f3436b3..00534a697 100644 --- a/objects/o_dialog_lua_reference/o_dialog_lua_reference.yy +++ b/objects/o_dialog_lua_reference/o_dialog_lua_reference.yy @@ -2,8 +2,8 @@ "$GMObject":"", "%Name":"o_dialog_lua_reference", "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_lua_reference", diff --git a/objects/o_dialog_output_visibility/Create_0.gml b/objects/o_dialog_output_visibility/Create_0.gml index 1385ffcf5..cb4b76c2e 100644 --- a/objects/o_dialog_output_visibility/Create_0.gml +++ b/objects/o_dialog_output_visibility/Create_0.gml @@ -25,6 +25,7 @@ event_inherited(); var _yy = _y + hh * i; if(sHOVER && sc_outputs.hover && point_in_rectangle(_m[0], _m[1], 0, _yy, sc_outputs.w, _yy + hh - 1)) { + sc_outputs.hover_content = true; BLEND_OVERRIDE; draw_sprite_stretched(THEME.node_bg, 0, ui(2), _yy + ui(2), ui(32 - 4), hh - ui(4)); BLEND_NORMAL; diff --git a/objects/o_dialog_output_visibility/o_dialog_output_visibility.yy b/objects/o_dialog_output_visibility/o_dialog_output_visibility.yy index 4a10f0f5d..d480f16d0 100644 --- a/objects/o_dialog_output_visibility/o_dialog_output_visibility.yy +++ b/objects/o_dialog_output_visibility/o_dialog_output_visibility.yy @@ -2,8 +2,8 @@ "$GMObject":"", "%Name":"o_dialog_output_visibility", "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_output_visibility", diff --git a/objects/o_dialog_palette/Create_0.gml b/objects/o_dialog_palette/Create_0.gml index 4f9856e3e..23db2b69f 100644 --- a/objects/o_dialog_palette/Create_0.gml +++ b/objects/o_dialog_palette/Create_0.gml @@ -78,8 +78,10 @@ event_inherited(); } : PALETTES[i]; var isHover = sHOVER && sp_presets.hover && point_in_rectangle(_m[0], _m[1], ui(4), yy, ui(4) + sp_preset_w - ui(16), yy + hg); draw_sprite_stretched(THEME.ui_panel_bg, 3, ui(4), yy, sp_preset_w - ui(16), hg); - if(isHover) + if(isHover) { + sp_presets.hover_content = true; draw_sprite_stretched_ext(THEME.node_active, 1, ui(4), yy, sp_preset_w - ui(16), hg, COLORS._main_accent, 1); + } draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub); draw_text(ui(16), yy + ui(8), pal.name); diff --git a/objects/o_dialog_palette/o_dialog_palette.yy b/objects/o_dialog_palette/o_dialog_palette.yy index deb452f3e..29a133335 100644 --- a/objects/o_dialog_palette/o_dialog_palette.yy +++ b/objects/o_dialog_palette/o_dialog_palette.yy @@ -2,10 +2,10 @@ "$GMObject":"", "%Name":"o_dialog_palette", "eventList":[ - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":75,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":75,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_palette", diff --git a/objects/o_dialog_preference/Create_0.gml b/objects/o_dialog_preference/Create_0.gml index bb1b6dc0b..0b55bb0c7 100644 --- a/objects/o_dialog_preference/Create_0.gml +++ b/objects/o_dialog_preference/Create_0.gml @@ -51,6 +51,7 @@ event_inherited(); else draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_inner); if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, yl, ww, yl + hg)) { + sp_page.hover_content = true; draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yl, ww, hg, CDEF.main_white, 1); if(i != page_current && mouse_click(mb_left, sFOCUS)) { @@ -70,6 +71,7 @@ event_inherited(); draw_set_text(f_p1, fa_left, fa_center, section_current == sect[0]? COLORS._main_text : COLORS._main_text_sub); if(sHOVER && point_in_rectangle(_m[0], _m[1], 0, yl, ww, yl + hs - 1)) { + sp_page.hover_content = true; if(mouse_press(mb_left, sFOCUS)) sect[1].scroll_y_to = -sect[2]; @@ -579,6 +581,7 @@ event_inherited(); var b = buttonInstant(THEME.button_def, cx, yy + cp, cw, ch, _m, sFOCUS, sHOVER && sp_colors.hover); draw_sprite_stretched_ext(THEME.palette_mask, 1, cx + ui(2), yy + ui(2), cw - ui(4), ch - ui(4), val, 1); + if(b) sp_colors.hover_content = true; if(b == 2) { var dialog = dialogCall(o_dialog_color_selector, WIN_W / 2, WIN_H / 2); dialog.setDefault(val); @@ -683,7 +686,8 @@ event_inherited(); var params = new widgetParam(widget_x, widget_y, widget_w, widget_h, val, {}, _m, sp_hotkey.x, sp_hotkey.y); var _th = _pref[2].drawParam(params) ?? 0; - + if(_pref[2].inBBOX(_m)) sp_hotkey.hover_content = true; + hh += _th + padd + ui(8); } @@ -744,7 +748,10 @@ event_inherited(); } else { var bx = key_x1 - ui(40) - kw; var by = _yy; - if(buttonInstant(THEME.button_hide, bx, by, kw + ui(32), th, _m, sFOCUS, sHOVER && sp_hotkey.hover) == 2) { + var b = buttonInstant(THEME.button_hide, bx, by, kw + ui(32), th, _m, sFOCUS, sHOVER && sp_hotkey.hover) + + if(b) sp_hotkey.hover_content = true; + if(b == 2) { hk_editing = key; keyboard_lastchar = pkey; } @@ -760,7 +767,9 @@ event_inherited(); modified = true; var bx = x1 - ui(32); var by = _yy; - if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset"), THEME.refresh_16) == 2) { + var b = buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset"), THEME.refresh_16); + if(b) sp_hotkey.hover_content = true; + if(b == 2) { key.key = dkey; key.modi = dmod; @@ -819,7 +828,10 @@ event_inherited(); } else { var bx = key_x1 - ui(40) - kw; var by = _yy; - if(buttonInstant(THEME.button_hide, bx, by, kw + ui(32), th, _m, sFOCUS, sHOVER && sp_hotkey.hover) == 2) { + var b = buttonInstant(THEME.button_hide, bx, by, kw + ui(32), th, _m, sFOCUS, sHOVER && sp_hotkey.hover) + + if(b) sp_hotkey.hover_content = true; + if(b == 2) { hk_editing = key; keyboard_lastchar = key.key; } @@ -835,8 +847,10 @@ event_inherited(); modified = true; var bx = x1 - ui(32); var by = _yy; + var b = buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset"), THEME.refresh_16) - if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset"), THEME.refresh_16) == 2) { + if(b) sp_hotkey.hover_content = true; + if(b == 2) { key.key = key.dKey; key.modi = key.dModi; @@ -1000,6 +1014,7 @@ event_inherited(); if(instanceof(_pref.editWidget) == "checkBox") params.halign = fa_center; var th = _pref.editWidget.drawParam(params) ?? 0; + if(_pref.editWidget.inBBOX(_m)) sp_pref.hover_content = true; if(_pref.getDefault != noone) { var _defVal = is_method(_pref.getDefault)? _pref.getDefault() : _pref.getDefault; diff --git a/objects/o_dialog_preference/o_dialog_preference.yy b/objects/o_dialog_preference/o_dialog_preference.yy index 24847d74c..d79a132e7 100644 --- a/objects/o_dialog_preference/o_dialog_preference.yy +++ b/objects/o_dialog_preference/o_dialog_preference.yy @@ -3,8 +3,8 @@ "%Name":"o_dialog_preference", "eventList":[ {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, - {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, "name":"o_dialog_preference", diff --git a/objects/o_dialog_preset/Create_0.gml b/objects/o_dialog_preset/Create_0.gml index db18e1657..8a4a79e2c 100644 --- a/objects/o_dialog_preset/Create_0.gml +++ b/objects/o_dialog_preset/Create_0.gml @@ -43,6 +43,7 @@ event_inherited(); var _yy = _y + (hh + ui(4)) * i; if(sHOVER && sc_presets.hover && point_in_rectangle(_m[0], _m[1], 0, _yy, sc_presets.w, _yy + hh)) { + sc_presets.hover_content = true; draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _yy, sc_presets.w - ui(12), hh, COLORS._main_icon, 0.85); if(mouse_click(mb_left, sFOCUS)) { diff --git a/objects/o_dialog_scrollbox/Create_0.gml b/objects/o_dialog_scrollbox/Create_0.gml index ca660f748..19b8698dc 100644 --- a/objects/o_dialog_scrollbox/Create_0.gml +++ b/objects/o_dialog_scrollbox/Create_0.gml @@ -99,6 +99,7 @@ event_inherited(); if(clickable) { if(sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly, _dw, _ly + hght - 1)) { + sc_content.hover_content = true; selecting = i; hovering = data[i]; diff --git a/objects/o_dialog_scrollbox_horizontal/Create_0.gml b/objects/o_dialog_scrollbox_horizontal/Create_0.gml index acb2059d5..8ae8412f9 100644 --- a/objects/o_dialog_scrollbox_horizontal/Create_0.gml +++ b/objects/o_dialog_scrollbox_horizontal/Create_0.gml @@ -171,6 +171,7 @@ event_inherited(); if(clickable) { if(sc_content.hover && point_in_rectangle(_m[0], _m[1], _lx, _ly, _lx + _dw, _ly + hght - 1)) { + sc_content.hover_content = true; _hov = true; selecting = i; hovering = data[i]; diff --git a/objects/o_dialog_splash/Create_0.gml b/objects/o_dialog_splash/Create_0.gml index a6c4e0b1a..e8e19ee39 100644 --- a/objects/o_dialog_splash/Create_0.gml +++ b/objects/o_dialog_splash/Create_0.gml @@ -81,6 +81,7 @@ event_inherited(); } if(sHOVER && sp_recent.hover && point_in_rectangle(_m[0], _m[1], fx, _y, fx + ww, _y + hg)) { + sp_recent.hover_content = true; TOOLTIP = [ _dat.getThumbnail(), VALUE_TYPE.surface ]; draw_sprite_stretched_ext(THEME.node_active, 0, fx, _y, ww, hg, COLORS._main_accent, 1); @@ -154,9 +155,13 @@ event_inherited(); draw_sprite_stretched_ext(THEME.group_label, _hov, mtx, mty, mtw, mth, _sel? c_white : COLORS._main_icon, 1); BLEND_NORMAL - if(_hov && mouse_press(mb_left)) { - if(_sel) array_remove(meta_filter, tg); - else array_push(meta_filter, tg); + if(_hov) { + sp_sample.hover_content = true; + + if(mouse_press(mb_left)) { + if(_sel) array_remove(meta_filter, tg); + else array_push(meta_filter, tg); + } } draw_text(mtx + ui(8), mty + mth / 2, tg); @@ -228,6 +233,8 @@ event_inherited(); if(yy > -grid_heigh && yy < sp_sample.surface_h) { draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_width, grid_heigh); if(sHOVER && sp_sample.hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_heigh)) { + sp_sample.hover_content = true; + var _meta = _project.getMetadata(); if(txt == "Workshop") TOOLTIP = _meta; @@ -338,9 +345,13 @@ event_inherited(); var _coll = array_exists(PREFERENCES.welcome_file_closed, lb.text); draw_sprite_ui(THEME.arrow, _coll? 0 : 3, pd + ui(16), _yy + ui(12), 1, 1, 0, CDEF.main_ltgrey, 1); - if(_hov && mouse_press(mb_left)) { - if(_coll) array_remove(PREFERENCES.welcome_file_closed, lb.text); - else array_push(PREFERENCES.welcome_file_closed, lb.text); + if(_hov) { + sp_sample.hover_content = true; + + if(mouse_press(mb_left)) { + if(_coll) array_remove(PREFERENCES.welcome_file_closed, lb.text); + else array_push(PREFERENCES.welcome_file_closed, lb.text); + } } draw_set_text(f_p2, fa_left, fa_center, CDEF.main_ltgrey); @@ -400,6 +411,7 @@ event_inherited(); spr_h *= ss; if(sHOVER && sp_contest.hover && point_in_rectangle(_m[0], _m[1], bx - spr_w / 2, _y + sy, bx + spr_w / 2, _y + sy + spr_h)) { + sp_contest.hover_content = true; TOOLTIP = "Go to Pixel Composer Discord server"; if(mouse_press(mb_left, sFOCUS)) @@ -451,6 +463,7 @@ event_inherited(); } if(sHOVER && sp_contest.hover && point_in_rectangle(_m[0], _m[1], tx, ty, tx + grid_width, ty + grid_heigh)) { + sp_contest.hover_content = true; draw_sprite_stretched_ext(THEME.node_active, 0, tx, ty, grid_width, grid_heigh, COLORS._main_accent, 1); if(mouse_press(mb_left, sFOCUS)) @@ -630,6 +643,7 @@ event_inherited(); draw_text_add(sp_contest.surface_w - ui(44), ui(8 + 28), __txt("Submissions")); if(sHOVER && sp_contest.hover && point_in_rectangle(_m[0], _m[1], ui(20 - 16), ui(36 - 16), ui(20 + 16), ui(36 + 16))) { + sp_contest.hover_content = true; draw_sprite_ui(THEME.arrow_back_32, 0, ui(20), ui(36),,,, c_white); if(mouse_press(mb_left, sFOCUS)) contest_viewing = noone; @@ -640,6 +654,7 @@ event_inherited(); var by = ui(36); if(sHOVER && sp_contest.hover && point_in_rectangle(_m[0], _m[1], bx - ui(16), by - ui(16), bx + ui(16), by + ui(16))) { + sp_contest.hover_content = true; TOOLTIP = __txtx("contest_open_discord", "Open in Discord"); draw_sprite_ui(THEME.discord, 0, bx, by,,,, c_white); diff --git a/objects/slider_Slider/Draw_64.gml b/objects/slider_Slider/Draw_64.gml index 59676230a..80c46b0dd 100644 --- a/objects/slider_Slider/Draw_64.gml +++ b/objects/slider_Slider/Draw_64.gml @@ -16,11 +16,10 @@ draw_sprite_stretched_ext(THEME.textbox, 3, x, y + h, w, _h_bot, COLORS._main_i //draw_sprite_stretched_ext(THEME.textbox, 3, x, y, w, h, c_white, 0.9); draw_sprite_stretched_ext(THEME.textbox, 1, x, _y, w, _h, c_white, 1.0); -var _mulp = 1; +var _mulp = text.slide_int? 10 : 1; if(key_mod_press(CTRL) && !text.slide_snap) _mulp *= 10; if(key_mod_press(ALT)) _mulp /= 10; - if(anim == 0) { draw_set_text(f_p4, fa_center, fa_bottom, text.slider_mulp == 1? COLORS._main_text_accent : COLORS._main_icon); draw_text(x + w / 2, y, string(10 * _mulp)); diff --git a/scripts/color_selector/color_selector.gml b/scripts/color_selector/color_selector.gml index 126952531..71e9c1dab 100644 --- a/scripts/color_selector/color_selector.gml +++ b/scripts/color_selector/color_selector.gml @@ -27,19 +27,19 @@ function colorSelector(onApply = noone) constructor { if(!interactable) return; hue = clamp(_val, 0, 255); setHSV(); - }); + }).setSlideType(1); tb_sat = slider(0, 255, 1, function(_val) { if(!interactable) return; sat = clamp(_val, 0, 255); setHSV(); - }); + }).setSlideType(1); tb_val= slider(0, 255, 1, function(_val) { if(!interactable) return; val = clamp(_val, 0, 255); setHSV(); - }); + }).setSlideType(1); tb_red = slider(0, 255, 1, function(_val) { if(!interactable) return; @@ -50,7 +50,7 @@ function colorSelector(onApply = noone) constructor { current_color = make_color_rgba(r, g, b, a); resetHSV(); - }); + }).setSlideType(1); tb_green = slider(0, 255, 1, function(_val) { if(!interactable) return; @@ -61,7 +61,7 @@ function colorSelector(onApply = noone) constructor { current_color = make_color_rgba(r, g, b, a); resetHSV(); - }); + }).setSlideType(1); tb_blue = slider(0, 255, 1, function(_val) { if(!interactable) return; @@ -72,7 +72,7 @@ function colorSelector(onApply = noone) constructor { current_color = make_color_rgba(r, g, b, a); resetHSV(); - }); + }).setSlideType(1); tb_alpha = slider(0, 255, 1, function(_val) { if(!interactable) return; @@ -80,7 +80,7 @@ function colorSelector(onApply = noone) constructor { current_color = _cola(current_color, alp); resetHSV(); - }); + }).setSlideType(1); tb_hue.hdw = ui(16); tb_sat.hdw = ui(16); diff --git a/scripts/curveBox/curveBox.gml b/scripts/curveBox/curveBox.gml index 80d506680..7ebe21de8 100644 --- a/scripts/curveBox/curveBox.gml +++ b/scripts/curveBox/curveBox.gml @@ -108,8 +108,6 @@ function curveBox(_onModify) : widget() constructor { curve_surface = surface_verify(curve_surface, cw, ch); if(node_dragging != -1) { #region editing - if(parent) parent.pen_scroll_lock = true; - show_coord = true; _data = array_clone(_data); diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index e0a9e0de1..3afc7a53d 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -38,7 +38,7 @@ LATEST_VERSION = 11700; VERSION = 11780; SAVE_VERSION = 11700; - VERSION_STRING = "1.17.9.001"; + VERSION_STRING = "1.17.9.004"; BUILD_NUMBER = 11780; globalvar HOTKEYS, HOTKEY_CONTEXT; diff --git a/scripts/globalvar_drawer/globalvar_drawer.gml b/scripts/globalvar_drawer/globalvar_drawer.gml index 1a98d9d55..fd46f4557 100644 --- a/scripts/globalvar_drawer/globalvar_drawer.gml +++ b/scripts/globalvar_drawer/globalvar_drawer.gml @@ -11,6 +11,7 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry var hh = 0; var lb_h = line_get_height(f_p0) + ui(8); var padd = ui(8); + var chov = false; var _node = PROJECT.globalNode; @@ -55,8 +56,9 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry var bx = wd_x + ui(10); var by = yy + ui(16); if(hover && point_in_rectangle(_m[0], _m[1], bx - ui(12), by - ui(12), bx + ui(12), by + ui(12))) { + chov = true; draw_sprite_stretched_ext(THEME.group_label, 0, bx - ui(12), by - ui(12), ui(24), ui(24), COLORS._main_icon_light, 1); - + if(mouse_press(mb_left, _foc)) { var_drag_disp = j; var_dragging = j; @@ -115,6 +117,7 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry var widg = drawWidget(xx, yy, ww, _m, _node.inputs[| j], true, focus, hover, _scrollPane, rx, ry); var widH = widg[0]; var mbRight = widg[1]; + var widHov = widg[2]; if(hover && point_in_rectangle(_m[0], _m[1], xx, yy, xx + ww, yy + widH)) _HOVERING_ELEMENT = _node.inputs[| j]; @@ -124,5 +127,5 @@ function globalvar_viewer_draw(xx, yy, ww, _m, focus, hover, _scrollPane, rx, ry } } - return hh; + return [ hh, chov ]; } \ No newline at end of file diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index 2619b0243..b949823b8 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -25,16 +25,17 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc var _name = jun.getName(); var wid = jun.editWidget; + var cHov = false; - switch(instanceof(wid)) { #region + switch(instanceof(wid)) { case "textArea" : case "controlPointBox" : case "transformBox" : breakLine = true; - } #endregion + } var butx = xx; - if(jun.connect_type == JUNCTION_CONNECT.input && jun.isAnimable() && !jun.expUse) { #region animation + if(jun.connect_type == JUNCTION_CONNECT.input && jun.isAnimable() && !jun.expUse) { // animation var index = jun.hasJunctionFrom()? 2 : jun.is_anim; var cc = c_white; @@ -43,6 +44,8 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc draw_sprite_ui_uniform(THEME.animate_clock, index, butx, lb_y, 1, cc, 0.8); if(_hover && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) { + cHov = true; + if(anim_hold != noone) jun.setAnim(anim_hold); @@ -59,16 +62,18 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc } } } - } #endregion + } if(anim_hold != noone && mouse_release(mb_left)) anim_hold = noone; butx += ui(20); - if(!global_var) { #region visibility + if(!global_var) { // visibility index = jun.visible; draw_sprite_ui_uniform(THEME.junc_visible, index, butx, lb_y, 1,, 0.8); if(_hover && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) { + cHov = true; + if(visi_hold != noone && jun.visible != visi_hold) { jun.visible = visi_hold; jun.node.refreshNodeDisplay(); @@ -83,7 +88,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc jun.node.refreshNodeDisplay(); } } - #endregion + } else draw_sprite_ui_uniform(THEME.node_use_expression, 0, butx, lb_y, 1,, 0.8); @@ -107,13 +112,13 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc var lb_w = ui(40 + 16) + string_width(_name); var lb_x = ui(40) + xx; - if(jun.color != -1) { #region + if(jun.color != -1) { draw_sprite_ext(THEME.timeline_color, 1, lb_x + ui(8), lb_y, 1, 1, 0, jun.color, 1); lb_x += ui(24); lb_w += ui(24); - } #endregion + } - if(!jun.active) { #region + if(!jun.active) { draw_set_text(_font, fa_left, fa_center, COLORS._main_text_sub_inner); draw_text_add(lb_x, lb_y - ui(2), _name); @@ -122,14 +127,16 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc var ty = lb_y - ui(1); if(point_in_circle(_m[0], _m[1], tx, ty, ui(10))) { + cHov = true; + TOOLTIP = jun.active_tooltip; draw_sprite_ui(THEME.info, 0, tx, ty,,,, COLORS._main_icon_light, 1); } else draw_sprite_ui(THEME.info, 0, tx, ty,,,, COLORS._main_icon_light, 0.75); } - return [ 0, true ]; - } #endregion + return [ 0, true, cHov ]; + } draw_text_over(lb_x, lb_y, _name); @@ -139,6 +146,8 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc var ty = lb_y - ui(1); if(point_in_circle(_m[0], _m[1], tx, ty, ui(10))) { + cHov = true; + if(is_string(jun.tooltip)) TOOLTIP = jun.tooltip; else if(mouse_click(mb_left, _focus)) @@ -155,7 +164,10 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc if(jun.connect_type == JUNCTION_CONNECT.input && breakLine && jun.is_anim) { var bx = xx + ww - ui(12); var by = lb_y; - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, "", THEME.prop_keyframe, 2) == 2) { + var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, "", THEME.prop_keyframe, 2) + + if(b) cHov = true; + if(b == 2) { for(var j = 0; j < ds_list_size(jun.animator.values); j++) { var _key = jun.animator.values[| j]; if(_key.time > CURRENT_FRAME) { @@ -175,9 +187,12 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc break; } } - - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, kfFocus? __txtx("panel_inspector_remove_key", "Remove keyframe") : - __txtx("panel_inspector_add_key", "Add keyframe"), THEME.prop_keyframe, 1, cc) == 2) { + + var _tlp = kfFocus? __txtx("panel_inspector_remove_key", "Remove keyframe") : __txtx("panel_inspector_add_key", "Add keyframe"); + var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, _tlp, THEME.prop_keyframe, 1, cc) + + if(b) cHov = true; + if(b == 2) { var _add = false; for(var j = 0; j < ds_list_size(jun.animator.values); j++) { var _key = jun.animator.values[| j]; @@ -196,7 +211,10 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc } bx -= ui(26); - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, "", THEME.prop_keyframe, 0) == 2) { + var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, "", THEME.prop_keyframe, 0) + + if(b) cHov = true; + if(b == 2) { var _t = -1; for(var j = 0; j < ds_list_size(jun.animator.values); j++) { var _key = jun.animator.values[| j]; @@ -215,8 +233,11 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc bx -= ui(26 + 12); tooltip_loop_type.index = jun.on_end; - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, tooltip_loop_type, THEME.prop_on_end, jun.on_end) == 2) - jun.on_end = safe_mod(jun.on_end + 1, sprite_get_number(THEME.prop_on_end)); + + var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, tooltip_loop_type, THEME.prop_on_end, jun.on_end) + + if(b) cHov = true; + if(b == 2) jun.on_end = safe_mod(jun.on_end + 1, sprite_get_number(THEME.prop_on_end)); } #endregion @@ -227,14 +248,19 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc bx -= ui(28); if(jun.is_modified) { - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_reset", "Reset value"), THEME.refresh_16, 0, COLORS._main_icon) == 2) - jun.resetValue(); + var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_reset", "Reset value"), THEME.refresh_16, 0, COLORS._main_icon) + if(b) cHov = true; + if(b == 2) jun.resetValue(); + } else draw_sprite_ui(THEME.refresh_16, 0, bx, by,,,, COLORS._main_icon, 0.5); bx -= ui(28); var ic_b = jun.expUse? c_white : COLORS._main_icon; - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_use_expression", "Use expression"), THEME.node_use_expression, jun.expUse, ic_b) == 2) { + var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_use_expression", "Use expression"), THEME.node_use_expression, jun.expUse, ic_b) + + if(b) cHov = true; + if(b == 2) { jun.setUseExpression(!jun.expUse); if(!jun.expUse) WIDGET_CURRENT = noone; @@ -243,14 +269,19 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc if(jun.expUse) { bx -= ui(28); var cc = NODE_DROPPER_TARGET == jun? COLORS._main_value_positive : COLORS._main_icon; - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_dropper", "Node Dropper"), THEME.node_dropper, 0, cc) == 2) - NODE_DROPPER_TARGET = NODE_DROPPER_TARGET == jun? noone : jun; + var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_dropper", "Node Dropper"), THEME.node_dropper, 0, cc) + + if(b) cHov = true; + if(b == 2) NODE_DROPPER_TARGET = NODE_DROPPER_TARGET == jun? noone : jun; } if(jun.expUse || jun.type == VALUE_TYPE.text) { bx -= ui(28); var cc = jun.popup_dialog == noone? COLORS._main_icon : COLORS._main_value_positive; - if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_pop_text", "Pop up Editor"), THEME.text_popup, 0, cc) == 2) { + var b = buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_pop_text", "Pop up Editor"), THEME.text_popup, 0, cc) + + if(b) cHov = true; + if(b == 2) { if(jun.expUse) jun.popup_dialog = dialogPanelCall(new Panel_Text_Editor(jun.express_edit, function() { return context.expression; }, jun)); else jun.popup_dialog = dialogPanelCall(new Panel_Text_Editor(jun.editWidget, function() { return context.showValue(); }, jun)); jun.popup_dialog.content.title = $"{jun.node.name} - {_name}"; @@ -280,7 +311,7 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc var widH = widExtend? editBoxH : 0; var mbRight = true; - if(jun.expUse) { #region expression editor + if(jun.expUse) { // expression editor var expValid = jun.expTree != noone && jun.expTree.validate(); jun.express_edit.boxColor = expValid? COLORS._main_value_positive : COLORS._main_value_negative; jun.express_edit.rx = rx; @@ -290,17 +321,16 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc if(_focus) jun.express_edit.register(_scrollPane); var wd_h = jun.express_edit.draw(editBoxX, editBoxY, editBoxW, editBoxH, jun.expression, _m); - widH = wd_h - (TEXTBOX_HEIGHT * !widExtend); + widH = wd_h - (TEXTBOX_HEIGHT * !widExtend); + cHov |= jun.express_edit.inBBOX(_m); var un = jun.unit; if(un.reference != noone) { un.triggerButton.icon_index = un.mode; un.triggerButton.tooltip.index = un.mode; } - - #endregion - } else if(wid && jun.display_type != VALUE_DISPLAY.none) { #region edit widget + } else if(wid && jun.display_type != VALUE_DISPLAY.none) { // edit widget wid.setFocusHover(_focus, _hover); if(jun.connect_type == JUNCTION_CONNECT.input) { @@ -357,18 +387,19 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc } var _widH = wid.drawParam(param) ?? 0; - widH = _widH - (TEXTBOX_HEIGHT * !widExtend); + widH = _widH - (TEXTBOX_HEIGHT * !widExtend); + cHov |= wid.inBBOX(_m) mbRight &= wid.right_click_block; - #endregion - } else if(jun.display_type == VALUE_DISPLAY.label) { #region label + + } else if(jun.display_type == VALUE_DISPLAY.label) { // label draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub); draw_text_add(xx + ui(16), _hsy, jun.display_data.data); widH = string_height(jun.display_data.data); - #endregion + } else widH = 0; - return [ widH, mbRight ]; + return [ widH, mbRight, cHov ]; } \ No newline at end of file diff --git a/scripts/node_posterize/node_posterize.gml b/scripts/node_posterize/node_posterize.gml index 8169d9a53..d412cfc58 100644 --- a/scripts/node_posterize/node_posterize.gml +++ b/scripts/node_posterize/node_posterize.gml @@ -31,7 +31,7 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) input_display_list = [ 5, 0, ["Palette", false, 2], 1, 3, 4, 7, 8, - ["Alpha", false, 6], + ["Alpha", false], 6, ]; outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 372c6be4a..5136bd4fa 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -38,9 +38,15 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru name_custom = false; switch(type) { - case VALUE_TYPE.PCXnode : - accept_array = false; + case VALUE_TYPE.color : + if(is_array(_value)) { + for (var i = 0, n = array_length(_value); i < n; i++) + _value[i] = cola(_value[i]); + } else + _value = cola(_value); break; + + case VALUE_TYPE.PCXnode : accept_array = false; break; } if(struct_has(node, "inputMap")) { diff --git a/scripts/node_widget_test/node_widget_test.gml b/scripts/node_widget_test/node_widget_test.gml index 09f0d0e13..205921240 100644 --- a/scripts/node_widget_test/node_widget_test.gml +++ b/scripts/node_widget_test/node_widget_test.gml @@ -11,7 +11,7 @@ function Node_Widget_Test(_x, _y, _group = noone) : Node(_x, _y, _group) constru inputs[| 5] = nodeValue("rotatorRange", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0]) .setDisplay(VALUE_DISPLAY.rotation_range) inputs[| 6] = nodeValue("rotatorRandom", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0, 0, 0, 0]) .setDisplay(VALUE_DISPLAY.rotation_random) inputs[| 7] = nodeValue("slider", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) .setDisplay(VALUE_DISPLAY.slider) - inputs[| 8] = nodeValue("sliderRange", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 0]) .setDisplay(VALUE_DISPLAY.slider_range) + inputs[| 8] = nodeValue("sliderRange", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ]) .setDisplay(VALUE_DISPLAY.slider_range) inputs[| 9] = nodeValue("areaBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, DEF_AREA) .setDisplay(VALUE_DISPLAY.area) inputs[| 10] = nodeValue("paddingBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0 ]) .setDisplay(VALUE_DISPLAY.padding) inputs[| 11] = nodeValue("cornerBox", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0 ]) .setDisplay(VALUE_DISPLAY.corner) diff --git a/scripts/panel_action_create/panel_action_create.gml b/scripts/panel_action_create/panel_action_create.gml index 3deb43715..dc0d13850 100644 --- a/scripts/panel_action_create/panel_action_create.gml +++ b/scripts/panel_action_create/panel_action_create.gml @@ -99,6 +99,8 @@ function Panel_Action_Create() : PanelContent() constructor { var _nd = nodes[i]; var _hv = pHOVER && point_in_rectangle(_m[0], _m[1], 0, yy, _w, yy + _lh + ui(4)); + + if(_hv) sc_node_content.hover_content = true; draw_sprite_stretched_ext(THEME.group_label, _hv, 0, yy, _w, _lh + ui(4), CDEF.main_grey); draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text); @@ -124,7 +126,11 @@ function Panel_Action_Create() : PanelContent() constructor { var _by = yy + _lh / 2; var _tg = struct_has(_vali, "value"); _ttg |= _tg; var _hv = pHOVER && point_in_circle(_m[0], _m[1], _bx, _by, 6); - if(_hv) TOOLTIP = "Save value"; + if(_hv) { + TOOLTIP = "Save value"; + sc_node_content.hover_content = true; + } + draw_sprite_ext(THEME.circle_toggle_8, _tg, _bx, _by, 1, 1, 0, _tg? c_white : COLORS._main_icon, .5 + .5 * (_hv || _tg)); if(mouse_press(mb_left, _hv)) { if(_tg) struct_remove(_vali, "value"); @@ -135,7 +141,11 @@ function Panel_Action_Create() : PanelContent() constructor { if(_in.expUse) { var _tg = struct_has(_vali, "expression"); _ttg |= _tg; var _hv = pHOVER && point_in_circle(_m[0], _m[1], _bx, _by, 6); - if(_hv) TOOLTIP = "Save expression"; + if(_hv) { + TOOLTIP = "Save expression"; + sc_node_content.hover_content = true; + } + draw_sprite_ext(THEME.circle_toggle_8, _tg, _bx, _by, 1, 1, 0, _tg? c_white : COLORS._main_icon, .5 + .5 * (_hv || _tg)); if(mouse_press(mb_left, _hv)) { if(_tg) struct_remove(_vali, "expression"); @@ -147,7 +157,11 @@ function Panel_Action_Create() : PanelContent() constructor { if(_in.unit.reference != noone) { var _tg = struct_has(_vali, "unit"); _ttg |= _tg; var _hv = pHOVER && point_in_circle(_m[0], _m[1], _bx, _by, 6); - if(_hv) TOOLTIP = "Save unit"; + if(_hv) { + TOOLTIP = "Save unit"; + sc_node_content.hover_content = true; + } + draw_sprite_ext(THEME.circle_toggle_8, _tg, _bx, _by, 1, 1, 0, _tg? c_white : COLORS._main_icon, .5 + .5 * (_hv || _tg)); if(mouse_press(mb_left, _hv)) { if(_tg) struct_remove(_vali, "unit"); diff --git a/scripts/panel_addon/panel_addon.gml b/scripts/panel_addon/panel_addon.gml index 922f4886a..27fb2f817 100644 --- a/scripts/panel_addon/panel_addon.gml +++ b/scripts/panel_addon/panel_addon.gml @@ -68,8 +68,11 @@ function Panel_Addon() : PanelContent() constructor { if(_addon.open) draw_sprite_stretched_ext(THEME.ui_panel_bg, 3, 0, by, ww, hh, COLORS._main_icon_light, 1); - if(hover) draw_sprite_stretched_ext(THEME.group_label, 0, 0, by, ww, hg, COLORS.panel_inspector_group_hover, 1); - else draw_sprite_stretched_ext(THEME.group_label, 0, 0, by, ww, hg, COLORS.panel_inspector_group_bg, 1); + if(hover) { + sc_addon.hover_content = true; + draw_sprite_stretched_ext(THEME.group_label, 0, 0, by, ww, hg, COLORS.panel_inspector_group_hover, 1); + } else + draw_sprite_stretched_ext(THEME.group_label, 0, 0, by, ww, hg, COLORS.panel_inspector_group_bg, 1); draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text); draw_text_add(ui(44), by + hg / 2, _addon.name); @@ -81,6 +84,8 @@ function Panel_Addon() : PanelContent() constructor { var _onStart = array_exists(ADDONS_ON_START, _addon.name); if(pHOVER && point_in_rectangle(_m[0], _m[1], chx0, chy0, chx1, chy1)) { + sc_addon.hover_content = true; + if(!_act) TOOLTIP = __txtx("panel_addon_not_activated", "Not activated"); else if(!_onStart) TOOLTIP = __txtx("panel_addon_activated", "Activated"); else TOOLTIP = __txtx("panel_addon_run_on_start", "Run on start"); diff --git a/scripts/panel_collection/panel_collection.gml b/scripts/panel_collection/panel_collection.gml index 252138e98..54a91a7a2 100644 --- a/scripts/panel_collection/panel_collection.gml +++ b/scripts/panel_collection/panel_collection.gml @@ -222,6 +222,7 @@ function Panel_Collection() : PanelContent() constructor { meta = _node.getMetadata(); if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) { + contentPane.hover_content = true; draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_size, grid_size, COLORS._main_accent, 1); if(mouse_press(mb_left, pFOCUS)) { @@ -314,6 +315,8 @@ function Panel_Collection() : PanelContent() constructor { } if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) { + contentPane.hover_content = true; + draw_sprite_stretched_ext(THEME.node_active, 0, ui(4), yy, list_width - ui(8), list_height, COLORS._main_accent, 1); if(mouse_press(mb_left, pFOCUS)) DRAGGING = { type : _node.type == FILE_TYPE.collection? "Collection" : "Asset", data : _node } @@ -360,6 +363,7 @@ function Panel_Collection() : PanelContent() constructor { var hh = ui(8); _y += ui(8); + folderPane.hover_content = true; if(pHOVER && folderPane.hover && point_in_rectangle(_m[0], _m[1], ui(32), _y - ui(2), group_w - ui(32), _y + ui(24))) { draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, ui(32), _y - ui(2), group_w - ui(64), ui(24), CDEF.main_white, 1); if(mouse_press(mb_left, pFOCUS)) diff --git a/scripts/panel_file_explorer/panel_file_explorer.gml b/scripts/panel_file_explorer/panel_file_explorer.gml index 15b525c61..2b44520a0 100644 --- a/scripts/panel_file_explorer/panel_file_explorer.gml +++ b/scripts/panel_file_explorer/panel_file_explorer.gml @@ -272,6 +272,8 @@ function Panel_File_Explorer() : PanelContent() constructor { context_hovering = noone; draggable = true; + contentPane.hover_content = true; + var _h = drawDir(rootFile, 0, _y, contentPane.surface_w, _m); if(frame_dragging) draw_sprite_stretched_points_clamp(THEME.ui_selection, 0, frame_drag_mx, frame_drag_my, _m[0], _m[1], COLORS._main_accent); diff --git a/scripts/panel_globalvar/panel_globalvar.gml b/scripts/panel_globalvar/panel_globalvar.gml index 1be1680e4..303e99daf 100644 --- a/scripts/panel_globalvar/panel_globalvar.gml +++ b/scripts/panel_globalvar/panel_globalvar.gml @@ -19,15 +19,17 @@ function Panel_Globalvar() : PanelContent() constructor { } contentPane = new scrollPane(w - ui(padding + padding), h - ui(title_height + padding), function(_y, _m) { - var _hover = pHOVER && contentPane.hover; - draw_clear_alpha(COLORS.panel_bg_clear, 0); + var _hover = pHOVER && contentPane.hover; var hh = 0; var yy = _y; var _x = ui(8); - var gvh = globalvar_viewer_draw(_x, yy, contentPane.surface_w - _x - ui(8), _m, pFOCUS, _hover, contentPane, x + _x + ui(padding), y + ui(title_height)); + var glPar = globalvar_viewer_draw(_x, yy, contentPane.surface_w - _x - ui(8), _m, pFOCUS, _hover, contentPane, x + _x + ui(padding), y + ui(title_height)); + var gvh = glPar[0]; + if(glPar[1]) contentPane.hover_content = true; + yy += gvh + ui(8); hh += gvh + ui(8); diff --git a/scripts/panel_gradient/panel_gradient.gml b/scripts/panel_gradient/panel_gradient.gml index f68653162..07d1fb840 100644 --- a/scripts/panel_gradient/panel_gradient.gml +++ b/scripts/panel_gradient/panel_gradient.gml @@ -38,8 +38,10 @@ function Panel_Gradient() : PanelContent() constructor { var isHover = pHOVER && point_in_rectangle(_m[0], _m[1], xx, max(0, yy), xx + gw - ui(8), min(sp_gradient.h, yy + hg)); draw_sprite_stretched(THEME.ui_panel_bg, 3, xx, yy, gw - ui(8), hg); - if(isHover) + if(isHover) { + sp_gradient.hover_content = true; draw_sprite_stretched_ext(THEME.node_active, 1, xx, yy, gw - ui(8), hg, COLORS._main_accent, 1); + } draw_set_text(f_p2, fa_left, fa_top, COLORS._main_text_sub); draw_text(xx + ui(10), yy + ui(2), preset.name); diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index ae20e73c5..a34ae5307 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -2069,7 +2069,9 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { var nh = _node.h * ss; draw_set_color(_node.getColor()); - draw_roundrect_ext(nx, ny, nx + nw, ny + nh, THEME_VALUE.minimap_corner_radius, THEME_VALUE.minimap_corner_radius, false); + draw_set_alpha(0.2 + 0.8 * (!is_instanceof(_node, Node_Frame))); + draw_rectangle(nx, ny, nx + nw, ny + nh, false); + draw_set_alpha(1); } draw_set_alpha(1); @@ -2115,7 +2117,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { } if(pHOVER && point_in_rectangle(mx, my, mx0, my0, mx0 + ui(16), my0 + ui(16))) { - draw_sprite_ui(THEME.node_resize, 0, mx0 + ui(2), my0 + ui(2), 0.5, 0.5, 180, c_white, 0.75); + draw_sprite_ui(THEME.node_resize, 0, mx0 + ui(10), my0 + ui(10), 0.5, 0.5, 180, c_white, 0.75); if(mouse_press(mb_left, pFOCUS)) { minimap_dragging = true; minimap_drag_sx = minimap_w; @@ -2124,7 +2126,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { minimap_drag_my = my; } } else - draw_sprite_ui(THEME.node_resize, 0, mx0 + ui(2), my0 + ui(2), 0.5, 0.5, 180, c_white, 0.3); + draw_sprite_ui(THEME.node_resize, 0, mx0 + ui(10), my0 + ui(10), 0.5, 0.5, 180, c_white, 0.3); } #endregion function drawSearch() { diff --git a/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml b/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml index 0e9493e05..f374f73f3 100644 --- a/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml +++ b/scripts/panel_graph_export_image_dialog/panel_graph_export_image_dialog.gml @@ -116,6 +116,8 @@ function Panel_Graph_Export_Image(targetPanel) : PanelContent() constructor { case "buttonColor" : _wid.draw(_tx - _ww, ty + wh * i - _hh / 2, _ww, _hh, _dat, _m); break; case "scrollBox" : _wid.draw(_tx - _ww, ty + wh * i - _hh / 2, _ww, _hh, _dat, _m, sc_settings.x + x, sc_settings.y + y); break; } + + if(_wid.inBBOX(_m)) sc_settings.hover_content = true; } var _h = wh * array_length(widgets) + _hh; diff --git a/scripts/panel_history/panel_history.gml b/scripts/panel_history/panel_history.gml index 43bbad4dc..fe27faf59 100644 --- a/scripts/panel_history/panel_history.gml +++ b/scripts/panel_history/panel_history.gml @@ -33,9 +33,7 @@ function Panel_History() : PanelContent() constructor { } refreshList(); - onResize = function() { - sc_history.resize(w - padding * 2, h - padding * 2); - } + onResize = function() { sc_history.resize(w - padding * 2, h - padding * 2); } sc_history = new scrollPane(w - padding * 2, h - padding * 2, function(_y, _m) { draw_clear_alpha(COLORS._main_text, 0); @@ -81,6 +79,7 @@ function Panel_History() : PanelContent() constructor { BLEND_OVERRIDE; if(pHOVER && sc_history.hover && point_in_rectangle(_m[0], _m[1], ui(32), yy - ui(4), lw, yy + hh + ui(4) - 1)) { + sc_history.hover_content = true; draw_sprite_stretched_ext(THEME.node_bg, 0, ui(32), yy - ui(2), lw, hh + ui(4), COLORS._main_icon_light, 1); _hover = i; diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 7a650f84c..a67efd7fe 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -280,6 +280,7 @@ function Panel_Inspector() : PanelContent() constructor { if(_b != noone) { _b.setFocusHover(pFOCUS, _hover); _b.draw(_x1, yy + ui(2), ui(28), lbh - ui(4), _m, THEME.button_hide_fill); + if(_b.inBBOX(_m)) contentPane.hover_content = true; } draw_sprite_ui(THEME.arrow, meta_display[i][1]? 0 : 3, ui(16), yy + lbh / 2, 1, 1, 0, COLORS.panel_inspector_group_bg, 1); @@ -290,9 +291,7 @@ function Panel_Inspector() : PanelContent() constructor { yy += lbh + ui(viewMode? 8 : 6); hh += lbh + ui(viewMode? 8 : 6); - if(meta_display[i][1]) { - continue; - } + if(meta_display[i][1]) continue; var _font = viewMode == INSP_VIEW_MODE.spacious? f_p0 : f_p2; @@ -336,6 +335,7 @@ function Panel_Inspector() : PanelContent() constructor { _param.font = _font; wh = editW.drawParam(_param); + if(editW.inBBOX(_m)) contentPane.hover_content = true; var jun = PANEL_GRAPH.value_dragging; var widw = con_w - ui(16); @@ -393,6 +393,7 @@ function Panel_Inspector() : PanelContent() constructor { } wh = meta_tb[j].drawParam(_param); + if(meta_tb[j].inBBOX(_m)) contentPane.hover_content = true; if(viewMode == INSP_VIEW_MODE.spacious) { yy += wh + ui(8); @@ -421,6 +422,7 @@ function Panel_Inspector() : PanelContent() constructor { _param.font = _font; wh = meta_steam_avatar.drawParam(_param); + if(meta_steam_avatar.inBBOX(_m)) contentPane.hover_content = true; yy += wh + ui(6); hh += wh + ui(6); if(viewMode == INSP_VIEW_MODE.spacious) { yy += ui(2); hh += ui(2); } @@ -435,7 +437,11 @@ function Panel_Inspector() : PanelContent() constructor { continue; } - var gvh = globalvar_viewer_draw(ui(16), yy, contentPane.surface_w - ui(24), _m, pFOCUS, _hover, contentPane, ui(16) + x, top_bar_h + y); + if(_m[1] > yy) contentPane.hover_content = true; + + var glPar = globalvar_viewer_draw(ui(16), yy, contentPane.surface_w - ui(24), _m, pFOCUS, _hover, contentPane, ui(16) + x, top_bar_h + y); + var gvh = glPar[0]; + yy += gvh + ui(8); hh += gvh + ui(8); @@ -568,6 +574,7 @@ function Panel_Inspector() : PanelContent() constructor { edt[2].text = edt[0]; edt[2].draw(ui(8), yy, con_w - ui(16), hg, _m); + if(edt[2].inBBOX(_m)) contentPane.hover_content = true; yy += hg + ui(8); hh += hg + ui(8); continue; @@ -581,6 +588,7 @@ function Panel_Inspector() : PanelContent() constructor { var _wh = edt[2].drawParam(_param); var _hg = max(hg, _wh); + if(edt[2].inBBOX(_m)) contentPane.hover_content = true; yy += _hg + ui(8); hh += _hg + ui(8); } @@ -682,6 +690,7 @@ function Panel_Inspector() : PanelContent() constructor { var ltx = lbx + ui(32); if(_hover && point_in_rectangle(_m[0], _m[1], lbx, yy, con_w, yy + lbh)) { + contentPane.hover_content = true; draw_sprite_stretched_ext(THEME.group_label, 0, lbx, yy, lbw, lbh, COLORS.panel_inspector_group_hover, 1); if(mouse_press(mb_left, pFOCUS)) @@ -698,6 +707,7 @@ function Panel_Inspector() : PanelContent() constructor { if(togl != noone) { if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, ui(32), yy + lbh)) { + contentPane.hover_content = true; draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy, ui(32), lbh, COLORS.panel_inspector_group_hover, 1); if(mouse_press(mb_left, pFOCUS)) @@ -785,9 +795,15 @@ function Panel_Inspector() : PanelContent() constructor { var widg = drawWidget(ui(16), yy, contentPane.surface_w - ui(24), _m, jun, false, pHOVER && contentPane.hover, pFOCUS, contentPane, ui(16) + x, top_bar_h + y); var widH = widg[0]; var mbRight = widg[1]; + var widHov = widg[2]; var lbHov = point_in_rectangle(_m[0], _m[1], lb_x, _selY + ui(2), lb_x + lb_w, _selY + lb_h - ui(4)); - if(lbHov) draw_sprite_stretched_ext(THEME.button_hide, 1, lb_x, _selY + ui(2), lb_w, lb_h - ui(6), COLORS._main_icon, 1); + if(lbHov) { + contentPane.hover_content = true; + draw_sprite_stretched_ext(THEME.button_hide, 1, lb_x, _selY + ui(2), lb_w, lb_h - ui(4), COLORS._main_icon, 1); + } + + if(widHov) contentPane.hover_content = true; hh += lb_h + widH + padd; @@ -809,12 +825,12 @@ function Panel_Inspector() : PanelContent() constructor { } #endregion - if(jun.connect_type == JUNCTION_CONNECT.input && jun.type == VALUE_TYPE.color && jun.display_type == VALUE_DISPLAY._default) { #region color picker + if(jun.connect_type == JUNCTION_CONNECT.input && jun.type == VALUE_TYPE.color && jun.display_type == VALUE_DISPLAY._default) { // color picker pickers[color_picker_index] = jun; color_picker_index++; - } #endregion + } - if(_hover && point_in_rectangle(_m[0], _m[1], ui(4), _selY, contentPane.surface_w - ui(4), _selY + _selH)) { #region mouse in widget + if(_hover && point_in_rectangle(_m[0], _m[1], ui(4), _selY, contentPane.surface_w - ui(4), _selY + _selH)) { // mouse in widget _HOVERING_ELEMENT = jun; var hov = PANEL_GRAPH.value_dragging != noone || (NODE_DROPPER_TARGET != noone && NODE_DROPPER_TARGET != jun); @@ -870,7 +886,7 @@ function Panel_Inspector() : PanelContent() constructor { var dia = menuCall("inspector_value_menu",,, _menuItem,, jun); __dialog_junction = jun; } #endregion - } #endregion + } } #region color picker @@ -1140,6 +1156,7 @@ function Panel_Inspector() : PanelContent() constructor { if(!locked && PANEL_GRAPH.getFocusingNode() && inspecting != PANEL_GRAPH.getFocusingNode()) setInspecting(PANEL_GRAPH.getFocusingNode()); + } #endregion //// =========== Serialize =========== diff --git a/scripts/panel_nodes/panel_nodes.gml b/scripts/panel_nodes/panel_nodes.gml index c7be53052..61ab49ab9 100644 --- a/scripts/panel_nodes/panel_nodes.gml +++ b/scripts/panel_nodes/panel_nodes.gml @@ -43,6 +43,8 @@ function Panel_Nodes() : PanelContent() constructor { node_collapse[? node.node_id] = false; if(pHOVER && point_in_rectangle(_m[0], _m[1], _x0, _y, _x1 - _x0 - ui(32), _y + hg)) { + sc_nodes.hover_content = true; + var cc = merge_color(COLORS._main_icon_light, COLORS._main_icon, 0.25); draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _x0, _y, _x1 - _x0, hg, cc, 1); @@ -90,13 +92,11 @@ function Panel_Nodes() : PanelContent() constructor { return _h; } - #region content - sc_nodes = new scrollPane(w - ui(padding + padding), h - ui(title_height + padding + 40), function(_y, _m) { - draw_clear_alpha(COLORS.panel_bg_clear, 0); - var _h = drawNodeList(PROJECT.nodes, 0, sc_nodes.surface_w, _y, _m); - return _h; - }) - #endregion + sc_nodes = new scrollPane(w - ui(padding + padding), h - ui(title_height + padding + 40), function(_y, _m) { + draw_clear_alpha(COLORS.panel_bg_clear, 0); + var _h = drawNodeList(PROJECT.nodes, 0, sc_nodes.surface_w, _y, _m); + return _h; + }); function drawContent(panel) { draw_clear_alpha(COLORS.panel_bg_clear, 0); diff --git a/scripts/panel_notification/panel_notification.gml b/scripts/panel_notification/panel_notification.gml index 45f049324..b78da689b 100644 --- a/scripts/panel_notification/panel_notification.gml +++ b/scripts/panel_notification/panel_notification.gml @@ -35,7 +35,6 @@ function Panel_Notification() : PanelContent() constructor { function onResize() { PANEL_PADDING - sp_noti.resize(w - ui(padding + padding), h - ui(title_height + padding)); } @@ -67,6 +66,7 @@ function Panel_Notification() : PanelContent() constructor { draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy, _w, _h, COLORS.dialog_notification_bg, 1); if(pHOVER && pHOVER && point_in_rectangle(_m[0], _m[1], 0, yy, _w, yy + _h)) { + sp_noti.hover_content = true; draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy, _w, _h, COLORS.dialog_notification_bg_hover, 1); if(noti.tooltip != "") diff --git a/scripts/panel_palette/panel_palette.gml b/scripts/panel_palette/panel_palette.gml index 2bc86d6d7..070eb48f3 100644 --- a/scripts/panel_palette/panel_palette.gml +++ b/scripts/panel_palette/panel_palette.gml @@ -129,6 +129,8 @@ function Panel_Palette() : PanelContent() constructor { } if(isHover) { + sp_palettes.hover_content = true; + if(_palRes.hoverIndex > noone) { var _box = _palRes.hoverBBOX; draw_sprite_stretched_add(THEME.menu_button_mask, 1, _box[0] + 1, _box[1] + 1, _box[2] - 2, _box[3] - 2, c_white, 0.3); diff --git a/scripts/panel_presets/panel_presets.gml b/scripts/panel_presets/panel_presets.gml index 1be420bba..404796cc0 100644 --- a/scripts/panel_presets/panel_presets.gml +++ b/scripts/panel_presets/panel_presets.gml @@ -61,9 +61,12 @@ function Panel_Presets(_node) : PanelContent() constructor { draw_set_text(f_p2, fa_center, fa_center, _hov? COLORS._main_value_positive : COLORS._main_icon); draw_text_add(_ww / 2, _y + _add_h / 2, __txt("New preset")); - if(_hov && mouse_press(mb_left, pFOCUS)) { - if(!adding) tb_add.activate(); - adding = true; + if(_hov) { + sc_presets.hover_content = true; + if(mouse_press(mb_left, pFOCUS)) { + if(!adding) tb_add.activate(); + adding = true; + } } _h += _add_h + ui(4); diff --git a/scripts/panel_tunnels/panel_tunnels.gml b/scripts/panel_tunnels/panel_tunnels.gml index 49014eb80..812b75db4 100644 --- a/scripts/panel_tunnels/panel_tunnels.gml +++ b/scripts/panel_tunnels/panel_tunnels.gml @@ -75,6 +75,7 @@ function Panel_Tunnels() : PanelContent() constructor { var node = arr[i]; if(point_in_rectangle(_m[0], _m[1], 0, _y, ww, _y + hg)) { + sc_tunnel.hover_content = true; var cc = merge_color(COLORS._main_icon_light, COLORS._main_icon, 0.25); draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y, ww, hg, cc, 1); tunnel_hover = node; diff --git a/scripts/scrollPane/scrollPane.gml b/scripts/scrollPane/scrollPane.gml index 6ba7943d5..f5da22e9b 100644 --- a/scripts/scrollPane/scrollPane.gml +++ b/scripts/scrollPane/scrollPane.gml @@ -28,7 +28,7 @@ function scrollPane(_w, _h, ondraw) : widget() constructor { pen_scroll_my = 0; pen_scroll_sy = 0; pen_scroll_py = 0; - pen_scroll_lock = false; + hover_content = false; scroll_s = sprite_get_width(THEME.ui_scrollbar); scroll_w = scroll_s; @@ -52,6 +52,9 @@ function scrollPane(_w, _h, ondraw) : widget() constructor { hover &= point_in_rectangle( mx, my, 0, 0, surface_w, surface_h); hover &= pen_scrolling != 2; surface = surface_verify(surface, surface_w, surface_h); + hover_content = false; + + //// Draw surface_set_target(surface); draw_clear(COLORS.panel_bg_clear); @@ -75,25 +78,28 @@ function scrollPane(_w, _h, ondraw) : widget() constructor { if(mouse_wheel_up()) scroll_y_to += scroll_step * SCROLL_SPEED; } - // if(pen_scroll_lock) pen_scrolling = 0; - // else if(hover && PEN_USE && mouse_press(mb_left)) { - // pen_scrolling = 1; - // pen_scroll_my = 0; - // } + //// Pen scroll + + if(pen_scrolling == 0 && mouse_press(mb_left, !hover_content && hover && PEN_USE)) { + pen_scrolling = 1; + pen_scroll_my = 0; + } if(pen_scrolling == 1) { pen_scroll_my += PEN_Y_DELTA; - if(abs(pen_scroll_my) > 16) + if(abs(pen_scroll_my) > 0) pen_scrolling = 2; if(mouse_release(mb_left)) pen_scrolling = 0; } else if(pen_scrolling == 2) { + scroll_y_to = clamp(scroll_y_to + PEN_Y_DELTA * 2, -content_h, 0); scroll_y_raw = scroll_y_to; scroll_y = round(scroll_y_raw); pen_scroll_py = abs(PEN_Y_DELTA) > abs(pen_scroll_py)? PEN_Y_DELTA : lerp_float(pen_scroll_py, PEN_Y_DELTA, 10); - if(mouse_release(mb_left)) pen_scrolling = 0; + if(mouse_release(mb_left)) + pen_scrolling = 0; } else { pen_scroll_py = lerp_float(pen_scroll_py, 0, 30, 1); @@ -109,7 +115,6 @@ function scrollPane(_w, _h, ondraw) : widget() constructor { } scroll_lock = false; - pen_scroll_lock = false; } static draw_scroll = function(scr_x, scr_y, is_vert, scr_s, scr_prog, scr_ratio, bg_col, bar_col, bar_hcol, mx, my, bar_spr_w) { diff --git a/scripts/sliderRange/sliderRange.gml b/scripts/sliderRange/sliderRange.gml index bcd1efa4b..b87caf94e 100644 --- a/scripts/sliderRange/sliderRange.gml +++ b/scripts/sliderRange/sliderRange.gml @@ -7,10 +7,10 @@ function sliderRange(_step, _int, _range, _onModify) : widget() constructor { onModify = _onModify; tb_value_min = new textBox(TEXTBOX_INPUT.number, function(val) /*=>*/ {return onModify(clamp(val, curr_range[0], curr_range[1]), 0)}) - .setSlideType(_int).setSlideStep(_step).setSlideRange(_range); + .setSlideType(_int).setSlideStep(_step).setSlideRange(_range[0], _range[1]); tb_value_max = new textBox(TEXTBOX_INPUT.number, function(val) /*=>*/ {return onModify(clamp(val, curr_range[0], curr_range[1]), 1)}) - .setSlideType(_int).setSlideStep(_step).setSlideRange(_range); + .setSlideType(_int).setSlideStep(_step).setSlideRange(_range[0], _range[1]); tb_value_min.hide = true; tb_value_max.hide = true; diff --git a/scripts/textArea/textArea.gml b/scripts/textArea/textArea.gml index 70cbe66fe..f742b22e3 100644 --- a/scripts/textArea/textArea.gml +++ b/scripts/textArea/textArea.gml @@ -718,14 +718,12 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor if(target != undefined) { if(!click_block) { if(mouse_press(mb_left, active) && HOVER != o_dialog_textbox_autocomplete.id) { - if(parent) parent.pen_scroll_lock = true; cursor_select = target; cursor = target; o_dialog_textbox_autocomplete.deactivate(self); } else if(mouse_click(mb_left, active)) { - if(parent) parent.pen_scroll_lock = true; cursor = target; } } @@ -997,7 +995,6 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor var bar_y = scr_y + (scr_h - bar_h) * abs(text_y / text_y_max); if(text_scrolling) { - if(parent) parent.pen_scroll_lock = true; text_y_to = text_scroll_sy - (_m[1] - text_scroll_my) / bar_h * scr_h; text_y_to = clamp(text_y_to, -text_y_max, 0); diff --git a/scripts/textBox/textBox.gml b/scripts/textBox/textBox.gml index 279d37725..b3e8d1b10 100644 --- a/scripts/textBox/textBox.gml +++ b/scripts/textBox/textBox.gml @@ -535,7 +535,6 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { var hoverRect = point_in_rectangle(_m[0], _m[1], _x, _y, _x + _w, _y + _h); if(sliding > 0) { #region slide - if(parent) parent.pen_scroll_lock = true; slide_delta += PEN_USE? PEN_X_DELTA : window_mouse_get_delta_x(); slide_delta += PEN_USE? PEN_Y_DELTA : window_mouse_get_delta_y(); @@ -551,7 +550,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { slider_dy = 0; slider_mulp = 0; - if(!slidePen) { + if(!slidePen && PREFERENCES.slider_lock_mouse) { CURSOR_LOCK_X = mouse_mx; CURSOR_LOCK_Y = mouse_my; } @@ -571,8 +570,10 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { slider_dy += slidePen? PEN_Y_DELTA : window_mouse_get_delta_y(); var _mulp = slider_mulp; - if(slider_dy < -160 * (1 + abs(slider_mulp) * .5)) { slider_mulp = clamp(slider_mulp + 1, -2, 2); slider_dy = 0; } - else if(slider_dy > 160 * (1 + abs(slider_mulp) * .5)) { slider_mulp = clamp(slider_mulp - 1, -2, 2); slider_dy = 0; } + var _stpH = slidePen || !PREFERENCES.slider_lock_mouse? 24 : 160; + + if(slider_dy < -_stpH * (1 + abs(slider_mulp) * .5)) { slider_mulp = clamp(slider_mulp + 1, -2, 2); slider_dy = 0; } + else if(slider_dy > _stpH * (1 + abs(slider_mulp) * .5)) { slider_mulp = clamp(slider_mulp - 1, -2, 2); slider_dy = 0; } if(_mulp != slider_mulp) { slider_dx = 0; @@ -589,28 +590,32 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { } else { MOUSE_BLOCK = true; - var _s = slide_speed; - var _sc = power(10, slider_mulp); + var _s = slide_speed; + // print($"{_s} : {slide_range} | {_w} / {_s * _w} - {slider_cur_del}"); + if(!PREFERENCES.slider_lock_mouse) + _s = slide_range != noone? (slide_range[1] - slide_range[0]) / _w * 2 : 1 / 100; + + var _sc = power(10, slider_mulp + slide_int); _s *= _sc; if(key_mod_press(CTRL) && !slide_snap) _s *= 10; if(key_mod_press(ALT)) _s /= 10; - var _slider_cur_val = slider_cur_val; - slider_dx += _mdx / w; - slider_cur_del += _mdx; - slider_cur_val = slider_def_val + slider_cur_del * _s; + if(abs(_mdx) > abs(_mdy)) { + slider_dx += _mdx / w; + slider_cur_del += _mdx; + slider_cur_val = slider_def_val + slider_cur_del * _s; - if(slide_range != noone) - slider_cur_val = clamp(slider_cur_val, curr_range[0], curr_range[1]); - - var _val = value_snap(slider_cur_val, _sc / 100); - // print($"{_slider_cur_val} > {slider_cur_val} : {curr_range} > {_val} [{_sc / 100}]"); - - if(key_mod_press(CTRL) && slide_snap) _val = value_snap(slider_cur_val, slide_snap); - if(slide_int) _val = round(_val); - - _input_text = string_real(_val); + if(slide_range != noone) + slider_cur_val = clamp(slider_cur_val, curr_range[0], curr_range[1]); + + var _val = value_snap(slider_cur_val, _sc / 100); + + if(key_mod_press(CTRL) && slide_snap) _val = value_snap(slider_cur_val, slide_snap); + if(slide_int) _val = round(_val); + + _input_text = string_real(_val); + } if(apply()) UNDO_HOLDING = true; } diff --git a/scripts/widget/widget.gml b/scripts/widget/widget.gml index 860c459a5..b0ce85458 100644 --- a/scripts/widget/widget.gml +++ b/scripts/widget/widget.gml @@ -8,6 +8,8 @@ function widget() constructor { keyframe = noone; interactable = true; + hover_content = false; + right_click_block = true; side_button = noone; @@ -98,6 +100,8 @@ function widget() constructor { hover = false; } + static inBBOX = function(_m) { return point_in_rectangle(_m[0], _m[1], x, y, x + w, y + h); } + static clone = function() { return variable_clone(self); } static drawParam = function(params) {}