Pixel-Composer/objects/o_dialog_preset/Draw_64.gml

30 lines
1.1 KiB
Text
Raw Normal View History

2022-12-10 05:06:01 +01:00
/// @description init
if !ready exit;
#region base UI
draw_sprite_stretched(THEME.dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h);
if(sFOCUS)
draw_sprite_stretched_ext(THEME.dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent, 1);
2023-06-10 13:59:45 +02:00
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
2023-06-05 18:27:53 +02:00
draw_text(dialog_x + ui(24), dialog_y + ui(20), __txt("Presets"));
2022-12-10 05:06:01 +01:00
#endregion
#region preset
var px = dialog_x + ui(padding);
2023-02-28 09:43:01 +01:00
var py = dialog_y + ui(title_height);
2022-12-10 05:06:01 +01:00
var pw = dialog_w - ui(padding + padding);
2023-02-28 09:43:01 +01:00
var ph = dialog_h - ui(title_height + padding)
2022-12-10 05:06:01 +01:00
draw_sprite_stretched(THEME.ui_panel_bg, 0, px - ui(8), py - ui(8), pw + ui(16), ph + ui(16));
2023-06-21 20:36:53 +02:00
sc_presets.setFocusHover(sFOCUS, sHOVER);
2022-12-10 05:06:01 +01:00
sc_presets.draw(px, py);
var bx = dialog_x + dialog_w - ui(32 + 16);
var by = dialog_y + ui(16);
2023-06-05 18:27:53 +02:00
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sFOCUS, sHOVER, __txtx("preset_new", "New preset"), THEME.add, 1) == 2) {
2022-12-10 05:06:01 +01:00
var dia = dialogCall(o_dialog_file_name, mouse_mx + ui(8), mouse_my + ui(8));
dia.onModify = newPresetFromNode;
}
#endregion