Add errors
and prepare for file menu more and fix that you can't go left right when going up down
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "../../gfx/gfx.h"
|
||||
#include "../../gfx/gfxutils.h"
|
||||
#include "../../utils/utils.h"
|
||||
#include "filemenu.h"
|
||||
#include <string.h>
|
||||
#include <mem/heap.h>
|
||||
|
||||
@@ -55,6 +56,10 @@ void FileExplorer(char *path){
|
||||
|
||||
gfx_con_setpos(144, 16);
|
||||
gfx_boxGrey(0, 16, 160, 31, 0x1B);
|
||||
|
||||
if (res >= fileVec.count + ARR_LEN(topEntries))
|
||||
res = 0;
|
||||
|
||||
res = newMenu(&entries, res, 60, 42, ENABLEB | ENABLEPAGECOUNT, (int)fileVec.count);
|
||||
|
||||
if (res < ARR_LEN(topEntries)) {
|
||||
@@ -66,14 +71,19 @@ void FileExplorer(char *path){
|
||||
char *copy = CpyStr(storedPath);
|
||||
storedPath = EscapeFolder(copy);
|
||||
free(copy);
|
||||
res = 0;
|
||||
}
|
||||
else if (fsEntries[res - ARR_LEN(topEntries)].isDir) {
|
||||
char *copy = CpyStr(storedPath);
|
||||
storedPath = CombinePaths(copy, fsEntries[res - ARR_LEN(topEntries)].name);
|
||||
free(copy);
|
||||
res = 0;
|
||||
}
|
||||
else {
|
||||
FileMenu(fsEntries[res - ARR_LEN(topEntries)]);
|
||||
}
|
||||
|
||||
res = 0;
|
||||
|
||||
clearFileVector(&fileVec);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "filemenu.h"
|
||||
#include "../../err.h"
|
||||
#include "../../gfx/menu.h"
|
||||
|
||||
MenuEntry_t FileMenuEntries[] = {
|
||||
// Still have to think up the options
|
||||
};
|
||||
|
||||
void FileMenu(FSEntry_t entry){
|
||||
DrawError(newErrCode(TE_ERR_UNIMPLEMENTED));
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
#include "../fstypes.h"
|
||||
|
||||
void FileMenu(FSEntry_t entry);
|
||||
Reference in New Issue
Block a user