1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

added town info

This commit is contained in:
Laserlicht
2024-09-18 22:39:53 +02:00
parent 6aa29ac8ee
commit 081ba4839c
3 changed files with 7 additions and 4 deletions

View File

@@ -12,7 +12,7 @@
"vcmi.adventureMap.monsterThreat.levels.9" : "Overpowering", "vcmi.adventureMap.monsterThreat.levels.9" : "Overpowering",
"vcmi.adventureMap.monsterThreat.levels.10" : "Deadly", "vcmi.adventureMap.monsterThreat.levels.10" : "Deadly",
"vcmi.adventureMap.monsterThreat.levels.11" : "Impossible", "vcmi.adventureMap.monsterThreat.levels.11" : "Impossible",
"vcmi.adventureMap.monsterLevel.title" : "\n\nLevel: ", "vcmi.adventureMap.monsterLevel" : "\n\n%TOWN unit of level %LEVEL",
"vcmi.adventureMap.confirmRestartGame" : "Are you sure you want to restart the game?", "vcmi.adventureMap.confirmRestartGame" : "Are you sure you want to restart the game?",
"vcmi.adventureMap.noTownWithMarket" : "There are no available marketplaces!", "vcmi.adventureMap.noTownWithMarket" : "There are no available marketplaces!",

View File

@@ -12,7 +12,7 @@
"vcmi.adventureMap.monsterThreat.levels.9" : "Überwältigend", "vcmi.adventureMap.monsterThreat.levels.9" : "Überwältigend",
"vcmi.adventureMap.monsterThreat.levels.10" : "Tödlich", "vcmi.adventureMap.monsterThreat.levels.10" : "Tödlich",
"vcmi.adventureMap.monsterThreat.levels.11" : "Unmöglich", "vcmi.adventureMap.monsterThreat.levels.11" : "Unmöglich",
"vcmi.adventureMap.monsterLevel.title" : "\n\nStufe: ", "vcmi.adventureMap.monsterLevel" : "\n\n%TOWN-Einheit der Stufe %LEVEL",
"vcmi.adventureMap.confirmRestartGame" : "Seid Ihr sicher, dass Ihr das Spiel neu starten wollt?", "vcmi.adventureMap.confirmRestartGame" : "Seid Ihr sicher, dass Ihr das Spiel neu starten wollt?",
"vcmi.adventureMap.noTownWithMarket" : "Kein Marktplatz verfügbar!", "vcmi.adventureMap.noTownWithMarket" : "Kein Marktplatz verfügbar!",

View File

@@ -22,6 +22,7 @@
#include "../networkPacks/PacksForClientBattle.h" #include "../networkPacks/PacksForClientBattle.h"
#include "../networkPacks/StackLocation.h" #include "../networkPacks/StackLocation.h"
#include "../serializer/JsonSerializeFormat.h" #include "../serializer/JsonSerializeFormat.h"
#include "../entities/faction/CTownHandler.h"
#include <vstd/RNG.h> #include <vstd/RNG.h>
@@ -101,8 +102,10 @@ std::string CGCreature::getPopupText(const CGHeroInstance * hero) const
if (settings["general"]["enableUiEnhancements"].Bool()) if (settings["general"]["enableUiEnhancements"].Bool())
{ {
hoverName += VLC->generaltexth->translate("vcmi.adventureMap.monsterLevel.title"); std::string monsterLevel = VLC->generaltexth->translate("vcmi.adventureMap.monsterLevel");
hoverName += std::to_string(VLC->creatures()->getById(getCreature())->getLevel()); boost::replace_first(monsterLevel, "%TOWN", (*VLC->townh)[VLC->creatures()->getById(getCreature())->getFaction()]->getNameTranslated());
boost::replace_first(monsterLevel, "%LEVEL", std::to_string(VLC->creatures()->getById(getCreature())->getLevel()));
hoverName += monsterLevel;
hoverName += VLC->generaltexth->translate("vcmi.adventureMap.monsterThreat.title"); hoverName += VLC->generaltexth->translate("vcmi.adventureMap.monsterThreat.title");