2022-01-13 05:24:03 +01:00
|
|
|
/// @description init
|
|
|
|
if !ready exit;
|
|
|
|
if !target exit;
|
|
|
|
|
|
|
|
#region base UI
|
|
|
|
draw_sprite_stretched(s_dialog_bg, 0, dialog_x, dialog_y, dialog_w, dialog_h);
|
2022-11-03 11:44:49 +01:00
|
|
|
if(sFOCUS)
|
2022-01-13 05:24:03 +01:00
|
|
|
draw_sprite_stretched(s_dialog_active, 0, dialog_x, dialog_y, dialog_w, dialog_h);
|
|
|
|
|
2022-11-03 11:44:49 +01:00
|
|
|
draw_set_text(f_p0, fa_left, fa_top, c_ui_blue_ltgrey);
|
|
|
|
draw_text(dialog_x + ui(24), dialog_y + ui(16), "Image array edit");
|
2022-01-13 05:24:03 +01:00
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region content
|
2022-11-03 11:44:49 +01:00
|
|
|
var x0 = dialog_x + ui(20);
|
2022-01-13 05:24:03 +01:00
|
|
|
var x1 = x0 + sp_content.w;
|
2022-11-03 11:44:49 +01:00
|
|
|
var y0 = dialog_y + ui(44);
|
2022-01-13 05:24:03 +01:00
|
|
|
var y1 = y0 + sp_content.h;
|
|
|
|
|
2022-11-03 11:44:49 +01:00
|
|
|
draw_sprite_stretched(s_ui_panel_bg, 1, x0 - ui(6), y0 - ui(6), x1 - x0 + ui(12), y1 - y0 + ui(12));
|
|
|
|
sp_content.active = sFOCUS;
|
2022-01-13 05:24:03 +01:00
|
|
|
sp_content.draw(x0, y0);
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region button
|
2022-11-03 11:44:49 +01:00
|
|
|
var bx = dialog_x + dialog_w - ui(108);
|
2022-01-13 05:24:03 +01:00
|
|
|
var by = y0;
|
|
|
|
|
2022-11-03 11:44:49 +01:00
|
|
|
if(buttonInstant(s_button, bx, by, ui(88), ui(40), mouse_ui, sFOCUS, sHOVER) == 2) {
|
2022-01-13 05:24:03 +01:00
|
|
|
var path = get_open_filenames(".png", "");
|
|
|
|
if(path != "") {
|
|
|
|
var paths = paths_to_array(path);
|
|
|
|
var arr = target.inputs[| 0].getValue();
|
|
|
|
|
|
|
|
for( var i = 0; i < array_length(paths); i++ )
|
|
|
|
array_push(arr, paths[i]);
|
|
|
|
|
|
|
|
target.inputs[| 0].setValue(arr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
draw_set_text(f_p0, fa_center, fa_center, c_white);
|
2022-11-03 11:44:49 +01:00
|
|
|
draw_text(bx + ui(44), by + ui(20), "Add...");
|
2022-01-13 05:24:03 +01:00
|
|
|
#endregion
|