Pixel-Composer/objects/o_main/Step_1.gml

71 lines
1.3 KiB
Plaintext
Raw Normal View History

2022-01-13 05:24:03 +01:00
/// @description init
#region window
//if(keyboard_check_pressed(vk_f12)) DEBUG = !DEBUG;
if(_cursor != CURSOR) {
window_set_cursor(CURSOR);
_cursor = CURSOR;
}
CURSOR = cr_default;
if((win_wp != WIN_W || win_hp != WIN_H) && (WIN_W > 1 && WIN_H > 1)) {
2022-11-01 03:06:03 +01:00
display_refresh();
2022-12-10 05:06:01 +01:00
Render();
2022-01-13 05:24:03 +01:00
}
#endregion
#region focus
HOVER = noone;
if(PANEL_MAIN != 0)
PANEL_MAIN.stepBegin();
DIALOG_DEPTH_HOVER = 0;
with(_p_dialog) {
checkFocus();
}
#endregion
#region nodes
2022-12-16 09:18:09 +01:00
var _k = ds_map_find_first(NODE_MAP);
var _a = ds_map_size(NODE_MAP);
repeat(_a) {
NODE_MAP[? _k].stepBegin();
_k = ds_map_find_next(NODE_MAP, _k);
2022-01-13 05:24:03 +01:00
}
2022-12-10 05:06:01 +01:00
if(UPDATE & RENDER_TYPE.full)
Render();
if(UPDATE & RENDER_TYPE.partial)
Render(true);
UPDATE = RENDER_TYPE.none;
2022-01-13 05:24:03 +01:00
#endregion
#region clicks
DOUBLE_CLICK = false;
2022-12-10 05:06:01 +01:00
if(mouse_press(mb_left)) {
2022-01-13 05:24:03 +01:00
if(dc_check > 0) {
DOUBLE_CLICK = true;
dc_check = 0;
2022-12-12 09:08:03 +01:00
} else
dc_check = PREF_MAP[? "double_click_delay"];
2022-01-13 05:24:03 +01:00
}
2022-12-12 09:08:03 +01:00
dc_check -= DELTA_TIME;
2022-01-13 05:24:03 +01:00
#endregion
#region step
if(array_length(action_last_frame) > 0) {
ds_stack_push(UNDO_STACK, action_last_frame);
ds_stack_clear(REDO_STACK);
}
action_last_frame = [];
2022-11-18 03:20:31 +01:00
#endregion
#region dialog
if(!ds_list_empty(DIALOGS))
DIALOGS[| ds_list_size(DIALOGS) - 1].checkMouse();
2022-12-10 05:06:01 +01:00
if(mouse_release(mb_left))
2022-11-18 03:20:31 +01:00
DIALOG_CLICK = true;
2022-01-13 05:24:03 +01:00
#endregion