From 39064efd62936fd8888e4e123a6dfb351d7a3afe Mon Sep 17 00:00:00 2001 From: tomvita <68505331+tomvita@users.noreply.github.com> Date: Wed, 7 Apr 2021 21:43:12 +0800 Subject: [PATCH] option on profile --- source/guis/gui_main.cpp | 6 +++++- source/guis/gui_sysmodule.cpp | 36 +++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/source/guis/gui_main.cpp b/source/guis/gui_main.cpp index 6b2dc99c..0fc24c82 100644 --- a/source/guis/gui_main.cpp +++ b/source/guis/gui_main.cpp @@ -191,7 +191,7 @@ void GuiMain::draw() { std::string buttonHintStr = ""; - buttonHintStr = !tmpEditableOnly ? "\uE0E6 Editable titles " : "\uE0E6 All titles "; + buttonHintStr = !tmpEditableOnly ? "\uE0E4 Config \uE0E6 Editable titles " : "\uE0E6 All titles "; buttonHintStr += m_backupAll ? "(\uE0E7) + \uE0E2 Backup all " : "(\uE0E7) + \uE0E2 Backup "; buttonHintStr += "\uE0E1 Back \uE0E0 OK"; @@ -209,6 +209,10 @@ void GuiMain::draw() { void GuiMain::onInput(u32 kdown) { if (kdown & KEY_B) Gui::g_requestExit = true; + else if (kdown & KEY_L) + { + Gui::g_nextGui = GUI_CHOOSE_MISSION; + } if (Title::g_titles.size() == 0) return; diff --git a/source/guis/gui_sysmodule.cpp b/source/guis/gui_sysmodule.cpp index d5572191..ac636efe 100644 --- a/source/guis/gui_sysmodule.cpp +++ b/source/guis/gui_sysmodule.cpp @@ -217,8 +217,16 @@ void GuiSysmodule::draw() { // if (hidMitmInstalled()) // Gui::drawTextAligned(font20, Gui::g_framebuffer_width - 50, Gui::g_framebuffer_height - 25, currTheme.textColor, "\uE0E2 Key configuration \uE0E1 Back \uE0E0 OK", ALIGNED_RIGHT); // else - Gui::drawTextAligned(font20, Gui::g_framebuffer_width - 50, Gui::g_framebuffer_height - 51, currTheme.textColor, "\uE0E1 Back \uE0E0 OK", ALIGNED_RIGHT); - + Gui::drawTextAligned(font20, Gui::g_framebuffer_width - 50, Gui::g_framebuffer_height - 51, currTheme.textColor, "\uE0E1 Back \uE0E0 OK", ALIGNED_RIGHT); + { + FILE *exefs = fopen(std::string(CONTENTS_PATH "0100000000001013/exefs.nsp").c_str(), "r"); + if ((exefs == nullptr) && (access(CONTENTS_PATH "0100000000001013/exefs.nsp1", F_OK) == 0)) + Gui::drawTextAligned(font20, Gui::g_framebuffer_width - 500, Gui::g_framebuffer_height - 51, currTheme.textColor, "\uE0E2 Make profile launch EdiZon SE", ALIGNED_RIGHT); + else { + Gui::drawTextAligned(font20, Gui::g_framebuffer_width - 500, Gui::g_framebuffer_height - 51, currTheme.textColor, "\uE0E3 Make profile launch profile", ALIGNED_RIGHT); + fclose(exefs); + } + } if (anyModulesPresent) Gui::drawTextAligned(font20, Gui::g_framebuffer_width / 2, 100, currTheme.textColor, "Enable as little background services (sysmodules) as possible for maximum compatibility with\ngames. If you encounter problem try disable all of them to see if it helps to improve stability.\nDo not enable tesla if you are on HOS11+ when running Edizon SE.", ALIGNED_CENTER); else @@ -245,6 +253,30 @@ void GuiSysmodule::onInput(u32 kdown) { else Gui::g_nextGui = GUI_CHOOSE_MISSION; } + else if ((kdown & KEY_X) && (access(CONTENTS_PATH "0100000000001013/exefs.nsp1", F_OK) == 0)) + { + try + { + if (access(CONTENTS_PATH "0100000000001013/exefs.nsp", F_OK) == -1) + rename(CONTENTS_PATH "0100000000001013/exefs.nsp1", CONTENTS_PATH "0100000000001013/exefs.nsp"); + } + catch (json::parse_error &e) + { + } + } + else if ((kdown & KEY_Y) && (access(CONTENTS_PATH "0100000000001013/exefs.nsp", F_OK) == 0)) + { + try + { + if (access(CONTENTS_PATH "0100000000001013/exefs.nsp1", F_OK) == -1) + rename(CONTENTS_PATH "0100000000001013/exefs.nsp", CONTENTS_PATH "0100000000001013/exefs.nsp1"); + else + remove(CONTENTS_PATH "0100000000001013/exefs.nsp"); + } + catch (json::parse_error &e) + { + } + } // if (hidMitmInstalled() && kdown & KEY_X) // Gui::g_nextGui = GUI_HID_MITM;