2
0
Эх сурвалжийг харах

Fix CCommanderArtPlace localization + minor fixes

dydzio 9 жил өмнө
parent
commit
b626f9a134

+ 8 - 9
client/widgets/CArtifactHolder.cpp

@@ -41,13 +41,13 @@ void CHeroArtPlace::createImage()
 {
 	OBJ_CONSTRUCTION_CAPTURING_ALL;
 
-	int graphic = 0;
+	int imageIndex = 0;
 	if (ourArt)
-		graphic = ourArt->artType->iconIndex;
+		imageIndex = ourArt->artType->iconIndex;
 	if (locked)
-		graphic = ArtifactID::ART_LOCK;
+		imageIndex = ArtifactID::ART_LOCK;
 
-	image = new CAnimImage("artifact", graphic);
+	image = new CAnimImage("artifact", imageIndex);
 	if (!ourArt)
 		image->disable();
 
@@ -969,8 +969,7 @@ CCommanderArtPlace::CCommanderArtPlace(Point position, const CGHeroInstance * co
 void CCommanderArtPlace::clickLeft(tribool down, bool previousState)
 {
 	if (down && ourArt && text.size())
-		LOCPLINT->showYesNoDialog("Do you want to give this artifact back to hero?", [this] { returnArtToHeroCallback(); }, [] {});
-		//CArtPlace::clickLeft(down, previousState);	
+		LOCPLINT->showYesNoDialog(CGI->generaltexth->localizedTexts["commanderWindow"]["artifactMessage"].String(), [this] { returnArtToHeroCallback(); }, [] {});
 }
 
 void CCommanderArtPlace::clickRight(tribool down, bool previousState)
@@ -983,11 +982,11 @@ void CCommanderArtPlace::createImage()
 {
 	OBJ_CONSTRUCTION_CAPTURING_ALL;
 
-	int graphic = 0;
+	int imageIndex = 0;
 	if (ourArt)
-		graphic = ourArt->artType->iconIndex;
+		imageIndex = ourArt->artType->iconIndex;
 
-	image = new CAnimImage("artifact", graphic);
+	image = new CAnimImage("artifact", imageIndex);
 	if (!ourArt)
 		image->disable();
 }

+ 13 - 8
config/translate.json

@@ -27,7 +27,7 @@
 		"fullscreenButton" :
 		{
 			"label" : "Fullscreen",
-			"help"  : "{Fullscreen}\n\n If selected, VCMI will run in fullscreen mode, othervice VCMI will run in window",
+			"help"  : "{Fullscreen}\n\n If selected, VCMI will run in fullscreen mode, othervice VCMI will run in window"
 		},
 		"resolutionButton" :
 		{
@@ -50,13 +50,18 @@
 		"allOf"  :  "All of the following:",
 		"noneOf" : "None of the following:"
 	},
-	"heroWindow" : {
-		"openCommander" :
-		{
-			"label" : "Open commander window",
-			"help" : "Displays information about commander of this hero"
-		}
-	},
+  "heroWindow": 
+  {
+    "openCommander": 
+    {
+      "label": "Open commander window",
+      "help": "Displays information about commander of this hero"
+    }
+  },
+  "commanderWindow": 
+  {
+    "artifactMessage": "Do you want to give this artifact back to hero?"
+  },
 	"creatureWindow" :
 	{
 		"showBonuses" :