"Hide Anime" now actually hides all anime, and disables sounds. Sounds can now be customized.

This commit is contained in:
Huntereb 2020-09-22 14:29:09 -04:00
parent 8919dad2f5
commit b6fff2fe69
17 changed files with 116 additions and 32 deletions

View File

@ -13,6 +13,8 @@ namespace inst::ui {
TextBlock::Ref installInfoText;
pu::ui::elm::ProgressBar::Ref installBar;
Image::Ref awooImage;
Image::Ref titleImage;
TextBlock::Ref appVersionText;
static void setTopInstInfoText(std::string ourText);
static void setInstInfoText(std::string ourText);
static void setInstBarPerc(double ourPercent);
@ -21,7 +23,5 @@ namespace inst::ui {
private:
Rectangle::Ref infoRect;
Rectangle::Ref topRect;
Image::Ref titleImage;
TextBlock::Ref appVersionText;
};
}

View File

@ -16,14 +16,14 @@ namespace inst::ui {
void exitMenuItem_Click();
void onInput(u64 Down, u64 Up, u64 Held, pu::ui::Touch Pos);
Image::Ref awooImage;
Image::Ref titleImage;
TextBlock::Ref appVersionText;
private:
bool appletFinished;
bool updateFinished;
TextBlock::Ref butText;
Rectangle::Ref topRect;
Rectangle::Ref botRect;
Image::Ref titleImage;
TextBlock::Ref appVersionText;
pu::ui::elm::Menu::Ref optionMenu;
pu::ui::elm::MenuItem::Ref installMenuItem;
pu::ui::elm::MenuItem::Ref netInstallMenuItem;

View File

@ -12,6 +12,8 @@ namespace inst::ui {
void startNetwork();
void onInput(u64 Down, u64 Up, u64 Held, pu::ui::Touch Pos);
TextBlock::Ref pageInfoText;
Image::Ref titleImage;
TextBlock::Ref appVersionText;
private:
std::vector<std::string> ourUrls;
std::vector<std::string> selectedUrls;
@ -20,8 +22,6 @@ namespace inst::ui {
Rectangle::Ref topRect;
Rectangle::Ref infoRect;
Rectangle::Ref botRect;
Image::Ref titleImage;
TextBlock::Ref appVersionText;
pu::ui::elm::Menu::Ref menu;
Image::Ref infoImage;
void drawMenuItems(bool clearItems);

View File

@ -10,13 +10,13 @@ namespace inst::ui {
PU_SMART_CTOR(optionsPage)
void onInput(u64 Down, u64 Up, u64 Held, pu::ui::Touch Pos);
static void askToUpdate(std::vector<std::string> updateInfo);
Image::Ref titleImage;
TextBlock::Ref appVersionText;
private:
TextBlock::Ref butText;
Rectangle::Ref topRect;
Rectangle::Ref infoRect;
Rectangle::Ref botRect;
Image::Ref titleImage;
TextBlock::Ref appVersionText;
TextBlock::Ref pageInfoText;
pu::ui::elm::Menu::Ref menu;
void setMenuText();

View File

@ -14,6 +14,8 @@ namespace inst::ui {
void onInput(u64 Down, u64 Up, u64 Held, pu::ui::Touch Pos);
TextBlock::Ref pageInfoText;
void drawMenuItems(bool clearItems, std::filesystem::path ourPath);
Image::Ref titleImage;
TextBlock::Ref appVersionText;
private:
std::vector<std::filesystem::path> ourDirectories;
std::vector<std::filesystem::path> ourFiles;
@ -23,8 +25,6 @@ namespace inst::ui {
Rectangle::Ref topRect;
Rectangle::Ref infoRect;
Rectangle::Ref botRect;
Image::Ref titleImage;
TextBlock::Ref appVersionText;
void followDirectory();
void selectNsp(int selectedIndex);
};

View File

@ -12,6 +12,8 @@ namespace inst::ui {
void startUsb();
void onInput(u64 Down, u64 Up, u64 Held, pu::ui::Touch Pos);
TextBlock::Ref pageInfoText;
Image::Ref titleImage;
TextBlock::Ref appVersionText;
private:
std::vector<std::string> ourTitles;
std::vector<std::string> selectedTitles;
@ -21,8 +23,6 @@ namespace inst::ui {
Rectangle::Ref topRect;
Rectangle::Ref infoRect;
Rectangle::Ref botRect;
Image::Ref titleImage;
TextBlock::Ref appVersionText;
pu::ui::elm::Menu::Ref menu;
Image::Ref infoImage;
void drawMenuItems(bool clearItems);

View File

@ -116,7 +116,10 @@ namespace tin::install::nsp
if (!Crypto::rsa2048PssVerify(&header->magic, 0x200, header->fixed_key_sig, Crypto::NCAHeaderSignature))
{
std::thread audioThread(inst::util::playAudio,"romfs:/audio/bark.wav");
std::string audioPath = "romfs:/audio/bark.wav";
if (inst::config::gayMode) audioPath = "";
if (std::filesystem::exists(inst::config::appDir + "/bark.wav")) audioPath = inst::config::appDir + "/bark.wav";
std::thread audioThread(inst::util::playAudio,audioPath);
int rc = inst::ui::mainApp->CreateShowDialog("inst.nca_verify.title"_lang, "inst.nca_verify.desc"_lang, {"common.cancel"_lang, "inst.nca_verify.opt1"_lang}, false);
audioThread.join();
if (rc != 1)

View File

@ -112,7 +112,10 @@ namespace tin::install::xci
if (!Crypto::rsa2048PssVerify(&header->magic, 0x200, header->fixed_key_sig, Crypto::NCAHeaderSignature))
{
std::thread audioThread(inst::util::playAudio,"romfs:/audio/bark.wav");
std::string audioPath = "romfs:/audio/bark.wav";
if (inst::config::gayMode) audioPath = "";
if (std::filesystem::exists(inst::config::appDir + "/bark.wav")) audioPath = inst::config::appDir + "/bark.wav";
std::thread audioThread(inst::util::playAudio,audioPath);
int rc = inst::ui::mainApp->CreateShowDialog("inst.nca_verify.title"_lang, "inst.nca_verify.desc"_lang, {"common.cancel"_lang, "inst.nca_verify.opt1"_lang}, false);
audioThread.join();
if (rc != 1)

View File

@ -163,7 +163,10 @@ namespace netInstStuff{
fprintf(stdout, "%s", e.what());
inst::ui::instPage::setInstInfoText("inst.info_page.failed"_lang + urlNames[urlItr]);
inst::ui::instPage::setInstBarPerc(0);
std::thread audioThread(inst::util::playAudio,"romfs:/audio/bark.wav");
std::string audioPath = "romfs:/audio/bark.wav";
if (inst::config::gayMode) audioPath = "";
if (std::filesystem::exists(inst::config::appDir + "/bark.wav")) audioPath = inst::config::appDir + "/bark.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);
audioThread.join();
nspInstalled = false;
@ -183,7 +186,10 @@ namespace netInstStuff{
if(nspInstalled) {
inst::ui::instPage::setInstInfoText("inst.info_page.complete"_lang);
inst::ui::instPage::setInstBarPerc(100);
std::thread audioThread(inst::util::playAudio,"romfs:/audio/awoo.wav");
std::string audioPath = "romfs:/audio/awoo.wav";
if (inst::config::gayMode) audioPath = "";
if (std::filesystem::exists(inst::config::appDir + "/awoo.wav")) audioPath = inst::config::appDir + "/awoo.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);
else inst::ui::mainApp->CreateShowDialog(urlNames[0] + "inst.info_page.desc1"_lang, Language::GetRandomMsg(), {"common.ok"_lang}, true);
audioThread.join();

View File

@ -92,7 +92,10 @@ namespace nspInstStuff {
fprintf(stdout, "%s", e.what());
inst::ui::instPage::setInstInfoText("inst.info_page.failed"_lang + inst::util::shortenString(ourTitleList[titleItr].filename().string(), 42, true));
inst::ui::instPage::setInstBarPerc(0);
std::thread audioThread(inst::util::playAudio,"romfs:/audio/bark.wav");
std::string audioPath = "romfs:/audio/bark.wav";
if (inst::config::gayMode) audioPath = "";
if (std::filesystem::exists(inst::config::appDir + "/bark.wav")) audioPath = inst::config::appDir + "/bark.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);
audioThread.join();
nspInstalled = false;
@ -107,7 +110,10 @@ namespace nspInstStuff {
if(nspInstalled) {
inst::ui::instPage::setInstInfoText("inst.info_page.complete"_lang);
inst::ui::instPage::setInstBarPerc(100);
std::thread audioThread(inst::util::playAudio,"romfs:/audio/awoo.wav");
std::string audioPath = "romfs:/audio/awoo.wav";
if (inst::config::gayMode) audioPath = "";
if (std::filesystem::exists(inst::config::appDir + "/awoo.wav")) audioPath = inst::config::appDir + "/awoo.wav";
std::thread audioThread(inst::util::playAudio,audioPath);
if (ourTitleList.size() > 1) {
if (inst::config::deletePrompt) {
if(inst::ui::mainApp->CreateShowDialog(std::to_string(ourTitleList.size()) + "inst.sd.delete_info_multi"_lang, "inst.sd.delete_desc"_lang, {"common.no"_lang,"common.yes"_lang}, false) == 1) {

View File

@ -14,8 +14,14 @@ namespace inst::ui {
else this->SetBackgroundImage("romfs:/images/background.jpg");
this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#170909FF"));
this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#17090980"));
if (inst::config::gayMode) {
this->titleImage = Image::New(-113, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(367, 49, "v" + inst::config::appVersion, 22);
}
else {
this->titleImage = Image::New(0, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(480, 49, "v" + inst::config::appVersion, 22);
}
this->appVersionText->SetColor(COLOR("#FFFFFFFF"));
this->pageInfoText = TextBlock::New(10, 109, "", 30);
this->pageInfoText->SetColor(COLOR("#FFFFFFFF"));

View File

@ -40,8 +40,14 @@ namespace inst::ui {
else this->SetBackgroundImage("romfs:/images/background.jpg");
this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#170909FF"));
this->botRect = Rectangle::New(0, 659, 1280, 61, COLOR("#17090980"));
if (inst::config::gayMode) {
this->titleImage = Image::New(-113, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(367, 49, "v" + inst::config::appVersion, 22);
}
else {
this->titleImage = Image::New(0, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(480, 49, "v" + inst::config::appVersion, 22);
}
this->appVersionText->SetColor(COLOR("#FFFFFFFF"));
this->butText = TextBlock::New(10, 678, "main.buttons"_lang, 24);
this->butText->SetColor(COLOR("#FFFFFFFF"));

View File

@ -24,8 +24,14 @@ namespace inst::ui {
this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#170909FF"));
this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#17090980"));
this->botRect = Rectangle::New(0, 660, 1280, 60, COLOR("#17090980"));
if (inst::config::gayMode) {
this->titleImage = Image::New(-113, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(367, 49, "v" + inst::config::appVersion, 22);
}
else {
this->titleImage = Image::New(0, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(480, 49, "v" + inst::config::appVersion, 22);
}
this->appVersionText->SetColor(COLOR("#FFFFFFFF"));
this->pageInfoText = TextBlock::New(10, 109, "", 30);
this->pageInfoText->SetColor(COLOR("#FFFFFFFF"));

View File

@ -25,8 +25,14 @@ namespace inst::ui {
this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#170909FF"));
this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#17090980"));
this->botRect = Rectangle::New(0, 660, 1280, 60, COLOR("#17090980"));
if (inst::config::gayMode) {
this->titleImage = Image::New(-113, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(367, 49, "v" + inst::config::appVersion, 22);
}
else {
this->titleImage = Image::New(0, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(480, 49, "v" + inst::config::appVersion, 22);
}
this->appVersionText->SetColor(COLOR("#FFFFFFFF"));
this->pageInfoText = TextBlock::New(10, 109, "options.title"_lang, 30);
this->pageInfoText->SetColor(COLOR("#FFFFFFFF"));
@ -186,11 +192,35 @@ namespace inst::ui {
inst::config::gayMode = false;
mainApp->mainPage->awooImage->SetVisible(true);
mainApp->instpage->awooImage->SetVisible(true);
mainApp->instpage->titleImage->SetX(0);
mainApp->instpage->appVersionText->SetX(480);
mainApp->mainPage->titleImage->SetX(0);
mainApp->mainPage->appVersionText->SetX(480);
mainApp->netinstPage->titleImage->SetX(0);
mainApp->netinstPage->appVersionText->SetX(480);
mainApp->optionspage->titleImage->SetX(0);
mainApp->optionspage->appVersionText->SetX(480);
mainApp->sdinstPage->titleImage->SetX(0);
mainApp->sdinstPage->appVersionText->SetX(480);
mainApp->usbinstPage->titleImage->SetX(0);
mainApp->usbinstPage->appVersionText->SetX(480);
}
else {
inst::config::gayMode = true;
mainApp->mainPage->awooImage->SetVisible(false);
mainApp->instpage->awooImage->SetVisible(false);
mainApp->instpage->titleImage->SetX(-113);
mainApp->instpage->appVersionText->SetX(367);
mainApp->mainPage->titleImage->SetX(-113);
mainApp->mainPage->appVersionText->SetX(367);
mainApp->netinstPage->titleImage->SetX(-113);
mainApp->netinstPage->appVersionText->SetX(367);
mainApp->optionspage->titleImage->SetX(-113);
mainApp->optionspage->appVersionText->SetX(367);
mainApp->sdinstPage->titleImage->SetX(-113);
mainApp->sdinstPage->appVersionText->SetX(367);
mainApp->usbinstPage->titleImage->SetX(-113);
mainApp->usbinstPage->appVersionText->SetX(367);
}
inst::config::setConfig();
this->setMenuText();

View File

@ -19,8 +19,14 @@ namespace inst::ui {
this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#170909FF"));
this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#17090980"));
this->botRect = Rectangle::New(0, 660, 1280, 60, COLOR("#17090980"));
if (inst::config::gayMode) {
this->titleImage = Image::New(-113, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(367, 49, "v" + inst::config::appVersion, 22);
}
else {
this->titleImage = Image::New(0, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(480, 49, "v" + inst::config::appVersion, 22);
}
this->appVersionText->SetColor(COLOR("#FFFFFFFF"));
this->pageInfoText = TextBlock::New(10, 109, "inst.sd.top_info"_lang, 30);
this->pageInfoText->SetColor(COLOR("#FFFFFFFF"));

View File

@ -19,8 +19,14 @@ namespace inst::ui {
this->topRect = Rectangle::New(0, 0, 1280, 94, COLOR("#170909FF"));
this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#17090980"));
this->botRect = Rectangle::New(0, 660, 1280, 60, COLOR("#17090980"));
if (inst::config::gayMode) {
this->titleImage = Image::New(-113, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(367, 49, "v" + inst::config::appVersion, 22);
}
else {
this->titleImage = Image::New(0, 0, "romfs:/images/logo.png");
this->appVersionText = TextBlock::New(480, 49, "v" + inst::config::appVersion, 22);
}
this->appVersionText->SetColor(COLOR("#FFFFFFFF"));
this->pageInfoText = TextBlock::New(10, 109, "", 30);
this->pageInfoText->SetColor(COLOR("#FFFFFFFF"));

View File

@ -136,7 +136,10 @@ namespace usbInstStuff {
fprintf(stdout, "%s", e.what());
inst::ui::instPage::setInstInfoText("inst.info_page.failed"_lang + fileNames[fileItr]);
inst::ui::instPage::setInstBarPerc(0);
std::thread audioThread(inst::util::playAudio,"romfs:/audio/bark.wav");
std::string audioPath = "romfs:/audio/bark.wav";
if (inst::config::gayMode) audioPath = "";
if (std::filesystem::exists(inst::config::appDir + "/bark.wav")) audioPath = inst::config::appDir + "/bark.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);
audioThread.join();
nspInstalled = false;
@ -152,7 +155,10 @@ namespace usbInstStuff {
tin::util::USBCmdManager::SendExitCmd();
inst::ui::instPage::setInstInfoText("inst.info_page.complete"_lang);
inst::ui::instPage::setInstBarPerc(100);
std::thread audioThread(inst::util::playAudio,"romfs:/audio/awoo.wav");
std::string audioPath = "romfs:/audio/awoo.wav";
if (inst::config::gayMode) audioPath = "";
if (std::filesystem::exists(inst::config::appDir + "/awoo.wav")) audioPath = inst::config::appDir + "/awoo.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);
else inst::ui::mainApp->CreateShowDialog(fileNames[0] + "inst.info_page.desc1"_lang, Language::GetRandomMsg(), {"common.ok"_lang}, true);
audioThread.join();