Skip to content

Commit

Permalink
Reimplementation of my recent sort fixes to solve further issues (#2456)
Browse files Browse the repository at this point in the history
* Revert "Fix recent sort... again (#2448)"

This reverts commit bab4f76.

* Revert "DSi-Based themes: Fix launching app with wrong info when sorting by recent (#2433)"

This reverts commit d38e825.

* Reimplement recent sort cursor fix
  • Loading branch information
mentusfentus authored Aug 17, 2024
1 parent f021aa9 commit d9fec73
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 68 deletions.
3 changes: 1 addition & 2 deletions romsel_aktheme/arm9/source/fileBrowse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1940,8 +1940,7 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {

if (ms().sortMethod == TWLSettings::ESortRecent) {
// Set cursor pos to the first slot that isn't a directory so it won't be misplaced with recent sort
CURPOS = fileStartPos % 40;
PAGENUM = fileStartPos / 40;
ms().saveCursorPosition[ms().secondaryDevice] = fileStartPos;
}

displayDiskIcon(false);
Expand Down
6 changes: 1 addition & 5 deletions romsel_dsimenutheme/arm9/source/fileBrowse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ int last_used_box = 0;
static int fileStartPos = 0; // The position of the first thing that is not a directory.

extern int spawnedtitleboxes;
extern int cursorPosOnScreen;

extern int titleboxXpos[2];
extern int titleboxXdest[2];
Expand Down Expand Up @@ -1381,7 +1380,6 @@ void switchDevice(void) {
}

if (directMethod) {
cursorPosOnScreen = CURPOS;
SetWidescreen(NULL);
chdir(sys().isRunFromSD() ? "sd:/" : "fat:/");
int err = runNdsFile("/_nds/TWiLightMenu/slot1launch.srldr", 0, NULL, true, true, false, true, true, false, -1);
Expand Down Expand Up @@ -3898,7 +3896,6 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
snd().playLaunch();
controlTopBright = true;
applaunch = true;
cursorPosOnScreen = CURPOS;

if (ms().theme == TWLSettings::EThemeDSi) {
applaunchprep = true;
Expand Down Expand Up @@ -3977,8 +3974,7 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {

if (ms().sortMethod == TWLSettings::ESortRecent) {
// Set cursor pos to the first slot that isn't a directory so it won't be misplaced with recent sort
CURPOS = fileStartPos % 40;
PAGENUM = fileStartPos / 40;
ms().saveCursorPosition[ms().secondaryDevice] = fileStartPos;
}

if (ms().theme == TWLSettings::EThemeHBL) {
Expand Down
Loading

0 comments on commit d9fec73

Please sign in to comment.