mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-14 06:23:55 +01:00
Compare commits
No commits in common. "76ac461738b135fd77ab1631bc21f259a1cc5e6d" and "3e4b61fc0bd84531aa5e686c37a3e8ab95869266" have entirely different histories.
76ac461738
...
3e4b61fc0b
@ -15,7 +15,6 @@
|
|||||||
{"name":"addons","order":142,"path":"folders/addons.yy",},
|
{"name":"addons","order":142,"path":"folders/addons.yy",},
|
||||||
{"name":"animation_curve","order":143,"path":"folders/animation_curve.yy",},
|
{"name":"animation_curve","order":143,"path":"folders/animation_curve.yy",},
|
||||||
{"name":"dialog","order":144,"path":"folders/dialog.yy",},
|
{"name":"dialog","order":144,"path":"folders/dialog.yy",},
|
||||||
{"name":"Extensions","order":157,"path":"folders/Extensions.yy",},
|
|
||||||
{"name":"font","order":145,"path":"folders/font.yy",},
|
{"name":"font","order":145,"path":"folders/font.yy",},
|
||||||
{"name":"functions","order":146,"path":"folders/functions.yy",},
|
{"name":"functions","order":146,"path":"folders/functions.yy",},
|
||||||
{"name":"camera","order":7,"path":"folders/functions/3d/camera.yy",},
|
{"name":"camera","order":7,"path":"folders/functions/3d/camera.yy",},
|
||||||
|
@ -50,7 +50,6 @@
|
|||||||
{"$GMFolder":"","%Name":"inspector","folderPath":"folders/dialog/inspector.yy","name":"inspector","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"inspector","folderPath":"folders/dialog/inspector.yy","name":"inspector","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"menu","folderPath":"folders/dialog/menu.yy","name":"menu","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"menu","folderPath":"folders/dialog/menu.yy","name":"menu","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"widget","folderPath":"folders/dialog/widget.yy","name":"widget","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"widget","folderPath":"folders/dialog/widget.yy","name":"widget","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"Extensions","folderPath":"folders/Extensions.yy","name":"Extensions","resourceType":"GMFolder","resourceVersion":"2.0",},
|
|
||||||
{"$GMFolder":"","%Name":"font","folderPath":"folders/font.yy","name":"font","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"font","folderPath":"folders/font.yy","name":"font","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"functions","folderPath":"folders/functions.yy","name":"functions","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"functions","folderPath":"folders/functions.yy","name":"functions","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"3d","folderPath":"folders/functions/3d.yy","name":"3d","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"3d","folderPath":"folders/functions/3d.yy","name":"3d","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
_dialog_h = 320;
|
_dialog_h = 320;
|
||||||
dialog_x = 0;
|
dialog_x = 0;
|
||||||
dialog_y = 0;
|
dialog_y = 0;
|
||||||
anchor = ANCHOR.none;
|
|
||||||
|
|
||||||
title = "dialog";
|
title = "dialog";
|
||||||
window = noone;
|
window = noone;
|
||||||
@ -41,6 +40,7 @@
|
|||||||
|
|
||||||
destroy_on_escape = true;
|
destroy_on_escape = true;
|
||||||
destroy_on_click_out = false;
|
destroy_on_click_out = false;
|
||||||
|
anchor = ANCHOR.none;
|
||||||
|
|
||||||
init_pressing = mouse_click(mb_left);
|
init_pressing = mouse_click(mb_left);
|
||||||
#endregion
|
#endregion
|
||||||
@ -82,8 +82,15 @@
|
|||||||
o_main.dialog_popup_y = mouse_my;
|
o_main.dialog_popup_y = mouse_my;
|
||||||
|
|
||||||
if(mouse_release(mb_left)) {
|
if(mouse_release(mb_left)) {
|
||||||
var _cfg = winwin_config_ext(title, winwin_kind_borderless, false, true);
|
var _wconfig = new winwin_config();
|
||||||
window = winwin_create_ext(_wx + _dx, _wy + _dy, dialog_w, dialog_h, _cfg);
|
_wconfig.kind = winwin_kind_borderless;
|
||||||
|
_wconfig.caption = title;
|
||||||
|
_wconfig.topmost = true;
|
||||||
|
_wconfig.per_pixel_alpha = true;
|
||||||
|
_wconfig.resize = true;
|
||||||
|
_wconfig.owner = winwin_main;
|
||||||
|
|
||||||
|
window = winwin_create(_wx + _dx, _wy + _dy, dialog_w, dialog_h, _wconfig);
|
||||||
dialog_x = 0;
|
dialog_x = 0;
|
||||||
dialog_y = 0;
|
dialog_y = 0;
|
||||||
}
|
}
|
||||||
@ -327,13 +334,11 @@
|
|||||||
function checkMouse() {
|
function checkMouse() {
|
||||||
if(!active) return;
|
if(!active) return;
|
||||||
if(!DIALOG_CLICK) return;
|
if(!DIALOG_CLICK) return;
|
||||||
if(init_pressing) return;
|
|
||||||
|
|
||||||
if(MOUSE_POOL.lpress || MOUSE_POOL.rpress) { //print($"Closing {title}");
|
WINDOW_ACTIVE = window;
|
||||||
if(!isTop()) {
|
|
||||||
// print($" > Not close, not on top.")
|
if(!init_pressing && mouse_press(mb_any)) {
|
||||||
return;
|
if(!isTop()) return;
|
||||||
}
|
|
||||||
|
|
||||||
for( var i = 0, n = array_length(children); i < n; i++ )
|
for( var i = 0, n = array_length(children); i < n; i++ )
|
||||||
if(instance_exists(children[i])) return;
|
if(instance_exists(children[i])) return;
|
||||||
|
@ -4,7 +4,6 @@ event_inherited();
|
|||||||
#region data
|
#region data
|
||||||
draggable = false;
|
draggable = false;
|
||||||
|
|
||||||
title = "Add node";
|
|
||||||
node_target_x = 0;
|
node_target_x = 0;
|
||||||
node_target_y = 0;
|
node_target_y = 0;
|
||||||
node_target_x_raw = 0;
|
node_target_x_raw = 0;
|
||||||
@ -61,8 +60,6 @@ event_inherited();
|
|||||||
category_width = maxLen + ui(56);
|
category_width = maxLen + ui(56);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
function isTop() { return true; }
|
|
||||||
|
|
||||||
function trigger_favourite() {
|
function trigger_favourite() {
|
||||||
if(node_menu_selecting == noone) return;
|
if(node_menu_selecting == noone) return;
|
||||||
|
|
||||||
@ -84,7 +81,7 @@ event_inherited();
|
|||||||
menuItem(fav? __txtx("add_node_remove_favourite", "Remove from favourite") : __txtx("add_node_add_favourite", "Add to favourite"), trigger_favourite, THEME.star)
|
menuItem(fav? __txtx("add_node_remove_favourite", "Remove from favourite") : __txtx("add_node_add_favourite", "Add to favourite"), trigger_favourite, THEME.star)
|
||||||
];
|
];
|
||||||
|
|
||||||
menuCall("add_node_window_menu", menu, 0, 0, fa_left);
|
menuCall("add_node_window_manu", menu, 0, 0, fa_left, node_menu_selecting);
|
||||||
}
|
}
|
||||||
|
|
||||||
function filtered(node) {
|
function filtered(node) {
|
||||||
|
@ -6,25 +6,4 @@ event_inherited();
|
|||||||
|
|
||||||
dialog_w = ui(440);
|
dialog_w = ui(440);
|
||||||
dialog_h = ui(140);
|
dialog_h = ui(140);
|
||||||
|
|
||||||
function resetPosition() {
|
|
||||||
if(!active) return;
|
|
||||||
dialog_x = xstart - dialog_w / 2;
|
|
||||||
dialog_y = ystart - dialog_h / 2;
|
|
||||||
|
|
||||||
dialog_x = round(clamp(dialog_x, 2, WIN_SW - dialog_w - 2));
|
|
||||||
dialog_y = round(clamp(dialog_y, 2, WIN_SH - dialog_h - 2));
|
|
||||||
|
|
||||||
if(PREFERENCES.multi_window) {
|
|
||||||
var _wx = WIN_X + dialog_x;
|
|
||||||
var _wy = WIN_Y + dialog_y;
|
|
||||||
|
|
||||||
var _cfg = winwin_config_ext("Exit", winwin_kind_borderless, false, false);
|
|
||||||
window = winwin_create_ext(_wx, _wy, dialog_w, dialog_h, _cfg);
|
|
||||||
|
|
||||||
dialog_x = 0;
|
|
||||||
dialog_y = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
@ -1,2 +0,0 @@
|
|||||||
/// @description Insert description here
|
|
||||||
event_inherited();
|
|
@ -16,12 +16,10 @@ if !ready exit;
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
DIALOG_PREDRAW
|
#region base UI
|
||||||
DIALOG_WINCLEAR
|
DIALOG_DRAW_BG
|
||||||
|
if(sFOCUS) DIALOG_DRAW_FOCUS
|
||||||
var _des = false;
|
#endregion
|
||||||
DIALOG_DRAW_BG
|
|
||||||
if(sFOCUS) DIALOG_DRAW_FOCUS
|
|
||||||
|
|
||||||
#region text
|
#region text
|
||||||
var py = dialog_y + ui(16);
|
var py = dialog_y + ui(16);
|
||||||
@ -35,7 +33,7 @@ if(sFOCUS) DIALOG_DRAW_FOCUS
|
|||||||
draw_text_ext(dialog_x + ui(24), py, txt, -1, dialog_w - ui(48));
|
draw_text_ext(dialog_x + ui(24), py, txt, -1, dialog_w - ui(48));
|
||||||
_dialog_h = ui(118) + string_height_ext(txt, -1, dialog_w - ui(48));
|
_dialog_h = ui(118) + string_height_ext(txt, -1, dialog_w - ui(48));
|
||||||
|
|
||||||
var bw = ui(96), bh = BUTTON_HEIGHT;
|
var bw = ui(96), bh = BUTTON_HEIGHT;
|
||||||
var bx1 = dialog_x + dialog_w - ui(16);
|
var bx1 = dialog_x + dialog_w - ui(16);
|
||||||
var by1 = dialog_y + dialog_h - ui(16);
|
var by1 = dialog_y + dialog_h - ui(16);
|
||||||
var bx0 = bx1 - bw;
|
var bx0 = bx1 - bw;
|
||||||
@ -45,7 +43,7 @@ if(sFOCUS) DIALOG_DRAW_FOCUS
|
|||||||
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
|
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
|
||||||
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Cancel"));
|
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Cancel"));
|
||||||
if(b == 2)
|
if(b == 2)
|
||||||
_des = true;
|
instance_destroy();
|
||||||
|
|
||||||
bx0 -= bw + ui(12);
|
bx0 -= bw + ui(12);
|
||||||
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
|
var b = buttonInstant(THEME.button_def, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
|
||||||
@ -53,7 +51,7 @@ if(sFOCUS) DIALOG_DRAW_FOCUS
|
|||||||
if(b == 2) {
|
if(b == 2) {
|
||||||
if(instance_number(o_dialog_exit) == 1)
|
if(instance_number(o_dialog_exit) == 1)
|
||||||
close_program();
|
close_program();
|
||||||
_des = true;
|
instance_destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
bx0 -= bw + ui(12);
|
bx0 -= bw + ui(12);
|
||||||
@ -62,12 +60,8 @@ if(sFOCUS) DIALOG_DRAW_FOCUS
|
|||||||
if(b == 2 && SAVE(project)) {
|
if(b == 2 && SAVE(project)) {
|
||||||
if(instance_number(o_dialog_exit) == 1)
|
if(instance_number(o_dialog_exit) == 1)
|
||||||
close_program();
|
close_program();
|
||||||
_des = true;
|
instance_destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog_h = _dialog_h;
|
dialog_h = _dialog_h;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
DIALOG_POSTDRAW
|
|
||||||
|
|
||||||
if(_des) instance_destroy();
|
|
@ -4,7 +4,6 @@
|
|||||||
"eventList":[
|
"eventList":[
|
||||||
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":64,"eventType":8,"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":0,"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":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":1,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
|
|
||||||
],
|
],
|
||||||
"managed":true,
|
"managed":true,
|
||||||
"name":"o_dialog_exit",
|
"name":"o_dialog_exit",
|
||||||
|
@ -11,15 +11,15 @@ event_inherited();
|
|||||||
menu_id = "";
|
menu_id = "";
|
||||||
alarm[0] = -1;
|
alarm[0] = -1;
|
||||||
menu = 1;
|
menu = 1;
|
||||||
font = f_p2;
|
font = f_p1;
|
||||||
hght = line_get_height(font, 10);
|
hght = line_get_height(font, 10);
|
||||||
tooltips = [];
|
tooltips = [];
|
||||||
show_icon = false;
|
show_icon = false;
|
||||||
context = noone;
|
context = noone;
|
||||||
submenu = noone;
|
submenu = noone;
|
||||||
|
|
||||||
_hovering_ch = true;
|
_hovering_ch = true;
|
||||||
init_press_l = MOUSE_POOL.lpress;
|
init_pressing = false;
|
||||||
|
|
||||||
setFocus(self.id);
|
setFocus(self.id);
|
||||||
|
|
||||||
@ -31,8 +31,7 @@ event_inherited();
|
|||||||
function setMenu(_menu, align = fa_left) {
|
function setMenu(_menu, align = fa_left) {
|
||||||
with(_p_dialog) { if(on_top) continue; other.depth = min(depth - 1, other.depth); }
|
with(_p_dialog) { if(on_top) continue; other.depth = min(depth - 1, other.depth); }
|
||||||
|
|
||||||
title = menu_id;
|
menu = _menu;
|
||||||
menu = _menu;
|
|
||||||
dialog_x = x;
|
dialog_x = x;
|
||||||
dialog_y = y;
|
dialog_y = y;
|
||||||
|
|
||||||
@ -104,10 +103,18 @@ event_inherited();
|
|||||||
var _wx = winwin_get_x_safe(WINDOW_ACTIVE) + dialog_x;
|
var _wx = winwin_get_x_safe(WINDOW_ACTIVE) + dialog_x;
|
||||||
var _wy = winwin_get_y_safe(WINDOW_ACTIVE) + dialog_y;
|
var _wy = winwin_get_y_safe(WINDOW_ACTIVE) + dialog_y;
|
||||||
|
|
||||||
if(window == noone || !winwin_exists(window)) {
|
if(window == noone) {
|
||||||
var _cfg = winwin_config_ext("", winwin_kind_borderless, false, false);
|
var _wconfig = new winwin_config();
|
||||||
window = winwin_create_ext(_wx, _wy, dialog_w, dialog_h, _cfg);
|
_wconfig.kind = winwin_kind_borderless;
|
||||||
|
_wconfig.caption = "";
|
||||||
|
_wconfig.topmost = true;
|
||||||
|
_wconfig.per_pixel_alpha = true;
|
||||||
|
_wconfig.resize = false;
|
||||||
|
_wconfig.owner = winwin_main;
|
||||||
|
_wconfig.taskbar_button = false;
|
||||||
|
_wconfig.close_button = false;
|
||||||
|
|
||||||
|
window = winwin_create(_wx, _wy, dialog_w, dialog_h, _wconfig);
|
||||||
} else {
|
} else {
|
||||||
winwin_set_position_safe(window, _wx, _wy);
|
winwin_set_position_safe(window, _wx, _wy);
|
||||||
winwin_set_size_safe(window, dialog_w, dialog_h);
|
winwin_set_size_safe(window, dialog_w, dialog_h);
|
||||||
@ -115,6 +122,9 @@ event_inherited();
|
|||||||
|
|
||||||
dialog_x = 0;
|
dialog_x = 0;
|
||||||
dialog_y = 0;
|
dialog_y = 0;
|
||||||
|
|
||||||
|
} else if(winwin_exists(window)) {
|
||||||
|
winwin_destroy(window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
@ -73,27 +73,23 @@ winwin_draw_clear(COLORS.panel_bg_clear, 1);
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(_menuItem.isShelf) {
|
if(_menuItem.isShelf) {
|
||||||
FOCUS_CONTENT = context;
|
|
||||||
|
|
||||||
var _res = _menuItem.func(_dat);
|
var _res = _menuItem.func(_dat);
|
||||||
if(submenu) instance_destroy(submenu);
|
if(submenu) instance_destroy(submenu);
|
||||||
submenu = _res;
|
submenu = _res;
|
||||||
|
|
||||||
} else if(remove_parents) {
|
} else if(remove_parents) {
|
||||||
DIALOG_POSTDRAW
|
|
||||||
FOCUS_CONTENT = context;
|
|
||||||
|
|
||||||
if(_par == noone) _menuItem.func();
|
if(_par == noone) _menuItem.func();
|
||||||
else _menuItem.func(_par);
|
else _menuItem.func(_par);
|
||||||
|
|
||||||
|
DIALOG_POSTDRAW
|
||||||
instance_destroy(o_dialog_menubox); // close all
|
instance_destroy(o_dialog_menubox); // close all
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DIALOG_POSTDRAW
|
|
||||||
FOCUS_CONTENT = context;
|
|
||||||
|
|
||||||
if(_par == noone) _menuItem.func();
|
if(_par == noone) _menuItem.func();
|
||||||
else _menuItem.func(_par);
|
else _menuItem.func(_par);
|
||||||
|
|
||||||
|
DIALOG_POSTDRAW
|
||||||
instance_destroy();
|
instance_destroy();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -159,7 +155,7 @@ winwin_draw_clear(COLORS.panel_bg_clear, 1);
|
|||||||
|
|
||||||
if(is_string(_sprs)) {
|
if(is_string(_sprs)) {
|
||||||
_str = _sprs;
|
_str = _sprs;
|
||||||
draw_set_text(font, fa_center, fa_center, COLORS._main_text);
|
draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text);
|
||||||
|
|
||||||
_sw = string_width(_str) + ui(12);
|
_sw = string_width(_str) + ui(12);
|
||||||
_sh = string_height(_str) + ui(8);
|
_sh = string_height(_str) + ui(8);
|
||||||
@ -181,9 +177,9 @@ winwin_draw_clear(COLORS.panel_bg_clear, 1);
|
|||||||
draw_sprite_stretched_ext(THEME.textbox, 1, _bx - _sw / 2, _by - _sh / 2, _sw, _sh, COLORS.dialog_menubox_highlight, 1);
|
draw_sprite_stretched_ext(THEME.textbox, 1, _bx - _sw / 2, _by - _sh / 2, _sw, _sh, COLORS.dialog_menubox_highlight, 1);
|
||||||
|
|
||||||
if(mouse_press(mb_left, sFOCUS)) {
|
if(mouse_press(mb_left, sFOCUS)) {
|
||||||
DIALOG_POSTDRAW
|
|
||||||
|
|
||||||
_submenu[1](_dat);
|
_submenu[1](_dat);
|
||||||
|
|
||||||
|
DIALOG_POSTDRAW
|
||||||
instance_destroy(o_dialog_menubox);
|
instance_destroy(o_dialog_menubox);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -236,10 +232,11 @@ winwin_draw_clear(COLORS.panel_bg_clear, 1);
|
|||||||
|
|
||||||
if(hk_editing == _menuItem) {
|
if(hk_editing == _menuItem) {
|
||||||
draw_set_color(COLORS._main_accent);
|
draw_set_color(COLORS._main_accent);
|
||||||
if(_ktxt == "") _ktxt = "-";
|
// draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _bw, _bh, COLORS._main_text_accent, .5);
|
||||||
|
|
||||||
} else if(_ktxt != "") {
|
} else if(_ktxt != "") {
|
||||||
draw_set_color(COLORS._main_text_sub);
|
draw_set_color(COLORS._main_text_sub);
|
||||||
|
// draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _bw, _bh, CDEF.main_dkgrey, .5);
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_text(_hx, _hy - ui(2), _ktxt);
|
draw_text(_hx, _hy - ui(2), _ktxt);
|
||||||
|
@ -7,14 +7,8 @@ if(item_sel_submenu) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(init_press_l) {
|
|
||||||
if(MOUSE_POOL.lrelease)
|
|
||||||
init_press_l = false;
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
var hov = point_in(mouse_raw_x, mouse_raw_y);
|
var hov = point_in(mouse_raw_x, mouse_raw_y);
|
||||||
if(submenu) hov |= submenu.point_in(mouse_raw_x, mouse_raw_y);
|
if(submenu) hov |= submenu.point_in(mouse_raw_x, mouse_raw_y);
|
||||||
|
|
||||||
_hovering_ch = hov;
|
_hovering_ch = hov;
|
||||||
if(!hov && MOUSE_POOL.lpress) instance_destroy();
|
if(!hov && mouse_press(mb_left)) instance_destroy();
|
@ -3,12 +3,6 @@ if(winMan_isMinimized()) exit;
|
|||||||
|
|
||||||
#region tooltip
|
#region tooltip
|
||||||
if(!_MOUSE_BLOCK) {
|
if(!_MOUSE_BLOCK) {
|
||||||
if(TOOLTIP_WINDOW != noone) {
|
|
||||||
winwin_set_topmost(TOOLTIP_WINDOW, true);
|
|
||||||
winwin_draw_begin(TOOLTIP_WINDOW);
|
|
||||||
winwin_draw_clear(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(is_struct(TOOLTIP)) {
|
if(is_struct(TOOLTIP)) {
|
||||||
if(struct_has(TOOLTIP, "drawTooltip"))
|
if(struct_has(TOOLTIP, "drawTooltip"))
|
||||||
TOOLTIP.drawTooltip();
|
TOOLTIP.drawTooltip();
|
||||||
@ -109,10 +103,6 @@ if(winMan_isMinimized()) exit;
|
|||||||
}
|
}
|
||||||
} else if(TOOLTIP != "")
|
} else if(TOOLTIP != "")
|
||||||
draw_tooltip_text(TOOLTIP);
|
draw_tooltip_text(TOOLTIP);
|
||||||
|
|
||||||
if(TOOLTIP_WINDOW != noone) {
|
|
||||||
winwin_draw_end();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
TOOLTIP = "";
|
TOOLTIP = "";
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -25,8 +25,7 @@ _FILE_DROPPED = false;
|
|||||||
}
|
}
|
||||||
|
|
||||||
var foc = window_has_focus();
|
var foc = window_has_focus();
|
||||||
//if(HOVER && instance_exists(HOVER) && HOVER.window != noone)
|
if(HOVER && instance_exists(HOVER) && HOVER.window != noone) foc = true;
|
||||||
foc = true;
|
|
||||||
|
|
||||||
game_set_speed(foc || IS_PLAYING? PREFERENCES.ui_framerate : PREFERENCES.ui_framerate_non_focus, gamespeed_fps);
|
game_set_speed(foc || IS_PLAYING? PREFERENCES.ui_framerate : PREFERENCES.ui_framerate_non_focus, gamespeed_fps);
|
||||||
WINDOW_ACTIVE = noone;
|
WINDOW_ACTIVE = noone;
|
||||||
@ -48,8 +47,6 @@ _FILE_DROPPED = false;
|
|||||||
#region window & mouse
|
#region window & mouse
|
||||||
//if(keyboard_check_pressed(vk_f12)) DEBUG = !DEBUG;
|
//if(keyboard_check_pressed(vk_f12)) DEBUG = !DEBUG;
|
||||||
|
|
||||||
global_mouse_pool_init();
|
|
||||||
|
|
||||||
if(_cursor != CURSOR) {
|
if(_cursor != CURSOR) {
|
||||||
window_set_cursor(CURSOR);
|
window_set_cursor(CURSOR);
|
||||||
_cursor = CURSOR;
|
_cursor = CURSOR;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
FOCUS_BEFORE = noone;
|
FOCUS_BEFORE = noone;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
function menuCall(menu_id = "", menu = [], _x = 0, _y = 0, align = fa_left) {
|
function menuCall(menu_id = "", menu = [], _x = 0, _y = 0, align = fa_left, context = noone) {
|
||||||
if(array_empty(menu)) return noone;
|
if(array_empty(menu)) return noone;
|
||||||
|
|
||||||
FOCUS_BEFORE = FOCUS;
|
FOCUS_BEFORE = FOCUS;
|
||||||
@ -22,13 +22,13 @@ function menuCall(menu_id = "", menu = [], _x = 0, _y = 0, align = fa_left) {
|
|||||||
array_append(menu, callbacks[i].populate());
|
array_append(menu, callbacks[i].populate());
|
||||||
}
|
}
|
||||||
|
|
||||||
dia.context = self;
|
|
||||||
dia.menu_id = menu_id;
|
dia.menu_id = menu_id;
|
||||||
|
dia.context = context;
|
||||||
dia.setMenu(menu, align);
|
dia.setMenu(menu, align);
|
||||||
return dia;
|
return dia;
|
||||||
}
|
}
|
||||||
|
|
||||||
function pieMenuCall(menu_id = "", _x = mouse_mx, _y = mouse_my, menu = []) {
|
function pieMenuCall(menu_id = "", _x = mouse_mx, _y = mouse_my, menu = [], context = noone) {
|
||||||
var dia = instance_create(_x, _y, o_pie_menu);
|
var dia = instance_create(_x, _y, o_pie_menu);
|
||||||
if(menu_id != "" && ds_map_exists(CONTEXT_MENU_CALLBACK, menu_id)) {
|
if(menu_id != "" && ds_map_exists(CONTEXT_MENU_CALLBACK, menu_id)) {
|
||||||
var callbacks = CONTEXT_MENU_CALLBACK[? menu_id];
|
var callbacks = CONTEXT_MENU_CALLBACK[? menu_id];
|
||||||
@ -37,8 +37,8 @@ function pieMenuCall(menu_id = "", _x = mouse_mx, _y = mouse_my, menu = []) {
|
|||||||
array_append(menu, callbacks[i].populate());
|
array_append(menu, callbacks[i].populate());
|
||||||
}
|
}
|
||||||
|
|
||||||
dia.context = self;
|
|
||||||
dia.menu_id = menu_id;
|
dia.menu_id = menu_id;
|
||||||
|
dia.context = context;
|
||||||
dia.setMenu(menu);
|
dia.setMenu(menu);
|
||||||
return dia;
|
return dia;
|
||||||
}
|
}
|
||||||
@ -46,12 +46,11 @@ function pieMenuCall(menu_id = "", _x = mouse_mx, _y = mouse_my, menu = []) {
|
|||||||
function submenuCall(_data = undefined, menu = []) {
|
function submenuCall(_data = undefined, menu = []) {
|
||||||
if(is_undefined(_data)) return menuCall("", menu);
|
if(is_undefined(_data)) return menuCall("", menu);
|
||||||
|
|
||||||
var _xx = _data.x - 1;
|
var dia = instance_create_depth(_data.x - ui(4), _data.y, _data.depth - 1, o_dialog_menubox);
|
||||||
var dia = instance_create_depth(_xx, _data.y, _data.depth - 1, o_dialog_menubox);
|
dia.context = _data.context;
|
||||||
dia.context = _data.context;
|
|
||||||
dia.setMenu(menu);
|
dia.setMenu(menu);
|
||||||
|
|
||||||
if(_xx + dia.dialog_w > WIN_W - ui(2))
|
if(_data.x - ui(4) + dia.dialog_w > WIN_W - ui(2))
|
||||||
dia.dialog_x = _data._x - dia.dialog_w + ui(4);
|
dia.dialog_x = _data._x - dia.dialog_w + ui(4);
|
||||||
|
|
||||||
return dia;
|
return dia;
|
||||||
|
@ -1,8 +1,3 @@
|
|||||||
#macro __mouse_tx (PREFERENCES.multi_window? mouse_raw_x : mouse_mxs)
|
|
||||||
#macro __mouse_ty (PREFERENCES.multi_window? mouse_raw_y : mouse_mys)
|
|
||||||
#macro __win_tw (PREFERENCES.multi_window? display_get_width() : WIN_W)
|
|
||||||
#macro __win_th (PREFERENCES.multi_window? display_get_height() : WIN_H)
|
|
||||||
|
|
||||||
function draw_tooltip_text(txt) {
|
function draw_tooltip_text(txt) {
|
||||||
txt = array_to_string(txt);
|
txt = array_to_string(txt);
|
||||||
|
|
||||||
@ -15,8 +10,8 @@ function draw_tooltip_text(txt) {
|
|||||||
var th = string_height_ext(txt, -1, tw);
|
var th = string_height_ext(txt, -1, tw);
|
||||||
|
|
||||||
var pd = ui(8);
|
var pd = ui(8);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (tw + pd * 2));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (tw + pd * 2));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (th + pd * 2));
|
var my = min(mouse_mys + ui(16), WIN_H - (th + pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, tw + pd * 2, th + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, tw + pd * 2, th + pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, tw + pd * 2, th + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, tw + pd * 2, th + pd * 2);
|
||||||
@ -33,8 +28,8 @@ function draw_tooltip_color(clr) {
|
|||||||
var hh = ui(32);
|
var hh = ui(32);
|
||||||
|
|
||||||
var pd = ui(4);
|
var pd = ui(4);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (ww + pd * 2));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (ww + pd * 2));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (hh + pd * 2));
|
var my = min(mouse_mys + ui(16), WIN_H - (hh + pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
@ -57,8 +52,8 @@ function draw_tooltip_palette(clr) {
|
|||||||
var hh = array_length(clr) * ph;
|
var hh = array_length(clr) * ph;
|
||||||
|
|
||||||
var pd = ui(4);
|
var pd = ui(4);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (ww + pd * 2));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (ww + pd * 2));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (hh + pd * 2));
|
var my = min(mouse_mys + ui(16), WIN_H - (hh + pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
@ -80,8 +75,8 @@ function draw_tooltip_gradient(clr) {
|
|||||||
var hh = array_length(clr) * gh;
|
var hh = array_length(clr) * gh;
|
||||||
|
|
||||||
var pd = ui(4);
|
var pd = ui(4);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (ww + pd * 2));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (ww + pd * 2));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (hh + pd * 2));
|
var my = min(mouse_mys + ui(16), WIN_H - (hh + pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
@ -113,8 +108,8 @@ function draw_tooltip_surface_array(surf) {
|
|||||||
var hh = sh * row;
|
var hh = sh * row;
|
||||||
|
|
||||||
var pd = ui(4);
|
var pd = ui(4);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (ww + pd * 2));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (ww + pd * 2));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (hh + pd * 2));
|
var my = min(mouse_mys + ui(16), WIN_H - (hh + pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
@ -159,8 +154,8 @@ function draw_tooltip_surface(surf) {
|
|||||||
var hh = sh * ss;
|
var hh = sh * ss;
|
||||||
|
|
||||||
var pd = ui(4);
|
var pd = ui(4);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (ww + pd * 2));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (ww + pd * 2));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (hh + pd * 2));
|
var my = min(mouse_mys + ui(16), WIN_H - (hh + pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
@ -184,8 +179,8 @@ function draw_tooltip_sprite(spr) {
|
|||||||
var hh = sh * ss + ui(16);
|
var hh = sh * ss + ui(16);
|
||||||
|
|
||||||
var pd = ui(4);
|
var pd = ui(4);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (ww + pd * 2));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (ww + pd * 2));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (hh + pd * 2));
|
var my = min(mouse_mys + ui(16), WIN_H - (hh + pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
@ -210,8 +205,8 @@ function draw_tooltip_atlas(atlas) {
|
|||||||
if(amo && is_array(atlas[0])) return;
|
if(amo && is_array(atlas[0])) return;
|
||||||
|
|
||||||
var pd = ui(4);
|
var pd = ui(4);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (ww + pd * 2));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (ww + pd * 2));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (hh + pd * 2));
|
var my = min(mouse_mys + ui(16), WIN_H - (hh + pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
@ -263,8 +258,8 @@ function draw_tooltip_buffer(buff) {
|
|||||||
th += string_height(" ");
|
th += string_height(" ");
|
||||||
|
|
||||||
var pd = ui(8);
|
var pd = ui(8);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (tw + pd * 2));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (tw + pd * 2));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (th + pd * 2));
|
var my = min(mouse_mys + ui(16), WIN_H - (th + pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, tw + pd * 2, th + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, tw + pd * 2, th + pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, tw + pd * 2, th + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, tw + pd * 2, th + pd * 2);
|
||||||
@ -282,8 +277,8 @@ function draw_tooltip_curve(curve) {
|
|||||||
var hh = ui(160);
|
var hh = ui(160);
|
||||||
|
|
||||||
var pd = ui(8);
|
var pd = ui(8);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (ww + pd * 2));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (ww + pd * 2));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (hh + pd * 2));
|
var my = min(mouse_mys + ui(16), WIN_H - (hh + pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, ww + pd * 2, hh + pd * 2);
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
globalvar FOCUS, FOCUS_STR, FOCUS_CONTENT, HOVER, HOVERING_ELEMENT, _HOVERING_ELEMENT;
|
globalvar FOCUS, FOCUS_STR, FOCUS_CONTENT, HOVER, HOVERING_ELEMENT, _HOVERING_ELEMENT;
|
||||||
globalvar DOUBLE_CLICK, DOUBLE_CLICK_POS;
|
globalvar DOUBLE_CLICK, DOUBLE_CLICK_POS;
|
||||||
globalvar DIALOG_CLICK;
|
globalvar DIALOG_CLICK;
|
||||||
globalvar WINDOW_ACTIVE, TOOLTIP_WINDOW;
|
globalvar WINDOW_ACTIVE;
|
||||||
|
|
||||||
DOUBLE_CLICK_POS = [ 0, 0 ];
|
DOUBLE_CLICK_POS = [ 0, 0 ];
|
||||||
DOUBLE_CLICK = false;
|
DOUBLE_CLICK = false;
|
||||||
@ -80,7 +80,6 @@
|
|||||||
ADD_NODE_PAGE = 0;
|
ADD_NODE_PAGE = 0;
|
||||||
ADD_NODE_SCROLL = 0;
|
ADD_NODE_SCROLL = 0;
|
||||||
WINDOW_ACTIVE = noone;
|
WINDOW_ACTIVE = noone;
|
||||||
TOOLTIP_WINDOW = noone;
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region macro
|
#region macro
|
||||||
@ -98,7 +97,6 @@
|
|||||||
|
|
||||||
#macro UI_SCALE PREFERENCES.display_scaling
|
#macro UI_SCALE PREFERENCES.display_scaling
|
||||||
|
|
||||||
#macro mouse_ui [mouse_mx, mouse_my]
|
|
||||||
#macro mouse_mx (PEN_USE? PEN_X : winwin_mouse_get_x_safe(WINDOW_ACTIVE))
|
#macro mouse_mx (PEN_USE? PEN_X : winwin_mouse_get_x_safe(WINDOW_ACTIVE))
|
||||||
#macro mouse_my (PEN_USE? PEN_Y : winwin_mouse_get_y_safe(WINDOW_ACTIVE))
|
#macro mouse_my (PEN_USE? PEN_Y : winwin_mouse_get_y_safe(WINDOW_ACTIVE))
|
||||||
|
|
||||||
@ -107,6 +105,7 @@
|
|||||||
|
|
||||||
#macro mouse_raw_x display_mouse_get_x()
|
#macro mouse_raw_x display_mouse_get_x()
|
||||||
#macro mouse_raw_y display_mouse_get_y()
|
#macro mouse_raw_y display_mouse_get_y()
|
||||||
|
#macro mouse_ui [device_mouse_x_to_gui(0), device_mouse_y_to_gui(0)]
|
||||||
|
|
||||||
#macro sFOCUS (FOCUS == self.id)
|
#macro sFOCUS (FOCUS == self.id)
|
||||||
#macro sHOVER (!CURSOR_IS_LOCK && (HOVER == self.id || (WINDOW_ACTIVE != noone && winwin_mouse_is_over_safe(WINDOW_ACTIVE))))
|
#macro sHOVER (!CURSOR_IS_LOCK && (HOVER == self.id || (WINDOW_ACTIVE != noone && winwin_mouse_is_over_safe(WINDOW_ACTIVE))))
|
||||||
|
@ -86,8 +86,8 @@ function MetaDataManager() constructor {
|
|||||||
_h = string_height(name);
|
_h = string_height(name);
|
||||||
_w = string_width(name);
|
_w = string_width(name);
|
||||||
|
|
||||||
var mx = min(__mouse_tx + _pd * 2, __win_tw - (_w + _pd * 2));
|
var mx = min(mouse_mx + _pd * 2, WIN_W - (_w + _pd * 2));
|
||||||
var my = min(__mouse_ty + _pd * 2, __win_th - (_h + _pd * 2));
|
var my = min(mouse_my + _pd * 2, WIN_H - (_h + _pd * 2));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, _w + _pd * 2, _h + _pd * 2);
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, _w + _pd * 2, _h + _pd * 2);
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, _w + _pd * 2, _h + _pd * 2);
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, _w + _pd * 2, _h + _pd * 2);
|
||||||
@ -152,8 +152,8 @@ function MetaDataManager() constructor {
|
|||||||
_h += th;
|
_h += th;
|
||||||
}
|
}
|
||||||
|
|
||||||
var mx = min(__mouse_tx + _pd * 2, __win_tw - (_w + _pd * 2));
|
var mx = min(mouse_mx + _pd * 2, WIN_W - (_w + _pd * 2));
|
||||||
var my = min(__mouse_ty + _pd * 2, __win_th - (_h + _pd * 2));
|
var my = min(mouse_my + _pd * 2, WIN_H - (_h + _pd * 2));
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -1,18 +1,12 @@
|
|||||||
#region mouse global
|
#region mouse global
|
||||||
globalvar CURSOR, CURSOR_LOCK, CURSOR_IS_LOCK, CURSOR_LOCK_X, CURSOR_LOCK_Y;
|
globalvar CURSOR, CURSOR_LOCK, CURSOR_IS_LOCK, CURSOR_LOCK_X, CURSOR_LOCK_Y;
|
||||||
globalvar MOUSE_WRAP, MOUSE_WRAPPING, MOUSE_BLOCK, _MOUSE_BLOCK;
|
globalvar MOUSE_WRAP, MOUSE_WRAPPING, MOUSE_BLOCK, _MOUSE_BLOCK;
|
||||||
globalvar MOUSE_POOL;
|
|
||||||
|
|
||||||
MOUSE_WRAP = false;
|
MOUSE_WRAP = false;
|
||||||
MOUSE_WRAPPING = false;
|
MOUSE_WRAPPING = false;
|
||||||
MOUSE_BLOCK = false;
|
MOUSE_BLOCK = false;
|
||||||
_MOUSE_BLOCK = false;
|
_MOUSE_BLOCK = false;
|
||||||
PEN_RELEASED = false;
|
PEN_RELEASED = false;
|
||||||
MOUSE_POOL = {
|
|
||||||
lclick: false, lpress: false, lrelease: false,
|
|
||||||
rclick: false, rpress: false, rrelease: false,
|
|
||||||
mclick: false, mpress: false, mrelease: false,
|
|
||||||
}
|
|
||||||
|
|
||||||
#macro SCROLL_SPEED PREFERENCES.mouse_wheel_speed
|
#macro SCROLL_SPEED PREFERENCES.mouse_wheel_speed
|
||||||
#macro MOUSE_MOVED (window_mouse_get_delta_x() || window_mouse_get_delta_y())
|
#macro MOUSE_MOVED (window_mouse_get_delta_x() || window_mouse_get_delta_y())
|
||||||
@ -29,37 +23,6 @@
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
function global_mouse_pool_init() {
|
|
||||||
MOUSE_POOL.lclick = mouse_check_button(mb_left);
|
|
||||||
MOUSE_POOL.rclick = mouse_check_button(mb_right);
|
|
||||||
MOUSE_POOL.mclick = mouse_check_button(mb_middle);
|
|
||||||
|
|
||||||
MOUSE_POOL.lpress = mouse_check_button_pressed(mb_left);
|
|
||||||
MOUSE_POOL.rpress = mouse_check_button_pressed(mb_right);
|
|
||||||
MOUSE_POOL.mpress = mouse_check_button_pressed(mb_middle);
|
|
||||||
|
|
||||||
MOUSE_POOL.lrelease = mouse_check_button_released(mb_left);
|
|
||||||
MOUSE_POOL.rrelease = mouse_check_button_released(mb_right);
|
|
||||||
MOUSE_POOL.mrelease = mouse_check_button_released(mb_middle);
|
|
||||||
|
|
||||||
for( var i = 0, n = array_length(global.winwin_all); i < n; i++ ) {
|
|
||||||
var ww = global.winwin_all[i];
|
|
||||||
if(!__ww_valid) continue;
|
|
||||||
|
|
||||||
MOUSE_POOL.lclick |= winwin_mouse_check_button(ww, mb_left);
|
|
||||||
MOUSE_POOL.rclick |= winwin_mouse_check_button(ww, mb_right);
|
|
||||||
MOUSE_POOL.mclick |= winwin_mouse_check_button(ww, mb_middle);
|
|
||||||
|
|
||||||
MOUSE_POOL.lpress |= winwin_mouse_check_button_pressed(ww, mb_left);
|
|
||||||
MOUSE_POOL.rpress |= winwin_mouse_check_button_pressed(ww, mb_right);
|
|
||||||
MOUSE_POOL.mpress |= winwin_mouse_check_button_pressed(ww, mb_middle);
|
|
||||||
|
|
||||||
MOUSE_POOL.lrelease |= winwin_mouse_check_button_released(ww, mb_left);
|
|
||||||
MOUSE_POOL.rrelease |= winwin_mouse_check_button_released(ww, mb_right);
|
|
||||||
MOUSE_POOL.mrelease |= winwin_mouse_check_button_released(ww, mb_middle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function mouse_click(mouse, focus = true) {
|
function mouse_click(mouse, focus = true) {
|
||||||
INLINE
|
INLINE
|
||||||
if(MOUSE_BLOCK) return false;
|
if(MOUSE_BLOCK) return false;
|
||||||
|
@ -309,11 +309,9 @@
|
|||||||
|
|
||||||
function create_preview_window(node) {
|
function create_preview_window(node) {
|
||||||
if(node == noone) return;
|
if(node == noone) return;
|
||||||
|
|
||||||
var win = new Panel_Preview_Window();
|
var win = new Panel_Preview_Window();
|
||||||
win.node_target = node;
|
win.node_target = node;
|
||||||
win.preview_channel = node.preview_channel;
|
win.preview_channel = node.preview_channel;
|
||||||
|
|
||||||
var dia = dialogPanelCall(win, mouse_mx, mouse_my);
|
var dia = dialogPanelCall(win, mouse_mx, mouse_my);
|
||||||
dia.destroy_on_click_out = false;
|
dia.destroy_on_click_out = false;
|
||||||
}
|
}
|
||||||
|
@ -963,6 +963,7 @@ function PanelContent() constructor {
|
|||||||
if(pFOCUS) FOCUS_CONTENT = self;
|
if(pFOCUS) FOCUS_CONTENT = self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
drawContent(panel);
|
drawContent(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3295,8 +3295,8 @@ function Panel_Graph_Drop_tooltip(panel) constructor {
|
|||||||
var tw = max(w1, w2);
|
var tw = max(w1, w2);
|
||||||
var th = h1 + ui(8) + h2;
|
var th = h1 + ui(8) + h2;
|
||||||
|
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (tw + ui(16)));
|
var mx = min(mouse_mxs + ui(16), WIN_W - (tw + ui(16)));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (th + ui(16)));
|
var my = min(mouse_mys + ui(16), WIN_H - (th + ui(16)));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, tw + ui(16), th + ui(16));
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, tw + ui(16), th + ui(16));
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, tw + ui(16), th + ui(16));
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, tw + ui(16), th + ui(16));
|
||||||
|
@ -811,7 +811,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||||||
if(mouse_press(mb_left, pFOCUS))
|
if(mouse_press(mb_left, pFOCUS))
|
||||||
jun[@ 1] = !coll;
|
jun[@ 1] = !coll;
|
||||||
if(mouse_press(mb_right, pFOCUS))
|
if(mouse_press(mb_right, pFOCUS))
|
||||||
menuCall("inspector_group_menu", group_menu, 0, 0, fa_left);
|
menuCall("inspector_group_menu", group_menu, 0, 0, fa_left, _inspecting);
|
||||||
} else
|
} else
|
||||||
draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, lbx, yy, lbw, lbh, COLORS.panel_inspector_group_bg, 1);
|
draw_sprite_stretched_ext(THEME.s_box_r5_clr, 0, lbx, yy, lbw, lbh, COLORS.panel_inspector_group_bg, 1);
|
||||||
|
|
||||||
|
@ -170,8 +170,7 @@ function Panel_Preview_Window() : PanelContent() constructor {
|
|||||||
array_push(_menu, menuItem(o.name, function(_dat) { changeChannel(_dat.index); }, noone, noone, noone, { index: _chan }));
|
array_push(_menu, menuItem(o.name, function(_dat) { changeChannel(_dat.index); }, noone, noone, noone, { index: _chan }));
|
||||||
_chan++;
|
_chan++;
|
||||||
}
|
}
|
||||||
|
menuCall("preview_window_menu", _menu, 0, 0, fa_left, node_target);
|
||||||
menuCall("preview_window_menu", _menu, 0, 0, fa_left);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -386,11 +386,5 @@
|
|||||||
|
|
||||||
var grav = struct_try_get(PREFERENCES, "physics_gravity", [ 0, 10 ]);
|
var grav = struct_try_get(PREFERENCES, "physics_gravity", [ 0, 10 ]);
|
||||||
physics_world_gravity(array_safe_get_fast(grav, 0, 0), array_safe_get_fast(grav, 1, 10));
|
physics_world_gravity(array_safe_get_fast(grav, 0, 0), array_safe_get_fast(grav, 1, 10));
|
||||||
|
|
||||||
if(PREFERENCES.multi_window) {
|
|
||||||
var _cfg = winwin_config_ext("", winwin_kind_borderless, true, false, winwin_main);
|
|
||||||
_cfg.clickthrough = true;
|
|
||||||
TOOLTIP_WINDOW = winwin_create(0, 0, display_get_width(), display_get_height(), _cfg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -15,11 +15,11 @@ function tooltipHotkey(text, context = "", name = "") constructor {
|
|||||||
draw_set_font(f_p1);
|
draw_set_font(f_p1);
|
||||||
var _w2 = string_width(keyStr);
|
var _w2 = string_width(keyStr);
|
||||||
|
|
||||||
var tw = min(__win_tw - ui(32), _w1 + ui(24) + _w2);
|
var tw = min(WIN_W - ui(32), _w1 + ui(24) + _w2);
|
||||||
var th = string_height_ext(text, -1, tw);
|
var th = string_height_ext(text, -1, tw);
|
||||||
|
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (tw + ui(16)));
|
var mx = min(mouse_mx + ui(16), WIN_W - (tw + ui(16)));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (th + ui(16)));
|
var my = min(mouse_my + ui(16), WIN_H - (th + ui(16)));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, tw + ui(16), th + ui(16));
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, tw + ui(16), th + ui(16));
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, tw + ui(16), th + ui(16));
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, tw + ui(16), th + ui(16));
|
||||||
@ -57,9 +57,9 @@ function tooltipHotkey_assign(text, hotkey = "") constructor {
|
|||||||
th += string_height(_ts);
|
th += string_height(_ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
var tw = min(__win_tw - ui(32), _w1 + ui(24) + _w2);
|
var tw = min(WIN_W - ui(32), _w1 + ui(24) + _w2);
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (tw + ui(16)));
|
var mx = min(mouse_mx + ui(16), WIN_W - (tw + ui(16)));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (th + ui(16)));
|
var my = min(mouse_my + ui(16), WIN_H - (th + ui(16)));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, tw + ui(16), th + ui(16));
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, tw + ui(16), th + ui(16));
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, tw + ui(16), th + ui(16));
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, tw + ui(16), th + ui(16));
|
||||||
|
@ -19,8 +19,8 @@ function tooltipSelector(title, data, index = 0) constructor {
|
|||||||
for( var i = 0, n = array_length(data); i < n; i++ )
|
for( var i = 0, n = array_length(data); i < n; i++ )
|
||||||
_w = max(_w, ui(8 + 16) + string_width(data[i]));
|
_w = max(_w, ui(8 + 16) + string_width(data[i]));
|
||||||
|
|
||||||
var mx = min(__mouse_tx + ui(16), __win_tw - (_w + ui(16) + ui(4)));
|
var mx = min(mouse_mx + ui(16), WIN_W - (_w + ui(16) + ui(4)));
|
||||||
var my = min(__mouse_ty + ui(16), __win_th - (_h + ui(16) + ui(4)));
|
var my = min(mouse_my + ui(16), WIN_H - (_h + ui(16) + ui(4)));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.textbox, 3, mx, my, _w + ui(16), _h + ui(16));
|
draw_sprite_stretched(THEME.textbox, 3, mx, my, _w + ui(16), _h + ui(16));
|
||||||
draw_sprite_stretched(THEME.textbox, 0, mx, my, _w + ui(16), _h + ui(16));
|
draw_sprite_stretched(THEME.textbox, 0, mx, my, _w + ui(16), _h + ui(16));
|
||||||
|
@ -1,53 +1,27 @@
|
|||||||
global.__winwin_map = ds_map_create();
|
global.__winwin_map = ds_map_create();
|
||||||
global.winwin_all = [];
|
|
||||||
|
|
||||||
function winwin(_ptr) constructor {
|
function winwin(_ptr) constructor {
|
||||||
__ptr__ = _ptr;
|
__ptr__ = _ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function winwin_config_ext(caption = "", kind = winwin_kind_normal, topmost = false, resize = false, owner = winwin_main) {
|
|
||||||
var cnf = new winwin_config();
|
|
||||||
|
|
||||||
cnf.caption = caption;
|
|
||||||
cnf.kind = kind;
|
|
||||||
cnf.topmost = topmost;
|
|
||||||
cnf.resize = resize;
|
|
||||||
cnf.owner = owner;
|
|
||||||
cnf.per_pixel_alpha = true;
|
|
||||||
|
|
||||||
return cnf;
|
|
||||||
}
|
|
||||||
|
|
||||||
function winwin_config() constructor {
|
function winwin_config() constructor {
|
||||||
static caption = "Window";
|
static caption = "Window";
|
||||||
static kind = winwin_kind_normal;
|
static kind = winwin_kind_normal;
|
||||||
static resize = false;
|
static resize = false;
|
||||||
static show = true;
|
static show = true;
|
||||||
static topmost = false;
|
static topmost = false;
|
||||||
static taskbar_button = true; // can only disable for borderless!
|
static taskbar_button = true; // can only disable for borderless!
|
||||||
static clickthrough = false;
|
static clickthrough = false;
|
||||||
static noactivate = false;
|
static noactivate = false;
|
||||||
static per_pixel_alpha = false;
|
static per_pixel_alpha = false;
|
||||||
static thread = false;
|
static thread = false;
|
||||||
static vsync = 0;
|
static vsync = 0;
|
||||||
static close_button = 1;
|
static close_button = 1;
|
||||||
static owner = undefined;
|
static owner = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
#macro __ww_valid (ww != noone && winwin_exists(ww))
|
#macro __ww_valid (ww != noone && winwin_exists(ww))
|
||||||
|
|
||||||
function winwin_create_ext(_x, _y, _w, _h, _conf) {
|
|
||||||
var window = winwin_create(_x, _y, _w, _h, _conf);
|
|
||||||
array_push(global.winwin_all, window);
|
|
||||||
|
|
||||||
return window;
|
|
||||||
}
|
|
||||||
|
|
||||||
function winwin_destroy_ext(ww) {
|
|
||||||
if(__ww_valid) winwin_destroy(_ww);
|
|
||||||
array_remove(global.winwin_all, window);
|
|
||||||
}
|
|
||||||
|
|
||||||
function winwin_get_x_safe(ww) { return __ww_valid? winwin_get_x(ww) : window_get_x(); }
|
function winwin_get_x_safe(ww) { return __ww_valid? winwin_get_x(ww) : window_get_x(); }
|
||||||
function winwin_get_y_safe(ww) { return __ww_valid? winwin_get_y(ww) : window_get_y(); }
|
function winwin_get_y_safe(ww) { return __ww_valid? winwin_get_y(ww) : window_get_y(); }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user