- added more fields for dev path support.. onlu ico files for linxu left to fix
This commit is contained in:
parent
86c6c6ee17
commit
fe808556bd
|
@ -1 +0,0 @@
|
||||||
../../data/glest_game/data
|
|
|
@ -1 +0,0 @@
|
||||||
../../source/g3d_viewer
|
|
|
@ -1,2 +1,3 @@
|
||||||
DataPath=$APPLICATIONPATH/../../data/glest_game/
|
DataPath=$APPLICATIONPATH/../../data/glest_game/
|
||||||
|
ServerListPath=$APPLICATIONPATH/../shared/
|
||||||
|
GlestKeysIniPath=$APPLICATIONPATH/../shared/
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../shared/glestkeys.ini
|
|
|
@ -1 +0,0 @@
|
||||||
../shared/servers.ini
|
|
|
@ -1,5 +1,5 @@
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
copy ..\shared\*.ini .\
|
rem copy ..\shared\*.ini .\
|
||||||
rem copy glest.ini ..\..\data\glest_game\
|
rem copy glest.ini ..\..\data\glest_game\
|
||||||
if not "%1" == "nopause" pause
|
if not "%1" == "nopause" pause
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
DataPath=$APPLICATIONPATH\..\..\data\glest_game\
|
DataPath=$APPLICATIONPATH\..\..\data\glest_game\
|
||||||
|
ServerListPath=$APPLICATIONPATH\..\shared\
|
||||||
|
GlestKeysIniPath=$APPLICATIONPATH\..\shared\
|
||||||
|
|
|
@ -152,7 +152,7 @@ bool Config::tryCustomPath(std::pair<ConfigType,ConfigType> &type, std::pair<str
|
||||||
return wasFound;
|
return wasFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
Config::Config(std::pair<ConfigType,ConfigType> type, std::pair<string,string> file, std::pair<bool,bool> fileMustExist) {
|
Config::Config(std::pair<ConfigType,ConfigType> type, std::pair<string,string> file, std::pair<bool,bool> fileMustExist,string custom_path) {
|
||||||
fileLoaded.first = false;
|
fileLoaded.first = false;
|
||||||
fileLoaded.second = false;
|
fileLoaded.second = false;
|
||||||
cfgType = type;
|
cfgType = type;
|
||||||
|
@ -164,8 +164,17 @@ Config::Config(std::pair<ConfigType,ConfigType> type, std::pair<string,string> f
|
||||||
fileName.second = getGameReadWritePath(GameConstants::path_ini_CacheLookupKey) + fileName.second;
|
fileName.second = getGameReadWritePath(GameConstants::path_ini_CacheLookupKey) + fileName.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
string currentpath = extractDirectoryPathFromFile(Properties::getApplicationPath());
|
bool foundPath = false;
|
||||||
bool foundPath = tryCustomPath(cfgType, fileName, currentpath);
|
string currentpath = custom_path;
|
||||||
|
|
||||||
|
if(custom_path != "") {
|
||||||
|
foundPath = tryCustomPath(cfgType, fileName, custom_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(foundPath == false) {
|
||||||
|
currentpath = extractDirectoryPathFromFile(Properties::getApplicationPath());
|
||||||
|
foundPath = tryCustomPath(cfgType, fileName, currentpath);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(CUSTOM_DATA_INSTALL_PATH)
|
#if defined(CUSTOM_DATA_INSTALL_PATH)
|
||||||
if(foundPath == false) {
|
if(foundPath == false) {
|
||||||
|
@ -291,11 +300,11 @@ Config::Config(std::pair<ConfigType,ConfigType> type, std::pair<string,string> f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Config &Config::getInstance(std::pair<ConfigType,ConfigType> type, std::pair<string,string> file, std::pair<bool,bool> fileMustExist) {
|
Config &Config::getInstance(std::pair<ConfigType,ConfigType> type, std::pair<string,string> file, std::pair<bool,bool> fileMustExist, string custom_path) {
|
||||||
if(configList.find(type.first) == configList.end()) {
|
if(configList.find(type.first) == configList.end()) {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
Config config(type, file, fileMustExist);
|
Config config(type, file, fileMustExist, custom_path);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Config();
|
Config();
|
||||||
Config(std::pair<ConfigType,ConfigType> type, std::pair<string,string> file, std::pair<bool,bool> fileMustExist);
|
Config(std::pair<ConfigType,ConfigType> type, std::pair<string,string> file, std::pair<bool,bool> fileMustExist,string custom_path="");
|
||||||
bool tryCustomPath(std::pair<ConfigType,ConfigType> &type, std::pair<string,string> &file, string custom_path);
|
bool tryCustomPath(std::pair<ConfigType,ConfigType> &type, std::pair<string,string> &file, string custom_path);
|
||||||
static void CopyAll(Config *src,Config *dest);
|
static void CopyAll(Config *src,Config *dest);
|
||||||
vector<pair<string,string> > getPropertiesFromContainer(const Properties &propertiesObj) const;
|
vector<pair<string,string> > getPropertiesFromContainer(const Properties &propertiesObj) const;
|
||||||
|
@ -83,7 +83,7 @@ public:
|
||||||
|
|
||||||
static Config &getInstance(std::pair<ConfigType,ConfigType> type = std::make_pair(cfgMainGame,cfgUserGame) ,
|
static Config &getInstance(std::pair<ConfigType,ConfigType> type = std::make_pair(cfgMainGame,cfgUserGame) ,
|
||||||
std::pair<string,string> file = std::make_pair(glest_ini_filename,glestuser_ini_filename) ,
|
std::pair<string,string> file = std::make_pair(glest_ini_filename,glestuser_ini_filename) ,
|
||||||
std::pair<bool,bool> fileMustExist = std::make_pair(true,false) );
|
std::pair<bool,bool> fileMustExist = std::make_pair(true,false),string custom_path="" );
|
||||||
void save(const string &path="");
|
void save(const string &path="");
|
||||||
void reload();
|
void reload();
|
||||||
|
|
||||||
|
|
|
@ -1304,6 +1304,30 @@ int setupGameItemPaths(int argc, char** argv, Config *config) {
|
||||||
string devPropertyFile = Properties::getApplicationPath() + "glest-dev.ini";
|
string devPropertyFile = Properties::getApplicationPath() + "glest-dev.ini";
|
||||||
if(fileExists(devPropertyFile) == true) {
|
if(fileExists(devPropertyFile) == true) {
|
||||||
devProperties.load(devPropertyFile);
|
devProperties.load(devPropertyFile);
|
||||||
|
|
||||||
|
if(devProperties.hasString("ServerListPath") == true) {
|
||||||
|
string devItem = devProperties.getString("ServerListPath");
|
||||||
|
Properties::applyTagsToValue(devItem);
|
||||||
|
if(devItem != "") {
|
||||||
|
endPathWithSlash(devItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(config != NULL) {
|
||||||
|
config->setString("ServerListPath",devItem,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(devProperties.hasString("GlestKeysIniPath") == true) {
|
||||||
|
string devItem = devProperties.getString("GlestKeysIniPath");
|
||||||
|
Properties::applyTagsToValue(devItem);
|
||||||
|
if(devItem != "") {
|
||||||
|
endPathWithSlash(devItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(config != NULL) {
|
||||||
|
config->setString("GlestKeysIniPath",devItem,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//GAME_ARG_DATA_PATH
|
//GAME_ARG_DATA_PATH
|
||||||
|
@ -4695,7 +4719,7 @@ int glestMain(int argc, char** argv) {
|
||||||
Config &configKeys = Config::getInstance(
|
Config &configKeys = Config::getInstance(
|
||||||
std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys),
|
std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys),
|
||||||
std::pair<string,string>(Config::glestkeys_ini_filename,Config::glestuserkeys_ini_filename),
|
std::pair<string,string>(Config::glestkeys_ini_filename,Config::glestuserkeys_ini_filename),
|
||||||
std::pair<bool,bool>(true,false));
|
std::pair<bool,bool>(true,false),config.getString("GlestKeysIniPath",""));
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,13 @@ void MenuStateJoinGame::CommonInit(bool connect, Ip serverIp,int portNumberOverr
|
||||||
networkManager.init(nrClient);
|
networkManager.init(nrClient);
|
||||||
|
|
||||||
serversSavedFile = serverFileName;
|
serversSavedFile = serverFileName;
|
||||||
string userData = config.getString("UserData_Root","");
|
|
||||||
|
string serverListPath = config.getString("ServerListPath","");
|
||||||
|
if(serverListPath != "") {
|
||||||
|
endPathWithSlash(serverListPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
string userData = config.getString("UserData_Root","");
|
||||||
if(userData != "") {
|
if(userData != "") {
|
||||||
endPathWithSlash(userData);
|
endPathWithSlash(userData);
|
||||||
}
|
}
|
||||||
|
@ -86,6 +92,15 @@ void MenuStateJoinGame::CommonInit(bool connect, Ip serverIp,int portNumberOverr
|
||||||
if(fileExists(serversSavedFile) == true) {
|
if(fileExists(serversSavedFile) == true) {
|
||||||
servers.load(serversSavedFile);
|
servers.load(serversSavedFile);
|
||||||
}
|
}
|
||||||
|
else if(fileExists(serverListPath + serverFileName) == true) {
|
||||||
|
servers.load(serverListPath + serverFileName);
|
||||||
|
}
|
||||||
|
else if(fileExists(Properties::getApplicationPath() + serverFileName) == true) {
|
||||||
|
servers.load(Properties::getApplicationPath() + serverFileName);
|
||||||
|
}
|
||||||
|
else if(fileExists(serverFileName) == true) {
|
||||||
|
servers.load(serverFileName);
|
||||||
|
}
|
||||||
|
|
||||||
//buttons
|
//buttons
|
||||||
buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
|
buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
|
||||||
|
|
Loading…
Reference in New Issue