diff --git a/assets/gfx/sprites/download.png b/assets/gfx/sprites/download.png index e9e3168..daecc55 100644 Binary files a/assets/gfx/sprites/download.png and b/assets/gfx/sprites/download.png differ diff --git a/assets/gfx/sprites/info.png b/assets/gfx/sprites/info.png index 628f051..41a08aa 100644 Binary files a/assets/gfx/sprites/info.png and b/assets/gfx/sprites/info.png differ diff --git a/assets/gfx/sprites/search.png b/assets/gfx/sprites/search.png index fc3252d..dcb5226 100644 Binary files a/assets/gfx/sprites/search.png and b/assets/gfx/sprites/search.png differ diff --git a/assets/gfx/sprites/settings.png b/assets/gfx/sprites/settings.png index 23c51b8..9723422 100644 Binary files a/assets/gfx/sprites/settings.png and b/assets/gfx/sprites/settings.png differ diff --git a/assets/gfx/sprites/sort.png b/assets/gfx/sprites/sort.png index 519d04e..79dd411 100644 Binary files a/assets/gfx/sprites/sort.png and b/assets/gfx/sprites/sort.png differ diff --git a/include/common.hpp b/include/common.hpp index 9ec1b19..ff6cc8b 100644 --- a/include/common.hpp +++ b/include/common.hpp @@ -37,7 +37,7 @@ #define _STORE_PATH "sdmc:/3ds/Universal-Updater/stores/" #define _META_PATH "sdmc:/3ds/Universal-Updater/MetaData.json" -#define _THEME_AMOUNT 1 +#define _THEME_AMOUNT 2 #define _UNISTORE_VERSION 4 inline std::unique_ptr config; diff --git a/include/gui/gfx.hpp b/include/gui/gfx.hpp index 053a676..5c37db3 100644 --- a/include/gui/gfx.hpp +++ b/include/gui/gfx.hpp @@ -74,6 +74,7 @@ namespace GFX { void DrawTime(); void DrawBattery(); void HandleBattery(); + void DrawIcon(const int Idx, int X, int Y, float ScaleX = 1, float ScaleY = 1); }; #endif \ No newline at end of file diff --git a/romfs/lang/en/app.json b/romfs/lang/en/app.json index 0b0f326..42139af 100644 --- a/romfs/lang/en/app.json +++ b/romfs/lang/en/app.json @@ -87,6 +87,7 @@ "LAST_UPDATED": "Last updated", "LICENSE": "License", "LIST": "List", + "LOADING_SCREENSHOT": "Loading Screenshot...", "LOADING_SPRITESHEET": "Loading Spritesheet %i of %i...", "MEDIATYPE_NAND": "MediaType NAND", "MEDIATYPE_SD": "MediaType SD", diff --git a/source/gui/gfx.cpp b/source/gui/gfx.cpp index 47695d6..02e1000 100644 --- a/source/gui/gfx.cpp +++ b/source/gui/gfx.cpp @@ -43,7 +43,7 @@ std::vector GFX::Themes = { C2D_Color32(25, 30, 53, 255), // Entry Outline. C2D_Color32(28, 33, 58, 255), // Box Inside. C2D_Color32(108, 130, 155, 255), // Box Outside. - BLACK, // Box Unselected. + BLACK, // Box Selected. C2D_Color32(28, 33, 58, 255), // Progressbar Out. C2D_Color32(77, 101, 128, 255), // Progressbar In. C2D_Color32(51, 75, 102, 255), // Searchbar. @@ -54,6 +54,28 @@ std::vector GFX::Themes = { C2D_Color32(28, 33, 58, 255), // Mark Unselected. C2D_Color32(28, 33, 58, 255), // Downlist Preview (Top). C2D_Color32(173, 204, 239, 255) // SideBar Icon Color. + }, + /* Stack Theme. */ + { + C2D_Color32(44, 48, 64, 255), // Bar. + C2D_Color32(52, 56, 64, 255), // BG. + C2D_Color32(22, 24, 32, 255), // Bar Outline. + C2D_Color32(216, 228, 228, 255), // Text. + C2D_Color32(60, 63, 113, 255), // Entry bar. + C2D_Color32(42, 46, 54, 255), // Entry Outline. + C2D_Color32(60, 63, 113, 255), // Box Inside. + C2D_Color32(42, 46, 54, 255), // Box Outside. + C2D_Color32(102, 105, 170, 255), // Box Selected. + C2D_Color32(42, 46, 54, 255), // Progressbar Out. + C2D_Color32(60, 63, 113, 255), // Progressbar In. + C2D_Color32(60, 63, 113, 255), // Searchbar. + C2D_Color32(42, 46, 54, 255), // Searchbar Outline. + C2D_Color32(60, 63, 113, 255), // Sidebar Selected. + C2D_Color32(42, 46, 54, 255), // Sidebar Unselected. + C2D_Color32(60, 63, 113, 255), // Mark Selected. + C2D_Color32(42, 46, 54, 255), // Mark Unselected. + C2D_Color32(52, 60, 76, 255), // Downlist Preview (Top). + C2D_Color32(102, 105, 170, 255) // SideBar Icon Color. } }; @@ -85,7 +107,7 @@ void GFX::DrawBox(float xPos, float yPos, float width, float height, bool select Gui::Draw_Rect(xPos, yPos, width, height, GFX::Themes[GFX::SelectedTheme].BoxInside); // Draw middle BG. if (selected) { - static constexpr int depth = 2; + static constexpr int depth = 3; Gui::Draw_Rect(xPos - depth, yPos - depth, width + depth * 2, depth, GFX::Themes[GFX::SelectedTheme].BoxSelected); // Top. Gui::Draw_Rect(xPos - depth, yPos - depth, depth, height + depth * 2, GFX::Themes[GFX::SelectedTheme].BoxSelected); // Left. @@ -196,4 +218,14 @@ void GFX::HandleBattery() { } } } +} + +/* + Draws the sidebar icons blended with the SideBarIconColor. +*/ +void GFX::DrawIcon(const int Idx, int X, int Y, float ScaleX, float ScaleY) { + C2D_ImageTint tint; + C2D_PlainImageTint(&tint, GFX::Themes[GFX::SelectedTheme].SideBarIconColor, 1.0f); + + C2D_DrawImageAt(C2D_SpriteSheetGetImage(sprites, Idx), X, Y, 0.5f, &tint, ScaleX, ScaleY); } \ No newline at end of file diff --git a/source/menu/screenshotMenu.cpp b/source/menu/screenshotMenu.cpp index 553ec9e..242561d 100644 --- a/source/menu/screenshotMenu.cpp +++ b/source/menu/screenshotMenu.cpp @@ -47,6 +47,13 @@ void StoreUtils::DrawScreenshotMenu(const C2D_Image &img, const int sIndex, cons Gui::ScreenDraw(Top); Gui::Draw_Rect(0, 0, 400, 240, GFX::Themes[GFX::SelectedTheme].BGColor); + if (sFetch) { + Animation::QueueEntryDone(); + GFX::DrawBottom(); + Gui::DrawStringCentered(0, 2, 0.6f, GFX::Themes[GFX::SelectedTheme].TextColor, Lang::get("LOADING_SCREENSHOT"), 310); + return; + } + if (!canDisplay) { Animation::QueueEntryDone(); diff --git a/source/menu/settings.cpp b/source/menu/settings.cpp index d91a93e..23993a5 100644 --- a/source/menu/settings.cpp +++ b/source/menu/settings.cpp @@ -90,7 +90,7 @@ static const std::vector dirStrings = { "CHANGE_3DSX_PATH", "3DSX_I static const std::vector languages = { "Bruh", "Deutsch", "English", "Español", "Français", "Italiano", "Magyar", "Polski", "Português (Brasil)", "Русский", "Украïнська", "日本語" }; static const std::string langsTemp[] = { "br", "de", "en", "es", "fr", "it", "hu", "pl", "pt-BR", "ru", "uk", "jp"}; -static const std::vector ThemeNames = { "THEME_DEFAULT" }; +static const std::vector ThemeNames = { "THEME_DEFAULT", "Stack" }; /* Main Settings. @@ -195,7 +195,7 @@ static void DrawGUISettings(int selection) { Gui::DrawString(47, 151, 0.4f, GFX::Themes[GFX::SelectedTheme].TextColor, Lang::get("CUSTOM_FONT_DESC"), 265, 0, font, C2D_WordWrap); Gui::Draw_Rect(40, 196, 280, 24, (selection == 2 ? GFX::Themes[GFX::SelectedTheme].MarkSelected : GFX::Themes[GFX::SelectedTheme].MarkUnselected)); - Gui::DrawString(47, 200, 0.5f, GFX::Themes[GFX::SelectedTheme].TextColor, Lang::get("ACTIVE_THEME") + ": " + Lang::get(ThemeNames[GFX::SelectedTheme]), 210, 0, font); + Gui::DrawString(47, 200, 0.5f, GFX::Themes[GFX::SelectedTheme].TextColor, Lang::get("ACTIVE_THEME") + ": " + (GFX::SelectedTheme == 0 ? Lang::get(ThemeNames[GFX::SelectedTheme]) : ThemeNames[GFX::SelectedTheme]), 210, 0, font); } diff --git a/source/menu/sideMenu.cpp b/source/menu/sideMenu.cpp index 66c6f4a..a38980e 100644 --- a/source/menu/sideMenu.cpp +++ b/source/menu/sideMenu.cpp @@ -54,12 +54,12 @@ void StoreUtils::DrawSideMenu(int currentMenu) { } } - GFX::DrawSprite(sprites_info_idx, sidePos[0].x, sidePos[0].y); - GFX::DrawSprite(sprites_download_idx, sidePos[1].x, sidePos[1].y); + GFX::DrawIcon(sprites_info_idx, sidePos[0].x, sidePos[0].y); + GFX::DrawIcon(sprites_download_idx, sidePos[1].x, sidePos[1].y); Animation::DrawQueue(sidePos[2].x, sidePos[2].y); - GFX::DrawSprite(sprites_search_idx, sidePos[3].x, sidePos[3].y); - GFX::DrawSprite(sprites_sort_idx, sidePos[4].x, sidePos[4].y); - GFX::DrawSprite(sprites_settings_idx, sidePos[5].x, sidePos[5].y); + GFX::DrawIcon(sprites_search_idx, sidePos[3].x, sidePos[3].y); + GFX::DrawIcon(sprites_sort_idx, sidePos[4].x, sidePos[4].y); + GFX::DrawIcon(sprites_settings_idx, sidePos[5].x, sidePos[5].y); Gui::Draw_Rect(40, 0, 1, 240, GFX::Themes[GFX::SelectedTheme].BarOutline); } diff --git a/source/utils/animation.cpp b/source/utils/animation.cpp index 115d278..645dd48 100644 --- a/source/utils/animation.cpp +++ b/source/utils/animation.cpp @@ -139,7 +139,7 @@ extern bool QueueRuns; extern std::deque> queueEntries; void Animation::DrawQueue(int x, int y) { - GFX::DrawSprite(sprites_queue0_idx + frame, x, y); + GFX::DrawIcon(sprites_queue0_idx + frame, x, y); Gui::DrawStringCentered(x + 20 - 160, y + 11, 0.6f, GFX::Themes[GFX::SelectedTheme].SideBarIconColor, QueueSystem::Wait ? "!" : std::to_string(queueEntries.size()), 0, 0, font); } void Animation::QueueAnimHandle() { diff --git a/source/utils/download.cpp b/source/utils/download.cpp index 8fc491a..07e5e17 100644 --- a/source/utils/download.cpp +++ b/source/utils/download.cpp @@ -425,12 +425,8 @@ Result downloadFromRelease(const std::string &url, const std::string &asset, con result_sz = 0; result_written = 0; - if (assetUrl.empty() || ret != 0) { - ret = DL_ERROR_GIT; - - } else { - ret = downloadToFile(assetUrl, path); - } + if (assetUrl.empty() || ret != 0) ret = DL_ERROR_GIT; + else ret = downloadToFile(assetUrl, path); return ret; }