Exit UU with START, switch START actions to SELECT

This commit is contained in:
Pk11
2022-02-21 03:16:14 -06:00
committed by Dark98
parent 6c16faeca7
commit c91372f66b
8 changed files with 34 additions and 8 deletions
+2 -3
View File
@@ -195,9 +195,8 @@ Result Init::MainLoop() {
C3D_FrameEnd(0); C3D_FrameEnd(0);
if (!exiting) Gui::ScreenLogic(hDown, hHeld, touch, true, false); if (!exiting) Gui::ScreenLogic(hDown, hHeld, touch, true, false);
else {
if (exiting) { if (hidKeysDown() & KEY_START) fullExit = true; // Make it optionally faster.
if (hDown & KEY_START) fullExit = true; // Make it optionally faster.
if (fadeAlpha < 255) { if (fadeAlpha < 255) {
fadeAlpha += 4; fadeAlpha += 4;
+6 -2
View File
@@ -35,7 +35,7 @@
#define DOWNLOAD_ENTRIES 7 #define DOWNLOAD_ENTRIES 7
extern std::string _3dsxPath; extern std::string _3dsxPath;
extern bool is3DSX; extern bool exiting, is3DSX, QueueRuns;
extern bool touching(touchPosition touch, Structs::ButtonPos button); extern bool touching(touchPosition touch, Structs::ButtonPos button);
static const std::vector<Structs::ButtonPos> downloadBoxes = { static const std::vector<Structs::ButtonPos> downloadBoxes = {
{ 46, 32, 241, 22 }, { 46, 32, 241, 22 },
@@ -175,7 +175,7 @@ void StoreUtils::DownloadHandle(const std::unique_ptr<StoreEntry> &entry, const
smallDelay--; 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 (is3DSX) { // Only allow if 3DSX.
if (StoreUtils::entries.size() <= 0) return; // Smaller than 0 -> No No. if (StoreUtils::entries.size() <= 0) return; // Smaller than 0 -> No No.
@@ -248,6 +248,10 @@ void StoreUtils::DownloadHandle(const std::unique_ptr<StoreEntry> &entry, const
if (hDown & KEY_B) currentMenu = lastMode; // Go back to EntryInfo. if (hDown & KEY_B) currentMenu = lastMode; // Go back to EntryInfo.
/* Quit UU. */
if (hDown & KEY_START && !QueueRuns)
exiting = true;
/* Scroll Handle. */ /* Scroll Handle. */
if (StoreUtils::store->GetDownloadIndex() < StoreUtils::store->GetDownloadSIndex()) StoreUtils::store->SetDownloadSIndex(StoreUtils::store->GetDownloadIndex()); 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); else if (StoreUtils::store->GetDownloadIndex() > StoreUtils::store->GetDownloadSIndex() + DOWNLOAD_ENTRIES - 1) StoreUtils::store->SetDownloadSIndex(StoreUtils::store->GetDownloadIndex() - DOWNLOAD_ENTRIES + 1);
+6 -2
View File
@@ -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 sshot = { 75, 215, 24, 24 };
static const Structs::ButtonPos notes = { 105, 215, 24, 24 }; static const Structs::ButtonPos notes = { 105, 215, 24, 24 };
extern bool checkWifiStatus(); extern bool checkWifiStatus();
extern bool QueueRuns; extern bool exiting, QueueRuns;
/* /*
Draw the Entry Info part. Draw the Entry Info part.
@@ -78,7 +78,7 @@ void StoreUtils::DrawEntryInfo(const std::unique_ptr<StoreEntry> &entry) {
*/ */
void StoreUtils::EntryHandle(bool &showMark, bool &fetch, bool &sFetch, int &mode, const std::unique_ptr<StoreEntry> &entry) { void StoreUtils::EntryHandle(bool &showMark, bool &fetch, bool &sFetch, int &mode, const std::unique_ptr<StoreEntry> &entry) {
if (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 ((hDown & KEY_Y) || (hDown & KEY_TOUCH && touching(touch, sshot))) {
if (!entry->GetScreenshots().empty()) { if (!entry->GetScreenshots().empty()) {
@@ -100,4 +100,8 @@ void StoreUtils::EntryHandle(bool &showMark, bool &fetch, bool &sFetch, int &mod
if (entry->GetReleaseNotes() != "") mode = 7; if (entry->GetReleaseNotes() != "") mode = 7;
} }
} }
/* Quit UU. */
if (hDown & KEY_START && !QueueRuns)
exiting = true;
} }
+1 -1
View File
@@ -124,5 +124,5 @@ void StoreUtils::MarkHandle(std::unique_ptr<StoreEntry> &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.
} }
+5
View File
@@ -36,6 +36,7 @@ extern u32 extractSize, writeOffset;
extern u32 installSize, installOffset; extern u32 installSize, installOffset;
extern u32 copyOffset, copySize; extern u32 copyOffset, copySize;
extern int filesExtracted, extractFilesCount; extern int filesExtracted, extractFilesCount;
extern bool exiting, QueueRuns;
extern curl_off_t downloadTotal; extern curl_off_t downloadTotal;
extern curl_off_t downloadNow; 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. if (hDown & KEY_B) storeMode = 0; // Go to EntryInfo.
/* Quit UU. */
if (hDown & KEY_START && !QueueRuns)
exiting = true;
} }
+5
View File
@@ -29,6 +29,7 @@
#include "storeUtils.hpp" #include "storeUtils.hpp"
#include "structs.hpp" #include "structs.hpp"
extern bool exiting, QueueRuns;
extern bool touching(touchPosition touch, Structs::ButtonPos button); extern bool touching(touchPosition touch, Structs::ButtonPos button);
static const std::vector<Structs::ButtonPos> SearchMenu = { static const std::vector<Structs::ButtonPos> SearchMenu = {
{ 51, 41, 262, 30 }, // Search bar. { 51, 41, 262, 30 }, // Search bar.
@@ -232,4 +233,8 @@ void StoreUtils::SearchHandle(std::vector<bool> &searchIncludes, std::string &se
StoreUtils::SortEntries(ascending, sorttype); StoreUtils::SortEntries(ascending, sorttype);
} }
} }
/* Quit UU. */
if (hDown & KEY_START && !QueueRuns)
exiting = true;
} }
+4
View File
@@ -316,6 +316,10 @@ static void SettingsHandleMain(int &page, bool &dspSettings, int &storeMode, int
break; break;
} }
} }
/* Quit UU. */
if (hDown & KEY_START && !QueueRuns)
exiting = true;
} }
/* /*
+5
View File
@@ -29,6 +29,7 @@
#include "storeUtils.hpp" #include "storeUtils.hpp"
#include "structs.hpp" #include "structs.hpp"
extern bool exiting, QueueRuns;
extern bool touching(touchPosition touch, Structs::ButtonPos button); extern bool touching(touchPosition touch, Structs::ButtonPos button);
static const std::vector<Structs::ButtonPos> buttons = { static const std::vector<Structs::ButtonPos> buttons = {
@@ -158,4 +159,8 @@ void StoreUtils::SortHandle(bool &asc, SortType &st) {
} }
} }
} }
/* Quit UU. */
if (hDown & KEY_START && !QueueRuns)
exiting = true;
} }