Pixel-Composer/objects/o_dialog_release_note/Draw_64.gml

45 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-01-13 05:24:03 +01:00
/// @description init
if !ready exit;
#region base UI
2023-11-13 15:42:14 +01:00
DIALOG_DRAW_BG
2022-11-03 11:44:49 +01:00
if(sFOCUS)
2023-11-13 15:42:14 +01:00
DIALOG_DRAW_FOCUS
2022-01-13 05:24:03 +01:00
#endregion
#region text
2024-04-09 05:32:00 +02:00
var bh = line_get_height(f_p0) + ui(8);
var _x = dialog_x + ui(24);
var _y = dialog_y + ui(16);
2024-09-10 11:48:51 +02:00
var hd = ui(48);
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text);
2024-04-09 05:32:00 +02:00
for( var i = 0, n = array_length(pages); i < n; i++ ) {
2024-09-10 11:48:51 +02:00
draw_set_font(i == page? f_p0b : f_p0);
2024-04-09 05:32:00 +02:00
var r = __txt(pages[i]);
var rw = string_width(r);
2024-09-10 11:48:51 +02:00
if(buttonInstant(THEME.button_hide_fill, _x - ui(8), _y - ui(4), rw + ui(16), bh, [ mouse_mx, mouse_my ], sFOCUS, sHOVER) == 2)
2024-04-09 05:32:00 +02:00
page = i;
2024-09-10 11:48:51 +02:00
draw_set_color(i == page? COLORS._main_text : COLORS._main_text_sub);
2024-04-09 05:32:00 +02:00
draw_text(_x, _y, r);
2024-09-10 11:48:51 +02:00
_x += rw + ui(24);
2024-04-09 05:32:00 +02:00
}
2024-09-10 11:48:51 +02:00
draw_sprite_stretched(THEME.ui_panel_bg, 1, dialog_x + padding, dialog_y + hd, dialog_w - padding * 2, dialog_h - hd - padding);
2022-01-13 05:24:03 +01:00
2024-04-09 05:32:00 +02:00
if(page == 0) {
sp_note.setFocusHover(sFOCUS, sHOVER);
2024-09-10 11:48:51 +02:00
sp_note.draw(dialog_x + padding + ui(8), dialog_y + hd + ui(8));
2024-04-09 05:32:00 +02:00
} else if(page == 1) {
sp_dl.setFocusHover(sFOCUS, sHOVER);
2024-09-10 11:48:51 +02:00
sp_dl.draw(dialog_x + padding + ui(8), dialog_y + hd + ui(8));
2024-04-09 05:32:00 +02:00
}
2022-01-13 05:24:03 +01:00
#endregion