[script] Make equivalent to tsV1

Fixed: functions in functions
Added functions: version, menu, pathCombine, pathEscFolder, fileMove, fileCopy, fileDel, mmcConnect, mmcMount, mkdir, dirRead, dirCopy, dirDel, mmcDump, mmcRestore
This commit is contained in:
suchmememanyskill
2021-01-04 01:55:58 +01:00
parent e1491da4ad
commit c9fdb650c3
8 changed files with 182 additions and 9 deletions

View File

@@ -89,6 +89,15 @@ void BoxRestOfScreen(){
}
ErrCode_t FolderCopy(const char *locin, const char *locout){
if (TConf.explorerCopyMode >= CMODE_CopyFolder){
if (strstr(locout, locin) != NULL)
return newErrCode(TE_ERR_PATH_IN_PATH);
}
if (!strcmp(locin, locout)){
return newErrCode(TE_ERR_SAME_LOC);
}
char *dstPath = CombinePaths(locout, strrchr(locin, '/') + 1);
int res = 0;
ErrCode_t ret = newErrCode(0);

View File

@@ -15,6 +15,7 @@
#include "../../script/parser.h"
#include "../../script/variables.h"
#include <storage/nx_sd.h>
#include "../../storage/emummc.h"
MenuEntry_t FileMenuEntries[] = {
{.optionUnion = COLORTORGB(COLOR_WHITE) | SKIPBIT, .name = "-- File menu --"},
@@ -83,6 +84,7 @@ void RunScript(char *path, FSEntry_t entry){
free(script);
dictVectorAdd(&ctx.varDict, newDict(CpyStr("_CWD"), (newVar(StringType, 0, .stringType = path))));
dictVectorAdd(&ctx.varDict, newDict(CpyStr("_EMU"), (newVar(IntType, 0, emu_cfg.enabled))));
printError(mainLoop(&ctx));