mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 06:26:42 +01:00
Fix dialog close order
This commit is contained in:
parent
5c43dec581
commit
3fc5ab2b75
7 changed files with 20 additions and 18 deletions
|
@ -160,10 +160,21 @@
|
|||
}
|
||||
|
||||
function checkMouse() {
|
||||
if(!DIALOG_CLICK) return;
|
||||
if(!DIALOG_CLICK) {
|
||||
//printIf(mouse_press(mb_any), $"Check {object_get_name(object_index)} : Click");
|
||||
return;
|
||||
}
|
||||
|
||||
with(_p_dialog) if(depth < other.depth) {
|
||||
//printIf(mouse_press(mb_any), $"Check {object_get_name(object_index)} : Top");
|
||||
return;
|
||||
}
|
||||
|
||||
for( var i = 0, n = array_length(children); i < n; i++ )
|
||||
if(instance_exists(children[i])) return;
|
||||
if(instance_exists(children[i])) {
|
||||
//printIf(mouse_press(mb_any), $"Check {object_get_name(object_index)} : Children");
|
||||
return;
|
||||
}
|
||||
|
||||
var x0 = dialog_x - dialog_resizable * 6;
|
||||
var x1 = dialog_x + dialog_w + dialog_resizable * 6;
|
||||
|
|
|
@ -21,14 +21,12 @@ event_inherited();
|
|||
|
||||
b_cancel = button(function() {
|
||||
onApply(previous_color);
|
||||
DIALOG_CLICK = false;
|
||||
instance_destroy();
|
||||
}).setIcon(THEME.undo, 0, COLORS._main_icon)
|
||||
.setTooltip(__txtx("dialog_revert_and_exit", "Revert and exit"));
|
||||
|
||||
b_apply = button(function() {
|
||||
onApply(selector.current_color);
|
||||
DIALOG_CLICK = false;
|
||||
instance_destroy();
|
||||
}).setIcon(THEME.accept, 0, COLORS._main_icon_dark);
|
||||
#endregion
|
||||
|
|
|
@ -49,7 +49,6 @@ event_inherited();
|
|||
|
||||
b_cancel = button(function() {
|
||||
onApply(previous_gradient);
|
||||
DIALOG_CLICK = false;
|
||||
instance_destroy();
|
||||
}).setIcon(THEME.undo, 0, COLORS._main_icon)
|
||||
.setTooltip(__txtx("dialog_revert_and_exit", "Revert and exit"));
|
||||
|
|
|
@ -36,7 +36,6 @@ event_inherited();
|
|||
|
||||
b_cancel = button(function() {
|
||||
onApply(previous_palette);
|
||||
DIALOG_CLICK = false;
|
||||
instance_destroy();
|
||||
}).setIcon(THEME.undo, 0, COLORS._main_icon)
|
||||
.setTooltip(__txtx("dialog_revert_and_exit", "Revert and exit"));
|
||||
|
|
|
@ -37,18 +37,21 @@ _HOVERING_ELEMENT = noone;
|
|||
#endregion
|
||||
|
||||
#region focus
|
||||
if(mouse_release(mb_any)) DIALOG_CLICK = true;
|
||||
|
||||
HOVER = noone;
|
||||
with(_p_dialog) checkMouse();
|
||||
|
||||
if(PANEL_MAIN != 0)
|
||||
PANEL_MAIN.stepBegin();
|
||||
|
||||
DIALOG_DEPTH_HOVER = 0;
|
||||
|
||||
with(_p_dialog) checkFocus();
|
||||
with(_p_dialog) checkDepth();
|
||||
|
||||
with(_p_dialog) doDrag();
|
||||
with(_p_dialog) doResize();
|
||||
with(_p_dialog) checkMouse();
|
||||
#endregion
|
||||
|
||||
#region auto save
|
||||
|
@ -127,11 +130,6 @@ _HOVERING_ELEMENT = noone;
|
|||
action_last_frame = [];
|
||||
#endregion
|
||||
|
||||
#region dialog
|
||||
if(mouse_release(mb_any))
|
||||
DIALOG_CLICK = true;
|
||||
#endregion
|
||||
|
||||
#region modifiers
|
||||
if(CTRL == KEYBOARD_STATUS.up)
|
||||
CTRL = KEYBOARD_STATUS.idle;
|
||||
|
|
|
@ -104,11 +104,8 @@ function FileObject(_name, _path) constructor {
|
|||
} else {
|
||||
var m = json_load_struct(path);
|
||||
|
||||
if(struct_has(m, "metadata"))
|
||||
meta.deserialize(m.metadata);
|
||||
if(struct_has(m, "preview"))
|
||||
thumbnail_data = json_try_parse(m.preview, -1);
|
||||
meta.version = m.version;
|
||||
if(struct_has(m, "metadata")) meta.deserialize(m.metadata);
|
||||
if(struct_has(m, "preview")) thumbnail_data = json_try_parse(m.preview, -1);
|
||||
}
|
||||
|
||||
meta.name = name;
|
||||
|
|
|
@ -15,7 +15,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor {
|
|||
new_node = false;
|
||||
|
||||
if(struct_has(global.NODE_GUIDE, node)) {
|
||||
var _n = global.NODE_GUIDE[$ node];
|
||||
var _n = global.NODE_GUIDEarn[$ node];
|
||||
name = _n.name;
|
||||
if(_n.tooltip != "")
|
||||
tooltip = _n.tooltip;
|
||||
|
|
Loading…
Reference in a new issue