Pixel-Composer/objects/o_dialog_crashed/Draw_64.gml

51 lines
1.6 KiB
Text
Raw Normal View History

2023-02-14 02:48:33 +01:00
/// @description init
if !ready exit;
draw_set_color(c_black);
draw_set_alpha(0.5);
draw_rectangle(0, 0, WIN_W, WIN_H, false);
draw_set_alpha(1);
#region base UI
2023-11-13 15:42:14 +01:00
DIALOG_DRAW_BG
2023-02-14 02:48:33 +01:00
if(sFOCUS)
2023-11-13 15:42:14 +01:00
DIALOG_DRAW_FOCUS
2023-02-14 02:48:33 +01:00
#endregion
#region text
var py = dialog_y + ui(16);
2023-06-10 13:59:45 +02:00
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text);
2023-06-04 18:28:29 +02:00
draw_text(dialog_x + ui(24), py, __txtx("crashed_title", "Restore project"));
2023-05-28 20:00:51 +02:00
py += line_get_height(, 4);
2023-02-14 02:48:33 +01:00
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
2023-06-04 18:28:29 +02:00
draw_text(dialog_x + ui(24), py, __txtx("crashed_content", "Restore previous project before crash?"));
2023-02-14 02:48:33 +01:00
2023-09-02 12:47:27 +02:00
var bw = ui(96), bh = BUTTON_HEIGHT;
2023-02-14 02:48:33 +01:00
var bx1 = dialog_x + dialog_w - ui(16);
var by1 = dialog_y + dialog_h - ui(16);
var bx0 = bx1 - bw;
var by0 = by1 - bh;
draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text);
var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
2023-06-05 18:27:53 +02:00
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Ignore"));
2023-02-14 02:48:33 +01:00
if(b == 2)
instance_destroy();
bx0 -= bw + ui(12);
var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
2023-06-05 18:27:53 +02:00
draw_text(bx0 + bw / 2, by0 + bh / 2, __txt("Restore"));
2023-02-14 02:48:33 +01:00
if(b == 2) {
var path = string(DIRECTORY) + "prev_crash.pxc";
LOAD_PATH(path, true, true);
instance_destroy();
}
bx0 = dialog_x + ui(16);
var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
2023-06-04 18:28:29 +02:00
draw_text(bx0 + bw / 2, by0 + bh / 2, __txtx("crashed_log", "Log file") + "...");
2023-02-14 02:48:33 +01:00
if(b == 2) {
var path = string(DIRECTORY) + "crash_log.txt";
if(file_exists(path)) shellOpenExplorer(path);
}
#endregion