diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index a9463015f..9f1b85140 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -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 = ""; diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index 9f2d56e6b..38644907c 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -157,6 +157,8 @@ public: const FactionType *factionType, Checksum* checksum, Checksum* techtreeChecksum, std::map > > &loadedFileList); + virtual string getName(bool translatedValue=false) const; + //get inline int getId() const {return id;} inline int getMaxHp() const {return maxHp;} diff --git a/source/glest_game/types/upgrade_type.cpp b/source/glest_game/types/upgrade_type.cpp index 7cfb51c78..321173a97 100644 --- a/source/glest_game/types/upgrade_type.cpp +++ b/source/glest_game/types/upgrade_type.cpp @@ -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(); diff --git a/source/glest_game/types/upgrade_type.h b/source/glest_game/types/upgrade_type.h index 592dc561e..d183a4813 100644 --- a/source/glest_game/types/upgrade_type.h +++ b/source/glest_game/types/upgrade_type.h @@ -81,6 +81,7 @@ protected: std::map 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 > > &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];}