فهرست منبع

added town info

Laserlicht 1 سال پیش
والد
کامیت
081ba4839c
3فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 1 1
      Mods/vcmi/config/vcmi/english.json
  2. 1 1
      Mods/vcmi/config/vcmi/german.json
  3. 5 2
      lib/mapObjects/CGCreature.cpp

+ 1 - 1
Mods/vcmi/config/vcmi/english.json

@@ -12,7 +12,7 @@
 	"vcmi.adventureMap.monsterThreat.levels.9"  : "Overpowering",
 	"vcmi.adventureMap.monsterThreat.levels.10" : "Deadly",
 	"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.noTownWithMarket"                 : "There are no available marketplaces!",

+ 1 - 1
Mods/vcmi/config/vcmi/german.json

@@ -12,7 +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.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.noTownWithMarket"                 : "Kein Marktplatz verfügbar!",

+ 5 - 2
lib/mapObjects/CGCreature.cpp

@@ -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,8 +102,10 @@ std::string CGCreature::getPopupText(const CGHeroInstance * hero) const
 
 	if (settings["general"]["enableUiEnhancements"].Bool())
 	{
-		hoverName += VLC->generaltexth->translate("vcmi.adventureMap.monsterLevel.title");
-		hoverName += std::to_string(VLC->creatures()->getById(getCreature())->getLevel());
+		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");