diff --git a/Mods/vcmi/config/vcmi/english.json b/Mods/vcmi/config/vcmi/english.json index f996609a8..ac798bf0f 100644 --- a/Mods/vcmi/config/vcmi/english.json +++ b/Mods/vcmi/config/vcmi/english.json @@ -181,6 +181,7 @@ "vcmi.battleWindow.damageEstimation.damage.1" : "%d damage", "vcmi.battleWindow.damageEstimation.kills" : "%d will perish", "vcmi.battleWindow.damageEstimation.kills.1" : "%d will perish", + "vcmi.battleWindow.killed" : "Killed", "vcmi.battleResultsWindow.applyResultsLabel" : "Apply battle result", diff --git a/Mods/vcmi/config/vcmi/german.json b/Mods/vcmi/config/vcmi/german.json index 90b0fafb6..17c2614ab 100644 --- a/Mods/vcmi/config/vcmi/german.json +++ b/Mods/vcmi/config/vcmi/german.json @@ -180,6 +180,7 @@ "vcmi.battleWindow.damageEstimation.damage.1" : "%d Schaden", "vcmi.battleWindow.damageEstimation.kills" : "%d werden verenden", "vcmi.battleWindow.damageEstimation.kills.1" : "%d werden verenden", + "vcmi.battleWindow.killed" : "Getötet", "vcmi.battleResultsWindow.applyResultsLabel" : "Kampfergebnis übernehmen", diff --git a/client/battle/BattleInterfaceClasses.cpp b/client/battle/BattleInterfaceClasses.cpp index 6c887bc0c..52c132f8c 100644 --- a/client/battle/BattleInterfaceClasses.cpp +++ b/client/battle/BattleInterfaceClasses.cpp @@ -504,7 +504,7 @@ void StackInfoBasicPanel::initializeData(const CStack * stack) icons.push_back(std::make_shared(AnimationPath::builtin("ILCK22"), luck + 3, 0, 47, 143)); //extra information - labels.push_back(std::make_shared(9, 168, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, std::string("Killed") + ":")); + labels.push_back(std::make_shared(9, 168, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->translate("vcmi.battleWindow.killed") + ":")); labels.push_back(std::make_shared(9, 180, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[389] + ":")); labels.push_back(std::make_shared(69, 180, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, std::to_string(killed))); @@ -531,7 +531,8 @@ void StackInfoBasicPanel::initializeData(const CStack * stack) int duration = stack->getBonusLocalFirst(Selector::source(BonusSource::SPELL_EFFECT, BonusSourceID(effect)))->turnsRemain; icons.push_back(std::make_shared(AnimationPath::builtin("SpellInt"), effect + 1, 0, firstPos.x + offset.x * printed, firstPos.y + offset.y * printed)); - labels.push_back(std::make_shared(firstPos.x + offset.x * printed + 46, firstPos.y + offset.y * printed + 36, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, std::to_string(duration))); + if(settings["general"]["enableUiEnhancements"].Bool()) + labels.push_back(std::make_shared(firstPos.x + offset.x * printed + 46, firstPos.y + offset.y * printed + 36, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, std::to_string(duration))); if(++printed >= 3 || (printed == 2 && spells.size() > 3)) // interface limit reached break; } @@ -540,7 +541,7 @@ void StackInfoBasicPanel::initializeData(const CStack * stack) if(spells.size() == 0) labelsMultiline.push_back(std::make_shared(Rect(firstPos.x, firstPos.y, 48, 36), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[674])); if(spells.size() > 3) - labelsMultiline.push_back(std::make_shared(Rect(firstPos.x + offset.x * 2, firstPos.y + offset.y * 2 - 5, 48, 36), EFonts::FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, "...")); + labelsMultiline.push_back(std::make_shared(Rect(firstPos.x + offset.x * 2, firstPos.y + offset.y * 2 - 4, 48, 36), EFonts::FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, "...")); } void StackInfoBasicPanel::update(const CStack * updatedInfo) diff --git a/client/battle/BattleWindow.cpp b/client/battle/BattleWindow.cpp index b90ab82a9..3e1098810 100644 --- a/client/battle/BattleWindow.cpp +++ b/client/battle/BattleWindow.cpp @@ -266,8 +266,8 @@ void BattleWindow::updateStackInfoWindow(const CStack * stack) if(stack && stack->unitSide() == BattleSide::DEFENDER) { Point position = (GH.screenDimensions().x >= 1000) - ? Point(pos.x + pos.w + 15, pos.y + 250) - : Point(pos.x + pos.w -79, pos.y + 135); + ? Point(pos.x + pos.w + 15, defenderHeroWindow ? defenderHeroWindow->pos.y + 210 : pos.y) + : Point(pos.x + pos.w -79, defenderHeroWindow ? defenderHeroWindow->pos.y : pos.y + 135); defenderStackWindow = std::make_shared(stack, &position); defenderStackWindow->setEnabled(showInfoWindows); } @@ -277,8 +277,8 @@ void BattleWindow::updateStackInfoWindow(const CStack * stack) if(stack && stack->unitSide() == BattleSide::ATTACKER) { Point position = (GH.screenDimensions().x >= 1000) - ? Point(pos.x - 93, pos.y + 250) - : Point(pos.x + 1, pos.y + 135); + ? Point(pos.x - 93, attackerHeroWindow ? attackerHeroWindow->pos.y + 210 : pos.y) + : Point(pos.x + 1, attackerHeroWindow ? attackerHeroWindow->pos.y : pos.y + 135); attackerStackWindow = std::make_shared(stack, &position); attackerStackWindow->setEnabled(showInfoWindows); } diff --git a/client/widgets/MiscWidgets.cpp b/client/widgets/MiscWidgets.cpp index c985e35e6..f60696d09 100644 --- a/client/widgets/MiscWidgets.cpp +++ b/client/widgets/MiscWidgets.cpp @@ -611,6 +611,8 @@ void MoraleLuckBox::set(const AFactionMember * node) image = std::make_shared(AnimationPath::builtin(imageName), *component.value + 3); image->moveBy(Point(pos.w/2 - image->pos.w/2, pos.h/2 - image->pos.h/2));//center icon + if(settings["general"]["enableUiEnhancements"].Bool()) + label = std::make_shared(small ? 30 : 42, small ? 20 : 38, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, std::to_string(modifierList->totalValue())); } MoraleLuckBox::MoraleLuckBox(bool Morale, const Rect &r, bool Small) diff --git a/client/widgets/MiscWidgets.h b/client/widgets/MiscWidgets.h index 59a1004dd..35c34712c 100644 --- a/client/widgets/MiscWidgets.h +++ b/client/widgets/MiscWidgets.h @@ -238,6 +238,7 @@ public: class MoraleLuckBox : public LRClickableAreaWTextComp { std::shared_ptr image; + std::shared_ptr label; public: bool morale; //true if morale, false if luck bool small; diff --git a/client/windows/CCreatureWindow.cpp b/client/windows/CCreatureWindow.cpp index f6e073f2c..e7b8b22b6 100644 --- a/client/windows/CCreatureWindow.cpp +++ b/client/windows/CCreatureWindow.cpp @@ -229,6 +229,7 @@ CStackWindow::ActiveSpellsSection::ActiveSpellsSection(CStackWindow * owner, int boost::replace_first(spellText, "%d", std::to_string(duration)); spellIcons.push_back(std::make_shared(AnimationPath::builtin("SpellInt"), effect + 1, 0, firstPos.x + offset.x * printed, firstPos.y + offset.y * printed)); + labels.push_back(std::make_shared(firstPos.x + offset.x * printed + 46, firstPos.y + offset.y * printed + 36, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, std::to_string(duration))); clickableAreas.push_back(std::make_shared(Rect(firstPos + offset * printed, Point(50, 38)), spellText, spellText)); if(++printed >= 8) // interface limit reached break; diff --git a/client/windows/CCreatureWindow.h b/client/windows/CCreatureWindow.h index b20a1ef39..de5997764 100644 --- a/client/windows/CCreatureWindow.h +++ b/client/windows/CCreatureWindow.h @@ -72,6 +72,7 @@ class CStackWindow : public CWindowObject { std::vector> spellIcons; std::vector> clickableAreas; + std::vector> labels; public: ActiveSpellsSection(CStackWindow * owner, int yOffset); };