From 31c397a5bf5129373430a5d8c267835f09b1d9ea Mon Sep 17 00:00:00 2001 From: mrdude2478 Date: Thu, 28 Sep 2023 06:43:44 +0100 Subject: [PATCH] prep for json theming --- romfs/audio/ameizing.mp3 | Bin 4592 -> 0 bytes romfs/audio/bark.wav | Bin 5412 -> 0 bytes source/HDInstall.cpp | 19 ++++++++----------- source/netInstall.cpp | 19 ++++++++----------- source/sdInstall.cpp | 19 ++++++++----------- source/ui/HDInstPage.cpp | 4 ++-- source/ui/ThemeInstPage.cpp | 4 ++-- source/ui/instPage.cpp | 4 ++-- source/ui/mainPage.cpp | 4 ++-- source/ui/netInstPage.cpp | 4 ++-- source/ui/optionsPage.cpp | 4 ++-- source/ui/sdInstPage.cpp | 4 ++-- source/ui/usbInstPage.cpp | 10 +++------- source/usbInstall.cpp | 18 +++++++----------- 14 files changed, 48 insertions(+), 65 deletions(-) delete mode 100644 romfs/audio/ameizing.mp3 delete mode 100644 romfs/audio/bark.wav diff --git a/romfs/audio/ameizing.mp3 b/romfs/audio/ameizing.mp3 deleted file mode 100644 index dd120eb13a6a37fc431fbbea2f7f8695f9575b17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4592 zcmY*d*>>E>k(J-((enrMHorlga>0%&)JAcU)KZfY zNwvG}wtMEm$9nO{%x6phq|bP=NFXEPMnoc!85x25U){O$KmUH~*5liczG(K;|M>N- zTep4%KkYwn)&IY`^>4Qt+v@f|0ONTcg?}G@|L^JpefKj78;7x4HZVBVv#Oo5a2C;J1__q z`7&BbKR{cg$uRb1agrQ`F4vz0I}#C^&6fEa-(rmeXD@MyEKaj*H8#jsxNiyW6wA}{ zHEE+p1NWGq{^5skx@fBQ*PaHtWO1HG?++T@UDu^{;x#&KSk8EFB35zaf=KJp5 zcnk5^jAZ_UR94TP%O>?Rofe0mC=S+iTk~S-x%2a6Jm0%L>v5jDgulB|Rk5ZQDk(i1 zt**#^@%)R|nqUjtiGNt_hT7Uf2>Zmr{`pTEopcSq!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K;wP8>oF3Fa5hgPGH?f7V+birD5Ci^mtG(Bd&U?tolqo;ybz?1x+6^qAk!An8m&runq1#qfExVCZB5k~0+nnT zPB<`Hx~g+nNfiTBRJUa)I&&cnPZ!Zt5Cv5#!8IeE3Qs{@P1V3gg-EB;S8z|!Rf;{% z;(0!m!I<>Nh5`)1Cj5TKYEXWq= zOj3ow$VSxmc#zB{(+K>I`exrlNCaW!S87CS!RGYg43XeB4=vZ+cY1bU)^1|3syQuV zq%jl1SU%570Z-E#!S1t(pviPz#8M?n+v#B9giv5Fl1xI?)O5O5UYYG0dVe zVg}_jo6aUuj=fP2R)mX$7iIG}6_#zboWA3k++*n^EqFDrhN@B%0(hKG5-D`74V(dd zQQ#2YiYQ^&aC?qoK>_avVUnes!SiU20v{BZC&COWH>ku$uI74f0P8nSVixE`w;Tf? z0hD2h5P|EuDl(7vYRmlLEKIGi+x}kK$0IAD}s(z?ys_U`?SpU-g7g5*k A(f|Me diff --git a/romfs/audio/bark.wav b/romfs/audio/bark.wav deleted file mode 100644 index 9267b7d67e7aa88c2da013b6f45417b5b92937b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5412 zcmYjVNqgJMa`oF~nMJb8BHR26J=@ogY|FAp$+{vXQJh6^G5`V)W;RA*CP0D|XMv(!w8HYXK?_og(gE$w zxYMevxlW_l{p@Bl4cZ?wMRL6CHIrxR*ydQhZ=u<$OB;-{6;hCRj}I4~S)%23j5c?_zJK)*0VPi8Ij&0xa+T`78cj#5=!3er{V)FI{#CFTq3?6fwIx#e{nyG)PIp5ONz{A3t_sG#Js$3S@~xqr-ebpI zU1jb689je4I_60En3i1A*HP&|zaH;26n)aordUl0e1e?++4!)JYW{$~xD;f|2e|(E zkIfgSf<5rj(}tqCJ+|ik$1=T(i00HT=3Bhh^F^>)XLnm2;5fA$2N)xi`Ma;V9n=PH zzmaAPS{}%)!M`iJr$ExjN~YG~X)mDp$1l0ps4N5_dQRz-FwjYN>z+Pp zOOD=bh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z9ZM`qA3Xz4+&Jh0vFu$8EG(JibsLzKq=AY9^*$zCA@4Z~ZV7v06TrQ|}%p z-NAC9W}d%3sZi$f^IXMh<@6an`MmUl*>X^S^L#(w6i1&QdrYHRNav*GGuAHPh*22#Gr;Jv$5==P^GqqO_#sML~2 z+lP>AR7)2*DqJsm-e5K}k$0~kpBUb6Co*2I{cto2)$0Ds{VXPS*Z;Ed;A$#l zinPC&g+V_IT!18ACklk*N84N2d0Dt9(7}8f_QKG&LG5riStKQI@v!!pTDh1l5YB8q z==J-askF}C?`Ltr9NyjyB@{u*#X1P5qrmU^jv>^4-T(EHlAOtU>9Gx@dRf8Ma1{EU z@7bokqoN?HGz;s;#r59LkFNaJhip%_dT5bq1kp+O{SFvny9l z(p7>MoSSthqG;nXUsuABZ@Z4lGD_DMO6hD3BicbUcQ_nHiU{jnhn{1rEG?RzBNL^I zYz2oe6h?tUHxYP-xG)};!qYGZuxz`-mQGS-vTX#TP$z3OoRdv2a1@T_0IY7hrp(kc z={zQ=mhbCy6QzODu{{&8EUY_h$CP2UNHi;T2EdX-S2+R#WW}^Qu;Nx>@~et45f%YQ z;xGZmX_zI)1r1ERAqwW>s;2OqD8a0sU0+@a)Fg1hOzY^!$Dy)KpxR3#`G=Ld@oVCLg9TozxJc!GWZ#4l_f!R98^BgY< zEX%?4Jgy7kiUU?ZaUlh(8ra|s@`(Zjau62R1m7B@i)$J9wkqy~G!PX(LF4e@sThd? zPxTJufDLv)VB8-g;`dy?aeeD=KcSv*&>;MSn3zA7e?vaKErYiwh8Xa~^fM9k=0}TB zu{kLCt0Bnv8{o-84EpBqPnhqBC;q2?9!h@l_9;ZrjVIg_;E5xS;P>{EnI~^!P|WcY z$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");