1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Merge pull request #4616 from Laserlicht/show_level

show creature level
This commit is contained in:
Ivan Savenko 2024-09-20 11:50:17 +03:00 committed by GitHub
commit 26aeb1dd48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

View File

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

View File

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

View File

@ -22,6 +22,7 @@
#include "../networkPacks/PacksForClientBattle.h"
#include "../networkPacks/StackLocation.h"
#include "../serializer/JsonSerializeFormat.h"
#include "../entities/faction/CTownHandler.h"
#include <vstd/RNG.h>
@ -101,6 +102,11 @@ std::string CGCreature::getPopupText(const CGHeroInstance * hero) const
if (settings["general"]["enableUiEnhancements"].Bool())
{
std::string monsterLevel = VLC->generaltexth->translate("vcmi.adventureMap.monsterLevel");
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");
int choice;