From ca036cae0a80c3931d8ef43bba1bbc1627099bbe Mon Sep 17 00:00:00 2001 From: bernardogiordano Date: Wed, 4 Oct 2017 13:19:10 +0200 Subject: [PATCH] Held Y to select all the titles --- source/main.cpp | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/source/main.cpp b/source/main.cpp index c624b49..15bdebb 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -33,6 +33,7 @@ void createError(Result res, std::string message) int main() { servicesInit(); + int selectionTimer = 0; menu = new Gui(); createThread((ThreadFunc)threadLoadTitles); @@ -59,6 +60,7 @@ int main() { { menu->resetIndex(); setMode(getMode() == MODE_SAVE ? MODE_EXTDATA : MODE_SAVE); + clearSelectedEntries(); } if (hidKeysDown() & KEY_Y) @@ -66,6 +68,25 @@ int main() { addSelectedEntry(menu->getNormalizedIndex()); } + if (hidKeysHeld() & KEY_Y) + { + selectionTimer++; + } + else + { + selectionTimer = 0; + } + + if (selectionTimer > 90) + { + clearSelectedEntries(); + for (size_t i = 0, sz = getTitlesCount(); i < sz; i++) + { + addSelectedEntry(i); + } + selectionTimer = 0; + } + if (menu->isBackupReleased()) { if (multipleSelectionEnabled()) @@ -86,7 +107,14 @@ int main() { if (menu->isRestoreReleased()) { - restore(menu->getNormalizedIndex()); + if (multipleSelectionEnabled()) + { + clearSelectedEntries(); + } + else + { + restore(menu->getNormalizedIndex()); + } } menu->updateSelector();