Pixel-Composer/objects/o_dialog_exit/Draw_64.gml

51 lines
1.5 KiB
Plaintext
Raw Normal View History

2022-09-27 06:37:28 +02:00
/// @description init
if !ready exit;
2023-02-23 07:02:19 +01:00
2022-09-27 06:37:28 +02:00
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
2022-11-18 03:20:31 +01:00
draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h);
2022-11-03 11:44:49 +01:00
if(sFOCUS)
2022-11-18 03:20:31 +01:00
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
2022-09-27 06:37:28 +02:00
#endregion
#region text
2022-11-03 11:44:49 +01:00
var py = dialog_y + ui(16);
2022-11-18 03:20:31 +01:00
draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title);
2022-11-03 11:44:49 +01:00
draw_text(dialog_x + ui(24), py, "Project modified");
py += line_height(, 4);
2022-09-27 06:37:28 +02:00
2022-11-18 03:20:31 +01:00
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
2022-11-03 11:44:49 +01:00
draw_text(dialog_x + ui(24), py, "Save progress before exit?");
2022-09-27 06:37:28 +02:00
2022-11-03 11:44:49 +01:00
var bw = ui(96), bh = TEXTBOX_HEIGHT;
var bx1 = dialog_x + dialog_w - ui(16);
var by1 = dialog_y + dialog_h - ui(16);
2022-09-27 06:37:28 +02:00
var bx0 = bx1 - bw;
var by0 = by1 - bh;
2022-11-18 03:20:31 +01:00
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);
2022-09-27 06:37:28 +02:00
draw_text(bx0 + bw / 2, by0 + bh / 2, "Cancel");
if(b == 2)
instance_destroy();
2022-11-03 11:44:49 +01:00
bx0 -= bw + ui(12);
2022-11-18 03:20:31 +01:00
var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
2022-09-27 06:37:28 +02:00
draw_text(bx0 + bw / 2, by0 + bh / 2, "Don't save");
if(b == 2) {
PREF_SAVE();
game_end();
}
2022-11-03 11:44:49 +01:00
bx0 -= bw + ui(12);
2022-11-18 03:20:31 +01:00
var b = buttonInstant(THEME.button, bx0, by0, bw, bh, mouse_ui, sFOCUS, sHOVER);
2022-09-27 06:37:28 +02:00
draw_text(bx0 + bw / 2, by0 + bh / 2, "Save");
2022-11-22 14:25:39 +01:00
if(b == 2 && SAVE()) {
2022-09-27 06:37:28 +02:00
PREF_SAVE();
game_end();
}
#endregion