mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fixes based on review remarks
This commit is contained in:
@@ -283,9 +283,6 @@
|
|||||||
|
|
||||||
"vcmi.adventureMap.revisitObject.hover" : "Revisit Object",
|
"vcmi.adventureMap.revisitObject.hover" : "Revisit Object",
|
||||||
"vcmi.adventureMap.revisitObject.help" : "{Revisit Object}\n\nIf a hero currently stands on a Map Object, he can revisit the location.",
|
"vcmi.adventureMap.revisitObject.help" : "{Revisit Object}\n\nIf a hero currently stands on a Map Object, he can revisit the location.",
|
||||||
"vcmi.adventureMap.miniHillFort.notAvailableUpgrade.message" : "This building cannot upgrade creatures of level 5 and higher.",
|
|
||||||
"vcmi.adventureMap.miniHillFort.statusBar.info" : "Upgrade creatures levels 1 - 5 at double the normal price",
|
|
||||||
"vcmi.adventureMap.HillFort.statusBar.info" : "Upgrades creatures. Levels 1 - 4 are less expensive than in associated town",
|
|
||||||
|
|
||||||
"vcmi.battleWindow.pressKeyToSkipIntro" : "Press any key to start battle immediately",
|
"vcmi.battleWindow.pressKeyToSkipIntro" : "Press any key to start battle immediately",
|
||||||
"vcmi.battleWindow.damageEstimation.melee" : "Attack %CREATURE (%DAMAGE).",
|
"vcmi.battleWindow.damageEstimation.melee" : "Attack %CREATURE (%DAMAGE).",
|
||||||
@@ -520,6 +517,8 @@
|
|||||||
"core.seerhut.quest.reachDate.visit.4" : "Closed till %s.",
|
"core.seerhut.quest.reachDate.visit.4" : "Closed till %s.",
|
||||||
"core.seerhut.quest.reachDate.visit.5" : "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",
|
||||||
|
|
||||||
"core.bonus.ADDITIONAL_ATTACK.name": "Double Strike",
|
"core.bonus.ADDITIONAL_ATTACK.name": "Double Strike",
|
||||||
"core.bonus.ADDITIONAL_ATTACK.description": "Attacks twice",
|
"core.bonus.ADDITIONAL_ATTACK.description": "Attacks twice",
|
||||||
"core.bonus.ADDITIONAL_RETALIATION.name": "Additional retaliations",
|
"core.bonus.ADDITIONAL_RETALIATION.name": "Additional retaliations",
|
||||||
|
|||||||
@@ -280,9 +280,6 @@
|
|||||||
|
|
||||||
"vcmi.adventureMap.revisitObject.hover" : "Odwiedź obiekt ponownie",
|
"vcmi.adventureMap.revisitObject.hover" : "Odwiedź obiekt ponownie",
|
||||||
"vcmi.adventureMap.revisitObject.help" : "{Odwiedź obiekt ponownie}\n\nJeżeli bohater aktualnie stoi na polu odwiedzającym obiekt za pomocą tego przycisku może go odwiedzić ponownie.",
|
"vcmi.adventureMap.revisitObject.help" : "{Odwiedź obiekt ponownie}\n\nJeżeli bohater aktualnie stoi na polu odwiedzającym obiekt za pomocą tego przycisku może go odwiedzić ponownie.",
|
||||||
"vcmi.adventureMap.miniHillFort.notAvailableUpgrade.message" : "Ten budynek nie ma możliwości ulepszenia jednostek poziomu 5 i wyższych.",
|
|
||||||
"vcmi.adventureMap.miniHillFort.statusBar.info" : "Ulepsza jednostki poziomu 1 - 5 za podwójną cenę",
|
|
||||||
"vcmi.adventureMap.HillFort.statusBar.info" : "Ulepsza jednostki. Koszt ulepszenia dla poziomów 1 - 4 są bardziej korzystne niż w mieście",
|
|
||||||
|
|
||||||
"vcmi.battleWindow.pressKeyToSkipIntro" : "Naciśnij dowolny klawisz by rozpocząć bitwę natychmiastowo",
|
"vcmi.battleWindow.pressKeyToSkipIntro" : "Naciśnij dowolny klawisz by rozpocząć bitwę natychmiastowo",
|
||||||
"vcmi.battleWindow.damageEstimation.melee" : "Atakuj %CREATURE (%DAMAGE).",
|
"vcmi.battleWindow.damageEstimation.melee" : "Atakuj %CREATURE (%DAMAGE).",
|
||||||
@@ -516,7 +513,7 @@
|
|||||||
"core.seerhut.quest.reachDate.visit.3" : "Zamknięte do %s.",
|
"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.4" : "Zamknięte do %s.",
|
||||||
"core.seerhut.quest.reachDate.visit.5" : "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 są bardziej korzystne niż w mieście",
|
||||||
"core.bonus.ADDITIONAL_ATTACK.name": "Podwójne Uderzenie",
|
"core.bonus.ADDITIONAL_ATTACK.name": "Podwójne Uderzenie",
|
||||||
"core.bonus.ADDITIONAL_ATTACK.description": "Atakuje dwa razy",
|
"core.bonus.ADDITIONAL_ATTACK.description": "Atakuje dwa razy",
|
||||||
"core.bonus.ADDITIONAL_RETALIATION.name": "Dodatkowy odwet",
|
"core.bonus.ADDITIONAL_RETALIATION.name": "Dodatkowy odwet",
|
||||||
|
|||||||
@@ -1130,10 +1130,7 @@ CHillFortWindow::CHillFortWindow(const CGHeroInstance * visitor, const CGObjectI
|
|||||||
|
|
||||||
garr = std::make_shared<CGarrisonInt>(Point(108, 60), 18, Point(), hero, nullptr);
|
garr = std::make_shared<CGarrisonInt>(Point(108, 60), 18, Point(), hero, nullptr);
|
||||||
|
|
||||||
if(object->typeName == "miniHillFort")
|
statusbar->write(dynamic_cast<const HillFort *>(fort)->getDescriptionToolTip());
|
||||||
statusbar->write(VLC->generaltexth->translate("vcmi.adventureMap.miniHillFort.statusBar.info"));
|
|
||||||
else if(object->typeName == "hillFort")
|
|
||||||
statusbar->write(VLC->generaltexth->translate("vcmi.adventureMap.HillFort.statusBar.info"));
|
|
||||||
|
|
||||||
updateGarrisons();
|
updateGarrisons();
|
||||||
}
|
}
|
||||||
@@ -1273,7 +1270,7 @@ void CHillFortWindow::makeDeal(SlotID slot)
|
|||||||
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[314 + offset], std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
|
LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[314 + offset], std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
|
||||||
break;
|
break;
|
||||||
case State::UNAVAILABLE:
|
case State::UNAVAILABLE:
|
||||||
LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.miniHillFort.notAvailableUpgrade.message"),
|
LOCPLINT->showInfoDialog(dynamic_cast<const HillFort*>(fort)->getUnavailableUpgradeMessage(),
|
||||||
std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
|
std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
|
||||||
break;
|
break;
|
||||||
case State::MAKE_UPGRADE:
|
case State::MAKE_UPGRADE:
|
||||||
@@ -1314,10 +1311,10 @@ CHillFortWindow::State CHillFortWindow::getState(SlotID slot)
|
|||||||
|
|
||||||
UpgradeInfo info;
|
UpgradeInfo info;
|
||||||
LOCPLINT->cb->fillUpgradeInfo(hero, slot, info);
|
LOCPLINT->cb->fillUpgradeInfo(hero, slot, info);
|
||||||
if (!info.newID.size())
|
if (info.newID.empty())
|
||||||
{
|
{
|
||||||
// new Hill Fort allows upgrades level 5 and below
|
// Hill Fort may limit level of upgradeable creatures, e.g. mini Hill Fort from HOTA
|
||||||
if (hero->getStack(slot).type->getLevel() >= 5 && hero->getCreature(slot)->hasUpgrades())
|
if (hero->getCreature(slot)->hasUpgrades())
|
||||||
return State::UNAVAILABLE;
|
return State::UNAVAILABLE;
|
||||||
|
|
||||||
return State::ALREADY_UPGRADED;
|
return State::ALREADY_UPGRADED;
|
||||||
|
|||||||
@@ -683,6 +683,7 @@
|
|||||||
"object" : {
|
"object" : {
|
||||||
"index" : 0,
|
"index" : 0,
|
||||||
"aiValue" : 7000,
|
"aiValue" : 7000,
|
||||||
|
"description" : "",
|
||||||
"rmg" : {
|
"rmg" : {
|
||||||
"zoneLimit" : 1,
|
"zoneLimit" : 1,
|
||||||
"value" : 7000,
|
"value" : 7000,
|
||||||
|
|||||||
@@ -11,17 +11,27 @@
|
|||||||
#include "HillFortInstanceConstructor.h"
|
#include "HillFortInstanceConstructor.h"
|
||||||
|
|
||||||
#include "../mapObjects/MiscObjects.h"
|
#include "../mapObjects/MiscObjects.h"
|
||||||
|
#include "../texts/CGeneralTextHandler.h"
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_BEGIN
|
VCMI_LIB_NAMESPACE_BEGIN
|
||||||
|
|
||||||
void HillFortInstanceConstructor::initTypeData(const JsonNode & config)
|
void HillFortInstanceConstructor::initTypeData(const JsonNode & config)
|
||||||
{
|
{
|
||||||
parameters = config;
|
parameters = config;
|
||||||
|
VLC->generaltexth->registerString(parameters.getModScope(), TextIdentifier(getBaseTextID(), "unavailableUpgradeMessage"), parameters["unavailableUpgradeMessage"].String());
|
||||||
|
VLC->generaltexth->registerString(parameters.getModScope(), TextIdentifier(getBaseTextID(), "description"), parameters["description"].String());
|
||||||
}
|
}
|
||||||
|
|
||||||
void HillFortInstanceConstructor::initializeObject(HillFort * fort) const
|
void HillFortInstanceConstructor::initializeObject(HillFort * fort) const
|
||||||
{
|
{
|
||||||
fort->upgradeCostPercentage = parameters["upgradeCostFactor"].convertTo<std::vector<int>>();
|
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
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
|||||||
@@ -451,6 +451,8 @@ class DLL_LINKAGE HillFort : public CGObjectInstance, public ICreatureUpgrader
|
|||||||
friend class HillFortInstanceConstructor;
|
friend class HillFortInstanceConstructor;
|
||||||
|
|
||||||
std::vector<int> upgradeCostPercentage;
|
std::vector<int> upgradeCostPercentage;
|
||||||
|
std::string descriptionToolTip;
|
||||||
|
std::string unavailableUpgradeMessage;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onHeroVisit(const CGHeroInstance * h) const override;
|
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||||
@@ -459,10 +461,22 @@ protected:
|
|||||||
public:
|
public:
|
||||||
using CGObjectInstance::CGObjectInstance;
|
using CGObjectInstance::CGObjectInstance;
|
||||||
|
|
||||||
|
const std::string & getDescriptionToolTip() const
|
||||||
|
{
|
||||||
|
return descriptionToolTip;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string & getUnavailableUpgradeMessage() const
|
||||||
|
{
|
||||||
|
return unavailableUpgradeMessage;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h)
|
template <typename Handler> void serialize(Handler &h)
|
||||||
{
|
{
|
||||||
h & static_cast<CGObjectInstance&>(*this);
|
h & static_cast<CGObjectInstance&>(*this);
|
||||||
h & upgradeCostPercentage;
|
h & upgradeCostPercentage;
|
||||||
|
h & descriptionToolTip;
|
||||||
|
h & unavailableUpgradeMessage;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user