mirror of
https://github.com/hax4dazy/TinWoo.git
synced 2025-02-09 19:25:05 +01:00
prep for json theming
This commit is contained in:
parent
bf54ce62de
commit
31c397a5bf
Binary file not shown.
Binary file not shown.
@ -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) {
|
||||
|
@ -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");
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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, "");
|
||||
|
@ -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, "");
|
||||
|
@ -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);
|
||||
|
@ -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, "");
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user