diff --git a/romfs/lang/en/app.json b/romfs/lang/en/app.json index bc9baca..bcadc9c 100644 --- a/romfs/lang/en/app.json +++ b/romfs/lang/en/app.json @@ -74,7 +74,7 @@ "TITLE": "Title", "TOP_STYLE": "Top Style", "UNISTORE_INVALID_ERROR": "This UniStore is invalid and cannot be\nloaded with Universal-Updater.\nMaybe check if there are any Syntax errors?", - "UNISTORE_TOO_NEW": "Your version of Universal-Updater is \ntoo old to use this UniStore.\nPlease update to the latest version.", + "UNISTORE_TOO_NEW": "Your version of Universal-Updater is\ntoo old to use this UniStore.\nPlease update to the latest version.", "UNISTORE_TOO_OLD": "This UniStore is outdated and cannot be used\nwith this version of Universal-Updater.\nPlease ask the creator to update it.", "UNSUPPORTED_UNISTORE_VERSION": "The version of this UniStore is unsupported.", "UPDATE_AVAILABLE": "Update Available!", diff --git a/screenshots/Credits.png b/screenshots/Credits.png new file mode 100644 index 0000000..e6f89f1 Binary files /dev/null and b/screenshots/Credits.png differ diff --git a/screenshots/DirectorySelection.png b/screenshots/DirectorySelection.png new file mode 100644 index 0000000..97e7038 Binary files /dev/null and b/screenshots/DirectorySelection.png differ diff --git a/screenshots/DownloadList.png b/screenshots/DownloadList.png new file mode 100644 index 0000000..bf624b0 Binary files /dev/null and b/screenshots/DownloadList.png differ diff --git a/screenshots/EntryInfo.png b/screenshots/EntryInfo.png new file mode 100644 index 0000000..31f98ca Binary files /dev/null and b/screenshots/EntryInfo.png differ diff --git a/screenshots/LanguageSelection.png b/screenshots/LanguageSelection.png new file mode 100644 index 0000000..1983be2 Binary files /dev/null and b/screenshots/LanguageSelection.png differ diff --git a/screenshots/ListStyle.png b/screenshots/ListStyle.png new file mode 100644 index 0000000..e612a08 Binary files /dev/null and b/screenshots/ListStyle.png differ diff --git a/screenshots/MarkMenu.png b/screenshots/MarkMenu.png new file mode 100644 index 0000000..092324c Binary files /dev/null and b/screenshots/MarkMenu.png differ diff --git a/screenshots/SearchMenu.png b/screenshots/SearchMenu.png new file mode 100644 index 0000000..ac19d76 Binary files /dev/null and b/screenshots/SearchMenu.png differ diff --git a/screenshots/SettingsMenu.png b/screenshots/SettingsMenu.png new file mode 100644 index 0000000..77cb539 Binary files /dev/null and b/screenshots/SettingsMenu.png differ diff --git a/screenshots/SortMenu.png b/screenshots/SortMenu.png new file mode 100644 index 0000000..74054cc Binary files /dev/null and b/screenshots/SortMenu.png differ diff --git a/screenshots/StoreSelection.png b/screenshots/StoreSelection.png new file mode 100644 index 0000000..aa69b68 Binary files /dev/null and b/screenshots/StoreSelection.png differ diff --git a/source/gui/msg.cpp b/source/gui/msg.cpp index 7a22d42..71a2db8 100644 --- a/source/gui/msg.cpp +++ b/source/gui/msg.cpp @@ -39,7 +39,7 @@ void Msg::DisplayMsg(const std::string &Text) { C2D_TargetClear(Bottom, TRANSPARENT); GFX::DrawTop(); - Gui::DrawStringCentered(0, (240 - Gui::GetStringHeight(0.6f, Text)) / 2, 0.6f, TEXT_COLOR, Text, 395, 100); + Gui::DrawStringCentered(0, (240 - Gui::GetStringHeight(0.6f, Text)) / 2, 0.6f, TEXT_COLOR, Text, 395); GFX::DrawBottom(); C3D_FrameEnd(0); } @@ -56,7 +56,7 @@ void Msg::DisplayWarnMsg(const std::string &Text) { C2D_TargetClear(Bottom, TRANSPARENT); GFX::DrawTop(); - Gui::DrawStringCentered(0, 1, 0.6f, TEXT_COLOR, Text, 400); + Gui::DrawStringCentered(0, 1, 0.6f, TEXT_COLOR, Text, 390); GFX::DrawBottom(); C3D_FrameEnd(0); @@ -79,15 +79,16 @@ bool Msg::promptMsg(const std::string &promptMsg) { GFX::DrawTop(); Gui::Draw_Rect(0, 215, 400, 25, BAR_COLOR); Gui::Draw_Rect(0, 214, 400, 1, BAR_OUTL_COLOR); - Gui::DrawStringCentered(0, (240 - Gui::GetStringHeight(0.6f, promptMsg)) / 2, 0.6f, TEXT_COLOR, promptMsg, 395, 100); + Gui::DrawStringCentered(0, (240 - Gui::GetStringHeight(0.6f, promptMsg)) / 2, 0.6f, TEXT_COLOR, promptMsg, 395); - Gui::DrawStringCentered(0, 217, 0.6f, TEXT_COLOR, Lang::get("CONFIRM_OR_CANCEL"), 400); + Gui::DrawStringCentered(0, 217, 0.6f, TEXT_COLOR, Lang::get("CONFIRM_OR_CANCEL"), 390); C3D_FrameEnd(0); - for (int i = 0; i < 20; i++) gspWaitForVBlank(); + for (int i = 0; i < 3; i++) gspWaitForVBlank(); + hidScanInput(); + while(1) { hidScanInput(); - if (hidKeysDown() & KEY_A) return true; else if (hidKeysDown() & KEY_B) return false; } @@ -106,17 +107,18 @@ void Msg::waitMsg(const std::string &msg) { C2D_TargetClear(Top, TRANSPARENT); GFX::DrawTop(); - Gui::DrawStringCentered(0, (240 - Gui::GetStringHeight(0.6f, msg)) / 2, 0.6f, TEXT_COLOR, msg, 395, 100); + Gui::DrawStringCentered(0, (240 - Gui::GetStringHeight(0.6f, msg)) / 2, 0.6f, TEXT_COLOR, msg, 395); Gui::Draw_Rect(0, 215, 400, 25, BAR_COLOR); Gui::Draw_Rect(0, 214, 400, 1, BAR_OUTL_COLOR); - Gui::DrawStringCentered(0, 217, 0.6f, TEXT_COLOR, Lang::get("KEY_CONTINUE"), 400); + Gui::DrawStringCentered(0, 217, 0.6f, TEXT_COLOR, Lang::get("KEY_CONTINUE"), 390); C3D_FrameEnd(0); - for (int i = 0; i < 20; i++) gspWaitForVBlank(); + for (int i = 0; i < 3; i++) gspWaitForVBlank(); + hidScanInput(); + while(!doOut) { hidScanInput(); - if (hidKeysDown()) doOut = !doOut; } } \ No newline at end of file diff --git a/source/overlays/credits.cpp b/source/overlays/credits.cpp index 40663e6..4fcb4ed 100644 --- a/source/overlays/credits.cpp +++ b/source/overlays/credits.cpp @@ -48,8 +48,8 @@ void Overlays::ShowCredits() { Gui::DrawString(10, 90, 0.5f, TEXT_COLOR, "- FlagBrew"); Gui::DrawString(10, 110, 0.5f, TEXT_COLOR, "- https://icons8.com/"); Gui::DrawString(10, 130, 0.5f, TEXT_COLOR, "- PabloMK7"); - Gui::DrawString(10, 150, 0.5f, TEXT_COLOR, Lang::get("CONTRIBUTOR_TRANSLATORS")); - Gui::DrawString(10, 195, 0.5f, TEXT_COLOR, Lang::get("GITHUB")); + Gui::DrawString(10, 150, 0.5f, TEXT_COLOR, Lang::get("CONTRIBUTOR_TRANSLATORS"), 210); + Gui::DrawString(10, 197, 0.5f, TEXT_COLOR, Lang::get("GITHUB"), 390); Gui::Draw_Rect(0, 215, 400, 25, BAR_COLOR); Gui::Draw_Rect(0, 214, 400, 1, BAR_OUTL_COLOR); diff --git a/source/overlays/dirSelect.cpp b/source/overlays/dirSelect.cpp index 2b475b9..98e984d 100644 --- a/source/overlays/dirSelect.cpp +++ b/source/overlays/dirSelect.cpp @@ -79,7 +79,7 @@ std::string Overlays::SelectDir(const std::string &oldDir, const std::string &ms Gui::Draw_Rect(0, 215, 320, 25, BAR_COLOR); Gui::Draw_Rect(0, 214, 320, 1, BAR_OUTL_COLOR); - Gui::DrawStringCentered(0, 220, 0.5f, TEXT_COLOR, Lang::get("START_SELECT"), 390); + Gui::DrawStringCentered(0, 220, 0.5f, TEXT_COLOR, Lang::get("START_SELECT"), 310); if (dirContents.size() > 0) { for(int i = 0; i < 7 && i < (int)dirContents.size(); i++) { diff --git a/source/overlays/langSelect.cpp b/source/overlays/langSelect.cpp index 1778b63..4bd12a2 100644 --- a/source/overlays/langSelect.cpp +++ b/source/overlays/langSelect.cpp @@ -36,14 +36,14 @@ static const std::vector languages = { "Bruh", "Dansk", "Deutsch", static const std::string langsTemp[] = { "br", "da", "de", "en", "es", "fr", "it", "lt", "pl", "pt", "ru", "jp "}; static const std::vector mainButtons = { - { 85, 4, 150, 22 }, - { 85, 34, 150, 22 }, - { 85, 64, 150, 22 }, - { 85, 94, 150, 22 }, - { 85, 124, 150, 22 }, - { 85, 154, 150, 22 }, - { 85, 184, 150, 22 }, - { 85, 214, 150, 22 } + { 10, 4, 300, 22 }, + { 10, 34, 300, 22 }, + { 10, 64, 300, 22 }, + { 10, 94, 300, 22 }, + { 10, 124, 300, 22 }, + { 10, 154, 300, 22 }, + { 10, 184, 300, 22 }, + { 10, 214, 300, 22 } }; /* @@ -66,7 +66,7 @@ void Overlays::SelectLanguage() { GFX::DrawBottom(); for(int i = 0; i < 8 && i < (int)languages.size(); i++) { - GFX::drawBox(85, mainButtons[i].y, 150, 22, sPos + i == selection); + GFX::drawBox(10, mainButtons[i].y, 300, 22, sPos + i == selection); Gui::DrawStringCentered(0, mainButtons[i].y + 4, 0.45f, TEXT_COLOR, languages[sPos + i], 280); } C3D_FrameEnd(0); diff --git a/source/overlays/storeSelect.cpp b/source/overlays/storeSelect.cpp index a7c5652..8aeb249 100644 --- a/source/overlays/storeSelect.cpp +++ b/source/overlays/storeSelect.cpp @@ -179,30 +179,30 @@ void Overlays::SelectStore(std::unique_ptr &store, std::vector 0) { if (info[selection].StoreSize != -1) { - Gui::DrawStringCentered(0, 30, 0.6f, TEXT_COLOR, info[selection].Title, 370); - Gui::DrawStringCentered(0, 60, 0.5f, TEXT_COLOR, info[selection].Author, 370); + Gui::DrawStringCentered(0, 30, 0.6f, TEXT_COLOR, info[selection].Title, 380); + Gui::DrawStringCentered(0, 60, 0.5f, TEXT_COLOR, info[selection].Author, 380); if (info[selection].Description != "") { /* "\n\n" breaks C2D_WordWrap, so check here. */ if (!(info[selection].Description.find("\n\n") != std::string::npos)) { - Gui::DrawStringCentered(0, 100, 0.5f, TEXT_COLOR, info[selection].Description, 390, 95, nullptr, C2D_WordWrap); + Gui::DrawStringCentered(0, 100, 0.5f, TEXT_COLOR, info[selection].Description, 380, 95, nullptr, C2D_WordWrap); } else { - Gui::DrawStringCentered(0, 100, 0.5f, TEXT_COLOR, info[selection].Description, 390, 95); + Gui::DrawStringCentered(0, 100, 0.5f, TEXT_COLOR, info[selection].Description, 380, 95); } } } else { - Gui::DrawStringCentered(0, 30, 0.6f, TEXT_COLOR, Lang::get("INVALID_UNISTORE"), 370); + Gui::DrawStringCentered(0, 30, 0.6f, TEXT_COLOR, Lang::get("INVALID_UNISTORE"), 380); } - Gui::DrawString(10, 200, 0.4, TEXT_COLOR, "- " + Lang::get("ENTRIES") + ": " + std::to_string(info[selection].StoreSize)); - Gui::DrawString(10, 210, 0.4, TEXT_COLOR, "- " + Lang::get("VERSION") + ": " + std::to_string(info[selection].Version)); - Gui::DrawString(10, 220, 0.4, TEXT_COLOR, "- " + Lang::get("REVISION") + ": " + std::to_string(info[selection].Revision)); + Gui::DrawString(10, 200, 0.4, TEXT_COLOR, "- " + Lang::get("ENTRIES") + ": " + std::to_string(info[selection].StoreSize), 150); + Gui::DrawString(10, 210, 0.4, TEXT_COLOR, "- " + Lang::get("VERSION") + ": " + std::to_string(info[selection].Version), 150); + Gui::DrawString(10, 220, 0.4, TEXT_COLOR, "- " + Lang::get("REVISION") + ": " + std::to_string(info[selection].Revision), 150); GFX::DrawBottom(); diff --git a/source/screens/mainScreen.cpp b/source/screens/mainScreen.cpp index 352e160..0b82c2a 100644 --- a/source/screens/mainScreen.cpp +++ b/source/screens/mainScreen.cpp @@ -68,7 +68,7 @@ MainScreen::MainScreen() { */ void MainScreen::Draw(void) const { GFX::DrawTop(); - if (this->store && this->store->GetValid()) Gui::DrawStringCentered(0, 1, 0.7, TEXT_COLOR, this->store->GetUniStoreTitle()); + if (this->store && this->store->GetValid()) Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, this->store->GetUniStoreTitle(), 370); else Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, Lang::get("INVALID_UNISTORE"), 370); config->list() ? StoreUtils::DrawList(this->store, this->entries) : StoreUtils::DrawGrid(this->store, this->entries); diff --git a/source/store/downList.cpp b/source/store/downList.cpp index e1e97ad..6d24470 100644 --- a/source/store/downList.cpp +++ b/source/store/downList.cpp @@ -57,7 +57,7 @@ void StoreUtils::DrawDownList(const std::unique_ptr &store, const std::ve } } else { // If no downloads available.. - Gui::DrawStringCentered(25, downloadBoxes[0].y + 4, 0.5f, TEXT_COLOR, Lang::get("NO_DOWNLOADS_AVAILABLE"), 260); + Gui::DrawStringCentered(25, downloadBoxes[0].y + 4, 0.5f, TEXT_COLOR, Lang::get("NO_DOWNLOADS_AVAILABLE"), 255); } } } diff --git a/source/store/entryInfo.cpp b/source/store/entryInfo.cpp index 27f1570..2625d1a 100644 --- a/source/store/entryInfo.cpp +++ b/source/store/entryInfo.cpp @@ -47,10 +47,10 @@ void StoreUtils::DrawEntryInfo(const std::unique_ptr &store, const std::u if (entry->GetDescription() != "") { /* "\n\n" breaks C2D_WordWrap, so check here. */ if (!(entry->GetDescription().find("\n\n") != std::string::npos)) { - Gui::DrawStringCentered(25, 50, 0.4, TEXT_COLOR, entry->GetDescription(), 220, 0, nullptr, C2D_WordWrap); + Gui::DrawStringCentered(25, 50, 0.4, TEXT_COLOR, entry->GetDescription(), 240, 0, nullptr, C2D_WordWrap); } else { - Gui::DrawStringCentered(25, 50, 0.4, TEXT_COLOR, entry->GetDescription(), 220, 0); + Gui::DrawStringCentered(25, 50, 0.4, TEXT_COLOR, entry->GetDescription(), 240, 0); } } diff --git a/source/store/searchMenu.cpp b/source/store/searchMenu.cpp index 4ae4d7a..6db994d 100644 --- a/source/store/searchMenu.cpp +++ b/source/store/searchMenu.cpp @@ -66,16 +66,16 @@ void StoreUtils::DrawSearchMenu(const std::vector &searchIncludes, const s GFX::DrawCheckbox(SearchMenu[i + 1].x, SearchMenu[i + 1].y, searchIncludes[i]); } - Gui::DrawString(84, 60, 0.5, TEXT_COLOR, Lang::get("INCLUDE_IN_RESULTS")); + Gui::DrawString(84, 60, 0.5, TEXT_COLOR, Lang::get("INCLUDE_IN_RESULTS"), 265); - Gui::DrawString(SearchMenu[1].x + 18, SearchMenu[1].y + 1, 0.4, TEXT_COLOR, Lang::get("TITLE")); - Gui::DrawString(SearchMenu[2].x + 18, SearchMenu[2].y + 1, 0.4, TEXT_COLOR, Lang::get("AUTHOR")); + Gui::DrawString(SearchMenu[1].x + 18, SearchMenu[1].y + 1, 0.4, TEXT_COLOR, Lang::get("TITLE"), 90); + Gui::DrawString(SearchMenu[2].x + 18, SearchMenu[2].y + 1, 0.4, TEXT_COLOR, Lang::get("AUTHOR"), 90); - Gui::DrawString(SearchMenu[3].x + 18, SearchMenu[3].y + 1, 0.4, TEXT_COLOR, Lang::get("CATEGORY")); - Gui::DrawString(SearchMenu[4].x + 18, SearchMenu[4].y + 1, 0.4, TEXT_COLOR, Lang::get("CONSOLE")); + Gui::DrawString(SearchMenu[3].x + 18, SearchMenu[3].y + 1, 0.4, TEXT_COLOR, Lang::get("CATEGORY"), 90); + Gui::DrawString(SearchMenu[4].x + 18, SearchMenu[4].y + 1, 0.4, TEXT_COLOR, Lang::get("CONSOLE"), 90); /* Filters. */ - Gui::DrawString(84, 150, 0.5, TEXT_COLOR, Lang::get("FILTER_TO")); + Gui::DrawString(84, 150, 0.5, TEXT_COLOR, Lang::get("FILTER_TO"), 265); GFX::drawBox(SearchMenu[5].x, SearchMenu[5].y, SearchMenu[5].w, SearchMenu[5].h, marks & favoriteMarks::STAR); GFX::drawBox(SearchMenu[6].x, SearchMenu[6].y, SearchMenu[6].w, SearchMenu[6].h, marks & favoriteMarks::HEART); diff --git a/source/store/settings.cpp b/source/store/settings.cpp index 85149b7..505fac8 100644 --- a/source/store/settings.cpp +++ b/source/store/settings.cpp @@ -55,13 +55,13 @@ static void DrawSettingsMain(const int &selection) { GFX::drawBox(mainButtons[i].x, mainButtons[i].y, mainButtons[i].w, mainButtons[i].h, i == selection); } - Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[0].y + 4, 0.45f, TEXT_COLOR, Lang::get(mainStrings[0]), 260); - Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[1].y + 4, 0.45f, TEXT_COLOR, Lang::get(mainStrings[1]), 260); - Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[2].y + 4, 0.45f, TEXT_COLOR, Lang::get(autoupdate()), 260); - Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[3].y + 4, 0.45f, TEXT_COLOR, Lang::get(updateCheck()), 260); - Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[4].y + 4, 0.45f, TEXT_COLOR, Lang::get(mainStrings[2]), 260); - Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[5].y + 4, 0.45f, TEXT_COLOR, Lang::get(mainStrings[3]), 260); - Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[6].y + 4, 0.45f, TEXT_COLOR, Lang::get(mainStrings[4]), 260); + Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[0].y + 4, 0.45f, TEXT_COLOR, Lang::get(mainStrings[0]), 255); + Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[1].y + 4, 0.45f, TEXT_COLOR, Lang::get(mainStrings[1]), 255); + Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[2].y + 4, 0.45f, TEXT_COLOR, Lang::get(autoupdate()), 255); + Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[3].y + 4, 0.45f, TEXT_COLOR, Lang::get(updateCheck()), 255); + Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[4].y + 4, 0.45f, TEXT_COLOR, Lang::get(mainStrings[2]), 255); + Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[5].y + 4, 0.45f, TEXT_COLOR, Lang::get(mainStrings[3]), 255); + Gui::DrawStringCentered(54 - 160 + (262 / 2), mainButtons[6].y + 4, 0.45f, TEXT_COLOR, Lang::get(mainStrings[4]), 255); } /* diff --git a/source/store/sortMenu.cpp b/source/store/sortMenu.cpp index 89ef26a..e613811 100644 --- a/source/store/sortMenu.cpp +++ b/source/store/sortMenu.cpp @@ -74,28 +74,28 @@ static const uint8_t GetType(const SortType &st) { */ void StoreUtils::DrawSorting(const bool &asc, const SortType &st) { /* Sort By. */ - Gui::DrawString(buttons[0].x + 5, buttons[0].y - 20, 0.6f, TEXT_COLOR, Lang::get("SORT_BY")); + Gui::DrawString(buttons[0].x + 5, buttons[0].y - 20, 0.6f, TEXT_COLOR, Lang::get("SORT_BY"), 90); for (int i = 0; i < 3; i++) { DrawCheck(i, i == GetType(st)); } - Gui::DrawString(buttons[0].x + 25, buttons[0].y + 2, 0.4f, TEXT_COLOR, Lang::get("TITLE")); - Gui::DrawString(buttons[1].x + 25, buttons[1].y + 2, 0.4f, TEXT_COLOR, Lang::get("AUTHOR")); - Gui::DrawString(buttons[2].x + 25, buttons[2].y + 2, 0.4f, TEXT_COLOR, Lang::get("LAST_UPDATED")); + Gui::DrawString(buttons[0].x + 25, buttons[0].y + 2, 0.4f, TEXT_COLOR, Lang::get("TITLE"), 80); + Gui::DrawString(buttons[1].x + 25, buttons[1].y + 2, 0.4f, TEXT_COLOR, Lang::get("AUTHOR"), 80); + Gui::DrawString(buttons[2].x + 25, buttons[2].y + 2, 0.4f, TEXT_COLOR, Lang::get("LAST_UPDATED"), 80); /* Direction. */ - Gui::DrawString(buttons[3].x + 5, buttons[3].y - 20, 0.6f, TEXT_COLOR, Lang::get("DIRECTION")); + Gui::DrawString(buttons[3].x + 5, buttons[3].y - 20, 0.6f, TEXT_COLOR, Lang::get("DIRECTION"), 80); DrawCheck(3, asc); DrawCheck(4, !asc); - Gui::DrawString(buttons[3].x + 25, buttons[3].y + 2, 0.4f, TEXT_COLOR, Lang::get("ASCENDING")); - Gui::DrawString(buttons[4].x + 25, buttons[4].y + 2, 0.4f, TEXT_COLOR, Lang::get("DESCENDING")); + Gui::DrawString(buttons[3].x + 25, buttons[3].y + 2, 0.4f, TEXT_COLOR, Lang::get("ASCENDING"), 80); + Gui::DrawString(buttons[4].x + 25, buttons[4].y + 2, 0.4f, TEXT_COLOR, Lang::get("DESCENDING"), 80); /* Top Style. */ - Gui::DrawString(buttons[5].x + 5, buttons[5].y - 20, 0.6f, TEXT_COLOR, Lang::get("TOP_STYLE")); + Gui::DrawString(buttons[5].x + 5, buttons[5].y - 20, 0.6f, TEXT_COLOR, Lang::get("TOP_STYLE"), 90); DrawCheck(5, config->list()); DrawCheck(6, !config->list()); - Gui::DrawString(buttons[5].x + 25, buttons[5].y + 2, 0.4f, TEXT_COLOR, Lang::get("LIST")); - Gui::DrawString(buttons[6].x + 25, buttons[6].y + 2, 0.4f, TEXT_COLOR, Lang::get("GRID")); + Gui::DrawString(buttons[5].x + 25, buttons[5].y + 2, 0.4f, TEXT_COLOR, Lang::get("LIST"), 90); + Gui::DrawString(buttons[6].x + 25, buttons[6].y + 2, 0.4f, TEXT_COLOR, Lang::get("GRID"), 90); } /* diff --git a/source/store/store.cpp b/source/store/store.cpp index cf609b6..3da4d9a 100644 --- a/source/store/store.cpp +++ b/source/store/store.cpp @@ -383,6 +383,7 @@ std::string Store::GetLicenseEntry(const int &index) const { */ C2D_Image Store::GetIconEntry(const int &index) const { if (!this->valid) return C2D_SpriteSheetGetImage(sprites, sprites_noIcon_idx); + if (this->sheets.empty()) return C2D_SpriteSheetGetImage(sprites, sprites_noIcon_idx); int iconIndex = -1, sheetIndex = 0; if (index > (int)this->storeJson["storeContent"].size() - 1) return C2D_SpriteSheetGetImage(sprites, sprites_noIcon_idx); diff --git a/source/utils/scriptUtils.cpp b/source/utils/scriptUtils.cpp index f729423..215c03c 100644 --- a/source/utils/scriptUtils.cpp +++ b/source/utils/scriptUtils.cpp @@ -53,6 +53,8 @@ bool ScriptUtils::matchPattern(const std::string &pattern, const std::string &te Result ScriptUtils::removeFile(const std::string &file, const std::string &message) { std::string out; out = std::regex_replace(file, std::regex("%ARCHIVE_DEFAULT%"), config->archPath()); + out = std::regex_replace(out, std::regex("%3DSX%"), config->_3dsxPath()); + out = std::regex_replace(out, std::regex("%NDS%"), config->ndsPath()); Result ret = NONE; if (access(out.c_str(), F_OK) != 0) return DELETE_ERROR; @@ -94,11 +96,19 @@ Result ScriptUtils::copyFile(const std::string &source, const std::string &desti Result ret = NONE; if (access(source.c_str(), F_OK) != 0) return COPY_ERROR; - Msg::DisplayMsg(message); - /* If destination does not exist, create dirs. */ - if (access(destination.c_str(), F_OK) != 0) makeDirs(destination.c_str()); + std::string _source, _dest; + _source = std::regex_replace(source, std::regex("%ARCHIVE_DEFAULT%"), config->archPath()); + _source = std::regex_replace(_source, std::regex("%3DSX%"), config->_3dsxPath()); + _source = std::regex_replace(_source, std::regex("%NDS%"), config->ndsPath()); + _dest = std::regex_replace(destination, std::regex("%ARCHIVE_DEFAULT%"), config->archPath()); + _dest = std::regex_replace(_dest, std::regex("%3DSX%"), config->_3dsxPath()); + _dest = std::regex_replace(_dest, std::regex("%NDS%"), config->ndsPath()); - fcopy(source.c_str(), destination.c_str()); + Msg::DisplayMsg(message); + + /* If destination does not exist, create dirs. */ + if (access(_dest.c_str(), F_OK) != 0) makeDirs(_dest.c_str()); + fcopy(_source.c_str(), _dest.c_str()); return ret; } @@ -106,14 +116,23 @@ Result ScriptUtils::copyFile(const std::string &source, const std::string &desti Rename / Move a file. */ Result ScriptUtils::renameFile(const std::string &oldName, const std::string &newName, const std::string &message) { + Result ret = NONE; if (access(oldName.c_str(), F_OK) != 0) return MOVE_ERROR; + std::string old, _new; + old = std::regex_replace(oldName, std::regex("%ARCHIVE_DEFAULT%"), config->archPath()); + old = std::regex_replace(old, std::regex("%3DSX%"), config->_3dsxPath()); + old = std::regex_replace(old, std::regex("%NDS%"), config->ndsPath()); + _new = std::regex_replace(newName, std::regex("%ARCHIVE_DEFAULT%"), config->archPath()); + _new = std::regex_replace(_new, std::regex("%3DSX%"), config->_3dsxPath()); + _new = std::regex_replace(_new, std::regex("%NDS%"), config->ndsPath()); + Msg::DisplayMsg(message); /* TODO: Kinda avoid that? */ - makeDirs(newName.c_str()); - rename(oldName.c_str(), newName.c_str()); + makeDirs(_new.c_str()); + rename(old.c_str(), _new.c_str()); return ret; } @@ -188,6 +207,11 @@ Result ScriptUtils::downloadFile(const std::string &file, const std::string &out Install CIA files. */ void ScriptUtils::installFile(const std::string &file, const bool &updatingSelf, const std::string &message) { + std::string in; + in = std::regex_replace(file, std::regex("%ARCHIVE_DEFAULT%"), config->archPath()); + in = std::regex_replace(in, std::regex("%3DSX%"), config->_3dsxPath()); + in = std::regex_replace(in, std::regex("%NDS%"), config->ndsPath()); + snprintf(progressBarMsg, sizeof(progressBarMsg), message.c_str()); showProgressBar = true; progressbarType = ProgressBar::Installing; @@ -196,7 +220,7 @@ void ScriptUtils::installFile(const std::string &file, const bool &updatingSelf, svcGetThreadPriority(&prio, CUR_THREAD_HANDLE); thread = threadCreate((ThreadFunc)displayProgressBar, NULL, 64 * 1024, prio - 1, -2, false); - installCia(file.c_str(), updatingSelf); + installCia(in.c_str(), updatingSelf); showProgressBar = false; threadJoin(thread, U64_MAX); threadFree(thread); @@ -208,7 +232,11 @@ void ScriptUtils::installFile(const std::string &file, const bool &updatingSelf, void ScriptUtils::extractFile(const std::string &file, const std::string &input, const std::string &output, const std::string &message) { std::string out, in; in = std::regex_replace(file, std::regex("%ARCHIVE_DEFAULT%"), config->archPath()); + in = std::regex_replace(in, std::regex("%3DSX%"), config->_3dsxPath()); + in = std::regex_replace(in, std::regex("%NDS%"), config->ndsPath()); out = std::regex_replace(output, std::regex("%ARCHIVE_DEFAULT%"), config->archPath()); + out = std::regex_replace(out, std::regex("%3DSX%"), config->_3dsxPath()); + out = std::regex_replace(out, std::regex("%NDS%"), config->ndsPath()); snprintf(progressBarMsg, sizeof(progressBarMsg), message.c_str()); showProgressBar = true; @@ -391,19 +419,28 @@ Result ScriptUtils::runFunctions(const nlohmann::json &storeJson, const int &sel else ret = SYNTAX_ERROR; - } else if (type == "promptMessage") { + } else if (type == "promptMessage" || type == "promptMsg") { std::string Message = ""; + int skipCount = -1; + if (storeJson["storeContent"][selection][entry][i].contains("message") && storeJson["storeContent"][selection][entry][i]["message"].is_string()) { Message = storeJson["storeContent"][selection][entry][i]["message"]; } + if (storeJson["storeContent"][selection][entry][i].contains("count") && storeJson["storeContent"][selection][entry][i]["count"].is_number()) { + skipCount = storeJson["storeContent"][selection][entry][i]["count"]; + } + ret = ScriptUtils::prompt(Message); - if (ret == SCRIPT_CANCELED) { + if (skipCount > -1 && ret == SCRIPT_CANCELED) { ret = NONE; - i++; // Skip. + i += skipCount; // Skip. } + } else if (type == "exit") { + break; + } else if (type == "copy") { std::string Message = "", source = "", destination = ""; bool missing = false; @@ -449,7 +486,7 @@ Result ScriptUtils::runFunctions(const nlohmann::json &storeJson, const int &sel } } - if (ret == NONE) doneMsg(); + if (ret == NONE || ret == SCRIPT_CANCELED) doneMsg(); else if (ret == FAILED_DOWNLOAD) Msg::waitMsg(Lang::get("DOWNLOAD_ERROR")); else if (ret == SYNTAX_ERROR) Msg::waitMsg(Lang::get("SYNTAX_ERROR")); else if (ret == COPY_ERROR) Msg::waitMsg(Lang::get("COPY_ERROR"));