From b626f9a1349a8210eed1f7ffe2578e32b57f7f51 Mon Sep 17 00:00:00 2001 From: dydzio Date: Tue, 8 Nov 2016 17:26:24 +0100 Subject: [PATCH] Fix CCommanderArtPlace localization + minor fixes --- client/widgets/CArtifactHolder.cpp | 17 ++++++++--------- config/translate.json | 21 +++++++++++++-------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/client/widgets/CArtifactHolder.cpp b/client/widgets/CArtifactHolder.cpp index 602a9e3d9..3a1e9031c 100644 --- a/client/widgets/CArtifactHolder.cpp +++ b/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(); } diff --git a/config/translate.json b/config/translate.json index 31a80b9de..882330e72 100644 --- a/config/translate.json +++ b/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" :