- fixup use of --data-path param
This commit is contained in:
parent
2b9326197a
commit
85319b30fc
|
@ -1337,6 +1337,8 @@ int setupGameItemPaths(int argc, char** argv, Config *config) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Properties::setApplicationDataPath(pathCache[GameConstants::path_data_CacheLookupKey]);
|
||||||
|
|
||||||
//GAME_ARG_INI_PATH
|
//GAME_ARG_INI_PATH
|
||||||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_INI_PATH]) == true) {
|
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_INI_PATH]) == true) {
|
||||||
int foundParamIndIndex = -1;
|
int foundParamIndIndex = -1;
|
||||||
|
@ -3977,6 +3979,7 @@ int glestMain(int argc, char** argv) {
|
||||||
preCacheThread=NULL;
|
preCacheThread=NULL;
|
||||||
|
|
||||||
Properties::setApplicationPath(executable_path(argv[0]));
|
Properties::setApplicationPath(executable_path(argv[0]));
|
||||||
|
Properties::setApplicationDataPath(executable_path(argv[0]));
|
||||||
Properties::setGameVersion(glestVersionString);
|
Properties::setGameVersion(glestVersionString);
|
||||||
|
|
||||||
ServerSocket::setMaxPlayerCount(GameConstants::maxPlayers);
|
ServerSocket::setMaxPlayerCount(GameConstants::maxPlayers);
|
||||||
|
|
|
@ -47,6 +47,7 @@ private:
|
||||||
|
|
||||||
string path;
|
string path;
|
||||||
static string applicationPath;
|
static string applicationPath;
|
||||||
|
static string applicationDataPath;
|
||||||
static string gameVersion;
|
static string gameVersion;
|
||||||
|
|
||||||
static string techtreePath;
|
static string techtreePath;
|
||||||
|
@ -57,6 +58,9 @@ public:
|
||||||
static void setApplicationPath(string value) { applicationPath=value; }
|
static void setApplicationPath(string value) { applicationPath=value; }
|
||||||
static string getApplicationPath() { return applicationPath; }
|
static string getApplicationPath() { return applicationPath; }
|
||||||
|
|
||||||
|
static void setApplicationDataPath(string value) { applicationDataPath=value; }
|
||||||
|
static string getApplicationDataPath() { return applicationDataPath; }
|
||||||
|
|
||||||
static void setGameVersion(string value) { gameVersion=value; }
|
static void setGameVersion(string value) { gameVersion=value; }
|
||||||
static string getGameVersion() { return gameVersion; }
|
static string getGameVersion() { return gameVersion; }
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ using namespace Shared::Graphics;
|
||||||
namespace Shared{ namespace Util{
|
namespace Shared{ namespace Util{
|
||||||
|
|
||||||
string Properties::applicationPath = "";
|
string Properties::applicationPath = "";
|
||||||
|
string Properties::applicationDataPath = "";
|
||||||
string Properties::gameVersion = "";
|
string Properties::gameVersion = "";
|
||||||
|
|
||||||
string Properties::techtreePath = "";
|
string Properties::techtreePath = "";
|
||||||
|
@ -234,9 +235,9 @@ std::map<string,string> Properties::getTagReplacementValues(std::map<string,stri
|
||||||
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH));
|
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH));
|
||||||
|
|
||||||
#else
|
#else
|
||||||
mapTagReplacementValues["$APPLICATIONDATAPATH"] = Properties::applicationPath;
|
mapTagReplacementValues["$APPLICATIONDATAPATH"] = Properties::applicationDataPath;
|
||||||
mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = Properties::applicationPath;
|
mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = Properties::applicationDataPath;
|
||||||
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = Properties::applicationPath;
|
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = Properties::applicationDataPath;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -336,9 +337,9 @@ bool Properties::applyTagsToValue(string &value, const std::map<string,string> *
|
||||||
replaceAll(value, "{APPLICATIONDATAPATH}", formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));
|
replaceAll(value, "{APPLICATIONDATAPATH}", formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));
|
||||||
|
|
||||||
#else
|
#else
|
||||||
replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationPath);
|
replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationDataPath);
|
||||||
replaceAll(value, "%%APPLICATIONDATAPATH%%", Properties::applicationPath);
|
replaceAll(value, "%%APPLICATIONDATAPATH%%", Properties::applicationDataPath);
|
||||||
replaceAll(value, "{APPLICATIONDATAPATH}", Properties::applicationPath);
|
replaceAll(value, "{APPLICATIONDATAPATH}", Properties::applicationDataPath);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue