Pixel-Composer/objects/o_dialog_drag_folder/Draw_64.gml

43 lines
1.5 KiB
Plaintext
Raw Normal View History

2022-01-13 05:24:03 +01:00
/// @description init
if !ready exit;
#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-01-13 05:24:03 +01:00
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(16), __txtx("add_images_title_direcory", "Import directory"));
2022-01-13 05:24:03 +01:00
#endregion
#region directory option
2022-11-03 11:44:49 +01:00
var dir_y = dialog_y + ui(44);
2023-06-21 20:36:53 +02:00
cb_recursive.setFocusHover(sFOCUS, sHOVER);
2022-11-03 11:44:49 +01:00
cb_recursive.draw(dialog_x + dialog_w - ui(48), dir_y, dir_recursive, mouse_ui);
2022-01-13 05:24:03 +01:00
2022-11-18 03:20:31 +01:00
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
2023-06-05 18:27:53 +02:00
draw_text(dialog_x + ui(20), dir_y + ui(14), __txt("Recursive"));
2022-11-03 11:44:49 +01:00
dir_y += ui(40);
2023-06-21 20:36:53 +02:00
tb_filter.setFocusHover(sFOCUS, sHOVER);
2022-11-03 11:44:49 +01:00
tb_filter.draw(dialog_x + ui(100), dir_y, dialog_w - ui(120), ui(36), dir_filter, mouse_ui);
2022-01-13 05:24:03 +01:00
2022-11-18 03:20:31 +01:00
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
2023-06-05 18:27:53 +02:00
draw_text(dialog_x + ui(20), dir_y + ui(18), __txt("Filter"));
2022-01-13 05:24:03 +01:00
2022-11-03 11:44:49 +01:00
var bx = dialog_x + dialog_w - ui(120);
dir_y += ui(48);
2022-01-13 05:24:03 +01:00
2022-11-18 03:20:31 +01:00
if(buttonInstant(THEME.button, bx, dir_y, ui(100), ui(40), mouse_ui, sFOCUS, sHOVER) == 2) {
2022-01-13 05:24:03 +01:00
if(target) {
var paths = paths_to_array(dir_paths, dir_recursive, dir_filter);
target.updatePaths(paths);
target.doUpdate();
2022-01-13 05:24:03 +01:00
}
instance_destroy();
}
2022-11-18 03:20:31 +01:00
draw_set_text(f_p0b, fa_center, fa_center, COLORS._main_text_accent);
2023-06-05 18:27:53 +02:00
draw_text(bx + ui(50), dir_y + ui(20), __txt("Import"));
2022-01-13 05:24:03 +01:00
#endregion