The manager that handles all interactions with filesystem
Classes
Methods
-
static addFileToImgFolder(orgFilePath, destPath, name, name2, force, deleteOrg) → {bool}
-
Parameters:
Name Type Description orgFilePathstring the path to the file from www/
destPathstring the path within the img folder
namestring the name of the file
name2string the name of the destination file if different than normal name
forceboolean whether this should overwrite or not
deleteOrgboolean whether the original file should be deleted after coping
Returns:
bool -if there is already a file at the dest location
-
static checkExists(orgFilePath, destPath, name)
-
Parameters:
Name Type Description orgFilePath* the path to the file from www/
destPath* the path within the img folder
name* the name of the file
-
static createDir()
-
creates a modData folder if one does not exist
or if a parm is passes it will create a specfic dir inside of the moddata folder -
static extractAndReturnSaveContents(contents)
-
load a save as an object to acsess information from it but not load it
Parameters:
Name Type Description contentsJSON a parsed json of the save you are loading
Returns:
-an object of the save's game data
-
static getMapData(mapId) → {rm.types.map}
-
get the map data from a map id
Parameters:
Name Type Description mapId* Returns:
rm.types.map -the json object of the map requested
-
static loadAndReturnSave(index)
-
get full game data of a save as an object.
Parameters:
Name Type Description indexinteger the index of the save slot you want to load
Returns:
-full game data of that save
-
static loadFileXML(src, cb)
-
load a data file using an xml request, then call the callback provided with the data
Parameters:
Name Type Description src* the file name IE: System.json
cb* the callback
-
static localFileDirectoryPath()
-
Returns:
-the path of the modData folder
-
static localGamePath()
-
Returns:
-the path of the www/ folder
-
static makeSaveContentsFromParam(data)
-
turn an object of save data into the format used to save the game
Parameters:
Name Type Description dataObject save data for a game parsed as an object
-
static makeSavefileInfo()
-
make save file info from param
Returns:
-save file info