Skip to content

Commit

Permalink
Implement vertical wrap around in file list.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiralCurtiss committed Sep 20, 2014
1 parent eb8b6a3 commit 0aa9814
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arm9/source/fileselect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,23 @@ void fileSelect(const char *startdir, char *out_dir, char *out_fname, netbuf *bu
if (sel_file >= first_file + size_list - 1)
first_file = sel_file - (size_list - 1);
filePrintFileList(startdir, first_file, sel_file, num_files, allow_cancel);
} else {
// wrap around to top of list
sel_file = 0;
first_file = 0;
filePrintFileList(startdir, first_file, sel_file, num_files, allow_cancel);
}
} else if (keys & KEY_UP) {
if (sel_file > 0) {
sel_file--;
if (sel_file < first_file)
first_file = sel_file;
filePrintFileList(startdir, first_file, sel_file, num_files, allow_cancel);
} else {
// wrap around to bottom of list
sel_file = num_files - 1;
first_file = sel_file - (size_list - 1);
filePrintFileList(startdir, first_file, sel_file, num_files, allow_cancel);
}
} else if (keys & KEY_A) {
// get selected file name
Expand Down

0 comments on commit 0aa9814

Please sign in to comment.