mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 04:02:30 +01:00
- do not show errors on console for scenarios without a description
This commit is contained in:
parent
af100408ed
commit
7dae926cf2
@ -453,6 +453,20 @@ string Lang::getScenarioString(const string &s) {
|
||||
}
|
||||
}
|
||||
|
||||
bool Lang::hasScenarioString(const string &s) {
|
||||
bool result = false;
|
||||
try {
|
||||
scenarioStrings.getString(s);
|
||||
result = true;
|
||||
}
|
||||
catch(exception &ex) {
|
||||
if(scenarioStrings.getpath() != "") {
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
string Lang::getTechTreeString(const string &s,const char *defaultValue) {
|
||||
try{
|
||||
string result = "";
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
string get(const string &s,string uselanguage="", bool fallbackToDefault=false);
|
||||
bool hasString(const string &s, string uselanguage="", bool fallbackToDefault=false);
|
||||
string getScenarioString(const string &s);
|
||||
bool hasScenarioString(const string &s);
|
||||
string getTechTreeString(const string &s, const char *defaultValue=NULL);
|
||||
string getTilesetString(const string &s, const char *defaultValue=NULL);
|
||||
|
||||
|
@ -310,9 +310,13 @@ void Scenario::loadScenarioInfo(string file, ScenarioInfo *scenarioInfo) {
|
||||
|
||||
//look for description and append it
|
||||
lang.loadScenarioStrings(scenarioDir,scenarioName.c_str());
|
||||
string tmp_description = lang.getScenarioString("DESCRIPTION");
|
||||
if( tmp_description != "???DESCRIPTION???"){
|
||||
scenarioInfo->desc+= lang.get("Description") + ": \n" + tmp_description + "\n";
|
||||
//string tmp_description = lang.getScenarioString("DESCRIPTION");
|
||||
string tmp_description = "";
|
||||
if(lang.hasScenarioString("DESCRIPTION") == true) {
|
||||
tmp_description = lang.getScenarioString("DESCRIPTION");
|
||||
}
|
||||
if( tmp_description != "") {
|
||||
scenarioInfo->desc += lang.get("Description") + ": \n" + tmp_description + "\n";
|
||||
}
|
||||
|
||||
if(scenarioNode->hasChild("fog-of-war") == true) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user