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
|
2023-12-24 12:06:44 +01:00
|
|
|
if(sFOCUS) DIALOG_DRAW_FOCUS
|
2022-01-13 05:24:03 +01:00
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region content
|
2022-11-18 03:20:31 +01:00
|
|
|
draw_sprite_ui_uniform(THEME.icon_64, 0, dialog_x + ui(56), dialog_y + ui(56));
|
|
|
|
draw_set_text(f_h5, fa_left, fa_center, COLORS._main_text_accent);
|
2022-11-03 11:44:49 +01:00
|
|
|
draw_text(dialog_x + ui(56 + 48), dialog_y + ui(56), "Pixel Composer");
|
2022-01-13 05:24:03 +01:00
|
|
|
|
2022-11-03 11:44:49 +01:00
|
|
|
var bx = dialog_x + ui(56 + 48) + string_width("Pixel Composer") + ui(16);
|
|
|
|
var by = dialog_y + ui(56);
|
2022-01-13 05:24:03 +01:00
|
|
|
var txt = "v. " + VERSION_STRING;
|
2022-11-18 03:20:31 +01:00
|
|
|
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_sub);
|
2022-11-03 11:44:49 +01:00
|
|
|
var ww = string_width(txt) + ui(16);
|
2023-05-28 20:00:51 +02:00
|
|
|
var hh = line_get_height(, 16);
|
2022-11-18 03:20:31 +01:00
|
|
|
if(buttonInstant(THEME.button_hide, bx, by - hh / 2, ww, hh, mouse_ui, sFOCUS, sHOVER) == 2) {
|
2022-01-13 05:24:03 +01:00
|
|
|
dialogCall(o_dialog_release_note, WIN_W / 2, WIN_H / 2);
|
|
|
|
}
|
2022-11-03 11:44:49 +01:00
|
|
|
draw_text(bx + ui(8), by, txt);
|
2022-01-13 05:24:03 +01:00
|
|
|
|
2022-11-03 11:44:49 +01:00
|
|
|
var bx = dialog_x + dialog_w - ui(52);
|
|
|
|
var by = dialog_y + ui(16);
|
2023-06-05 18:27:53 +02:00
|
|
|
if(buttonInstant(THEME.button_hide, bx, by, ui(36), ui(36), mouse_ui, sFOCUS, sHOVER, __txt("Preferences"), THEME.gear) == 2) {
|
2022-01-13 05:24:03 +01:00
|
|
|
dialogCall(o_dialog_preference, WIN_W / 2, WIN_H / 2);
|
|
|
|
}
|
|
|
|
|
2022-11-03 11:44:49 +01:00
|
|
|
bx -= ui(40);
|
2023-10-31 05:30:42 +01:00
|
|
|
if(buttonInstant(THEME.button_hide, bx, by, ui(36), ui(36), mouse_ui, sFOCUS, sHOVER, __txt("Show on startup"), THEME.icon_splash_show_on_start, PREFERENCES.show_splash) == 2) {
|
|
|
|
PREFERENCES.show_splash = !PREFERENCES.show_splash;
|
2022-11-01 03:06:03 +01:00
|
|
|
PREF_SAVE();
|
|
|
|
}
|
|
|
|
|
2022-11-03 11:44:49 +01:00
|
|
|
var x0 = dialog_x + ui(16);
|
2023-03-05 07:16:44 +01:00
|
|
|
var x1 = x0 + recent_width;
|
2022-11-03 11:44:49 +01:00
|
|
|
var y0 = dialog_y + ui(128);
|
|
|
|
var y1 = dialog_y + dialog_h - ui(16);
|
2022-01-13 05:24:03 +01:00
|
|
|
|
2022-11-18 03:20:31 +01:00
|
|
|
draw_set_text(f_p0, fa_left, fa_bottom, COLORS._main_text_sub);
|
2023-06-04 18:28:29 +02:00
|
|
|
draw_text(x0, y0 - ui(4), __txt("Recent files"));
|
2023-11-26 13:16:38 +01:00
|
|
|
|
2023-06-21 20:36:53 +02:00
|
|
|
sp_recent.setFocusHover(sFOCUS, sHOVER);
|
2022-11-03 11:44:49 +01:00
|
|
|
sp_recent.draw(x0 + ui(6), y0);
|
2023-06-13 14:42:06 +02:00
|
|
|
draw_sprite_stretched(THEME.ui_panel_fg, 0, x0, y0, x1 - x0, y1 - y0);
|
2022-01-13 05:24:03 +01:00
|
|
|
|
2023-06-05 18:27:53 +02:00
|
|
|
var bx = x1 - ui(28);
|
|
|
|
var by = y0 - ui(28 + 4);
|
|
|
|
var txt = __txtx("splash_clear_recent", "Clear recent files");
|
|
|
|
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, txt, THEME.icon_delete,, COLORS._main_value_negative) == 2) {
|
2023-03-05 07:16:44 +01:00
|
|
|
ds_list_clear(RECENT_FILES);
|
|
|
|
RECENT_SAVE();
|
|
|
|
}
|
2023-06-05 18:27:53 +02:00
|
|
|
|
2023-03-05 07:16:44 +01:00
|
|
|
bx -= ui(28 + 4);
|
2023-06-05 18:27:53 +02:00
|
|
|
txt = recent_thumbnail? __txtx("splash_hide_thumbnail", "Hide thumbnail") : __txtx("splash_show_thumbnail", "Show thumbnail");
|
|
|
|
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, txt, THEME.splash_thumbnail, recent_thumbnail) == 2) {
|
2023-03-05 07:16:44 +01:00
|
|
|
recent_thumbnail = !recent_thumbnail;
|
|
|
|
}
|
2023-03-07 14:29:47 +01:00
|
|
|
bx -= ui(28 + 4);
|
2023-06-05 18:27:53 +02:00
|
|
|
txt = __txtx("splash_open_autosave", "Open autosave folder");
|
|
|
|
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, txt, THEME.save_auto, 0) == 2) {
|
2023-03-07 14:29:47 +01:00
|
|
|
shellOpenExplorer(DIRECTORY + "autosave");
|
|
|
|
}
|
2023-03-05 07:16:44 +01:00
|
|
|
|
|
|
|
var expandAction = false;
|
2023-10-31 05:30:42 +01:00
|
|
|
var expand = PREFERENCES.splash_expand_recent;
|
2023-06-01 10:32:21 +02:00
|
|
|
|
|
|
|
switch(pages[project_page]) {
|
2024-06-29 05:22:20 +02:00
|
|
|
case "Welcome Files" :
|
2023-06-01 10:32:21 +02:00
|
|
|
case "Workshop" :
|
|
|
|
if(buttonInstant(THEME.button_hide_fill, x1, (y0 + y1) / 2 - ui(32), ui(16), ui(32), mouse_ui, sFOCUS, sHOVER,, THEME.arrow, expand? 2 : 0) == 2) {
|
2023-10-31 05:30:42 +01:00
|
|
|
PREFERENCES.splash_expand_recent = !PREFERENCES.splash_expand_recent;
|
2023-06-01 10:32:21 +02:00
|
|
|
expandAction = true;
|
|
|
|
}
|
|
|
|
break;
|
2023-03-05 07:16:44 +01:00
|
|
|
}
|
|
|
|
|
2022-11-03 11:44:49 +01:00
|
|
|
x0 = x1 + ui(16);
|
|
|
|
x1 = dialog_x + dialog_w - ui(16);
|
2023-03-05 07:16:44 +01:00
|
|
|
bx = x0;
|
2023-06-13 14:42:06 +02:00
|
|
|
var tab_cover = noone;
|
|
|
|
var th = ui(36) + THEME_VALUE.panel_tab_extend;
|
2023-02-15 10:43:24 +01:00
|
|
|
|
2023-11-22 10:21:50 +01:00
|
|
|
for( var i = 0, n = array_length(pages); i < n; i++ ) { #region
|
2023-05-07 20:55:13 +02:00
|
|
|
draw_set_text(f_p0, fa_left, fa_bottom, project_page == i? COLORS._main_text : COLORS._main_text_sub);
|
2023-06-04 18:28:29 +02:00
|
|
|
var txt = pages[i];
|
|
|
|
var dtxt = __txt(txt);
|
2024-06-20 04:08:40 +02:00
|
|
|
var amo = 0;
|
2023-06-01 10:32:21 +02:00
|
|
|
|
|
|
|
switch(txt) {
|
2024-06-29 05:22:20 +02:00
|
|
|
case "Welcome Files" : amo = ds_list_size(SAMPLE_PROJECTS); break;
|
2023-06-01 10:32:21 +02:00
|
|
|
case "Workshop" : amo = ds_list_size(STEAM_PROJECTS); break;
|
2024-06-20 04:08:40 +02:00
|
|
|
case "Contests" : dtxt = ""; break;
|
2023-06-01 10:32:21 +02:00
|
|
|
}
|
|
|
|
|
2023-06-04 18:28:29 +02:00
|
|
|
var tw = ui(16) + string_width(dtxt);
|
2024-06-20 04:08:40 +02:00
|
|
|
if(amo) tw += ui(8) + string_width(amo) + ui(6);
|
|
|
|
if(txt == "Contests") tw = ui(32 + 8);
|
2023-06-01 10:32:21 +02:00
|
|
|
|
2023-11-22 10:21:50 +01:00
|
|
|
var _x1 = min(bx + tw, x1);
|
|
|
|
var _tabW = _x1 - bx;
|
2023-02-15 10:43:24 +01:00
|
|
|
|
2023-06-13 14:42:06 +02:00
|
|
|
if(project_page == i) {
|
2023-11-22 10:21:50 +01:00
|
|
|
draw_sprite_stretched_ext(THEME.ui_panel_tab, 1, bx, y0 - ui(32), _tabW, th, COLORS.panel_tab, 1);
|
2023-06-13 14:42:06 +02:00
|
|
|
tab_cover = BBOX().fromWH(bx, y0, tw, THEME_VALUE.panel_tab_extend);
|
2024-06-20 04:08:40 +02:00
|
|
|
|
2023-11-22 10:21:50 +01:00
|
|
|
} else if(point_in_rectangle(mouse_mx, mouse_my, bx, y0 - ui(32), bx + _tabW, y0)) {
|
2024-06-20 04:08:40 +02:00
|
|
|
|
2023-11-22 10:21:50 +01:00
|
|
|
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, bx, y0 - ui(32), _tabW, th, COLORS.panel_tab_hover, 1);
|
2024-06-20 04:08:40 +02:00
|
|
|
draw_sprite_stretched_add(THEME.ui_panel_tab, 0, bx, y0 - ui(32), _tabW, th, COLORS.panel_tab_hover, 0.1);
|
2023-02-15 10:43:24 +01:00
|
|
|
|
2023-06-01 10:32:21 +02:00
|
|
|
if(mouse_click(mb_left, sFOCUS)) {
|
2023-02-15 10:43:24 +01:00
|
|
|
project_page = i;
|
2023-06-01 10:32:21 +02:00
|
|
|
|
2023-10-31 05:30:42 +01:00
|
|
|
if(txt == "Contests" && PREFERENCES.splash_expand_recent) {
|
|
|
|
PREFERENCES.splash_expand_recent = false;
|
2023-06-01 10:32:21 +02:00
|
|
|
expandAction = true;
|
|
|
|
}
|
|
|
|
}
|
2023-06-13 14:42:06 +02:00
|
|
|
} else
|
2023-11-22 10:21:50 +01:00
|
|
|
draw_sprite_stretched_ext(THEME.ui_panel_tab, 0, bx, y0 - ui(32), _tabW, th, COLORS.panel_tab_inactive, 1);
|
2023-06-13 14:42:06 +02:00
|
|
|
|
2023-05-07 20:55:13 +02:00
|
|
|
var _btx = bx + ui(8);
|
2023-06-01 10:32:21 +02:00
|
|
|
if(txt == "Contests") {
|
2024-06-20 04:08:40 +02:00
|
|
|
draw_sprite_ui(THEME.trophy, 0, _btx + ui(12), y0 - ui(14),,,, COLORS._main_icon);
|
2023-06-01 10:32:21 +02:00
|
|
|
_btx += ui(32);
|
|
|
|
}
|
|
|
|
|
2023-06-13 14:42:06 +02:00
|
|
|
var cc = COLORS._main_text_sub;
|
|
|
|
if(project_page == i) cc = txt == "Contests"? CDEF.yellow : COLORS._main_text;
|
2023-06-10 13:59:45 +02:00
|
|
|
|
|
|
|
draw_set_color(cc);
|
2023-11-22 10:21:50 +01:00
|
|
|
draw_text_cut(_btx, y0 - ui(4), dtxt, _tabW - ui(16));
|
2023-05-07 20:55:13 +02:00
|
|
|
|
2023-06-04 18:28:29 +02:00
|
|
|
_btx += ui(8) + string_width(dtxt);
|
2023-05-07 20:55:13 +02:00
|
|
|
|
2023-11-22 10:21:50 +01:00
|
|
|
if(amo && _x1 + ui(32) < x1) {
|
2024-06-20 04:08:40 +02:00
|
|
|
var _btw = string_width(amo) + ui(8);
|
|
|
|
var _bth = ui(22);
|
|
|
|
var _btc = COLORS._main_icon_light;
|
|
|
|
|
|
|
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, _btx, y0 - ui(26), _btw, _bth, _btc, 1);
|
|
|
|
draw_sprite_stretched_add(THEME.ui_panel_fg, 1, _btx, y0 - ui(26), _btw, _bth, _btc, 0.1);
|
2023-06-01 10:32:21 +02:00
|
|
|
|
2024-06-20 04:08:40 +02:00
|
|
|
_btx += ui(4);
|
|
|
|
draw_set_text(f_p1, fa_left, fa_bottom, COLORS._main_text_sub);
|
2024-06-22 04:19:30 +02:00
|
|
|
draw_text(_btx, y0 - ui(6), amo);
|
2023-06-01 10:32:21 +02:00
|
|
|
}
|
2023-02-15 10:43:24 +01:00
|
|
|
|
2023-11-22 10:21:50 +01:00
|
|
|
bx += _tabW;
|
|
|
|
} #endregion
|
2023-02-15 10:43:24 +01:00
|
|
|
|
2022-11-18 03:20:31 +01:00
|
|
|
draw_sprite_stretched(THEME.ui_panel_bg, 0, x0, y0, x1 - x0, y1 - y0);
|
2023-06-13 14:42:06 +02:00
|
|
|
draw_sprite_stretched(THEME.ui_panel_fg, 0, x0, y0, x1 - x0, y1 - y0);
|
|
|
|
draw_sprite_bbox(THEME.ui_panel_tab, 3, tab_cover);
|
2023-06-01 10:32:21 +02:00
|
|
|
|
|
|
|
switch(pages[project_page]) {
|
2024-06-29 05:22:20 +02:00
|
|
|
case "Welcome Files" :
|
2023-06-21 20:36:53 +02:00
|
|
|
sp_sample.setFocusHover(sFOCUS, sHOVER);
|
2023-06-01 10:32:21 +02:00
|
|
|
sp_sample.draw(x0 + ui(6), y0);
|
|
|
|
|
|
|
|
if(!expand) {
|
|
|
|
draw_set_text(f_p1, fa_right, fa_bottom, COLORS._main_text_sub);
|
2024-06-22 05:12:08 +02:00
|
|
|
draw_text(x1 - ui(0), y0 - ui(4), __txt("Art by Kenney"));
|
2023-06-01 10:32:21 +02:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "Workshop" :
|
2023-06-21 20:36:53 +02:00
|
|
|
sp_sample.setFocusHover(sFOCUS, sHOVER);
|
2023-06-01 10:32:21 +02:00
|
|
|
sp_sample.draw(x0 + ui(6), y0);
|
2023-06-25 20:12:17 +02:00
|
|
|
|
2023-06-01 10:32:21 +02:00
|
|
|
var bx = x1 - ui(32);
|
|
|
|
var by = y0 - ui(32);
|
2023-02-15 10:43:24 +01:00
|
|
|
|
2023-06-05 18:27:53 +02:00
|
|
|
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sFOCUS, sHOVER, __txtx("workshop_open", "Open Steam Workshop"), THEME.steam) == 2)
|
2023-06-01 10:32:21 +02:00
|
|
|
steam_activate_overlay_browser("https://steamcommunity.com/app/2299510/workshop/");
|
2023-02-17 11:31:33 +01:00
|
|
|
|
2023-06-01 10:32:21 +02:00
|
|
|
bx -= ui(36);
|
2024-03-31 05:36:11 +02:00
|
|
|
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), mouse_ui, sFOCUS, sHOVER, __txt("Refresh"), THEME.refresh_icon) == 2)
|
2023-06-01 10:32:21 +02:00
|
|
|
steamUCGload();
|
|
|
|
break;
|
|
|
|
case "Contests" :
|
2023-06-21 20:36:53 +02:00
|
|
|
sp_contest.setFocusHover(sFOCUS, sHOVER);
|
2023-06-25 20:12:17 +02:00
|
|
|
sp_contest.draw(x0 + ui(6), y0 + 1);
|
2023-06-01 10:32:21 +02:00
|
|
|
break;
|
2023-02-15 10:43:24 +01:00
|
|
|
}
|
2023-03-05 07:16:44 +01:00
|
|
|
|
|
|
|
if(expandAction) {
|
2023-10-31 05:30:42 +01:00
|
|
|
recent_width = PREFERENCES.splash_expand_recent? ui(564) : ui(288);
|
2023-03-05 07:16:44 +01:00
|
|
|
resize();
|
|
|
|
}
|
2022-01-13 05:24:03 +01:00
|
|
|
#endregion
|