mirror of
https://github.com/glest/glest-source.git
synced 2025-08-23 00:12:49 +02:00
- translatable techtrees, currently supported resource names, unit names and upgrade names. For each techtree created a lang folder in the techtree main folder. Now create language specific files <techtree>_language.lng as we do for scenarios. In the file add:
ResourceTypeName_<name>=My new resource name UnitTypeName_<name>=<name>=my new unit name UpgradeTypeName_<name>=my new upgrade name
This commit is contained in:
@@ -982,6 +982,13 @@ string UnitType::getReqDesc() const{
|
||||
return ProducibleType::getReqDesc()+"\nLimits: "+resultTxt;
|
||||
}
|
||||
|
||||
string UnitType::getName(bool translatedValue) const {
|
||||
if(translatedValue == false) return name;
|
||||
|
||||
Lang &lang = Lang::getInstance();
|
||||
return lang.getTechTreeString("UnitTypeName_" + name,name.c_str());
|
||||
}
|
||||
|
||||
std::string UnitType::toString() const {
|
||||
std::string result = "";
|
||||
|
||||
|
@@ -157,6 +157,8 @@ public:
|
||||
const FactionType *factionType, Checksum* checksum,
|
||||
Checksum* techtreeChecksum, std::map<string,vector<pair<string, string> > > &loadedFileList);
|
||||
|
||||
virtual string getName(bool translatedValue=false) const;
|
||||
|
||||
//get
|
||||
inline int getId() const {return id;}
|
||||
inline int getMaxHp() const {return maxHp;}
|
||||
|
@@ -476,6 +476,13 @@ const UpgradeType * UpgradeTypeBase::loadGame(const XmlNode *rootNode, Faction *
|
||||
|
||||
// ==================== misc ====================
|
||||
|
||||
string UpgradeType::getName(bool translatedValue) const {
|
||||
if(translatedValue == false) return name;
|
||||
|
||||
Lang &lang = Lang::getInstance();
|
||||
return lang.getTechTreeString("UpgradeTypeName_" + name,name.c_str());
|
||||
}
|
||||
|
||||
string UpgradeType::getReqDesc() const{
|
||||
Lang &lang= Lang::getInstance();
|
||||
string str= ProducibleType::getReqDesc();
|
||||
|
@@ -81,6 +81,7 @@ protected:
|
||||
std::map<string,int> prodSpeedMorphIsMultiplierValueList;
|
||||
|
||||
public:
|
||||
|
||||
int getMaxHp() const {return maxHp;}
|
||||
bool getMaxHpIsMultiplier() const {return maxHpIsMultiplier;}
|
||||
int getMaxHpRegeneration() const {return maxHpRegeneration;}
|
||||
@@ -158,6 +159,8 @@ public:
|
||||
const FactionType *factionType, Checksum* checksum,
|
||||
Checksum* techtreeChecksum, std::map<string,vector<pair<string, string> > > &loadedFileList);
|
||||
|
||||
virtual string getName(bool translatedValue=false) const;
|
||||
|
||||
//get all
|
||||
int getEffectCount() const {return effects.size();}
|
||||
const UnitType * getEffect(int i) const {return effects[i];}
|
||||
|
Reference in New Issue
Block a user