diff --git a/romfs/audio/ameizing.mp3 b/romfs/audio/ameizing.mp3 deleted file mode 100644 index dd120eb..0000000 Binary files a/romfs/audio/ameizing.mp3 and /dev/null differ diff --git a/romfs/audio/bark.wav b/romfs/audio/bark.wav deleted file mode 100644 index 9267b7d..0000000 Binary files a/romfs/audio/bark.wav and /dev/null differ diff --git a/source/HDInstall.cpp b/source/HDInstall.cpp index 8cfff19..047cbc7 100644 --- a/source/HDInstall.cpp +++ b/source/HDInstall.cpp @@ -102,12 +102,12 @@ namespace nspInstStuff_B { inst::ui::instPage::setInstInfoText("inst.info_page.failed"_lang + inst::util::shortenString(ourTitleList[titleItr].filename().string(), 42, true)); inst::ui::instPage::setInstBarPerc(0); std::string audioPath = ""; - if (std::filesystem::exists(inst::config::appDir + "/sounds/OHNO.WAV")) { - audioPath = (inst::config::appDir + "/sounds/OHNO.WAV"); - } - else { - audioPath = "romfs:/audio/bark.wav"; + + if (inst::config::useSound) { + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/sounds/failed.wav")) audioPath = (inst::config::appDir + "/theme/sounds/failed.wav"); + else audioPath = "romfs:/audio/ohno.wav"; } + std::thread audioThread(inst::util::playAudio, audioPath); inst::ui::mainApp->CreateShowDialog("inst.info_page.failed"_lang + inst::util::shortenString(ourTitleList[titleItr].filename().string(), 42, true) + "!", "inst.info_page.failed_desc"_lang + "\n\n" + (std::string)e.what(), { "common.ok"_lang }, true, "romfs:/images/icons/fail.png"); audioThread.join(); @@ -126,12 +126,9 @@ namespace nspInstStuff_B { std::string audioPath = ""; if (inst::config::useSound) { - if (std::filesystem::exists(inst::config::appDir + "/sounds/YIPPEE.WAV")) { - audioPath = (inst::config::appDir + "/sounds/YIPPEE.WAV"); - } - else { - audioPath = "romfs:/audio/ameizing.mp3"; - } + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/sounds/complete.wav")) audioPath = (inst::config::appDir + "/theme/sounds/complete.wav"); + else audioPath = "romfs:/audio/yipee.wav"; + std::thread audioThread(inst::util::playAudio, audioPath); if (ourTitleList.size() > 1) { diff --git a/source/netInstall.cpp b/source/netInstall.cpp index 2d9f559..04f608c 100644 --- a/source/netInstall.cpp +++ b/source/netInstall.cpp @@ -243,12 +243,12 @@ namespace netInstStuff { inst::ui::instPage::setInstInfoText("inst.info_page.failed"_lang + urlNames[urlItr]); inst::ui::instPage::setInstBarPerc(0); std::string audioPath = ""; - if (std::filesystem::exists(inst::config::appDir + "/sounds/OHNO.WAV")) { - audioPath = (inst::config::appDir + "/sounds/OHNO.WAV"); - } - else { - audioPath = "romfs:/audio/bark.wav"; + + if (inst::config::useSound) { + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/sounds/failed.wav")) audioPath = (inst::config::appDir + "/theme/sounds/failed.wav"); + else audioPath = "romfs:/audio/ohno.wav"; } + std::thread audioThread(inst::util::playAudio, audioPath); inst::ui::mainApp->CreateShowDialog("inst.info_page.failed"_lang + urlNames[urlItr] + "!", "inst.info_page.failed_desc"_lang + "\n\n" + (std::string)e.what(), { "common.ok"_lang }, true, "romfs:/images/icons/fail.png"); audioThread.join(); @@ -272,12 +272,9 @@ namespace netInstStuff { std::string audioPath = ""; if (inst::config::useSound) { - if (std::filesystem::exists(inst::config::appDir + "/sounds/YIPPEE.WAV")) { - audioPath = (inst::config::appDir + "/sounds/YIPPEE.WAV"); - } - else { - audioPath = "romfs:/audio/ameizing.mp3"; - } + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/sounds/complete.wav")) audioPath = (inst::config::appDir + "/theme/sounds/complete.wav"); + else audioPath = "romfs:/audio/yipee.wav"; + std::thread audioThread(inst::util::playAudio, audioPath); if (ourUrlList.size() > 1) inst::ui::mainApp->CreateShowDialog(std::to_string(ourUrlList.size()) + "inst.info_page.desc0"_lang, Language::GetRandomMsg(), { "common.ok"_lang }, true, "romfs:/images/icons/good.png"); diff --git a/source/sdInstall.cpp b/source/sdInstall.cpp index dd280fc..a938272 100644 --- a/source/sdInstall.cpp +++ b/source/sdInstall.cpp @@ -102,12 +102,12 @@ namespace nspInstStuff { inst::ui::instPage::setInstInfoText("inst.info_page.failed"_lang + inst::util::shortenString(ourTitleList[titleItr].filename().string(), 42, true)); inst::ui::instPage::setInstBarPerc(0); std::string audioPath = ""; - if (std::filesystem::exists(inst::config::appDir + "/sounds/OHNO.WAV")) { - audioPath = (inst::config::appDir + "/sounds/OHNO.WAV"); - } - else { - audioPath = "romfs:/audio/bark.wav"; + + if (inst::config::useSound) { + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/sounds/failed.wav")) audioPath = (inst::config::appDir + "/theme/sounds/failed.wav"); + else audioPath = "romfs:/audio/ohno.wav"; } + std::thread audioThread(inst::util::playAudio, audioPath); inst::ui::mainApp->CreateShowDialog("inst.info_page.failed"_lang + inst::util::shortenString(ourTitleList[titleItr].filename().string(), 42, true) + "!\n", "inst.info_page.failed_desc"_lang + "\n\n" + (std::string)e.what(), { "common.ok"_lang }, true); audioThread.join(); @@ -127,12 +127,9 @@ namespace nspInstStuff { if (inst::config::useSound) { - if (std::filesystem::exists(inst::config::appDir + "/sounds/YIPPEE.WAV")) { - audioPath = (inst::config::appDir + "/sounds/YIPPEE.WAV"); - } - else { - audioPath = "romfs:/audio/ameizing.mp3"; - } + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/sounds/complete.wav")) audioPath = (inst::config::appDir + "/theme/sounds/complete.wav"); + else audioPath = "romfs:/audio/yipee.wav"; + std::thread audioThread(inst::util::playAudio, audioPath); if (ourTitleList.size() > 1) { diff --git a/source/ui/HDInstPage.cpp b/source/ui/HDInstPage.cpp index 2a51e19..0c911fe 100644 --- a/source/ui/HDInstPage.cpp +++ b/source/ui/HDInstPage.cpp @@ -20,10 +20,10 @@ namespace inst::ui { this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#000000FF")); this->botRect = Rectangle::New(0, 659, 1280, 61, COLOR("#000000FF")); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Hd.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/images/Hd.png")); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Hd.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/theme/images/Hd.png")); else this->titleImage = Image::New(0, 0, "romfs:/images/Hd.png"); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/images/Background.png"); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/theme/images/Background.png"); else this->SetBackgroundImage("romfs:/images/Background.png"); this->pageInfoText = TextBlock::New(10, 109, "inst.hd.top_info"_lang); diff --git a/source/ui/ThemeInstPage.cpp b/source/ui/ThemeInstPage.cpp index da04256..3d8ed81 100644 --- a/source/ui/ThemeInstPage.cpp +++ b/source/ui/ThemeInstPage.cpp @@ -33,10 +33,10 @@ namespace inst::ui { this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#000000FF")); this->botRect = Rectangle::New(0, 659, 1280, 61, COLOR("#000000FF")); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Net.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/images/Net.png")); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Net.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/theme/images/Net.png")); else this->titleImage = Image::New(0, 0, "romfs:/images/Net.png"); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/images/Background.png"); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/theme/images/Background.png"); else this->SetBackgroundImage("romfs:/images/Background.png"); this->pageInfoText = TextBlock::New(10, 109, ""); diff --git a/source/ui/instPage.cpp b/source/ui/instPage.cpp index 41ddc0b..a9225f3 100644 --- a/source/ui/instPage.cpp +++ b/source/ui/instPage.cpp @@ -30,10 +30,10 @@ namespace inst::ui { this->SetBackgroundColor(COLOR("#000000FF")); this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#000000FF")); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Install.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/images/Install.png")); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Install.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/theme/images/Install.png")); else this->titleImage = Image::New(0, 0, "romfs:/images/Install.png"); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/images/Background.png"); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/theme/images/Background.png"); else this->SetBackgroundImage("romfs:/images/Background.png"); this->pageInfoText = TextBlock::New(10, 109, ""); diff --git a/source/ui/mainPage.cpp b/source/ui/mainPage.cpp index 44ae094..feeab8d 100644 --- a/source/ui/mainPage.cpp +++ b/source/ui/mainPage.cpp @@ -154,10 +154,10 @@ namespace inst::ui { this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#000000FF")); this->botRect = Rectangle::New(0, 659, 1280, 61, COLOR("#000000FF")); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Main.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/images/Main.png")); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Main.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/theme/images/Main.png")); else this->titleImage = Image::New(0, 0, "romfs:/images/Main.png"); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/images/Background.png"); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/theme/images/Background.png"); else this->SetBackgroundImage("romfs:/images/Background.png"); this->butText = TextBlock::New(10, 678, "main.buttons"_lang); diff --git a/source/ui/netInstPage.cpp b/source/ui/netInstPage.cpp index 2399148..57cbd63 100644 --- a/source/ui/netInstPage.cpp +++ b/source/ui/netInstPage.cpp @@ -26,10 +26,10 @@ namespace inst::ui { this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#000000FF")); this->botRect = Rectangle::New(0, 659, 1280, 61, COLOR("#000000FF")); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Net.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/images/Net.png")); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Net.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/theme/images/Net.png")); else this->titleImage = Image::New(0, 0, "romfs:/images/Net.png"); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/images/Background.png"); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/theme/images/Background.png"); else this->SetBackgroundImage("romfs:/images/Background.png"); this->pageInfoText = TextBlock::New(10, 109, ""); diff --git a/source/ui/optionsPage.cpp b/source/ui/optionsPage.cpp index f9c637a..d79aed4 100644 --- a/source/ui/optionsPage.cpp +++ b/source/ui/optionsPage.cpp @@ -27,10 +27,10 @@ namespace inst::ui { this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#000000FF")); this->botRect = Rectangle::New(0, 659, 1280, 61, COLOR("#000000FF")); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Settings.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/images/Settings.png")); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Settings.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/theme/images/Settings.png")); else this->titleImage = Image::New(0, 0, "romfs:/images/Settings.png"); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/images/Background.png"); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/theme/images/Background.png"); else this->SetBackgroundImage("romfs:/images/Background.png"); this->appVersionText = TextBlock::New(1200, 680, "v" + inst::config::appVersion); diff --git a/source/ui/sdInstPage.cpp b/source/ui/sdInstPage.cpp index af62ab2..2853395 100644 --- a/source/ui/sdInstPage.cpp +++ b/source/ui/sdInstPage.cpp @@ -22,10 +22,10 @@ namespace inst::ui { this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#000000FF")); this->botRect = Rectangle::New(0, 659, 1280, 61, COLOR("#000000FF")); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Sd.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/images/Sd.png")); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Sd.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/theme/images/Sd.png")); else this->titleImage = Image::New(0, 0, "romfs:/images/Sd.png"); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/images/Background.png"); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/theme/images/Background.png"); else this->SetBackgroundImage("romfs:/images/Background.png"); this->pageInfoText = TextBlock::New(10, 109, "inst.sd.top_info"_lang); diff --git a/source/ui/usbInstPage.cpp b/source/ui/usbInstPage.cpp index 1e5a5d7..a05c344 100644 --- a/source/ui/usbInstPage.cpp +++ b/source/ui/usbInstPage.cpp @@ -18,10 +18,10 @@ namespace inst::ui { this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#000000FF")); this->botRect = Rectangle::New(0, 659, 1280, 61, COLOR("#000000FF")); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Usb.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/images/Usb.png")); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Usb.png")) this->titleImage = Image::New(0, 0, (inst::config::appDir + "/theme/images/Usb.png")); else this->titleImage = Image::New(0, 0, "romfs:/images/Usb.png"); - if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/images/Background.png"); + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/images/Background.png")) this->SetBackgroundImage(inst::config::appDir + "/theme/images/Background.png"); else this->SetBackgroundImage("romfs:/images/Background.png"); this->pageInfoText = TextBlock::New(10, 109, ""); @@ -179,11 +179,7 @@ namespace inst::ui { int var = this->menu->GetItems().size(); auto s = std::to_string(var); - if (s == "0") { - //do nothing here because there's no items in the list, that way the app won't freeze - } - - else { + if (s != "0") { if (this->selectedTitles.size() == 0) { this->selectTitle(this->menu->GetSelectedIndex()); this->startInstall(); diff --git a/source/usbInstall.cpp b/source/usbInstall.cpp index 5888a5b..032c7c5 100644 --- a/source/usbInstall.cpp +++ b/source/usbInstall.cpp @@ -151,12 +151,12 @@ namespace usbInstStuff { inst::ui::instPage::setInstInfoText("inst.info_page.failed"_lang + fileNames[fileItr]); inst::ui::instPage::setInstBarPerc(0); std::string audioPath = ""; - if (std::filesystem::exists(inst::config::appDir + "/sounds/OHNO.WAV")) { - audioPath = (inst::config::appDir + "/sounds/OHNO.WAV"); - } - else { - audioPath = "romfs:/audio/bark.wav"; + + if (inst::config::useSound) { + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/sounds/failed.wav")) audioPath = (inst::config::appDir + "/theme/sounds/failed.wav"); + else audioPath = "romfs:/audio/ohno.wav"; } + std::thread audioThread(inst::util::playAudio, audioPath); inst::ui::mainApp->CreateShowDialog("inst.info_page.failed"_lang + fileNames[fileItr] + "!", "inst.info_page.failed_desc"_lang + "\n\n" + (std::string)e.what(), { "common.ok"_lang }, true, "romfs:/images/icons/fail.png"); audioThread.join(); @@ -176,12 +176,8 @@ namespace usbInstStuff { std::string audioPath = ""; if (inst::config::useSound) { - if (std::filesystem::exists(inst::config::appDir + "/sounds/YIPPEE.WAV")) { - audioPath = (inst::config::appDir + "/sounds/YIPPEE.WAV"); - } - else { - audioPath = "romfs:/audio/ameizing.mp3"; - } + if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/sounds/complete.wav")) audioPath = (inst::config::appDir + "/theme/sounds/complete.wav"); + else audioPath = "romfs:/audio/yipee.wav"; std::thread audioThread(inst::util::playAudio, audioPath); if (ourTitleList.size() > 1) inst::ui::mainApp->CreateShowDialog(std::to_string(ourTitleList.size()) + "inst.info_page.desc0"_lang, Language::GetRandomMsg(), { "common.ok"_lang }, true, "romfs:/images/icons/good.png");