mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-14 10:12:59 +02:00
Get and translate messages on client side
This commit is contained in:
parent
8a42127210
commit
edf43f5702
@ -517,7 +517,7 @@
|
||||
"core.seerhut.quest.reachDate.visit.4" : "Closed till %s.",
|
||||
"core.seerhut.quest.reachDate.visit.5" : "Closed till %s.",
|
||||
|
||||
"mapObject.core.hillFort.object.description" : "Upgrades creatures. Levels 1 - 4 are less expensive than in associated town",
|
||||
"mapObject.core.hillFort.object.description" : "Upgrades creatures. Levels 1 - 4 are less expensive than in associated town.",
|
||||
|
||||
"core.bonus.ADDITIONAL_ATTACK.name": "Double Strike",
|
||||
"core.bonus.ADDITIONAL_ATTACK.description": "Attacks twice",
|
||||
|
@ -513,7 +513,9 @@
|
||||
"core.seerhut.quest.reachDate.visit.3" : "Zamknięte do %s.",
|
||||
"core.seerhut.quest.reachDate.visit.4" : "Zamknięte do %s.",
|
||||
"core.seerhut.quest.reachDate.visit.5" : "Zamknięte do %s.",
|
||||
"mapObject.core.hillFort.object.description" : "Ulepsza jednostki. Koszt ulepszenia dla poziomów 1 - 4 jest bardziej korzystny niż w mieście",
|
||||
|
||||
"mapObject.core.hillFort.object.description" : "Ulepsza jednostki. Koszt ulepszenia dla poziomów 1 - 4 jest bardziej korzystny niż w mieście.",
|
||||
|
||||
"core.bonus.ADDITIONAL_ATTACK.name": "Podwójne Uderzenie",
|
||||
"core.bonus.ADDITIONAL_ATTACK.description": "Atakuje dwa razy",
|
||||
"core.bonus.ADDITIONAL_RETALIATION.name": "Dodatkowy odwet",
|
||||
|
@ -1130,7 +1130,7 @@ CHillFortWindow::CHillFortWindow(const CGHeroInstance * visitor, const CGObjectI
|
||||
|
||||
garr = std::make_shared<CGarrisonInt>(Point(108, 60), 18, Point(), hero, nullptr);
|
||||
|
||||
statusbar->write(dynamic_cast<const HillFort *>(fort)->getDescriptionToolTip());
|
||||
statusbar->write(VLC->generaltexth->translate(dynamic_cast<const HillFort *>(fort)->getDescriptionToolTip()));
|
||||
|
||||
updateGarrisons();
|
||||
}
|
||||
@ -1270,9 +1270,11 @@ void CHillFortWindow::makeDeal(SlotID slot)
|
||||
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[314 + offset], std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
|
||||
break;
|
||||
case State::UNAVAILABLE:
|
||||
LOCPLINT->showInfoDialog(dynamic_cast<const HillFort*>(fort)->getUnavailableUpgradeMessage(),
|
||||
std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
|
||||
{
|
||||
std::string message = VLC->generaltexth->translate(dynamic_cast<const HillFort *>(fort)->getUnavailableUpgradeMessage());
|
||||
LOCPLINT->showInfoDialog(message, std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
|
||||
break;
|
||||
}
|
||||
case State::MAKE_UPGRADE:
|
||||
for(int i = 0; i < slotsCount; i++)
|
||||
{
|
||||
|
@ -25,13 +25,6 @@ void HillFortInstanceConstructor::initTypeData(const JsonNode & config)
|
||||
void HillFortInstanceConstructor::initializeObject(HillFort * fort) const
|
||||
{
|
||||
fort->upgradeCostPercentage = parameters["upgradeCostFactor"].convertTo<std::vector<int>>();
|
||||
fort->descriptionToolTip = VLC->generaltexth->translate(TextIdentifier(getBaseTextID(), "description").get());
|
||||
if (fort->descriptionToolTip.empty())
|
||||
fort->descriptionToolTip = parameters["description"].String();
|
||||
|
||||
fort->unavailableUpgradeMessage = VLC->generaltexth->translate(TextIdentifier(getBaseTextID(), "unavailableUpgradeMessage").get());
|
||||
if (fort->unavailableUpgradeMessage.empty())
|
||||
fort->unavailableUpgradeMessage = parameters["unavailableUpgradeMessage"].String();
|
||||
}
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
@ -1403,4 +1403,14 @@ void HillFort::fillUpgradeInfo(UpgradeInfo & info, const CStackInstance &stack)
|
||||
}
|
||||
}
|
||||
|
||||
std::string HillFort::getDescriptionToolTip() const
|
||||
{
|
||||
return TextIdentifier(getObjectHandler()->getBaseTextID(), "description").get();
|
||||
}
|
||||
|
||||
std::string HillFort::getUnavailableUpgradeMessage() const
|
||||
{
|
||||
return TextIdentifier(getObjectHandler()->getBaseTextID(), "unavailableUpgradeMessage").get();
|
||||
}
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
@ -451,8 +451,6 @@ class DLL_LINKAGE HillFort : public CGObjectInstance, public ICreatureUpgrader
|
||||
friend class HillFortInstanceConstructor;
|
||||
|
||||
std::vector<int> upgradeCostPercentage;
|
||||
std::string descriptionToolTip;
|
||||
std::string unavailableUpgradeMessage;
|
||||
|
||||
protected:
|
||||
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||
@ -461,22 +459,13 @@ protected:
|
||||
public:
|
||||
using CGObjectInstance::CGObjectInstance;
|
||||
|
||||
const std::string & getDescriptionToolTip() const
|
||||
{
|
||||
return descriptionToolTip;
|
||||
}
|
||||
|
||||
const std::string & getUnavailableUpgradeMessage() const
|
||||
{
|
||||
return unavailableUpgradeMessage;
|
||||
}
|
||||
std::string getDescriptionToolTip() const;
|
||||
std::string getUnavailableUpgradeMessage() const;
|
||||
|
||||
template <typename Handler> void serialize(Handler &h)
|
||||
{
|
||||
h & static_cast<CGObjectInstance&>(*this);
|
||||
h & upgradeCostPercentage;
|
||||
h & descriptionToolTip;
|
||||
h & unavailableUpgradeMessage;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user