Skip to content

Commit

Permalink
Wood theme: Only start game via touch if it's on the icon
Browse files Browse the repository at this point in the history
ALSO: Reset icon scale with other buttons
  • Loading branch information
RocketRobz committed May 10, 2024
1 parent 98c9841 commit 4bd12a1
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions romsel_aktheme/arm9/source/fileBrowse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1474,31 +1474,31 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
if (cursorPosOnScreen != 0) {
cursorPosOnScreen = 0;
fileOffset = screenOffset;
} else {
} else if (touch.px >= 2 && touch.px < 2+5+32) {
selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 2 && touch.py >= 19+38 && touch.py <= 19+37+38) {
if (cursorPosOnScreen != 1) {
cursorPosOnScreen = 1;
fileOffset = screenOffset+1;
} else {
} else if (touch.px >= 2 && touch.px < 2+5+32) {
selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 3 && touch.py >= 19+(38*2) && touch.py <= 19+37+(38*2)) {
if (cursorPosOnScreen != 2) {
cursorPosOnScreen = 2;
fileOffset = screenOffset+2;
} else {
} else if (touch.px >= 2 && touch.px < 2+5+32) {
selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 4 && touch.py >= 19+(38*3) && touch.py <= 19+37+(38*3)) {
if (cursorPosOnScreen != 3) {
cursorPosOnScreen = 3;
fileOffset = screenOffset+3;
} else {
} else if (touch.px >= 2 && touch.px < 2+5+32) {
selectionTouched = true;
}
resetIconScale();
Expand All @@ -1509,79 +1509,79 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
cursorPosOnScreen = 0;
fileOffset = screenOffset;
} else {
selectionTouched = true;
// selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 2 && touch.py >= 19+15 && touch.py <= 19+14+15) {
if (cursorPosOnScreen != 1) {
cursorPosOnScreen = 1;
fileOffset = screenOffset+1;
} else {
selectionTouched = true;
// selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 3 && touch.py >= 19+(15*2) && touch.py <= 19+14+(15*2)) {
if (cursorPosOnScreen != 2) {
cursorPosOnScreen = 2;
fileOffset = screenOffset+2;
} else {
selectionTouched = true;
// selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 4 && touch.py >= 19+(15*3) && touch.py <= 19+14+(15*3)) {
if (cursorPosOnScreen != 3) {
cursorPosOnScreen = 3;
fileOffset = screenOffset+3;
} else {
selectionTouched = true;
// selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 5 && touch.py >= 19+(15*4) && touch.py <= 19+14+(15*4)) {
if (cursorPosOnScreen != 4) {
cursorPosOnScreen = 4;
fileOffset = screenOffset+4;
} else {
selectionTouched = true;
// selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 6 && touch.py >= 19+(15*5) && touch.py <= 19+14+(15*5)) {
if (cursorPosOnScreen != 5) {
cursorPosOnScreen = 5;
fileOffset = screenOffset+5;
} else {
selectionTouched = true;
// selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 7 && touch.py >= 19+(15*6) && touch.py <= 19+14+(15*6)) {
if (cursorPosOnScreen != 6) {
cursorPosOnScreen = 6;
fileOffset = screenOffset+6;
} else {
selectionTouched = true;
// selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 8 && touch.py >= 19+(15*7) && touch.py <= 19+14+(15*7)) {
if (cursorPosOnScreen != 7) {
cursorPosOnScreen = 7;
fileOffset = screenOffset+7;
} else {
selectionTouched = true;
// selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 9 && touch.py >= 19+(15*8) && touch.py <= 19+14+(15*8)) {
if (cursorPosOnScreen != 8) {
cursorPosOnScreen = 8;
fileOffset = screenOffset+8;
} else {
selectionTouched = true;
// selectionTouched = true;
}
resetIconScale();
} else if (file_count >= 10 && touch.py >= 19+(15*9) && touch.py <= 19+14+(15*9)) {
if (cursorPosOnScreen != 9) {
cursorPosOnScreen = 9;
fileOffset = screenOffset+9;
} else {
selectionTouched = true;
// selectionTouched = true;
}
resetIconScale();
}
Expand Down Expand Up @@ -1650,6 +1650,7 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
listModeSwitched = false;

if ((pressed & KEY_A) || selectionTouched) {
resetIconScale();
DirEntry* entry = &dirContents.at(fileOffset);
if (entry->isDirectory) {
// Enter selected directory
Expand Down Expand Up @@ -1922,6 +1923,7 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
}

if ((pressed & KEY_R) && bothSDandFlashcard()) {
resetIconScale();
CURPOS = fileOffset;
PAGENUM = 0;
for (int i = 0; i < 100; i++) {
Expand Down Expand Up @@ -1950,6 +1952,7 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {

if (((pressed & KEY_L) || (pressed & KEY_B)
|| ((pressed & KEY_TOUCH) && touch.px >= folderUpX && touch.px < folderUpX+folderUpW && touch.py >= folderUpY && touch.py < folderUpY+folderUpH)) && ms().showDirectories) {
resetIconScale();
// Go up a directory
chdir ("..");
char buf[256];
Expand Down Expand Up @@ -2018,6 +2021,7 @@ std::string browseForFile(const std::vector<std::string_view> extensionList) {
displayDiskIcon(false);
}

resetIconScale();
CURPOS = fileOffset;
PAGENUM = 0;
for (int i = 0; i < 100; i++) {
Expand Down

0 comments on commit 4bd12a1

Please sign in to comment.