diff --git a/client/lobby/CLobbyScreen.cpp b/client/lobby/CLobbyScreen.cpp index 22a26e244..dbe54e0cb 100644 --- a/client/lobby/CLobbyScreen.cpp +++ b/client/lobby/CLobbyScreen.cpp @@ -136,10 +136,10 @@ void CLobbyScreen::startScenario(bool allowOnlyAI) logGlobal->error("Exception during startScenario: %s", e.what()); if(std::string(e.what()) == "ExceptionNoHuman") - CInfoWindow::showInfoDialog(std::ref(CGI->generaltexth->allTexts[530]), CInfoWindow::TCompsInfo(), PlayerColor(1)); + CInfoWindow::showInfoDialog(CGI->generaltexth->allTexts[530], CInfoWindow::TCompsInfo(), PlayerColor(1)); if(std::string(e.what()) == "ExceptionNoTemplate") - CInfoWindow::showInfoDialog(std::ref(CGI->generaltexth->allTexts[751]), CInfoWindow::TCompsInfo(), PlayerColor(1)); + CInfoWindow::showInfoDialog(CGI->generaltexth->allTexts[751], CInfoWindow::TCompsInfo(), PlayerColor(1)); } catch(...) { diff --git a/client/mainmenu/CMainMenu.cpp b/client/mainmenu/CMainMenu.cpp index 99aab3d59..3b265d0cd 100644 --- a/client/mainmenu/CMainMenu.cpp +++ b/client/mainmenu/CMainMenu.cpp @@ -205,7 +205,7 @@ static std::function genCommand(CMenuScreen * menu, std::vectorgeneraltexth->allTexts[69]), std::vector>(), do_quit, 0, PlayerColor(1)); + return std::bind(CInfoWindow::showYesNoDialog, CGI->generaltexth->allTexts[69], std::vector>(), do_quit, 0, PlayerColor(1)); } break; case 5: //highscores diff --git a/client/windows/CQuestLog.cpp b/client/windows/CQuestLog.cpp index f6920a837..2295433ba 100644 --- a/client/windows/CQuestLog.cpp +++ b/client/windows/CQuestLog.cpp @@ -132,7 +132,7 @@ CQuestLog::CQuestLog (const std::vector & Quests) ok = std::make_shared(Point(539, 398), "IOKAY.DEF", CGI->generaltexth->zelp[445], std::bind(&CQuestLog::close, this), SDLK_RETURN); // Both button and lable are shifted to -2px by x and y to not make them actually look like they're on same line with quests list and ok button hideCompleteButton = std::make_shared(Point(10, 396), "sysopchk.def", CButton::tooltipLocalized("vcmi.questLog.hideComplete"), std::bind(&CQuestLog::toggleComplete, this, _1)); - hideCompleteLabel = std::make_shared(46, 398, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("vcmi.questLog.hideComplete.label")); + hideCompleteLabel = std::make_shared(46, 398, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("vcmi.questLog.hideComplete.hover")); slider = std::make_shared(Point(166, 195), 191, std::bind(&CQuestLog::sliderMoved, this, _1), QUEST_COUNT, 0, false, CSlider::BROWN); recreateLabelList(); diff --git a/client/windows/GUIClasses.cpp b/client/windows/GUIClasses.cpp index c0f5c8ef4..efaf8b4db 100644 --- a/client/windows/GUIClasses.cpp +++ b/client/windows/GUIClasses.cpp @@ -454,7 +454,7 @@ CSystemOptionsWindow::CSystemOptionsWindow() leftGroup->add(122, 64, CGI->generaltexth->allTexts[569]); leftGroup->add(122, 130, CGI->generaltexth->allTexts[570]); leftGroup->add(122, 196, CGI->generaltexth->allTexts[571]); - leftGroup->add(122, 262, CGI->generaltexth->translate("vcmi.systemOptions.resolutionButton.label")); + leftGroup->add(122, 262, CGI->generaltexth->translate("vcmi.systemOptions.resolutionButton.hover")); leftGroup->add(122, 347, CGI->generaltexth->allTexts[394]); leftGroup->add(122, 412, CGI->generaltexth->allTexts[395]); @@ -464,8 +464,8 @@ CSystemOptionsWindow::CSystemOptionsWindow() rightGroup->add(282, 89, CGI->generaltexth->allTexts[573]); rightGroup->add(282, 121, CGI->generaltexth->allTexts[574]); rightGroup->add(282, 153, CGI->generaltexth->allTexts[577]); - //rightGroup->add(282, 185, CGI->generaltexth->translate("vcmi.systemOptions.creatureWindowButton.label")); - rightGroup->add(282, 217, CGI->generaltexth->translate("vcmi.systemOptions.fullscreenButton.label")); + //rightGroup->add(282, 185, CGI->generaltexth->translate("vcmi.systemOptions.creatureWindowButton.hover")); + rightGroup->add(282, 217, CGI->generaltexth->translate("vcmi.systemOptions.fullscreenButton.hover")); //setting up buttons load = std::make_shared(Point(246, 298), "SOLOAD.DEF", CGI->generaltexth->zelp[321], [&](){ bloadf(); }, SDLK_l); @@ -583,7 +583,7 @@ void CSystemOptionsWindow::selectGameRes() } GH.pushIntT(items, nullptr, - CGI->generaltexth->translate("vcmi.systemOptions.resolutionMenu.label"), + CGI->generaltexth->translate("vcmi.systemOptions.resolutionMenu.hover"), CGI->generaltexth->translate("vcmi.systemOptions.resolutionMenu.help"), std::bind(&CSystemOptionsWindow::setGameRes, this, _1), currentResolutionIndex); diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index fd14ecece..8bf972536 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -139,7 +139,7 @@ void MetaString::getLocalString(const std::pair &txt, std::string &dst switch(type) { case GENERAL_TXT: - dst = VLC->generaltexth->translate("core.allTexts", ser); + dst = VLC->generaltexth->translate("core.genrltxt", ser); break; case XTRAINFO_TXT: dst = VLC->generaltexth->translate("core.xtrainfo", ser); diff --git a/lib/CGeneralTextHandler.cpp b/lib/CGeneralTextHandler.cpp index 832f27e37..fb848af91 100644 --- a/lib/CGeneralTextHandler.cpp +++ b/lib/CGeneralTextHandler.cpp @@ -603,7 +603,7 @@ LegacyTextContainer::LegacyTextContainer(CGeneralTextHandler & owner, std::strin basePath(basePath) {} -const std::string & LegacyTextContainer::operator[](size_t index) const +std::string LegacyTextContainer::operator[](size_t index) const { return owner.translate(basePath, index); } diff --git a/lib/CGeneralTextHandler.h b/lib/CGeneralTextHandler.h index 48a5827a1..71c4acc34 100644 --- a/lib/CGeneralTextHandler.h +++ b/lib/CGeneralTextHandler.h @@ -101,7 +101,7 @@ class DLL_LINKAGE LegacyTextContainer public: LegacyTextContainer(CGeneralTextHandler & owner, std::string const & basePath); - const std::string & operator[](size_t index) const; + std::string operator [](size_t index) const; }; /// Small wrapper that provides help text access API compatible with old code @@ -166,7 +166,7 @@ public: /// returns translated version of a string that can be displayed to user template - const std::string & translate(std::string arg1, Args ... args) const + std::string translate(std::string arg1, Args ... args) const { TextIdentifier id(arg1, args ...); return deserialize(id); diff --git a/lib/mapObjects/CBank.cpp b/lib/mapObjects/CBank.cpp index 0d58ad14d..ffdab4555 100644 --- a/lib/mapObjects/CBank.cpp +++ b/lib/mapObjects/CBank.cpp @@ -24,7 +24,7 @@ VCMI_LIB_NAMESPACE_BEGIN ///helpers -static const std::string & visitedTxt(const bool visited) +static std::string visitedTxt(const bool visited) { int id = visited ? 352 : 353; return VLC->generaltexth->allTexts[id]; diff --git a/lib/mapObjects/CQuest.cpp b/lib/mapObjects/CQuest.cpp index 7bb7d1f9c..8746f7012 100644 --- a/lib/mapObjects/CQuest.cpp +++ b/lib/mapObjects/CQuest.cpp @@ -56,7 +56,7 @@ static void showInfoDialog(const CGHeroInstance* h, const ui32 txtID, const ui16 showInfoDialog(playerID,txtID,soundID); } -static const std::string & visitedTxt(const bool visited) +static std::string visitedTxt(const bool visited) { int id = visited ? 352 : 353; return VLC->generaltexth->allTexts[id]; diff --git a/lib/mapObjects/CRewardableObject.cpp b/lib/mapObjects/CRewardableObject.cpp index 7e031765a..0b8e73f52 100644 --- a/lib/mapObjects/CRewardableObject.cpp +++ b/lib/mapObjects/CRewardableObject.cpp @@ -402,7 +402,7 @@ Component CRewardInfo::getDisplayedComponent(const CGHeroInstance * h) const } // FIXME: copy-pasted from CObjectHandler -static const std::string & visitedTxt(const bool visited) +static std::string visitedTxt(const bool visited) { int id = visited ? 352 : 353; return VLC->generaltexth->allTexts[id]; diff --git a/lib/mapObjects/MiscObjects.cpp b/lib/mapObjects/MiscObjects.cpp index 0494d8594..3d784a602 100644 --- a/lib/mapObjects/MiscObjects.cpp +++ b/lib/mapObjects/MiscObjects.cpp @@ -58,7 +58,7 @@ static void showInfoDialog(const CGHeroInstance* h, const ui32 txtID, const ui16 showInfoDialog(playerID,txtID,soundID); } -static const std::string & visitedTxt(const bool visited) +static std::string visitedTxt(const bool visited) { int id = visited ? 352 : 353; return VLC->generaltexth->allTexts[id];