From 2b0352114ecb953f8f1289ba987aa02d42008b03 Mon Sep 17 00:00:00 2001 From: Pk11 Date: Mon, 21 Feb 2022 03:16:14 -0600 Subject: [PATCH] Exit UU with START, switch START actions to SELECT --- source/init.cpp | 5 ++--- source/menu/downList.cpp | 8 ++++++-- source/menu/entryInfo.cpp | 8 ++++++-- source/menu/markMenu.cpp | 2 +- source/menu/queueMenu.cpp | 5 +++++ source/menu/searchMenu.cpp | 5 +++++ source/menu/settings.cpp | 4 ++++ source/menu/sortMenu.cpp | 5 +++++ 8 files changed, 34 insertions(+), 8 deletions(-) diff --git a/source/init.cpp b/source/init.cpp index c9b70fa..d86d4f5 100644 --- a/source/init.cpp +++ b/source/init.cpp @@ -195,9 +195,8 @@ Result Init::MainLoop() { C3D_FrameEnd(0); if (!exiting) Gui::ScreenLogic(hDown, hHeld, touch, true, false); - - if (exiting) { - if (hDown & KEY_START) fullExit = true; // Make it optionally faster. + else { + if (hidKeysDown() & KEY_START) fullExit = true; // Make it optionally faster. if (fadeAlpha < 255) { fadeAlpha += 4; diff --git a/source/menu/downList.cpp b/source/menu/downList.cpp index a55dfeb..c891630 100644 --- a/source/menu/downList.cpp +++ b/source/menu/downList.cpp @@ -35,7 +35,7 @@ #define DOWNLOAD_ENTRIES 7 extern std::string _3dsxPath; -extern bool is3DSX; +extern bool exiting, is3DSX, QueueRuns; extern bool touching(touchPosition touch, Structs::ButtonPos button); static const std::vector downloadBoxes = { { 46, 32, 241, 22 }, @@ -175,7 +175,7 @@ void StoreUtils::DownloadHandle(const std::unique_ptr &entry, const smallDelay--; } - if ((hDown & (KEY_Y | KEY_START) || (hDown & KEY_TOUCH && touching(touch, downloadBoxes[6]))) && !entries.empty()) { + if ((hDown & (KEY_Y | KEY_SELECT) || (hDown & KEY_TOUCH && touching(touch, downloadBoxes[6]))) && !entries.empty()) { if (is3DSX) { // Only allow if 3DSX. if (StoreUtils::entries.size() <= 0) return; // Smaller than 0 -> No No. @@ -248,6 +248,10 @@ void StoreUtils::DownloadHandle(const std::unique_ptr &entry, const if (hDown & KEY_B) currentMenu = lastMode; // Go back to EntryInfo. + /* Quit UU. */ + if (hDown & KEY_START && !QueueRuns) + exiting = true; + /* Scroll Handle. */ if (StoreUtils::store->GetDownloadIndex() < StoreUtils::store->GetDownloadSIndex()) StoreUtils::store->SetDownloadSIndex(StoreUtils::store->GetDownloadIndex()); else if (StoreUtils::store->GetDownloadIndex() > StoreUtils::store->GetDownloadSIndex() + DOWNLOAD_ENTRIES - 1) StoreUtils::store->SetDownloadSIndex(StoreUtils::store->GetDownloadIndex() - DOWNLOAD_ENTRIES + 1); diff --git a/source/menu/entryInfo.cpp b/source/menu/entryInfo.cpp index 17fe781..ca6ad2d 100644 --- a/source/menu/entryInfo.cpp +++ b/source/menu/entryInfo.cpp @@ -34,7 +34,7 @@ static const Structs::ButtonPos btn = { 45, 215, 24, 24 }; static const Structs::ButtonPos sshot = { 75, 215, 24, 24 }; static const Structs::ButtonPos notes = { 105, 215, 24, 24 }; extern bool checkWifiStatus(); -extern bool QueueRuns; +extern bool exiting, QueueRuns; /* Draw the Entry Info part. @@ -78,7 +78,7 @@ void StoreUtils::DrawEntryInfo(const std::unique_ptr &entry) { */ void StoreUtils::EntryHandle(bool &showMark, bool &fetch, bool &sFetch, int &mode, const std::unique_ptr &entry) { if (entry) { - if ((hDown & KEY_START) || (hDown & KEY_TOUCH && touching(touch, btn))) showMark = true; + if ((hDown & KEY_SELECT) || (hDown & KEY_TOUCH && touching(touch, btn))) showMark = true; if ((hDown & KEY_Y) || (hDown & KEY_TOUCH && touching(touch, sshot))) { if (!entry->GetScreenshots().empty()) { @@ -100,4 +100,8 @@ void StoreUtils::EntryHandle(bool &showMark, bool &fetch, bool &sFetch, int &mod if (entry->GetReleaseNotes() != "") mode = 7; } } + + /* Quit UU. */ + if (hDown & KEY_START && !QueueRuns) + exiting = true; } \ No newline at end of file diff --git a/source/menu/markMenu.cpp b/source/menu/markMenu.cpp index d4052cf..1a3153f 100644 --- a/source/menu/markMenu.cpp +++ b/source/menu/markMenu.cpp @@ -124,5 +124,5 @@ void StoreUtils::MarkHandle(std::unique_ptr &entry, bool &showMark) } - if ((hidKeysDown() & KEY_B || hidKeysDown() & KEY_START) || (hidKeysDown() & KEY_TOUCH && touching(t, markBox[5]))) showMark = false; // Return back to screen. + if ((hidKeysDown() & KEY_B || hidKeysDown() & KEY_SELECT) || (hidKeysDown() & KEY_TOUCH && touching(t, markBox[5]))) showMark = false; // Return back to screen. } \ No newline at end of file diff --git a/source/menu/queueMenu.cpp b/source/menu/queueMenu.cpp index d46583a..6c731b4 100644 --- a/source/menu/queueMenu.cpp +++ b/source/menu/queueMenu.cpp @@ -36,6 +36,7 @@ extern u32 extractSize, writeOffset; extern u32 installSize, installOffset; extern u32 copyOffset, copySize; extern int filesExtracted, extractFilesCount; +extern bool exiting, QueueRuns; extern curl_off_t downloadTotal; extern curl_off_t downloadNow; @@ -331,4 +332,8 @@ void StoreUtils::QueueMenuHandle(int &queueIndex, int &storeMode) { } if (hDown & KEY_B) storeMode = 0; // Go to EntryInfo. + + /* Quit UU. */ + if (hDown & KEY_START && !QueueRuns) + exiting = true; } \ No newline at end of file diff --git a/source/menu/searchMenu.cpp b/source/menu/searchMenu.cpp index bcb32e8..5659fa4 100644 --- a/source/menu/searchMenu.cpp +++ b/source/menu/searchMenu.cpp @@ -29,6 +29,7 @@ #include "storeUtils.hpp" #include "structs.hpp" +extern bool exiting, QueueRuns; extern bool touching(touchPosition touch, Structs::ButtonPos button); static const std::vector SearchMenu = { { 51, 41, 262, 30 }, // Search bar. @@ -232,4 +233,8 @@ void StoreUtils::SearchHandle(std::vector &searchIncludes, std::string &se StoreUtils::SortEntries(ascending, sorttype); } } + + /* Quit UU. */ + if (hDown & KEY_START && !QueueRuns) + exiting = true; } \ No newline at end of file diff --git a/source/menu/settings.cpp b/source/menu/settings.cpp index 783305f..e8bbf37 100644 --- a/source/menu/settings.cpp +++ b/source/menu/settings.cpp @@ -316,6 +316,10 @@ static void SettingsHandleMain(int &page, bool &dspSettings, int &storeMode, int break; } } + + /* Quit UU. */ + if (hDown & KEY_START && !QueueRuns) + exiting = true; } /* diff --git a/source/menu/sortMenu.cpp b/source/menu/sortMenu.cpp index 9eba71e..b6978f0 100644 --- a/source/menu/sortMenu.cpp +++ b/source/menu/sortMenu.cpp @@ -29,6 +29,7 @@ #include "storeUtils.hpp" #include "structs.hpp" +extern bool exiting, QueueRuns; extern bool touching(touchPosition touch, Structs::ButtonPos button); static const std::vector buttons = { @@ -158,4 +159,8 @@ void StoreUtils::SortHandle(bool &asc, SortType &st) { } } } + + /* Quit UU. */ + if (hDown & KEY_START && !QueueRuns) + exiting = true; } \ No newline at end of file