forked from jaildesigner-jailgames/jaildoctors_dilemma
- Modificada la carpeta de guardar datos al estandar de jailgames
This commit is contained in:
@@ -29,7 +29,12 @@ Director::Director(int argc, char *argv[])
|
|||||||
checkProgramArguments(argc, argv);
|
checkProgramArguments(argc, argv);
|
||||||
|
|
||||||
// Crea la carpeta del sistema donde guardar datos
|
// Crea la carpeta del sistema donde guardar datos
|
||||||
createSystemFolder();
|
createSystemFolder("jailgames");
|
||||||
|
#ifndef DEBUG
|
||||||
|
createSystemFolder("jailgames/jaildoctors_dilemma");
|
||||||
|
#else
|
||||||
|
createSystemFolder("jailgames/jaildoctors_dilemma_debug");
|
||||||
|
#endif
|
||||||
|
|
||||||
// Crea el objeto que controla los ficheros de recursos
|
// Crea el objeto que controla los ficheros de recursos
|
||||||
asset = new Asset(executablePath);
|
asset = new Asset(executablePath);
|
||||||
@@ -410,24 +415,18 @@ bool Director::saveConfig()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Crea la carpeta del sistema donde guardar datos
|
// Crea la carpeta del sistema donde guardar datos
|
||||||
void Director::createSystemFolder()
|
void Director::createSystemFolder(std::string folder)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
|
||||||
const std::string folderName = "jaildoctors_dilemma_debug";
|
|
||||||
#else
|
|
||||||
const std::string folderName = "jaildoctors_dilemma";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
systemFolder = std::string(getenv("APPDATA")) + "/" + folderName;
|
systemFolder = std::string(getenv("APPDATA")) + "/" + folder;
|
||||||
#elif __APPLE__
|
#elif __APPLE__
|
||||||
struct passwd *pw = getpwuid(getuid());
|
struct passwd *pw = getpwuid(getuid());
|
||||||
const char *homedir = pw->pw_dir;
|
const char *homedir = pw->pw_dir;
|
||||||
systemFolder = std::string(homedir) + "/Library/Application Support/" + folderName;
|
systemFolder = std::string(homedir) + "/Library/Application Support" + "/" + folder;
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
struct passwd *pw = getpwuid(getuid());
|
struct passwd *pw = getpwuid(getuid());
|
||||||
const char *homedir = pw->pw_dir;
|
const char *homedir = pw->pw_dir;
|
||||||
systemFolder = std::string(homedir) + "/." + folderName;
|
systemFolder = std::string(homedir) + "/." + folder;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct stat st = {0};
|
struct stat st = {0};
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ private:
|
|||||||
bool saveConfig();
|
bool saveConfig();
|
||||||
|
|
||||||
// Crea la carpeta del sistema donde guardar datos
|
// Crea la carpeta del sistema donde guardar datos
|
||||||
void createSystemFolder();
|
void createSystemFolder(std::string folder);
|
||||||
|
|
||||||
// Carga los recursos
|
// Carga los recursos
|
||||||
void loadResources(section_t *section);
|
void loadResources(section_t *section);
|
||||||
|
|||||||
Reference in New Issue
Block a user