Explorar o código

Removed CGI in favor of VLC. Map handle is for now global variable

Ivan Savenko hai 8 meses
pai
achega
ffd37a8fa8
Modificáronse 100 ficheiros con 844 adicións e 1110 borrados
  1. 3 4
      client/ArtifactsUIController.cpp
  2. 0 107
      client/CGameInfo.cpp
  3. 0 87
      client/CGameInfo.h
  4. 0 2
      client/CMakeLists.txt
  5. 7 8
      client/CPlayerInterface.cpp
  6. 6 6
      client/CServerHandler.cpp
  7. 5 6
      client/Client.cpp
  8. 7 12
      client/GameEngine.cpp
  9. 1 2
      client/HeroMovementController.cpp
  10. 38 39
      client/NetPacksClient.cpp
  11. 0 1
      client/NetPacksLobbyClient.cpp
  12. 5 6
      client/adventureMap/AdventureMapInterface.cpp
  13. 12 13
      client/adventureMap/AdventureMapShortcuts.cpp
  14. 2 2
      client/adventureMap/AdventureOptions.cpp
  15. 0 1
      client/adventureMap/CInGameConsole.cpp
  16. 6 7
      client/adventureMap/CInfoBar.cpp
  17. 2 3
      client/adventureMap/CList.cpp
  18. 2 3
      client/adventureMap/CMinimap.cpp
  19. 4 4
      client/adventureMap/CResDataBar.cpp
  20. 3 4
      client/adventureMap/MapAudioPlayer.cpp
  21. 0 1
      client/adventureMap/TurnTimerWidget.cpp
  22. 25 26
      client/battle/BattleActionsController.cpp
  23. 0 1
      client/battle/BattleAnimationClasses.cpp
  24. 1 2
      client/battle/BattleEffectsController.cpp
  25. 0 1
      client/battle/BattleFieldController.cpp
  26. 1 2
      client/battle/BattleInterface.cpp
  27. 29 30
      client/battle/BattleInterfaceClasses.cpp
  28. 0 1
      client/battle/BattleObstacleController.cpp
  29. 0 1
      client/battle/BattleProjectileController.cpp
  30. 0 1
      client/battle/BattleSiegeController.cpp
  31. 1 2
      client/battle/BattleStacksController.cpp
  32. 7 8
      client/battle/BattleWindow.cpp
  33. 0 1
      client/eventsSDL/InputHandler.cpp
  34. 0 1
      client/eventsSDL/InputSourceGameController.cpp
  35. 0 1
      client/eventsSDL/InputSourceTouch.cpp
  36. 5 5
      client/globalLobby/GlobalLobbyClient.cpp
  37. 6 6
      client/globalLobby/GlobalLobbyLoginWindow.cpp
  38. 4 4
      client/globalLobby/GlobalLobbyRoomWindow.cpp
  39. 9 9
      client/globalLobby/GlobalLobbyServerSetup.cpp
  40. 0 1
      client/globalLobby/GlobalLobbyWidget.cpp
  41. 4 4
      client/gui/InterfaceObjectConfigurable.cpp
  42. 0 1
      client/gui/WindowHandler.cpp
  43. 13 14
      client/lobby/CBonusSelection.cpp
  44. 0 1
      client/lobby/CCampaignInfoScreen.cpp
  45. 18 18
      client/lobby/CLobbyScreen.cpp
  46. 3 3
      client/lobby/CSavingScreen.cpp
  47. 2 2
      client/lobby/CScenarioInfoScreen.cpp
  48. 28 28
      client/lobby/CSelectionBase.cpp
  49. 58 58
      client/lobby/OptionsTab.cpp
  50. 9 9
      client/lobby/OptionsTabBase.cpp
  51. 0 1
      client/lobby/RandomMapTab.cpp
  52. 22 22
      client/lobby/SelectionTab.cpp
  53. 1 2
      client/mainmenu/CCampaignScreen.cpp
  54. 20 20
      client/mainmenu/CHighScoreScreen.cpp
  55. 23 23
      client/mainmenu/CMainMenu.cpp
  56. 1 4
      client/mainmenu/CPrologEpilogVideo.cpp
  57. 41 42
      client/mainmenu/CStatisticScreen.cpp
  58. 0 1
      client/mapView/MapRenderer.cpp
  59. 2 3
      client/mapView/MapRendererContext.cpp
  60. 2 3
      client/mapView/MapRendererContextState.cpp
  61. 0 1
      client/mapView/MapView.cpp
  62. 0 1
      client/mapView/MapViewActions.cpp
  63. 7 6
      client/mapView/mapHandler.cpp
  64. 2 0
      client/mapView/mapHandler.h
  65. 3 3
      client/media/CMusicHandler.cpp
  66. 0 1
      client/media/CSoundHandler.cpp
  67. 2 2
      client/media/CVideoHandler.cpp
  68. 0 1
      client/renderSDL/CBitmapFont.cpp
  69. 3 4
      client/renderSDL/FontChain.cpp
  70. 0 1
      client/renderSDL/ScreenHandler.cpp
  71. 3 3
      client/widgets/Buttons.cpp
  72. 0 2
      client/widgets/CArtifactsOfHeroBase.cpp
  73. 30 30
      client/widgets/CComponent.cpp
  74. 7 8
      client/widgets/CComponentHolder.cpp
  75. 10 11
      client/widgets/CGarrisonInt.cpp
  76. 0 1
      client/widgets/Images.cpp
  77. 13 14
      client/widgets/MiscWidgets.cpp
  78. 2 2
      client/widgets/RadialMenu.cpp
  79. 0 1
      client/widgets/VideoWidget.cpp
  80. 6 7
      client/widgets/markets/CAltarArtifacts.cpp
  81. 9 10
      client/widgets/markets/CAltarCreatures.cpp
  82. 5 6
      client/widgets/markets/CArtifactsBuying.cpp
  83. 6 7
      client/widgets/markets/CArtifactsSelling.cpp
  84. 5 6
      client/widgets/markets/CFreelancerGuild.cpp
  85. 6 7
      client/widgets/markets/CMarketBase.cpp
  86. 7 7
      client/widgets/markets/CMarketResources.cpp
  87. 6 6
      client/widgets/markets/CTransferResources.cpp
  88. 9 10
      client/widgets/markets/TradePanels.cpp
  89. 65 66
      client/windows/CCastleInterface.cpp
  90. 39 40
      client/windows/CCreatureWindow.cpp
  91. 23 24
      client/windows/CExchangeWindow.cpp
  92. 32 31
      client/windows/CHeroOverview.cpp
  93. 28 29
      client/windows/CHeroWindow.cpp
  94. 38 39
      client/windows/CKingdomInterface.cpp
  95. 14 15
      client/windows/CMarketWindow.cpp
  96. 5 4
      client/windows/CPuzzleWindow.cpp
  97. 2 3
      client/windows/CQuestLog.cpp
  98. 16 17
      client/windows/CSpellWindow.cpp
  99. 3 3
      client/windows/CTutorialWindow.cpp
  100. 0 1
      client/windows/CWindowObject.cpp

+ 3 - 4
client/ArtifactsUIController.cpp

@@ -10,7 +10,6 @@
  
 #include "StdInc.h"
 #include "ArtifactsUIController.h"
-#include "CGameInfo.h"
 #include "CPlayerInterface.h"
 
 #include "../CCallback.h"
@@ -76,9 +75,9 @@ bool ArtifactsUIController::askToAssemble(const CGHeroInstance * hero, const Art
 					message.appendEOL();
 					message.appendEOL();
 					if(combinedArt->isFused())
-						message.appendRawString(CGI->generaltexth->translate("vcmi.heroWindow.fusingArtifact.fusing"));
+						message.appendRawString(VLC->generaltexth->translate("vcmi.heroWindow.fusingArtifact.fusing"));
 					else
-						message.appendRawString(CGI->generaltexth->allTexts[732]); // You possess all of the components needed to assemble the
+						message.appendRawString(VLC->generaltexth->allTexts[732]); // You possess all of the components needed to assemble the
 					message.replaceName(ArtifactID(combinedArt->getId()));
 					LOCPLINT->showYesNoDialog(message.toString(), [&assembleConfirmed, hero, slot, combinedArt]()
 						{
@@ -114,7 +113,7 @@ bool ArtifactsUIController::askToDisassemble(const CGHeroInstance * hero, const
 		MetaString message = MetaString::createFromTextID(art->getType()->getDescriptionTextID());
 		message.appendEOL();
 		message.appendEOL();
-		message.appendRawString(CGI->generaltexth->allTexts[733]); // Do you wish to disassemble this artifact?
+		message.appendRawString(VLC->generaltexth->allTexts[733]); // Do you wish to disassemble this artifact?
 		LOCPLINT->showYesNoDialog(message.toString(), [hero, slot]()
 			{
 				LOCPLINT->cb->assembleArtifacts(hero->id, slot, false, ArtifactID());

+ 0 - 107
client/CGameInfo.cpp

@@ -1,107 +0,0 @@
-/*
- * CGameInfo.cpp, part of VCMI engine
- *
- * Authors: listed in file AUTHORS in main folder
- *
- * License: GNU General Public License v2.0 or later
- * Full text of license available in license.txt file, in main folder
- *
- */
-#include "StdInc.h"
-#include "CGameInfo.h"
-
-#include "../lib/VCMI_Lib.h"
-
-CGameInfo * CGI;
-CServerHandler * CSH;
-
-
-CGameInfo::CGameInfo()
-{
-	globalServices = nullptr;
-}
-
-void CGameInfo::setFromLib()
-{
-	globalServices = VLC;
-	modh = VLC->modh;
-	generaltexth = VLC->generaltexth;
-	creh = VLC->creh;
-	townh = VLC->townh;
-	heroh = VLC->heroh;
-	objh = VLC->objh;
-	spellh = VLC->spellh;
-	skillh = VLC->skillh;
-	objtypeh = VLC->objtypeh;
-	terrainTypeHandler = VLC->terrainTypeHandler;
-	battleFieldHandler = VLC->battlefieldsHandler;
-	obstacleHandler = VLC->obstacleHandler;
-	//TODO: biomeHandler?
-}
-
-const ArtifactService * CGameInfo::artifacts() const
-{
-	return globalServices->artifacts();
-}
-
-const BattleFieldService * CGameInfo::battlefields() const
-{
-	return globalServices->battlefields();
-}
-
-const CreatureService * CGameInfo::creatures() const
-{
-	return globalServices->creatures();
-}
-
-const FactionService * CGameInfo::factions() const
-{
-	return globalServices->factions();
-}
-
-const HeroClassService * CGameInfo::heroClasses() const
-{
-	return globalServices->heroClasses();
-}
-
-const HeroTypeService * CGameInfo::heroTypes() const
-{
-	return globalServices->heroTypes();
-}
-
-#if SCRIPTING_ENABLED
-const scripting::Service * CGameInfo::scripts()  const
-{
-	return globalServices->scripts();
-}
-#endif
-
-const spells::Service * CGameInfo::spells()  const
-{
-	return globalServices->spells();
-}
-
-const SkillService * CGameInfo::skills() const
-{
-	return globalServices->skills();
-}
-
-const ObstacleService * CGameInfo::obstacles() const
-{
-	return globalServices->obstacles();
-}
-
-const IGameSettings * CGameInfo::engineSettings() const
-{
-	return globalServices->engineSettings();
-}
-
-spells::effects::Registry * CGameInfo::spellEffects()
-{
-	return nullptr;
-}
-
-const spells::effects::Registry * CGameInfo::spellEffects() const
-{
-	return globalServices->spellEffects();
-}

+ 0 - 87
client/CGameInfo.h

@@ -1,87 +0,0 @@
-/*
- * CGameInfo.h, part of VCMI engine
- *
- * Authors: listed in file AUTHORS in main folder
- *
- * License: GNU General Public License v2.0 or later
- * Full text of license available in license.txt file, in main folder
- *
- */
-#pragma once
-
-#include <vcmi/Services.h>
-
-#include "../lib/ConstTransitivePtr.h"
-
-VCMI_LIB_NAMESPACE_BEGIN
-
-class CModHandler;
-class CHeroHandler;
-class CCreatureHandler;
-class CSpellHandler;
-class CSkillHandler;
-class CObjectHandler;
-class CObjectClassesHandler;
-class CTownHandler;
-class CGeneralTextHandler;
-class CConsoleHandler;
-class CGameState;
-class BattleFieldHandler;
-class ObstacleHandler;
-class TerrainTypeHandler;
-
-class CMap;
-
-VCMI_LIB_NAMESPACE_END
-
-class CMapHandler;
-class ISoundPlayer;
-class IMusicPlayer;
-class CursorHandler;
-class IVideoPlayer;
-class CServerHandler;
-
-/// CGameInfo class
-/// for allowing different functions for accessing game information
-class CGameInfo final : public Services
-{
-public:
-	const ArtifactService * artifacts() const override;
-	const CreatureService * creatures() const override;
-	const FactionService * factions() const override;
-	const HeroClassService * heroClasses() const override;
-	const HeroTypeService * heroTypes() const override;
-#if SCRIPTING_ENABLED
-	const scripting::Service * scripts() const override;
-#endif
-	const spells::Service * spells() const override;
-	const SkillService * skills() const override;
-	const BattleFieldService * battlefields() const override;
-	const ObstacleService * obstacles() const override;
-	const IGameSettings * engineSettings() const override;
-
-	const spells::effects::Registry * spellEffects() const override;
-	spells::effects::Registry * spellEffects() override;
-
-	std::shared_ptr<const CModHandler> modh;
-	std::shared_ptr<const BattleFieldHandler> battleFieldHandler;
-	std::shared_ptr<const CHeroHandler> heroh;
-	std::shared_ptr<const CCreatureHandler> creh;
-	std::shared_ptr<const CSpellHandler> spellh;
-	std::shared_ptr<const CSkillHandler> skillh;
-	std::shared_ptr<const CObjectHandler> objh;
-	std::shared_ptr<const TerrainTypeHandler> terrainTypeHandler;
-	std::shared_ptr<const CObjectClassesHandler> objtypeh;
-	std::shared_ptr<const ObstacleHandler> obstacleHandler;
-	std::shared_ptr<const CGeneralTextHandler> generaltexth;
-	std::shared_ptr<const CTownHandler> townh;
-
-	std::shared_ptr<CMapHandler> mh;
-
-	void setFromLib();
-
-	CGameInfo();
-private:
-	const Services * globalServices;
-};
-extern CGameInfo* CGI;

+ 0 - 2
client/CMakeLists.txt

@@ -180,7 +180,6 @@ set(vcmiclientcommon_SRCS
 
 	ArtifactsUIController.cpp
 	GameEngine.cpp
-	CGameInfo.cpp
 	CPlayerInterface.cpp
 	PlayerLocalState.cpp
 	CServerHandler.cpp
@@ -395,7 +394,6 @@ set(vcmiclientcommon_HEADERS
 	xBRZ/xbrz_tools.h
 
 	ArtifactsUIController.h
-	CGameInfo.h
 	CMT.h
 	CPlayerInterface.h
 	GameEngine.h

+ 7 - 8
client/CPlayerInterface.cpp

@@ -12,7 +12,6 @@
 
 #include <vcmi/Artifact.h>
 
-#include "CGameInfo.h"
 #include "CServerHandler.h"
 #include "HeroMovementController.h"
 #include "PlayerLocalState.h"
@@ -330,7 +329,7 @@ void CPlayerInterface::yourTurn(QueryID queryID)
 			adventureInt->onHotseatWaitStarted(playerID);
 
 			makingTurn = true;
-			std::string msg = CGI->generaltexth->allTexts[13];
+			std::string msg = VLC->generaltexth->allTexts[13];
 			boost::replace_first(msg, "%s", cb->getStartInfo()->playerInfos.find(playerID)->second.name);
 			std::vector<std::shared_ptr<CComponent>> cmp;
 			cmp.push_back(std::make_shared<CComponent>(ComponentType::FLAG, playerID));
@@ -1458,7 +1457,7 @@ void CPlayerInterface::objectRemoved(const CGObjectInstance * obj, const PlayerC
 			ENGINE->sound().playSound(removalSound.value());
 		}
 	}
-	CGI->mh->waitForOngoingAnimations();
+	MAPHANDLER->waitForOngoingAnimations();
 
 	if(obj->ID == Obj::HERO && obj->tempOwner == playerID)
 	{
@@ -1497,7 +1496,7 @@ void CPlayerInterface::playerBlocked(int reason, bool start)
 			LOCPLINT = this;
 			ENGINE->curInt = this;
 			adventureInt->onCurrentPlayerChanged(playerID);
-			std::string msg = CGI->generaltexth->translate("vcmi.adventureMap.playerAttacked");
+			std::string msg = VLC->generaltexth->translate("vcmi.adventureMap.playerAttacked");
 			boost::replace_first(msg, "%s", cb->getStartInfo()->playerInfos.find(playerID)->second.name);
 			std::vector<std::shared_ptr<CComponent>> cmp;
 			cmp.push_back(std::make_shared<CComponent>(ComponentType::FLAG, playerID));
@@ -1576,7 +1575,7 @@ void CPlayerInterface::gameOver(PlayerColor player, const EVictoryLossCheckResul
 	if (player == playerID)
 	{
 		if (victoryLossCheckResult.loss())
-			showInfoDialog(CGI->generaltexth->allTexts[95]);
+			showInfoDialog(VLC->generaltexth->allTexts[95]);
 
 		assert(ENGINE->curInt == LOCPLINT);
 		auto previousInterface = LOCPLINT; //without multiple player interfaces some of lines below are useless, but for hotseat we wanna swap player interface temporarily
@@ -1664,7 +1663,7 @@ void CPlayerInterface::tryDigging(const CGHeroInstance * h)
 	if(msgToShow < 0)
 		cb->dig(h);
 	else
-		showInfoDialog(CGI->generaltexth->allTexts[msgToShow]);
+		showInfoDialog(VLC->generaltexth->allTexts[msgToShow]);
 }
 
 void CPlayerInterface::battleNewRoundFirst(const BattleID & battleID)
@@ -1817,7 +1816,7 @@ void CPlayerInterface::waitForAllDialogs()
 void CPlayerInterface::proposeLoadingGame()
 {
 	showYesNoDialog(
-		CGI->generaltexth->allTexts[68],
+		VLC->generaltexth->allTexts[68],
 		[]()
 		{
 			CSH->endGameplay();
@@ -1835,7 +1834,7 @@ bool CPlayerInterface::capturedAllEvents()
 		return true;
 	}
 
-	bool needToLockAdventureMap = adventureInt && adventureInt->isActive() && CGI->mh->hasOngoingAnimations();
+	bool needToLockAdventureMap = adventureInt && adventureInt->isActive() && MAPHANDLER->hasOngoingAnimations();
 	bool quickCombatOngoing = isAutoFightOn && !battleInt;
 
 	if (ignoreEvents || needToLockAdventureMap || quickCombatOngoing )

+ 6 - 6
client/CServerHandler.cpp

@@ -11,7 +11,6 @@
 
 #include "CServerHandler.h"
 #include "Client.h"
-#include "CGameInfo.h"
 #include "ServerRunner.h"
 #include "GameChatHandler.h"
 #include "CPlayerInterface.h"
@@ -27,7 +26,6 @@
 #include "media/CMusicHandler.h"
 #include "media/IVideoPlayer.h"
 
-
 #include "mainmenu/CMainMenu.h"
 #include "mainmenu/CPrologEpilogVideo.h"
 #include "mainmenu/CHighScoreScreen.h"
@@ -60,6 +58,8 @@
 
 #include <vcmi/events/EventBus.h>
 
+CServerHandler * CSH = nullptr;
+
 CServerHandler::~CServerHandler()
 {
 	if (serverRunner)
@@ -144,7 +144,7 @@ void CServerHandler::resetStateForLobby(EStartMode mode, ESelectionScreen screen
 	{
 		std::string playerName = settings["general"]["playerName"].String();
 		if(playerName == "Player")
-			playerName = CGI->generaltexth->translate("core.genrltxt.434");
+			playerName = VLC->generaltexth->translate("core.genrltxt.434");
 		localPlayerNames.push_back(playerName);
 	}
 
@@ -230,7 +230,7 @@ void CServerHandler::onConnectionFailed(const std::string & errorMessage)
 	{
 		// remote server refused connection - show error message
 		setState(EClientState::NONE);
-		CInfoWindow::showInfoDialog(CGI->generaltexth->translate("vcmi.mainMenu.serverConnectionFailed"), {});
+		CInfoWindow::showInfoDialog(VLC->generaltexth->translate("vcmi.mainMenu.serverConnectionFailed"), {});
 	}
 }
 
@@ -894,7 +894,7 @@ void CServerHandler::onDisconnected(const std::shared_ptr<INetworkConnection> &
 	{
 		endGameplay();
 		CMM->menu->switchToTab("main");
-		showServerError(CGI->generaltexth->translate("vcmi.server.errors.disconnected"));
+		showServerError(VLC->generaltexth->translate("vcmi.server.errors.disconnected"));
 	}
 	else
 	{
@@ -923,7 +923,7 @@ void CServerHandler::waitForServerShutdown()
 	{
 		if (getState() == EClientState::CONNECTING)
 		{
-			showServerError(CGI->generaltexth->translate("vcmi.server.errors.existingProcess"));
+			showServerError(VLC->generaltexth->translate("vcmi.server.errors.existingProcess"));
 			setState(EClientState::CONNECTION_CANCELLED); // stop attempts to reconnect
 		}
 		logNetwork->error("Error: server failed to close correctly or crashed!");

+ 5 - 6
client/Client.cpp

@@ -11,7 +11,6 @@
 #include "Global.h"
 #include "Client.h"
 
-#include "CGameInfo.h"
 #include "CPlayerInterface.h"
 #include "PlayerLocalState.h"
 #include "CServerHandler.h"
@@ -91,7 +90,7 @@ CClient::~CClient() = default;
 
 const Services * CClient::services() const
 {
-	return VLC; //todo: this should be CGI
+	return VLC; //todo: this should be VLC
 }
 
 const CClient::BattleCb * CClient::battle(const BattleID & battleID) const
@@ -168,8 +167,8 @@ void CClient::save(const std::string & fname)
 
 void CClient::endNetwork()
 {
-	if (CGI->mh)
-		CGI->mh->endNetwork();
+	if (MAPHANDLER)
+		MAPHANDLER->endNetwork();
 
 	if (CPlayerInterface::battleInt)
 		CPlayerInterface::battleInt->endNetwork();
@@ -197,7 +196,7 @@ void CClient::endGame()
 		logNetwork->info("Ending current game!");
 		removeGUI();
 
-		CGI->mh.reset();
+		MAPHANDLER.reset();
 		vstd::clear_pointer(gs);
 
 		logNetwork->info("Deleted mapHandler and gameState.");
@@ -219,7 +218,7 @@ void CClient::initMapHandler()
 	// During loading CPlayerInterface from serialized state it's depend on MH
 	if(!settings["session"]["headless"].Bool())
 	{
-		CGI->mh = std::make_shared<CMapHandler>(gs->map);
+		MAPHANDLER = std::make_unique<CMapHandler>(gs->map);
 		logNetwork->trace("Creating mapHandler: %d ms", CSH->th->getDiff());
 	}
 }

+ 7 - 12
client/GameEngine.cpp

@@ -23,7 +23,6 @@
 #include "media/CVideoHandler.h"
 #include "media/CEmptyVideoPlayer.h"
 
-#include "CGameInfo.h"
 #include "CPlayerInterface.h"
 #include "adventureMap/AdventureMapInterface.h"
 #include "render/Canvas.h"
@@ -73,20 +72,16 @@ void GameEngine::init()
 #ifndef ENABLE_VIDEO
 	videoPlayerInstance = std::make_unique<CEmptyVideoPlayer>();
 #else
-	if (!settings["session"]["headless"].Bool())
-		videoPlayerInstance = std::make_unique<CVideoPlayer>();
-	else
+	if (settings["session"]["disableVideo"].Bool())
 		videoPlayerInstance = std::make_unique<CEmptyVideoPlayer>();
+	else
+		videoPlayerInstance = std::make_unique<CVideoPlayer>();
 #endif
 
-	if(!settings["session"]["headless"].Bool())
-	{
-		soundPlayerInstance = std::make_unique<CSoundHandler>();
-		musicPlayerInstance = std::make_unique<CMusicHandler>();
-		sound().setVolume((ui32)settings["general"]["sound"].Float());
-		music().setVolume((ui32)settings["general"]["music"].Float());
-	}
-
+	soundPlayerInstance = std::make_unique<CSoundHandler>();
+	musicPlayerInstance = std::make_unique<CMusicHandler>();
+	sound().setVolume((ui32)settings["general"]["sound"].Float());
+	music().setVolume((ui32)settings["general"]["music"].Float());
 	cursorHandlerInstance = std::make_unique<CursorHandler>();
 }
 

+ 1 - 2
client/HeroMovementController.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "HeroMovementController.h"
 
-#include "CGameInfo.h"
 #include "CPlayerInterface.h"
 #include "PlayerLocalState.h"
 #include "adventureMap/AdventureMapInterface.h"
@@ -185,7 +184,7 @@ void HeroMovementController::onTryMoveHero(const CGHeroInstance * hero, const Tr
 
 	// We are in network thread
 	// Block netpack processing until movement animation is over
-	CGI->mh->waitForOngoingAnimations();
+	MAPHANDLER->waitForOngoingAnimations();
 
 	//move finished
 	adventureInt->onHeroChanged(hero);

+ 38 - 39
client/NetPacksClient.cpp

@@ -12,7 +12,6 @@
 
 #include "Client.h"
 #include "CPlayerInterface.h"
-#include "CGameInfo.h"
 #include "windows/GUIClasses.h"
 #include "windows/CCastleInterface.h"
 #include "mapView/mapHandler.h"
@@ -382,20 +381,20 @@ void ApplyClientNetPackVisitor::visitGiveBonus(GiveBonus & pack)
 void ApplyFirstClientNetPackVisitor::visitChangeObjPos(ChangeObjPos & pack)
 {
 	CGObjectInstance *obj = gs.getObjInstance(pack.objid);
-	if(CGI && CGI->mh)
+	if(VLC && MAPHANDLER)
 	{
-		CGI->mh->onObjectFadeOut(obj, pack.initiator);
-		CGI->mh->waitForOngoingAnimations();
+		MAPHANDLER->onObjectFadeOut(obj, pack.initiator);
+		MAPHANDLER->waitForOngoingAnimations();
 	}
 }
 
 void ApplyClientNetPackVisitor::visitChangeObjPos(ChangeObjPos & pack)
 {
 	CGObjectInstance *obj = gs.getObjInstance(pack.objid);
-	if(CGI && CGI->mh)
+	if(VLC && MAPHANDLER)
 	{
-		CGI->mh->onObjectFadeIn(obj, pack.initiator);
-		CGI->mh->waitForOngoingAnimations();
+		MAPHANDLER->onObjectFadeIn(obj, pack.initiator);
+		MAPHANDLER->waitForOngoingAnimations();
 	}
 	callAllInterfaces(cl, &CGameInterface::invalidatePaths);
 }
@@ -486,8 +485,8 @@ void ApplyFirstClientNetPackVisitor::visitRemoveObject(RemoveObject & pack)
 {
 	const CGObjectInstance *o = cl.getObj(pack.objectID);
 
-	if(CGI->mh)
-		CGI->mh->onObjectFadeOut(o, pack.initiator);
+	if(MAPHANDLER)
+		MAPHANDLER->onObjectFadeOut(o, pack.initiator);
 
 	//notify interfaces about removal
 	for(auto i=cl.playerint.begin(); i!=cl.playerint.end(); i++)
@@ -498,8 +497,8 @@ void ApplyFirstClientNetPackVisitor::visitRemoveObject(RemoveObject & pack)
 			i->second->objectRemoved(o, pack.initiator);
 	}
 
-	if(CGI->mh)
-		CGI->mh->waitForOngoingAnimations();
+	if(MAPHANDLER)
+		MAPHANDLER->waitForOngoingAnimations();
 }
 
 void ApplyClientNetPackVisitor::visitRemoveObject(RemoveObject & pack)
@@ -514,21 +513,21 @@ void ApplyFirstClientNetPackVisitor::visitTryMoveHero(TryMoveHero & pack)
 {
 	CGHeroInstance *h = gs.getHero(pack.id);
 
-	if(CGI->mh)
+	if(MAPHANDLER)
 	{
 		switch (pack.result)
 		{
 			case TryMoveHero::EMBARK:
-				CGI->mh->onBeforeHeroEmbark(h, pack.start, pack.end);
+				MAPHANDLER->onBeforeHeroEmbark(h, pack.start, pack.end);
 				break;
 			case TryMoveHero::TELEPORTATION:
-				CGI->mh->onBeforeHeroTeleported(h, pack.start, pack.end);
+				MAPHANDLER->onBeforeHeroTeleported(h, pack.start, pack.end);
 				break;
 			case TryMoveHero::DISEMBARK:
-				CGI->mh->onBeforeHeroDisembark(h, pack.start, pack.end);
+				MAPHANDLER->onBeforeHeroDisembark(h, pack.start, pack.end);
 				break;
 		}
-		CGI->mh->waitForOngoingAnimations();
+		MAPHANDLER->waitForOngoingAnimations();
 	}
 }
 
@@ -537,21 +536,21 @@ void ApplyClientNetPackVisitor::visitTryMoveHero(TryMoveHero & pack)
 	const CGHeroInstance *h = cl.getHero(pack.id);
 	callAllInterfaces(cl, &CGameInterface::invalidatePaths);
 
-	if(CGI->mh)
+	if(MAPHANDLER)
 	{
 		switch(pack.result)
 		{
 			case TryMoveHero::SUCCESS:
-				CGI->mh->onHeroMoved(h, pack.start, pack.end);
+				MAPHANDLER->onHeroMoved(h, pack.start, pack.end);
 				break;
 			case TryMoveHero::EMBARK:
-				CGI->mh->onAfterHeroEmbark(h, pack.start, pack.end);
+				MAPHANDLER->onAfterHeroEmbark(h, pack.start, pack.end);
 				break;
 			case TryMoveHero::TELEPORTATION:
-				CGI->mh->onAfterHeroTeleported(h, pack.start, pack.end);
+				MAPHANDLER->onAfterHeroTeleported(h, pack.start, pack.end);
 				break;
 			case TryMoveHero::DISEMBARK:
-				CGI->mh->onAfterHeroDisembark(h, pack.start, pack.end);
+				MAPHANDLER->onAfterHeroDisembark(h, pack.start, pack.end);
 				break;
 		}
 	}
@@ -586,10 +585,10 @@ void ApplyClientNetPackVisitor::visitNewStructures(NewStructures & pack)
 	}
 
 	// invalidate section of map view with our object and force an update
-	if(CGI->mh)
+	if(MAPHANDLER)
 	{
-		CGI->mh->onObjectInstantRemove(town, town->getOwner());
-		CGI->mh->onObjectInstantAdd(town, town->getOwner());
+		MAPHANDLER->onObjectInstantRemove(town, town->getOwner());
+		MAPHANDLER->onObjectInstantAdd(town, town->getOwner());
 	}
 }
 void ApplyClientNetPackVisitor::visitRazeStructures(RazeStructures & pack)
@@ -601,10 +600,10 @@ void ApplyClientNetPackVisitor::visitRazeStructures(RazeStructures & pack)
 	}
 
 	// invalidate section of map view with our object and force an update
-	if(CGI->mh)
+	if(MAPHANDLER)
 	{
-		CGI->mh->onObjectInstantRemove(town, town->getOwner());
-		CGI->mh->onObjectInstantAdd(town, town->getOwner());
+		MAPHANDLER->onObjectInstantRemove(town, town->getOwner());
+		MAPHANDLER->onObjectInstantAdd(town, town->getOwner());
 	}
 }
 
@@ -655,15 +654,15 @@ void ApplyClientNetPackVisitor::visitHeroRecruited(HeroRecruited & pack)
 		if(const CGTownInstance *t = gs.getTown(pack.tid))
 			callInterfaceIfPresent(cl, h->getOwner(), &IGameEventsReceiver::heroInGarrisonChange, t);
 	}
-	if(CGI->mh)
-		CGI->mh->onObjectInstantAdd(h, h->getOwner());
+	if(MAPHANDLER)
+		MAPHANDLER->onObjectInstantAdd(h, h->getOwner());
 }
 
 void ApplyClientNetPackVisitor::visitGiveHero(GiveHero & pack)
 {
 	CGHeroInstance *h = gs.getHero(pack.id);
-	if(CGI->mh)
-		CGI->mh->onObjectInstantAdd(h, h->getOwner());
+	if(MAPHANDLER)
+		MAPHANDLER->onObjectInstantAdd(h, h->getOwner());
 	callInterfaceIfPresent(cl, h->tempOwner, &IGameEventsReceiver::heroCreated, h);
 }
 
@@ -689,10 +688,10 @@ void ApplyFirstClientNetPackVisitor::visitSetObjectProperty(SetObjectProperty &
 	}
 
 	// invalidate section of map view with our object and force an update with new flag color
-	if(pack.what == ObjProperty::OWNER && CGI->mh)
+	if(pack.what == ObjProperty::OWNER && MAPHANDLER)
 	{
 		auto object = gs.getObjInstance(pack.id);
-		CGI->mh->onObjectInstantRemove(object, object->getOwner());
+		MAPHANDLER->onObjectInstantRemove(object, object->getOwner());
 	}
 }
 
@@ -706,10 +705,10 @@ void ApplyClientNetPackVisitor::visitSetObjectProperty(SetObjectProperty & pack)
 	}
 
 	// invalidate section of map view with our object and force an update with new flag color
-	if(pack.what == ObjProperty::OWNER && CGI->mh)
+	if(pack.what == ObjProperty::OWNER && MAPHANDLER)
 	{
 		auto object = gs.getObjInstance(pack.id);
-		CGI->mh->onObjectInstantAdd(object, object->getOwner());
+		MAPHANDLER->onObjectInstantAdd(object, object->getOwner());
 	}
 }
 
@@ -1046,8 +1045,8 @@ void ApplyClientNetPackVisitor::visitNewObject(NewObject & pack)
 	callAllInterfaces(cl, &CGameInterface::invalidatePaths);
 
 	const CGObjectInstance *obj = pack.newObject;
-	if(CGI->mh)
-		CGI->mh->onObjectFadeIn(obj, pack.initiator);
+	if(MAPHANDLER)
+		MAPHANDLER->onObjectFadeIn(obj, pack.initiator);
 
 	for(auto i=cl.playerint.begin(); i!=cl.playerint.end(); i++)
 	{
@@ -1055,8 +1054,8 @@ void ApplyClientNetPackVisitor::visitNewObject(NewObject & pack)
 			i->second->newObject(obj);
 	}
 
-	if(CGI->mh)
-		CGI->mh->waitForOngoingAnimations();
+	if(MAPHANDLER)
+		MAPHANDLER->waitForOngoingAnimations();
 }
 
 void ApplyClientNetPackVisitor::visitSetAvailableArtifacts(SetAvailableArtifacts & pack)

+ 0 - 1
client/NetPacksLobbyClient.cpp

@@ -25,7 +25,6 @@
 
 #include "CServerHandler.h"
 #include "GameChatHandler.h"
-#include "CGameInfo.h"
 #include "Client.h"
 #include "GameEngine.h"
 #include "gui/WindowHandler.h"

+ 5 - 6
client/adventureMap/AdventureMapInterface.cpp

@@ -25,7 +25,6 @@
 #include "../mapView/MapView.h"
 #include "../windows/InfoWindows.h"
 #include "../widgets/RadialMenu.h"
-#include "../CGameInfo.h"
 #include "../gui/CursorHandler.h"
 #include "../GameEngine.h"
 #include "../gui/Shortcut.h"
@@ -566,8 +565,8 @@ void AdventureMapInterface::onTileLeftClicked(const int3 &targetPosition)
 			   LOCPLINT->localState->getPath(currentHero).endPos() == destinationTile &&
 			   !ENGINE->isKeyboardShiftDown())//we'll be moving
 			{
-				assert(!CGI->mh->hasOngoingAnimations());
-				if(!CGI->mh->hasOngoingAnimations() && LOCPLINT->localState->getPath(currentHero).nextNode().turns == 0)
+				assert(!MAPHANDLER->hasOngoingAnimations());
+				if(!MAPHANDLER->hasOngoingAnimations() && LOCPLINT->localState->getPath(currentHero).nextNode().turns == 0)
 					LOCPLINT->moveHero(currentHero, LOCPLINT->localState->getPath(currentHero));
 				return;
 			}
@@ -652,7 +651,7 @@ void AdventureMapInterface::onTileHovered(const int3 &targetPosition)
 	}
 	else if(isTargetPositionVisible)
 	{
-		std::string tileTooltipText = CGI->mh->getTerrainDescr(targetPosition, false);
+		std::string tileTooltipText = MAPHANDLER->getTerrainDescr(targetPosition, false);
 		if (ENGINE->isKeyboardCmdDown())
 			tileTooltipText.append(" (" + std::to_string(targetPosition.x) + ", " + std::to_string(targetPosition.y) + ")");
 		ENGINE->statusbar()->write(tileTooltipText);
@@ -821,7 +820,7 @@ void AdventureMapInterface::onTileRightClicked(const int3 &mapPos)
 		const TerrainTile * tile = LOCPLINT->cb->getTile(mapPos);
 		if(tile)
 		{
-			std::string hlp = CGI->mh->getTerrainDescr(mapPos, true);
+			std::string hlp = MAPHANDLER->getTerrainDescr(mapPos, true);
 			CRClickPopup::createAndPush(hlp);
 		}
 		return;
@@ -853,7 +852,7 @@ void AdventureMapInterface::exitCastingMode()
 void AdventureMapInterface::hotkeyAbortCastingMode()
 {
 	exitCastingMode();
-	LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[731]); //Spell cancelled
+	LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[731]); //Spell cancelled
 }
 
 void AdventureMapInterface::performSpellcasting(const int3 & dest)

+ 12 - 13
client/adventureMap/AdventureMapShortcuts.cpp

@@ -11,7 +11,6 @@
 #include "StdInc.h"
 #include "AdventureMapShortcuts.h"
 
-#include "../CGameInfo.h"
 #include "../CMT.h"
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
@@ -289,14 +288,14 @@ void AdventureMapShortcuts::endTurn()
 
 				if(!LOCPLINT->localState->hasPath(hero))
 				{
-					LOCPLINT->showYesNoDialog( CGI->generaltexth->allTexts[55], [this](){ owner.hotkeyEndingTurn(); }, nullptr);
+					LOCPLINT->showYesNoDialog( VLC->generaltexth->allTexts[55], [this](){ owner.hotkeyEndingTurn(); }, nullptr);
 					return;
 				}
 
 				auto path = LOCPLINT->localState->getPath(hero);
 				if (path.nodes.size() < 2 || path.nodes[path.nodes.size() - 2].turns)
 				{
-					LOCPLINT->showYesNoDialog( CGI->generaltexth->allTexts[55], [this](){ owner.hotkeyEndingTurn(); }, nullptr);
+					LOCPLINT->showYesNoDialog( VLC->generaltexth->allTexts[55], [this](){ owner.hotkeyEndingTurn(); }, nullptr);
 					return;
 				}
 			}
@@ -316,7 +315,7 @@ void AdventureMapShortcuts::showThievesGuild()
 	if(itr != LOCPLINT->localState->getOwnedTowns().end())
 		LOCPLINT->showThievesGuildWindow(*itr);
 	else
-		LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"));
+		LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"));
 }
 
 void AdventureMapShortcuts::showScenarioInfo()
@@ -327,7 +326,7 @@ void AdventureMapShortcuts::showScenarioInfo()
 void AdventureMapShortcuts::toMainMenu()
 {
 	LOCPLINT->showYesNoDialog(
-		CGI->generaltexth->allTexts[578],
+		VLC->generaltexth->allTexts[578],
 		[]()
 		{
 			CSH->endGameplay();
@@ -340,7 +339,7 @@ void AdventureMapShortcuts::toMainMenu()
 void AdventureMapShortcuts::newGame()
 {
 	LOCPLINT->showYesNoDialog(
-		CGI->generaltexth->allTexts[578],
+		VLC->generaltexth->allTexts[578],
 		[]()
 		{
 			CSH->endGameplay();
@@ -353,7 +352,7 @@ void AdventureMapShortcuts::newGame()
 void AdventureMapShortcuts::quitGame()
 {
 	LOCPLINT->showYesNoDialog(
-		CGI->generaltexth->allTexts[578],
+		VLC->generaltexth->allTexts[578],
 		[]()
 		{
 			ENGINE->dispatchMainThread( []()
@@ -391,7 +390,7 @@ void AdventureMapShortcuts::viewPuzzleMap()
 void AdventureMapShortcuts::restartGame()
 {
 	LOCPLINT->showYesNoDialog(
-		CGI->generaltexth->translate("vcmi.adventureMap.confirmRestartGame"),
+		VLC->generaltexth->translate("vcmi.adventureMap.confirmRestartGame"),
 		[]()
 		{
 			ENGINE->dispatchMainThread(
@@ -440,7 +439,7 @@ void AdventureMapShortcuts::showMarketplace()
 	if(townWithMarket) //if any town has marketplace, open window
 		ENGINE->windows().createAndPushWindow<CMarketWindow>(townWithMarket, nullptr, nullptr, EMarketMode::RESOURCE_RESOURCE);
 	else //if not - complain
-		LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
+		LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
 }
 
 void AdventureMapShortcuts::firstTown()
@@ -516,7 +515,7 @@ void AdventureMapShortcuts::search(bool next)
 	if(next)
 		selectObjOnMap(lastSel);
 	else
-		ENGINE->windows().createAndPushWindow<CObjectListWindow>(texts, nullptr, CGI->generaltexth->translate("vcmi.adventureMap.search.hover"), CGI->generaltexth->translate("vcmi.adventureMap.search.help"), [selectObjOnMap](int index){ selectObjOnMap(index); }, lastSel, std::vector<std::shared_ptr<IImage>>(), true);
+		ENGINE->windows().createAndPushWindow<CObjectListWindow>(texts, nullptr, VLC->generaltexth->translate("vcmi.adventureMap.search.hover"), VLC->generaltexth->translate("vcmi.adventureMap.search.help"), [selectObjOnMap](int index){ selectObjOnMap(index); }, lastSel, std::vector<std::shared_ptr<IImage>>(), true);
 }
 
 void AdventureMapShortcuts::nextObject()
@@ -537,12 +536,12 @@ void AdventureMapShortcuts::moveHeroDirectional(const Point & direction)
 	if(!h)
 		return;
 
-	if (CGI->mh->hasOngoingAnimations())
+	if (MAPHANDLER->hasOngoingAnimations())
 		return;
 
 	int3 dst = h->visitablePos() + int3(direction.x, direction.y, 0);
 
-	if (!CGI->mh->isInMap((dst)))
+	if (!MAPHANDLER->isInMap((dst)))
 		return;
 
 	if ( !LOCPLINT->localState->setPath(h, dst))
@@ -559,7 +558,7 @@ void AdventureMapShortcuts::moveHeroDirectional(const Point & direction)
 
 bool AdventureMapShortcuts::optionCanViewQuests()
 {
-	return optionInMapView() && !CGI->mh->getMap()->quests.empty();
+	return optionInMapView() && !MAPHANDLER->getMap()->quests.empty();
 }
 
 bool AdventureMapShortcuts::optionCanToggleLevel()

+ 2 - 2
client/adventureMap/AdventureOptions.cpp

@@ -11,7 +11,6 @@
 #include "StdInc.h"
 #include "AdventureOptions.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../PlayerLocalState.h"
 #include "../lobby/CCampaignInfoScreen.h"
@@ -22,6 +21,7 @@
 #include "../widgets/Buttons.h"
 
 #include "../../CCallback.h"
+#include "../../lib/VCMI_Lib.h"
 #include "../../lib/StartInfo.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 
@@ -46,7 +46,7 @@ AdventureOptions::AdventureOptions()
 	scenInfo->addCallback(AdventureOptions::showScenarioInfo);
 	
 	replay = std::make_shared<CButton>(Point(24, 257), AnimationPath::builtin("ADVTURN.DEF"), CButton::tooltip(), [&](){ close(); }, EShortcut::ADVENTURE_REPLAY_TURN);
-	replay->addCallback([]{ LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.replayOpponentTurnNotImplemented")); });
+	replay->addCallback([]{ LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.replayOpponentTurnNotImplemented")); });
 
 	exit = std::make_shared<CButton>(Point(203, 313), AnimationPath::builtin("IOK6432.DEF"), CButton::tooltip(), std::bind(&AdventureOptions::close, this), EShortcut::GLOBAL_RETURN);
 }

+ 0 - 1
client/adventureMap/CInGameConsole.cpp

@@ -11,7 +11,6 @@
 #include "StdInc.h"
 #include "CInGameConsole.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
 #include "../GameChatHandler.h"

+ 6 - 7
client/adventureMap/CInfoBar.cpp

@@ -19,7 +19,6 @@
 #include "../widgets/TextControls.h"
 #include "../widgets/MiscWidgets.h"
 #include "../windows/InfoWindows.h"
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../PlayerLocalState.h"
 #include "../GameEngine.h"
@@ -80,9 +79,9 @@ CInfoBar::VisibleDateInfo::VisibleDateInfo()
 
 	std::string labelText;
 	if(LOCPLINT->cb->getDate(Date::DAY_OF_WEEK) == 1 && LOCPLINT->cb->getDate(Date::DAY) != 1) // monday of any week but first - show new week info
-		labelText = CGI->generaltexth->allTexts[63] + " " + std::to_string(LOCPLINT->cb->getDate(Date::WEEK));
+		labelText = VLC->generaltexth->allTexts[63] + " " + std::to_string(LOCPLINT->cb->getDate(Date::WEEK));
 	else
-		labelText = CGI->generaltexth->allTexts[64] + " " + std::to_string(LOCPLINT->cb->getDate(Date::DAY_OF_WEEK));
+		labelText = VLC->generaltexth->allTexts[64] + " " + std::to_string(LOCPLINT->cb->getDate(Date::DAY_OF_WEEK));
 
 	label = std::make_shared<CLabel>(95, 31, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, labelText);
 
@@ -151,8 +150,8 @@ CInfoBar::VisibleGameStatusInfo::VisibleGameStatusInfo()
 
 	//generate widgets
 	background = std::make_shared<CPicture>(ImagePath::builtin("ADSTATIN"));
-	allyLabel = std::make_shared<CLabel>(10, 106, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[390] + ":");
-	enemyLabel = std::make_shared<CLabel>(10, 136, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[391] + ":");
+	allyLabel = std::make_shared<CLabel>(10, 106, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[390] + ":");
+	enemyLabel = std::make_shared<CLabel>(10, 136, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[391] + ":");
 
 	int posx = allyLabel->pos.w + allyLabel->pos.x - pos.x + 4;
 	for(PlayerColor & player : allies)
@@ -308,13 +307,13 @@ void CInfoBar::clickReleased(const Point & cursorPosition, bool lastActivated)
 
 void CInfoBar::showPopupWindow(const Point & cursorPosition)
 {
-	CRClickPopup::createAndPush(CGI->generaltexth->allTexts[109]);
+	CRClickPopup::createAndPush(VLC->generaltexth->allTexts[109]);
 }
 
 void CInfoBar::hover(bool on)
 {
 	if(on)
-		ENGINE->statusbar()->write(CGI->generaltexth->zelp[292].first);
+		ENGINE->statusbar()->write(VLC->generaltexth->zelp[292].first);
 	else
 		ENGINE->statusbar()->clear();
 }

+ 2 - 3
client/adventureMap/CList.cpp

@@ -19,7 +19,6 @@
 #include "../widgets/RadialMenu.h"
 #include "../windows/InfoWindows.h"
 #include "../windows/CCastleInterface.h"
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../PlayerLocalState.h"
 #include "../GameEngine.h"
@@ -265,7 +264,7 @@ void CHeroList::CHeroItem::showTooltip()
 
 std::string CHeroList::CHeroItem::getHoverText()
 {
-	return boost::str(boost::format(CGI->generaltexth->allTexts[15]) % hero->getNameTranslated() % hero->getClassNameTranslated()) + hero->getMovementPointsTextIfOwner(hero->getOwner());
+	return boost::str(boost::format(VLC->generaltexth->allTexts[15]) % hero->getNameTranslated() % hero->getClassNameTranslated()) + hero->getMovementPointsTextIfOwner(hero->getOwner());
 }
 
 void CHeroList::CHeroItem::gesture(bool on, const Point & initialPosition, const Point & finalPosition)
@@ -315,7 +314,7 @@ void CHeroList::CHeroItem::keyPressed(EShortcut key)
 
 	if(key == EShortcut::LIST_HERO_DISMISS)
 	{
-		LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[22], [=](){ LOCPLINT->cb->dismissHero(hero); }, nullptr);
+		LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[22], [=](){ LOCPLINT->cb->dismissHero(hero); }, nullptr);
 		return;
 	}
 

+ 2 - 3
client/adventureMap/CMinimap.cpp

@@ -14,7 +14,6 @@
 #include "AdventureMapInterface.h"
 
 #include "../widgets/Images.h"
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../gui/MouseButton.h"
@@ -159,13 +158,13 @@ void CMinimap::clickPressed(const Point & cursorPosition)
 
 void CMinimap::showPopupWindow(const Point & cursorPosition)
 {
-	CRClickPopup::createAndPush(CGI->generaltexth->zelp[291].second);
+	CRClickPopup::createAndPush(VLC->generaltexth->zelp[291].second);
 }
 
 void CMinimap::hover(bool on)
 {
 	if(on)
-		ENGINE->statusbar()->write(CGI->generaltexth->zelp[291].first);
+		ENGINE->statusbar()->write(VLC->generaltexth->zelp[291].first);
 	else
 		ENGINE->statusbar()->clear();
 }

+ 4 - 4
client/adventureMap/CResDataBar.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "CResDataBar.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../render/Canvas.h"
 #include "../render/Colors.h"
@@ -23,6 +22,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/ResourceSet.h"
+#include "../../lib/VCMI_Lib.h"
 
 CResDataBar::CResDataBar(const ImagePath & imageName, const Point & position)
 {
@@ -61,9 +61,9 @@ std::string CResDataBar::buildDateString()
 	std::string pattern = "%s: %d, %s: %d, %s: %d";
 
 	auto formatted = boost::format(pattern)
-		% CGI->generaltexth->translate("core.genrltxt.62") % LOCPLINT->cb->getDate(Date::MONTH)
-		% CGI->generaltexth->translate("core.genrltxt.63") % LOCPLINT->cb->getDate(Date::WEEK)
-		% CGI->generaltexth->translate("core.genrltxt.64") % LOCPLINT->cb->getDate(Date::DAY_OF_WEEK);
+		% VLC->generaltexth->translate("core.genrltxt.62") % LOCPLINT->cb->getDate(Date::MONTH)
+		% VLC->generaltexth->translate("core.genrltxt.63") % LOCPLINT->cb->getDate(Date::WEEK)
+		% VLC->generaltexth->translate("core.genrltxt.64") % LOCPLINT->cb->getDate(Date::DAY_OF_WEEK);
 
 	return boost::str(formatted);
 }

+ 3 - 4
client/adventureMap/MapAudioPlayer.cpp

@@ -11,7 +11,6 @@
 #include "MapAudioPlayer.h"
 
 #include "../CCallback.h"
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../mapView/mapHandler.h"
@@ -132,7 +131,7 @@ std::vector<AudioPath> MapAudioPlayer::getAmbientSounds(const int3 & tile)
 
 	for(auto & objectID : objects[tile.z][tile.x][tile.y])
 	{
-		const auto & object = CGI->mh->getMap()->objects[objectID.getNum()];
+		const auto & object = MAPHANDLER->getMap()->objects[objectID.getNum()];
 
 		assert(object);
 		if (!object)
@@ -146,7 +145,7 @@ std::vector<AudioPath> MapAudioPlayer::getAmbientSounds(const int3 & tile)
 		}
 	}
 
-	if(CGI->mh->getMap()->isCoastalTile(tile))
+	if(MAPHANDLER->getMap()->isCoastalTile(tile))
 		result.emplace_back(AudioPath::builtin("LOOPOCEA"));
 
 	return result;
@@ -206,7 +205,7 @@ MapAudioPlayer::MapAudioPlayer()
 
 	objects.resize(boost::extents[mapSize.z][mapSize.x][mapSize.y]);
 
-	for(const auto & obj : CGI->mh->getMap()->objects)
+	for(const auto & obj : MAPHANDLER->getMap()->objects)
 	{
 		if (obj)
 			addObject(obj);

+ 0 - 1
client/adventureMap/TurnTimerWidget.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "TurnTimerWidget.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../battle/BattleInterface.h"
 #include "../battle/BattleStacksController.h"

+ 25 - 26
client/battle/BattleActionsController.cpp

@@ -17,7 +17,6 @@
 #include "BattleSiegeController.h"
 #include "BattleInterfaceClasses.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../gui/CursorHandler.h"
 #include "../GameEngine.h"
@@ -55,8 +54,8 @@ static std::string replacePlaceholders(std::string input, const TextReplacementL
 static std::string translatePlural(int amount, const std::string& baseTextID)
 {
 	if(amount == 1)
-		return CGI->generaltexth->translate(baseTextID + ".1");
-	return CGI->generaltexth->translate(baseTextID);
+		return VLC->generaltexth->translate(baseTextID + ".1");
+	return VLC->generaltexth->translate(baseTextID);
 }
 
 static std::string formatPluralImpl(int amount, const std::string & amountString, const std::string & baseTextID)
@@ -93,7 +92,7 @@ static std::string formatAttack(const DamageEstimation & estimation, const std::
 		{ "%KILLS", formatPlural(estimation.kills, "vcmi.battleWindow.damageEstimation.kills") },
 	};
 
-	return replacePlaceholders(CGI->generaltexth->translate(baseTextID), replacements);
+	return replacePlaceholders(VLC->generaltexth->translate(baseTextID), replacements);
 }
 
 static std::string formatMeleeAttack(const DamageEstimation & estimation, const std::string & creatureName)
@@ -117,7 +116,7 @@ static std::string formatRangedAttack(const DamageEstimation & estimation, const
 static std::string formatRetaliation(const DamageEstimation & estimation, bool mayBeKilled)
 {
 	if (estimation.damage.max == 0)
-		return CGI->generaltexth->translate("vcmi.battleWindow.damageRetaliation.never");
+		return VLC->generaltexth->translate("vcmi.battleWindow.damageRetaliation.never");
 
 	std::string baseTextID = estimation.kills.max == 0 ?
 								 "vcmi.battleWindow.damageRetaliation.damage" :
@@ -127,7 +126,7 @@ static std::string formatRetaliation(const DamageEstimation & estimation, bool m
 		"vcmi.battleWindow.damageRetaliation.may" :
 		"vcmi.battleWindow.damageRetaliation.will";
 
-	return CGI->generaltexth->translate(prefixTextID) + formatAttack(estimation, "", baseTextID, 0);
+	return VLC->generaltexth->translate(prefixTextID) + formatAttack(estimation, "", baseTextID, 0);
 }
 
 BattleActionsController::BattleActionsController(BattleInterface & owner):
@@ -507,14 +506,14 @@ std::string BattleActionsController::actionGetStatusMessage(PossiblePlayerBattle
 	switch (action.get()) //display console message, realize selected action
 	{
 		case PossiblePlayerBattleAction::CHOOSE_TACTICS_STACK:
-			return (boost::format(CGI->generaltexth->allTexts[481]) % targetStack->getName()).str(); //Select %s
+			return (boost::format(VLC->generaltexth->allTexts[481]) % targetStack->getName()).str(); //Select %s
 
 		case PossiblePlayerBattleAction::MOVE_TACTICS:
 		case PossiblePlayerBattleAction::MOVE_STACK:
 			if (owner.stacksController->getActiveStack()->hasBonusOfType(BonusType::FLYING))
-				return (boost::format(CGI->generaltexth->allTexts[295]) % owner.stacksController->getActiveStack()->getName()).str(); //Fly %s here
+				return (boost::format(VLC->generaltexth->allTexts[295]) % owner.stacksController->getActiveStack()->getName()).str(); //Fly %s here
 			else
-				return (boost::format(CGI->generaltexth->allTexts[294]) % owner.stacksController->getActiveStack()->getName()).str(); //Move %s here
+				return (boost::format(VLC->generaltexth->allTexts[294]) % owner.stacksController->getActiveStack()->getName()).str(); //Move %s here
 
 		case PossiblePlayerBattleAction::ATTACK:
 		case PossiblePlayerBattleAction::WALK_AND_ATTACK:
@@ -539,7 +538,7 @@ std::string BattleActionsController::actionGetStatusMessage(PossiblePlayerBattle
 			{
 				auto spellLikeAttackBonus = owner.stacksController->getActiveStack()->getBonus(Selector::type()(BonusType::SPELL_LIKE_ATTACK));
 				assert(spellLikeAttackBonus != nullptr);
-				return boost::str(boost::format(CGI->generaltexth->allTexts[26]) % spellLikeAttackBonus->subtype.as<SpellID>().toSpell()->getNameTranslated());
+				return boost::str(boost::format(VLC->generaltexth->allTexts[26]) % spellLikeAttackBonus->subtype.as<SpellID>().toSpell()->getNameTranslated());
 			}
 
 			const auto * shooter = owner.stacksController->getActiveStack();
@@ -553,37 +552,37 @@ std::string BattleActionsController::actionGetStatusMessage(PossiblePlayerBattle
 		}
 
 		case PossiblePlayerBattleAction::AIMED_SPELL_CREATURE:
-			return boost::str(boost::format(CGI->generaltexth->allTexts[27]) % action.spell().toSpell()->getNameTranslated() % targetStack->getName()); //Cast %s on %s
+			return boost::str(boost::format(VLC->generaltexth->allTexts[27]) % action.spell().toSpell()->getNameTranslated() % targetStack->getName()); //Cast %s on %s
 
 		case PossiblePlayerBattleAction::ANY_LOCATION:
-			return boost::str(boost::format(CGI->generaltexth->allTexts[26]) % action.spell().toSpell()->getNameTranslated()); //Cast %s
+			return boost::str(boost::format(VLC->generaltexth->allTexts[26]) % action.spell().toSpell()->getNameTranslated()); //Cast %s
 
 		case PossiblePlayerBattleAction::RANDOM_GENIE_SPELL: //we assume that teleport / sacrifice will never be available as random spell
-			return boost::str(boost::format(CGI->generaltexth->allTexts[301]) % targetStack->getName()); //Cast a spell on %
+			return boost::str(boost::format(VLC->generaltexth->allTexts[301]) % targetStack->getName()); //Cast a spell on %
 
 		case PossiblePlayerBattleAction::TELEPORT:
-			return CGI->generaltexth->allTexts[25]; //Teleport Here
+			return VLC->generaltexth->allTexts[25]; //Teleport Here
 
 		case PossiblePlayerBattleAction::OBSTACLE:
-			return CGI->generaltexth->allTexts[550];
+			return VLC->generaltexth->allTexts[550];
 
 		case PossiblePlayerBattleAction::SACRIFICE:
-			return (boost::format(CGI->generaltexth->allTexts[549]) % targetStack->getName()).str(); //sacrifice the %s
+			return (boost::format(VLC->generaltexth->allTexts[549]) % targetStack->getName()).str(); //sacrifice the %s
 
 		case PossiblePlayerBattleAction::FREE_LOCATION:
-			return boost::str(boost::format(CGI->generaltexth->allTexts[26]) % action.spell().toSpell()->getNameTranslated()); //Cast %s
+			return boost::str(boost::format(VLC->generaltexth->allTexts[26]) % action.spell().toSpell()->getNameTranslated()); //Cast %s
 
 		case PossiblePlayerBattleAction::HEAL:
-			return (boost::format(CGI->generaltexth->allTexts[419]) % targetStack->getName()).str(); //Apply first aid to the %s
+			return (boost::format(VLC->generaltexth->allTexts[419]) % targetStack->getName()).str(); //Apply first aid to the %s
 
 		case PossiblePlayerBattleAction::CATAPULT:
 			return ""; // TODO
 
 		case PossiblePlayerBattleAction::CREATURE_INFO:
-			return (boost::format(CGI->generaltexth->allTexts[297]) % targetStack->getName()).str();
+			return (boost::format(VLC->generaltexth->allTexts[297]) % targetStack->getName()).str();
 
 		case PossiblePlayerBattleAction::HERO_INFO:
-			return  CGI->generaltexth->translate("core.genrltxt.417"); // "View Hero Stats"
+			return  VLC->generaltexth->translate("core.genrltxt.417"); // "View Hero Stats"
 	}
 	assert(0);
 	return "";
@@ -595,16 +594,16 @@ std::string BattleActionsController::actionGetStatusMessageBlocked(PossiblePlaye
 	{
 		case PossiblePlayerBattleAction::AIMED_SPELL_CREATURE:
 		case PossiblePlayerBattleAction::RANDOM_GENIE_SPELL:
-			return CGI->generaltexth->allTexts[23];
+			return VLC->generaltexth->allTexts[23];
 			break;
 		case PossiblePlayerBattleAction::TELEPORT:
-			return CGI->generaltexth->allTexts[24]; //Invalid Teleport Destination
+			return VLC->generaltexth->allTexts[24]; //Invalid Teleport Destination
 			break;
 		case PossiblePlayerBattleAction::SACRIFICE:
-			return CGI->generaltexth->allTexts[543]; //choose army to sacrifice
+			return VLC->generaltexth->allTexts[543]; //choose army to sacrifice
 			break;
 		case PossiblePlayerBattleAction::FREE_LOCATION:
-			return boost::str(boost::format(CGI->generaltexth->allTexts[181]) % action.spell().toSpell()->getNameTranslated()); //No room to place %s here
+			return boost::str(boost::format(VLC->generaltexth->allTexts[181]) % action.spell().toSpell()->getNameTranslated()); //No room to place %s here
 			break;
 		default:
 			return "";
@@ -1064,7 +1063,7 @@ void BattleActionsController::onHexRightClicked(const BattleHex & clickedHex)
 	if (heroSpellcastingModeActive() || isCurrentStackInSpellcastMode)
 	{
 		endCastingSpell();
-		CRClickPopup::createAndPush(CGI->generaltexth->translate("core.genrltxt.731")); // spell cancelled
+		CRClickPopup::createAndPush(VLC->generaltexth->translate("core.genrltxt.731")); // spell cancelled
 		return;
 	}
 
@@ -1126,4 +1125,4 @@ void BattleActionsController::pushFrontPossibleAction(PossiblePlayerBattleAction
 void BattleActionsController::resetCurrentStackPossibleActions()
 {
 	possibleActions = getPossibleActionsForStack(owner.stacksController->getActiveStack());
-}
+}

+ 0 - 1
client/battle/BattleAnimationClasses.cpp

@@ -19,7 +19,6 @@
 #include "BattleStacksController.h"
 #include "CreatureAnimation.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../gui/CursorHandler.h"
 #include "../GameEngine.h"

+ 1 - 2
client/battle/BattleEffectsController.cpp

@@ -18,7 +18,6 @@
 #include "BattleStacksController.h"
 #include "BattleRenderer.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../media/ISoundPlayer.h"
@@ -83,7 +82,7 @@ void BattleEffectsController::battleTriggerEffect(const BattleTriggerEffect & bt
 			break;
 		case BonusType::MORALE:
 		{
-			std::string hlp = CGI->generaltexth->allTexts[33];
+			std::string hlp = VLC->generaltexth->allTexts[33];
 			boost::algorithm::replace_first(hlp,"%s",(stack->getName()));
 			displayEffect(EBattleEffect::GOOD_MORALE, AudioPath::builtin("GOODMRLE"), stack->getPosition());
 			owner.appendBattleLog(hlp);

+ 0 - 1
client/battle/BattleFieldController.cpp

@@ -21,7 +21,6 @@
 #include "BattleProjectileController.h"
 #include "BattleRenderer.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../render/CAnimation.h"
 #include "../render/Canvas.h"

+ 1 - 2
client/battle/BattleInterface.cpp

@@ -23,7 +23,6 @@
 #include "BattleStacksController.h"
 #include "BattleRenderer.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../gui/CursorHandler.h"
 #include "../GameEngine.h"
@@ -257,7 +256,7 @@ void BattleInterface::newRoundFirst()
 
 void BattleInterface::newRound()
 {
-	console->addText(CGI->generaltexth->allTexts[412]);
+	console->addText(VLC->generaltexth->allTexts[412]);
 	round++;
 }
 

+ 29 - 30
client/battle/BattleInterfaceClasses.cpp

@@ -18,7 +18,6 @@
 #include "BattleStacksController.h"
 #include "BattleWindow.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../gui/CursorHandler.h"
 #include "../GameEngine.h"
@@ -462,7 +461,7 @@ std::vector<std::tuple<SpellID, bool>> QuickSpellPanel::getSpells() const
 		if(spellIds[i] != SpellID::NONE)
 			continue;
 
-		for(const auto & availableSpellID : CGI->spellh->getDefaultAllowed())
+		for(const auto & availableSpellID : VLC->spellh->getDefaultAllowed())
 		{
 			const auto * availableSpell = availableSpellID.toSpell();
 			if(!availableSpell->isAdventure() && !availableSpell->isCreatureAbility() && hero->canCastThisSpell(availableSpell) && !vstd::contains(spellIds, availableSpell->getId()))
@@ -572,10 +571,10 @@ void HeroInfoBasicPanel::initializeData(const InfoAboutHero & hero)
 	icons.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("PortraitsLarge"), hero.getIconIndex(), 0, 10, 6));
 
 	//primary stats
-	labels.push_back(std::make_shared<CLabel>(9, 75, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[380] + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 87, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[381] + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 99, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[382] + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 111, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[383] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 75, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[380] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 87, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[381] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 99, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[382] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 111, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[383] + ":"));
 
 	labels.push_back(std::make_shared<CLabel>(69, 87, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, std::to_string(attack)));
 	labels.push_back(std::make_shared<CLabel>(69, 99, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, std::to_string(defense)));
@@ -583,14 +582,14 @@ void HeroInfoBasicPanel::initializeData(const InfoAboutHero & hero)
 	labels.push_back(std::make_shared<CLabel>(69, 123, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, std::to_string(knowledge)));
 
 	//morale+luck
-	labels.push_back(std::make_shared<CLabel>(9, 131, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[384] + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 143, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[385] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 131, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[384] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 143, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[385] + ":"));
 
 	icons.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("IMRL22"), morale + 3, 0, 47, 131));
 	icons.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("ILCK22"), luck + 3, 0, 47, 143));
 
 	//spell points
-	labels.push_back(std::make_shared<CLabel>(39, 174, EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[387]));
+	labels.push_back(std::make_shared<CLabel>(39, 174, EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[387]));
 	labels.push_back(std::make_shared<CLabel>(39, 186, EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, std::to_string(currentSpellPoints) + "/" + std::to_string(maxSpellPoints)));
 }
 
@@ -633,9 +632,9 @@ void StackInfoBasicPanel::initializeData(const CStack * stack)
 	icons.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("TWCRPORT"), stack->creatureId() + 2, 0, 10, 6));
 	labels.push_back(std::make_shared<CLabel>(10 + 58, 6 + 64, FONT_MEDIUM, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, TextOperations::formatMetric(stack->getCount(), 4)));
 
-	auto attack = std::to_string(CGI->creatures()->getByIndex(stack->creatureIndex())->getAttack(stack->isShooter())) + "(" + std::to_string(stack->getAttack(stack->isShooter())) + ")";
-	auto defense = std::to_string(CGI->creatures()->getByIndex(stack->creatureIndex())->getDefense(stack->isShooter())) + "(" + std::to_string(stack->getDefense(stack->isShooter())) + ")";
-	auto damage = std::to_string(CGI->creatures()->getByIndex(stack->creatureIndex())->getMinDamage(stack->isShooter())) + "-" + std::to_string(stack->getMaxDamage(stack->isShooter()));
+	auto attack = std::to_string(VLC->creatures()->getByIndex(stack->creatureIndex())->getAttack(stack->isShooter())) + "(" + std::to_string(stack->getAttack(stack->isShooter())) + ")";
+	auto defense = std::to_string(VLC->creatures()->getByIndex(stack->creatureIndex())->getDefense(stack->isShooter())) + "(" + std::to_string(stack->getDefense(stack->isShooter())) + ")";
+	auto damage = std::to_string(VLC->creatures()->getByIndex(stack->creatureIndex())->getMinDamage(stack->isShooter())) + "-" + std::to_string(stack->getMaxDamage(stack->isShooter()));
 	auto health = stack->getMaxHealth();
 	auto morale = stack->moraleVal();
 	auto luck = stack->luckVal();
@@ -644,10 +643,10 @@ void StackInfoBasicPanel::initializeData(const CStack * stack)
 	auto healthRemaining = TextOperations::formatMetric(std::max(stack->getAvailableHealth() - (stack->getCount() - 1) * health, (si64)0), 4);
 
 	//primary stats*/
-	labels.push_back(std::make_shared<CLabel>(9, 75, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[380] + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 87, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[381] + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 99, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[386] + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 111, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[389] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 75, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[380] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 87, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[381] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 99, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[386] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 111, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[389] + ":"));
 
 	labels.push_back(std::make_shared<CLabel>(69, 87, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, attack));
 	labels.push_back(std::make_shared<CLabel>(69, 99, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, defense));
@@ -655,15 +654,15 @@ void StackInfoBasicPanel::initializeData(const CStack * stack)
 	labels.push_back(std::make_shared<CLabel>(69, 123, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, std::to_string(health)));
 
 	//morale+luck
-	labels.push_back(std::make_shared<CLabel>(9, 131, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[384] + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 143, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[385] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 131, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[384] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 143, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[385] + ":"));
 
 	icons.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("IMRL22"), morale + 3, 0, 47, 131));
 	icons.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("ILCK22"), luck + 3, 0, 47, 143));
 
 	//extra information
 	labels.push_back(std::make_shared<CLabel>(9, 168, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->translate("vcmi.battleWindow.killed") + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 180, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[389] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 180, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[389] + ":"));
 
 	labels.push_back(std::make_shared<CLabel>(69, 180, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, std::to_string(killed)));
 	labels.push_back(std::make_shared<CLabel>(69, 192, EFonts::FONT_TINY, ETextAlignment::BOTTOMRIGHT, Colors::WHITE, healthRemaining));
@@ -702,7 +701,7 @@ void StackInfoBasicPanel::initializeData(const CStack * stack)
 	}
 
 	if(spells.size() == 0)
-		labelsMultiline.push_back(std::make_shared<CMultiLineLabel>(Rect(firstPos.x, firstPos.y, 48, 36), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[674]));
+		labelsMultiline.push_back(std::make_shared<CMultiLineLabel>(Rect(firstPos.x, firstPos.y, 48, 36), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[674]));
 	if(spells.size() > 3)
 		labelsMultiline.push_back(std::make_shared<CMultiLineLabel>(Rect(firstPos.x + offset.x * 2, firstPos.y + offset.y * 2 - 4, 48, 36), EFonts::FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, "..."));
 }
@@ -750,30 +749,30 @@ BattleResultWindow::BattleResultWindow(const BattleResult & br, CPlayerInterface
 	{
 		repeat = std::make_shared<CButton>(Point(24, 505), AnimationPath::builtin("icn6432.def"), std::make_pair("", ""), [&](){ bRepeatf();}, EShortcut::GLOBAL_CANCEL);
 		repeat->setBorderColor(Colors::METALLIC_GOLD);
-		labels.push_back(std::make_shared<CLabel>(232, 520, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->translate("vcmi.battleResultsWindow.applyResultsLabel")));
+		labels.push_back(std::make_shared<CLabel>(232, 520, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->translate("vcmi.battleResultsWindow.applyResultsLabel")));
 	}
 
 	if(br.winner == BattleSide::ATTACKER)
 	{
-		labels.push_back(std::make_shared<CLabel>(59, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[410]));
+		labels.push_back(std::make_shared<CLabel>(59, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[410]));
 	}
 	else
 	{
-		labels.push_back(std::make_shared<CLabel>(59, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[411]));
+		labels.push_back(std::make_shared<CLabel>(59, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[411]));
 	}
 	
 	if(br.winner == BattleSide::DEFENDER)
 	{
-		labels.push_back(std::make_shared<CLabel>(412, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[410]));
+		labels.push_back(std::make_shared<CLabel>(412, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[410]));
 	}
 	else
 	{
-		labels.push_back(std::make_shared<CLabel>(408, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[411]));
+		labels.push_back(std::make_shared<CLabel>(408, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[411]));
 	}
 
-	labels.push_back(std::make_shared<CLabel>(232, 302, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW,  CGI->generaltexth->allTexts[407]));
-	labels.push_back(std::make_shared<CLabel>(232, 332, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[408]));
-	labels.push_back(std::make_shared<CLabel>(232, 428, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[409]));
+	labels.push_back(std::make_shared<CLabel>(232, 302, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW,  VLC->generaltexth->allTexts[407]));
+	labels.push_back(std::make_shared<CLabel>(232, 332, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[408]));
+	labels.push_back(std::make_shared<CLabel>(232, 428, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[409]));
 
 	std::string sideNames[2] = {"N/A", "N/A"};
 
@@ -817,7 +816,7 @@ BattleResultWindow::BattleResultWindow(const BattleResult & br, CPlayerInterface
 	{
 		if(br.casualties[step].size()==0)
 		{
-			labels.push_back(std::make_shared<CLabel>(235, 360 + 97 * static_cast<int>(step), FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[523]));
+			labels.push_back(std::make_shared<CLabel>(235, 360 + 97 * static_cast<int>(step), FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[523]));
 		}
 		else
 		{
@@ -825,7 +824,7 @@ BattleResultWindow::BattleResultWindow(const BattleResult & br, CPlayerInterface
 			int yPos = 344 + static_cast<int>(step) * 97;
 			for(auto & elem : br.casualties[step])
 			{
-				auto creature = CGI->creatures()->getByIndex(elem.first);
+				auto creature = VLC->creatures()->getByIndex(elem.first);
 				if (creature->getId() == CreatureID::ARROW_TOWERS )
 					continue; // do not show destroyed towers in battle results
 

+ 0 - 1
client/battle/BattleObstacleController.cpp

@@ -17,7 +17,6 @@
 #include "BattleRenderer.h"
 #include "CreatureAnimation.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../media/ISoundPlayer.h"

+ 0 - 1
client/battle/BattleProjectileController.cpp

@@ -19,7 +19,6 @@
 #include "../render/Canvas.h"
 #include "../render/IRenderHandler.h"
 #include "../GameEngine.h"
-#include "../CGameInfo.h"
 
 #include "../../lib/CStack.h"
 #include "../../lib/mapObjects/CGTownInstance.h"

+ 0 - 1
client/battle/BattleSiegeController.cpp

@@ -17,7 +17,6 @@
 #include "BattleFieldController.h"
 #include "BattleRenderer.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../media/ISoundPlayer.h"

+ 1 - 2
client/battle/BattleStacksController.cpp

@@ -23,7 +23,6 @@
 #include "CreatureAnimation.h"
 
 #include "../CPlayerInterface.h"
-#include "../CGameInfo.h"
 #include "../GameEngine.h"
 #include "../gui/WindowHandler.h"
 #include "../media/ISoundPlayer.h"
@@ -263,7 +262,7 @@ std::shared_ptr<IImage> BattleStacksController::getStackAmountBox(const CStack *
 
 	for(const auto & spellID : activeSpells)
 	{
-		auto positiveness = CGI->spells()->getByIndex(spellID)->getPositiveness();
+		auto positiveness = VLC->spells()->getByIndex(spellID)->getPositiveness();
 		if(!boost::logic::indeterminate(positiveness))
 		{
 			if(positiveness)

+ 7 - 8
client/battle/BattleWindow.cpp

@@ -16,7 +16,6 @@
 #include "BattleStacksController.h"
 #include "BattleActionsController.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../gui/CursorHandler.h"
 #include "../GameEngine.h"
@@ -561,7 +560,7 @@ void BattleWindow::bSurrenderf()
 			enemyHeroName = "#ENEMY#";
 		}
 
-		std::string surrenderMessage = boost::str(boost::format(CGI->generaltexth->allTexts[32]) % enemyHeroName % cost); //%s states: "I will accept your surrender and grant you and your troops safe passage for the price of %d gold."
+		std::string surrenderMessage = boost::str(boost::format(VLC->generaltexth->allTexts[32]) % enemyHeroName % cost); //%s states: "I will accept your surrender and grant you and your troops safe passage for the price of %d gold."
 		owner.curInt->showYesNoDialog(surrenderMessage, [this](){ reallySurrender(); }, nullptr);
 	}
 }
@@ -574,7 +573,7 @@ void BattleWindow::bFleef()
 	if ( owner.getBattle()->battleCanFlee() )
 	{
 		auto ony = std::bind(&BattleWindow::reallyFlee,this);
-		owner.curInt->showYesNoDialog(CGI->generaltexth->allTexts[28], ony, nullptr); //Are you sure you want to retreat?
+		owner.curInt->showYesNoDialog(VLC->generaltexth->allTexts[28], ony, nullptr); //Are you sure you want to retreat?
 	}
 	else
 	{
@@ -588,7 +587,7 @@ void BattleWindow::bFleef()
 			if (owner.defendingHeroInstance->tempOwner == owner.curInt->cb->getPlayerID())
 				heroName = owner.defendingHeroInstance->getNameTranslated();
 		//calculating text
-		auto txt = boost::format(CGI->generaltexth->allTexts[340]) % heroName; //The Shackles of War are present.  %s can not retreat!
+		auto txt = boost::format(VLC->generaltexth->allTexts[340]) % heroName; //The Shackles of War are present.  %s can not retreat!
 
 		//printing message
 		owner.curInt->showInfoDialog(boost::str(txt), comps);
@@ -605,7 +604,7 @@ void BattleWindow::reallySurrender()
 {
 	if (owner.curInt->cb->getResourceAmount(EGameResID::GOLD) < owner.getBattle()->battleGetSurrenderCost())
 	{
-		owner.curInt->showInfoDialog(CGI->generaltexth->allTexts[29]); //You don't have enough gold!
+		owner.curInt->showInfoDialog(VLC->generaltexth->allTexts[29]); //You don't have enough gold!
 	}
 	else
 	{
@@ -746,13 +745,13 @@ void BattleWindow::bSpellf()
 			std::string heroName = myHero->hasArt(artID, true) ? myHero->getNameTranslated() : owner.enemyHero().name;
 
 			//%s wields the %s, an ancient artifact which creates a p dead to all magic.
-			LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[683])
-										% heroName % CGI->artifacts()->getByIndex(artID)->getNameTranslated()));
+			LOCPLINT->showInfoDialog(boost::str(boost::format(VLC->generaltexth->allTexts[683])
+										% heroName % VLC->artifacts()->getByIndex(artID)->getNameTranslated()));
 		}
 		else if(blockingBonus->source == BonusSource::OBJECT_TYPE)
 		{
 			if(blockingBonus->sid.as<MapObjectID>() == Obj::GARRISON || blockingBonus->sid.as<MapObjectID>() == Obj::GARRISON2)
-				LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[684]);
+				LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[684]);
 		}
 	}
 	else

+ 0 - 1
client/eventsSDL/InputHandler.cpp

@@ -26,7 +26,6 @@
 #include "../media/ISoundPlayer.h"
 #include "../CMT.h"
 #include "../CPlayerInterface.h"
-#include "../CGameInfo.h"
 
 #include "../../lib/CConfigHandler.h"
 

+ 0 - 1
client/eventsSDL/InputSourceGameController.cpp

@@ -13,7 +13,6 @@
 
 #include "InputHandler.h"
 
-#include "../CGameInfo.h"
 #include "../GameEngine.h"
 #include "../gui/CursorHandler.h"
 #include "../gui/EventDispatcher.h"

+ 0 - 1
client/eventsSDL/InputSourceTouch.cpp

@@ -14,7 +14,6 @@
 #include "InputHandler.h"
 
 #include "../../lib/CConfigHandler.h"
-#include "../CGameInfo.h"
 #include "../gui/CursorHandler.h"
 #include "../GameEngine.h"
 #include "../gui/EventDispatcher.h"

+ 5 - 5
client/globalLobby/GlobalLobbyClient.cpp

@@ -16,7 +16,6 @@
 #include "GlobalLobbyObserver.h"
 #include "GlobalLobbyWindow.h"
 
-#include "../CGameInfo.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"
 #include "../gui/WindowHandler.h"
@@ -29,6 +28,7 @@
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/MetaString.h"
 #include "../../lib/texts/TextOperations.h"
+#include "../../lib/VCMI_Lib.h"
 
 GlobalLobbyClient::GlobalLobbyClient()
 {
@@ -37,8 +37,8 @@ GlobalLobbyClient::GlobalLobbyClient()
 	if (customChannels.empty())
 	{
 		activeChannels.emplace_back("english");
-		if (CGI->generaltexth->getPreferredLanguage() != "english")
-			activeChannels.emplace_back(CGI->generaltexth->getPreferredLanguage());
+		if (VLC->generaltexth->getPreferredLanguage() != "english")
+			activeChannels.emplace_back(VLC->generaltexth->getPreferredLanguage());
 	}
 	else
 	{
@@ -379,7 +379,7 @@ void GlobalLobbyClient::sendClientRegister(const std::string & accountName)
 	JsonNode toSend;
 	toSend["type"].String() = "clientRegister";
 	toSend["displayName"].String() = accountName;
-	toSend["language"].String() = CGI->generaltexth->getPreferredLanguage();
+	toSend["language"].String() = VLC->generaltexth->getPreferredLanguage();
 	toSend["version"].String() = VCMI_VERSION_STRING;
 	sendMessage(toSend);
 }
@@ -390,7 +390,7 @@ void GlobalLobbyClient::sendClientLogin()
 	toSend["type"].String() = "clientLogin";
 	toSend["accountID"].String() = getAccountID();
 	toSend["accountCookie"].String() = getAccountCookie();
-	toSend["language"].String() = CGI->generaltexth->getPreferredLanguage();
+	toSend["language"].String() = VLC->generaltexth->getPreferredLanguage();
 	toSend["version"].String() = VCMI_VERSION_STRING;
 
 	for (const auto & language : activeChannels)

+ 6 - 6
client/globalLobby/GlobalLobbyLoginWindow.cpp

@@ -13,7 +13,6 @@
 
 #include "GlobalLobbyClient.h"
 
-#include "../CGameInfo.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"
 #include "../gui/Shortcut.h"
@@ -27,6 +26,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/MetaString.h"
+#include "../../lib/VCMI_Lib.h"
 
 GlobalLobbyLoginWindow::GlobalLobbyLoginWindow()
 	: CWindowObject(BORDERED)
@@ -41,8 +41,8 @@ GlobalLobbyLoginWindow::GlobalLobbyLoginWindow()
 	loginAs.replaceRawString(CSH->getGlobalLobby().getAccountDisplayName());
 
 	filledBackground = std::make_shared<FilledTexturePlayerColored>(Rect(0, 0, pos.w, pos.h));
-	labelTitle = std::make_shared<CLabel>( pos.w / 2, 20, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->translate("vcmi.lobby.login.title"));
-	labelUsernameTitle = std::make_shared<CLabel>( 10, 65, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("vcmi.lobby.login.username"));
+	labelTitle = std::make_shared<CLabel>( pos.w / 2, 20, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->translate("vcmi.lobby.login.title"));
+	labelUsernameTitle = std::make_shared<CLabel>( 10, 65, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->translate("vcmi.lobby.login.username"));
 	labelUsername = std::make_shared<CLabel>( 10, 65, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, loginAs.toString(), 265);
 	backgroundUsername = std::make_shared<TransparentFilledRectangle>(Rect(10, 90, 264, 20), ColorRGBA(0,0,0,128), ColorRGBA(64,64,64,64));
 	inputUsername = std::make_shared<CTextInput>(Rect(15, 93, 260, 16), FONT_SMALL, ETextAlignment::CENTERLEFT, true);
@@ -52,8 +52,8 @@ GlobalLobbyLoginWindow::GlobalLobbyLoginWindow()
 
 	auto buttonRegister = std::make_shared<CToggleButton>(Point(10, 40),  AnimationPath::builtin("GSPBUT2"), CButton::tooltip(), 0);
 	auto buttonLogin = std::make_shared<CToggleButton>(Point(146, 40), AnimationPath::builtin("GSPBUT2"), CButton::tooltip(), 0);
-	buttonRegister->setTextOverlay(CGI->generaltexth->translate("vcmi.lobby.login.create"), EFonts::FONT_SMALL, Colors::YELLOW);
-	buttonLogin->setTextOverlay(CGI->generaltexth->translate("vcmi.lobby.login.login"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonRegister->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.login.create"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonLogin->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.login.login"), EFonts::FONT_SMALL, Colors::YELLOW);
 
 	toggleMode = std::make_shared<CToggleGroup>(nullptr);
 	toggleMode->addToggle(0, buttonRegister);
@@ -109,7 +109,7 @@ void GlobalLobbyLoginWindow::onClose()
 
 void GlobalLobbyLoginWindow::onLogin()
 {
-	labelStatus->setText(CGI->generaltexth->translate("vcmi.lobby.login.connecting"));
+	labelStatus->setText(VLC->generaltexth->translate("vcmi.lobby.login.connecting"));
 	if(!CSH->getGlobalLobby().isConnected())
 		CSH->getGlobalLobby().connect();
 	else

+ 4 - 4
client/globalLobby/GlobalLobbyRoomWindow.cpp

@@ -15,7 +15,6 @@
 #include "GlobalLobbyDefines.h"
 #include "GlobalLobbyWindow.h"
 
-#include "../CGameInfo.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"
 #include "../gui/Shortcut.h"
@@ -30,6 +29,7 @@
 #include "../../lib/modding/ModDescription.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/MetaString.h"
+#include "../../lib/VCMI_Lib.h"
 
 GlobalLobbyRoomAccountCard::GlobalLobbyRoomAccountCard(const GlobalLobbyAccount & accountDescription)
 {
@@ -63,7 +63,7 @@ GlobalLobbyRoomModCard::GlobalLobbyRoomModCard(const GlobalLobbyRoomModInfo & mo
 		statusColor = ColorRGBA(128, 128, 128);
 	else if(modInfo.status == ModVerificationStatus::VERSION_MISMATCH)
 		statusColor = Colors::YELLOW;
-	labelStatus = std::make_shared<CLabel>(5, 30, FONT_SMALL, ETextAlignment::CENTERLEFT, statusColor, CGI->generaltexth->translate("vcmi.lobby.mod.state." + statusToString.at(modInfo.status)));
+	labelStatus = std::make_shared<CLabel>(5, 30, FONT_SMALL, ETextAlignment::CENTERLEFT, statusColor, VLC->generaltexth->translate("vcmi.lobby.mod.state." + statusToString.at(modInfo.status)));
 }
 
 static std::string getJoinRoomErrorMessage(const GlobalLobbyRoom & roomDescription, const std::vector<GlobalLobbyRoomModInfo> & modVerificationList)
@@ -128,14 +128,14 @@ GlobalLobbyRoomWindow::GlobalLobbyRoomWindow(GlobalLobbyWindow * window, const s
 		GlobalLobbyRoomModInfo modInfo;
 		modInfo.status = modEntry.second;
 		if (modEntry.second == ModVerificationStatus::EXCESSIVE)
-			modInfo.version = CGI->modh->getModInfo(modEntry.first).getVersion().toString();
+			modInfo.version = VLC->modh->getModInfo(modEntry.first).getVersion().toString();
 		else
 			modInfo.version = roomDescription.modList.at(modEntry.first).version.toString();
 
 		if (modEntry.second == ModVerificationStatus::NOT_INSTALLED)
 			modInfo.modName = roomDescription.modList.at(modEntry.first).name;
 		else
-			modInfo.modName = CGI->modh->getModInfo(modEntry.first).getName();
+			modInfo.modName = VLC->modh->getModInfo(modEntry.first).getName();
 
 		modVerificationList.push_back(modInfo);
 	}

+ 9 - 9
client/globalLobby/GlobalLobbyServerSetup.cpp

@@ -13,7 +13,6 @@
 
 #include "GlobalLobbyClient.h"
 
-#include "../CGameInfo.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"
 #include "../gui/Shortcut.h"
@@ -25,6 +24,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/MetaString.h"
+#include "../../lib/VCMI_Lib.h"
 
 GlobalLobbyServerSetup::GlobalLobbyServerSetup()
 	: CWindowObject(BORDERED)
@@ -35,10 +35,10 @@ GlobalLobbyServerSetup::GlobalLobbyServerSetup()
 	pos.h = 340;
 
 	filledBackground = std::make_shared<FilledTexturePlayerColored>(Rect(0, 0, pos.w, pos.h));
-	labelTitle = std::make_shared<CLabel>( pos.w / 2, 20, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->translate("vcmi.lobby.room.create"));
-	labelPlayerLimit = std::make_shared<CLabel>( pos.w / 2, 48, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->translate("vcmi.lobby.room.players.limit"));
-	labelRoomType = std::make_shared<CLabel>( pos.w / 2, 108, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->translate("vcmi.lobby.room.type"));
-	labelGameMode = std::make_shared<CLabel>( pos.w / 2, 158, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->translate("vcmi.lobby.room.mode"));
+	labelTitle = std::make_shared<CLabel>( pos.w / 2, 20, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->translate("vcmi.lobby.room.create"));
+	labelPlayerLimit = std::make_shared<CLabel>( pos.w / 2, 48, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->translate("vcmi.lobby.room.players.limit"));
+	labelRoomType = std::make_shared<CLabel>( pos.w / 2, 108, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->translate("vcmi.lobby.room.type"));
+	labelGameMode = std::make_shared<CLabel>( pos.w / 2, 158, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->translate("vcmi.lobby.room.mode"));
 
 	togglePlayerLimit = std::make_shared<CToggleGroup>(nullptr);
 	togglePlayerLimit->addToggle(2, std::make_shared<CToggleButton>(Point(10 + 39*0, 60), AnimationPath::builtin("RanNum2"), CButton::tooltip(), 0));
@@ -53,8 +53,8 @@ GlobalLobbyServerSetup::GlobalLobbyServerSetup()
 
 	auto buttonPublic  = std::make_shared<CToggleButton>(Point(10, 120),  AnimationPath::builtin("GSPBUT2"), CButton::tooltip(), 0);
 	auto buttonPrivate = std::make_shared<CToggleButton>(Point(146, 120), AnimationPath::builtin("GSPBUT2"), CButton::tooltip(), 0);
-	buttonPublic->setTextOverlay(CGI->generaltexth->translate("vcmi.lobby.room.state.public"), EFonts::FONT_SMALL, Colors::YELLOW);
-	buttonPrivate->setTextOverlay(CGI->generaltexth->translate("vcmi.lobby.room.state.private"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonPublic->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.room.state.public"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonPrivate->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.room.state.private"), EFonts::FONT_SMALL, Colors::YELLOW);
 
 	toggleRoomType = std::make_shared<CToggleGroup>(nullptr);
 	toggleRoomType->addToggle(0, buttonPublic);
@@ -64,8 +64,8 @@ GlobalLobbyServerSetup::GlobalLobbyServerSetup()
 
 	auto buttonNewGame = std::make_shared<CToggleButton>(Point(10, 170),  AnimationPath::builtin("GSPBUT2"), CButton::tooltip(), 0);
 	auto buttonLoadGame = std::make_shared<CToggleButton>(Point(146, 170), AnimationPath::builtin("GSPBUT2"), CButton::tooltip(), 0);
-	buttonNewGame->setTextOverlay(CGI->generaltexth->translate("vcmi.lobby.room.new"), EFonts::FONT_SMALL, Colors::YELLOW);
-	buttonLoadGame->setTextOverlay(CGI->generaltexth->translate("vcmi.lobby.room.load"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonNewGame->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.room.new"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonLoadGame->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.room.load"), EFonts::FONT_SMALL, Colors::YELLOW);
 
 	toggleGameMode = std::make_shared<CToggleGroup>(nullptr);
 	toggleGameMode->addToggle(0, buttonNewGame);

+ 0 - 1
client/globalLobby/GlobalLobbyWidget.cpp

@@ -16,7 +16,6 @@
 #include "GlobalLobbyRoomWindow.h"
 #include "GlobalLobbyWindow.h"
 
-#include "../CGameInfo.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"
 #include "../gui/WindowHandler.h"

+ 4 - 4
client/gui/InterfaceObjectConfigurable.cpp

@@ -12,7 +12,6 @@
 
 #include "InterfaceObjectConfigurable.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../gui/ShortcutHandler.h"
@@ -35,6 +34,7 @@
 #include "../../lib/json/JsonUtils.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/filesystem/ResourcePath.h"
+#include "../../lib/VCMI_Lib.h"
 
 InterfaceObjectConfigurable::InterfaceObjectConfigurable(const JsonNode & config, int used, Point offset):
 	InterfaceObjectConfigurable(used, offset)
@@ -185,7 +185,7 @@ std::string InterfaceObjectConfigurable::readText(const JsonNode & config) const
 	if(s.empty())
 		return s;
 	logGlobal->debug("Reading text from translations by key: %s", s);
-	return CGI->generaltexth->translate(s);
+	return VLC->generaltexth->translate(s);
 }
 
 Point InterfaceObjectConfigurable::readPosition(const JsonNode & config) const
@@ -303,8 +303,8 @@ std::pair<std::string, std::string> InterfaceObjectConfigurable::readHintText(co
 		if(config.getType() == JsonNode::JsonType::DATA_STRING)
 		{
 			logGlobal->debug("Reading hint text (help) from generaltext handler:%sd", config.String());
-			result.first  = CGI->generaltexth->translate( config.String(), "hover");
-			result.second = CGI->generaltexth->translate( config.String(), "help");
+			result.first  = VLC->generaltexth->translate( config.String(), "hover");
+			result.second = VLC->generaltexth->translate( config.String(), "help");
 		}
 	}
 	return result;

+ 0 - 1
client/gui/WindowHandler.cpp

@@ -14,7 +14,6 @@
 #include "CIntObject.h"
 #include "CursorHandler.h"
 
-#include "../CGameInfo.h"
 #include "../render/Canvas.h"
 #include "../render/IScreenHandler.h"
 #include "../render/Colors.h"

+ 13 - 14
client/lobby/CBonusSelection.cpp

@@ -17,7 +17,6 @@
 #include "CSelectionBase.h"
 #include "ExtraOptionsTab.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
 #include "../mainmenu/CMainMenu.h"
@@ -92,29 +91,29 @@ CBonusSelection::CBonusSelection()
 
 	iconsMapSizes = std::make_shared<CAnimImage>(AnimationPath::builtin("SCNRMPSZ"), 4, 0, 735, 26);
 
-	labelCampaignDescription = std::make_shared<CLabel>(481, 63, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[38]);
+	labelCampaignDescription = std::make_shared<CLabel>(481, 63, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[38]);
 	campaignDescription = std::make_shared<CTextBox>(getCampaign()->getDescriptionTranslated(), Rect(480, 86, 286, 117), 1);
 
 	bool videoButtonActive = CSH->getState() == EClientState::GAMEPLAY;
 	int availableSpace = videoButtonActive ? 225 : 285;
 	mapName = std::make_shared<CLabel>(481, 219, FONT_BIG, ETextAlignment::TOPLEFT, Colors::YELLOW, CSH->mi->getNameTranslated(), availableSpace );
-	labelMapDescription = std::make_shared<CLabel>(481, 253, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[496]);
+	labelMapDescription = std::make_shared<CLabel>(481, 253, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[496]);
 	mapDescription = std::make_shared<CTextBox>("", Rect(480, 278, 286, 108), 1);
 
-	labelChooseBonus = std::make_shared<CLabel>(475, 432, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[71]);
+	labelChooseBonus = std::make_shared<CLabel>(475, 432, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[71]);
 	groupBonuses = std::make_shared<CToggleGroup>(std::bind(&IServerAPI::setCampaignBonus, CSH, _1));
 
 	flagbox = std::make_shared<CFlagBox>(Rect(486, 407, 335, 23));
 
 	std::vector<std::string> difficulty;
-	std::string difficultyString = CGI->generaltexth->allTexts[492];
+	std::string difficultyString = VLC->generaltexth->allTexts[492];
 	boost::split(difficulty, difficultyString, boost::is_any_of(" "));
 	labelDifficulty = std::make_shared<CLabel>(724, settings["general"]["enableUiEnhancements"].Bool() ? 457 : 432, FONT_MEDIUM, ETextAlignment::TOPCENTER, Colors::WHITE, difficulty.back());
 
 	for(size_t b = 0; b < difficultyIcons.size(); ++b)
 	{
 		difficultyIcons[b] = std::make_shared<CAnimImage>(AnimationPath::builtinTODO("GSPBUT" + std::to_string(b + 3) + ".DEF"), 0, 0, 709, settings["general"]["enableUiEnhancements"].Bool() ? 480 : 455);
-		difficultyIconAreas[b] = std::make_shared<LRClickableArea>(difficultyIcons[b]->pos - pos.topLeft(), nullptr, [b]() { CRClickPopup::createAndPush(CGI->generaltexth->zelp[24 + b].second); });
+		difficultyIconAreas[b] = std::make_shared<LRClickableArea>(difficultyIcons[b]->pos - pos.topLeft(), nullptr, [b]() { CRClickPopup::createAndPush(VLC->generaltexth->zelp[24 + b].second); });
 	}
 
 	if(getCampaign()->playerSelectedDifficulty())
@@ -145,8 +144,8 @@ CBonusSelection::CBonusSelection()
 		tabExtraOptions->recActions = UPDATE | SHOWALL | LCLICK | RCLICK_POPUP;
 		tabExtraOptions->recreate(true);
 		tabExtraOptions->setEnabled(false);
-		buttonExtraOptions = std::make_shared<CButton>(Point(643, 431), AnimationPath::builtin("GSPBUT2.DEF"), CGI->generaltexth->zelp[46], [this]{ tabExtraOptions->setEnabled(!tabExtraOptions->isActive()); ENGINE->windows().totalRedraw(); }, EShortcut::LOBBY_EXTRA_OPTIONS);
-		buttonExtraOptions->setTextOverlay(CGI->generaltexth->translate("vcmi.optionsTab.extraOptions.hover"), FONT_SMALL, Colors::WHITE);
+		buttonExtraOptions = std::make_shared<CButton>(Point(643, 431), AnimationPath::builtin("GSPBUT2.DEF"), VLC->generaltexth->zelp[46], [this]{ tabExtraOptions->setEnabled(!tabExtraOptions->isActive()); ENGINE->windows().totalRedraw(); }, EShortcut::LOBBY_EXTRA_OPTIONS);
+		buttonExtraOptions->setTextOverlay(VLC->generaltexth->translate("vcmi.optionsTab.extraOptions.hover"), FONT_SMALL, Colors::WHITE);
 	}
 }
 
@@ -213,8 +212,8 @@ void CBonusSelection::createBonusesIcons()
 			picName = graphics->ERMUtoPicture[faction][buildID];
 			picNumber = -1;
 
-			if(vstd::contains((*CGI->townh)[faction]->town->buildings, buildID))
-				desc.appendTextID((*CGI->townh)[faction]->town->buildings.find(buildID)->second->getNameTextID());
+			if(vstd::contains((*VLC->townh)[faction]->town->buildings, buildID))
+				desc.appendTextID((*VLC->townh)[faction]->town->buildings.find(buildID)->second->getNameTextID());
 			break;
 		}
 		case CampaignBonusType::ARTIFACT:
@@ -248,7 +247,7 @@ void CBonusSelection::createBonusesIcons()
 			for(int v = 0; v < toPrint.size(); ++v)
 			{
 				substitute += std::to_string(toPrint[v].second);
-				substitute += " " + CGI->generaltexth->primarySkillNames[toPrint[v].first];
+				substitute += " " + VLC->generaltexth->primarySkillNames[toPrint[v].first];
 				if(v != toPrint.size() - 1)
 				{
 					substitute += ", ";
@@ -314,7 +313,7 @@ void CBonusSelection::createBonusesIcons()
 			else
 			{
 				desc.appendLocalString(EMetaText::GENERAL_TXT, 715); // Start with %s
-				desc.replaceTextID(CGI->heroh->objects[bonDescs[i].info2]->getNameTextID());
+				desc.replaceTextID(VLC->heroh->objects[bonDescs[i].info2]->getNameTextID());
 			}
 			break;
 		}
@@ -450,7 +449,7 @@ void CBonusSelection::startMap()
 	if(LOCPLINT) // we're currently ingame, so ask for starting new map and end game
 	{
 		close();
-		LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[67], [=]()
+		LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[67], [=]()
 		{
 			showPrologVideo();
 		}, 0);
@@ -465,7 +464,7 @@ void CBonusSelection::restartMap()
 {
 	close();
 	LOCPLINT->showYesNoDialog(
-		CGI->generaltexth->allTexts[67],
+		VLC->generaltexth->allTexts[67],
 		[=]()
 		{
 			ENGINE->dispatchMainThread(

+ 0 - 1
client/lobby/CCampaignInfoScreen.cpp

@@ -17,7 +17,6 @@
 #include "../../lib/mapping/CMapInfo.h"
 #include "../../lib/mapping/CMapHeader.h"
 #include "../GameEngine.h"
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 
 CCampaignInfoScreen::CCampaignInfoScreen()

+ 18 - 18
client/lobby/CLobbyScreen.cpp

@@ -34,7 +34,7 @@
 #include "../../lib/mapping/CMapInfo.h"
 #include "../../lib/networkPacks/PacksForLobby.h"
 #include "../../lib/rmg/CMapGenOptions.h"
-#include "../CGameInfo.h"
+#include "../../lib/VCMI_Lib.h"
 
 CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 	: CSelectionBase(screenType), bonusSel(nullptr)
@@ -47,7 +47,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 	{
 		tabSel->callOnSelect = std::bind(&IServerAPI::setMapInfo, CSH, _1, nullptr);
 
-		buttonSelect = std::make_shared<CButton>(Point(411, 80), AnimationPath::builtin("GSPBUTT.DEF"), CGI->generaltexth->zelp[45], 0, EShortcut::LOBBY_SELECT_SCENARIO);
+		buttonSelect = std::make_shared<CButton>(Point(411, 80), AnimationPath::builtin("GSPBUTT.DEF"), VLC->generaltexth->zelp[45], 0, EShortcut::LOBBY_SELECT_SCENARIO);
 		buttonSelect->addCallback([=]()
 		{
 			toggleTab(tabSel);
@@ -55,16 +55,16 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 				CSH->setMapInfo(tabSel->getSelectedMapInfo());
 		});
 
-		buttonOptions = std::make_shared<CButton>(Point(411, 510), AnimationPath::builtin("GSPBUTT.DEF"), CGI->generaltexth->zelp[46], std::bind(&CLobbyScreen::toggleTab, this, tabOpt), EShortcut::LOBBY_ADDITIONAL_OPTIONS);
+		buttonOptions = std::make_shared<CButton>(Point(411, 510), AnimationPath::builtin("GSPBUTT.DEF"), VLC->generaltexth->zelp[46], std::bind(&CLobbyScreen::toggleTab, this, tabOpt), EShortcut::LOBBY_ADDITIONAL_OPTIONS);
 		if(settings["general"]["enableUiEnhancements"].Bool())
 		{
-			buttonTurnOptions = std::make_shared<CButton>(Point(619, 105), AnimationPath::builtin("GSPBUT2.DEF"), CGI->generaltexth->zelp[46], std::bind(&CLobbyScreen::toggleTab, this, tabTurnOptions), EShortcut::LOBBY_TURN_OPTIONS);
-			buttonExtraOptions = std::make_shared<CButton>(Point(619, 510), AnimationPath::builtin("GSPBUT2.DEF"), CGI->generaltexth->zelp[46], std::bind(&CLobbyScreen::toggleTab, this, tabExtraOptions), EShortcut::LOBBY_EXTRA_OPTIONS);
+			buttonTurnOptions = std::make_shared<CButton>(Point(619, 105), AnimationPath::builtin("GSPBUT2.DEF"), VLC->generaltexth->zelp[46], std::bind(&CLobbyScreen::toggleTab, this, tabTurnOptions), EShortcut::LOBBY_TURN_OPTIONS);
+			buttonExtraOptions = std::make_shared<CButton>(Point(619, 510), AnimationPath::builtin("GSPBUT2.DEF"), VLC->generaltexth->zelp[46], std::bind(&CLobbyScreen::toggleTab, this, tabExtraOptions), EShortcut::LOBBY_EXTRA_OPTIONS);
 		}
 	};
 
-	buttonChat = std::make_shared<CButton>(Point(619, 80), AnimationPath::builtin("GSPBUT2.DEF"), CGI->generaltexth->zelp[48], std::bind(&CLobbyScreen::toggleChat, this), EShortcut::LOBBY_TOGGLE_CHAT);
-	buttonChat->setTextOverlay(CGI->generaltexth->allTexts[532], FONT_SMALL, Colors::WHITE);
+	buttonChat = std::make_shared<CButton>(Point(619, 80), AnimationPath::builtin("GSPBUT2.DEF"), VLC->generaltexth->zelp[48], std::bind(&CLobbyScreen::toggleChat, this), EShortcut::LOBBY_TOGGLE_CHAT);
+	buttonChat->setTextOverlay(VLC->generaltexth->allTexts[532], FONT_SMALL, Colors::WHITE);
 
 	switch(screenType)
 	{
@@ -75,7 +75,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 		tabExtraOptions = std::make_shared<ExtraOptionsTab>();
 		tabRand = std::make_shared<RandomMapTab>();
 		tabRand->mapInfoChanged += std::bind(&IServerAPI::setMapInfo, CSH, _1, _2);
-		buttonRMG = std::make_shared<CButton>(Point(411, 105), AnimationPath::builtin("GSPBUTT.DEF"), CGI->generaltexth->zelp[47], 0, EShortcut::LOBBY_RANDOM_MAP);
+		buttonRMG = std::make_shared<CButton>(Point(411, 105), AnimationPath::builtin("GSPBUTT.DEF"), VLC->generaltexth->zelp[47], 0, EShortcut::LOBBY_RANDOM_MAP);
 		buttonRMG->addCallback([this]()
 		{
 			toggleTab(tabRand);
@@ -85,7 +85,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 
 		card->iconDifficulty->addCallback(std::bind(&IServerAPI::setDifficulty, CSH, _1));
 
-		buttonStart = std::make_shared<CButton>(Point(411, 535), AnimationPath::builtin("SCNRBEG.DEF"), CGI->generaltexth->zelp[103], std::bind(&CLobbyScreen::startScenario, this, false), EShortcut::LOBBY_BEGIN_STANDARD_GAME);
+		buttonStart = std::make_shared<CButton>(Point(411, 535), AnimationPath::builtin("SCNRBEG.DEF"), VLC->generaltexth->zelp[103], std::bind(&CLobbyScreen::startScenario, this, false), EShortcut::LOBBY_BEGIN_STANDARD_GAME);
 		initLobby();
 		break;
 	}
@@ -94,7 +94,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 		tabOpt = std::make_shared<OptionsTab>();
 		tabTurnOptions = std::make_shared<TurnOptionsTab>();
 		tabExtraOptions = std::make_shared<ExtraOptionsTab>();
-		buttonStart = std::make_shared<CButton>(Point(411, 535), AnimationPath::builtin("SCNRLOD.DEF"), CGI->generaltexth->zelp[103], std::bind(&CLobbyScreen::startScenario, this, false), EShortcut::LOBBY_LOAD_GAME);
+		buttonStart = std::make_shared<CButton>(Point(411, 535), AnimationPath::builtin("SCNRLOD.DEF"), VLC->generaltexth->zelp[103], std::bind(&CLobbyScreen::startScenario, this, false), EShortcut::LOBBY_LOAD_GAME);
 		initLobby();
 		break;
 	}
@@ -106,7 +106,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 
 	buttonStart->block(true); // to be unblocked after map list is ready
 
-	buttonBack = std::make_shared<CButton>(Point(581, 535), AnimationPath::builtin("SCNRBACK.DEF"), CGI->generaltexth->zelp[105], [&]()
+	buttonBack = std::make_shared<CButton>(Point(581, 535), AnimationPath::builtin("SCNRBACK.DEF"), VLC->generaltexth->zelp[105], [&]()
 	{
 		bool wasInLobbyRoom = CSH->inLobbyRoom();
 		CSH->sendClientDisconnecting();
@@ -195,18 +195,18 @@ void CLobbyScreen::toggleMode(bool host)
 		return;
 
 	auto buttonColor = host ? Colors::WHITE : Colors::ORANGE;
-	buttonSelect->setTextOverlay("  " + CGI->generaltexth->allTexts[500], FONT_SMALL, buttonColor);
-	buttonOptions->setTextOverlay(CGI->generaltexth->allTexts[501], FONT_SMALL, buttonColor);
+	buttonSelect->setTextOverlay("  " + VLC->generaltexth->allTexts[500], FONT_SMALL, buttonColor);
+	buttonOptions->setTextOverlay(VLC->generaltexth->allTexts[501], FONT_SMALL, buttonColor);
 
 	if (buttonTurnOptions)
-		buttonTurnOptions->setTextOverlay(CGI->generaltexth->translate("vcmi.optionsTab.turnOptions.hover"), FONT_SMALL, buttonColor);
+		buttonTurnOptions->setTextOverlay(VLC->generaltexth->translate("vcmi.optionsTab.turnOptions.hover"), FONT_SMALL, buttonColor);
 
 	if (buttonExtraOptions)
-		buttonExtraOptions->setTextOverlay(CGI->generaltexth->translate("vcmi.optionsTab.extraOptions.hover"), FONT_SMALL, buttonColor);
+		buttonExtraOptions->setTextOverlay(VLC->generaltexth->translate("vcmi.optionsTab.extraOptions.hover"), FONT_SMALL, buttonColor);
 
 	if(buttonRMG)
 	{
-		buttonRMG->setTextOverlay("  " + CGI->generaltexth->allTexts[740], FONT_SMALL, buttonColor);
+		buttonRMG->setTextOverlay("  " + VLC->generaltexth->allTexts[740], FONT_SMALL, buttonColor);
 		buttonRMG->block(!host);
 	}
 	buttonSelect->block(!host);
@@ -230,9 +230,9 @@ void CLobbyScreen::toggleChat()
 {
 	card->toggleChat();
 	if(card->showChat)
-		buttonChat->setTextOverlay(CGI->generaltexth->allTexts[531], FONT_SMALL, Colors::WHITE);
+		buttonChat->setTextOverlay(VLC->generaltexth->allTexts[531], FONT_SMALL, Colors::WHITE);
 	else
-		buttonChat->setTextOverlay(CGI->generaltexth->allTexts[532], FONT_SMALL, Colors::WHITE);
+		buttonChat->setTextOverlay(VLC->generaltexth->allTexts[532], FONT_SMALL, Colors::WHITE);
 }
 
 void CLobbyScreen::updateAfterStateChange()

+ 3 - 3
client/lobby/CSavingScreen.cpp

@@ -12,7 +12,6 @@
 #include "CSavingScreen.h"
 #include "SelectionTab.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../gui/Shortcut.h"
@@ -26,6 +25,7 @@
 #include "../../lib/filesystem/Filesystem.h"
 #include "../../lib/mapping/CMapInfo.h"
 #include "../../lib/mapping/CMapHeader.h"
+#include "../../lib/VCMI_Lib.h"
 
 CSavingScreen::CSavingScreen()
 	: CSelectionBase(ESelectionScreen::saveGame)
@@ -40,7 +40,7 @@ CSavingScreen::CSavingScreen()
 	tabSel->toggleMode();
 	curTab = tabSel;
 		
-	buttonStart = std::make_shared<CButton>(Point(411, 535), AnimationPath::builtin("SCNRSAV.DEF"), CGI->generaltexth->zelp[103], std::bind(&CSavingScreen::saveGame, this), EShortcut::LOBBY_SAVE_GAME);
+	buttonStart = std::make_shared<CButton>(Point(411, 535), AnimationPath::builtin("SCNRSAV.DEF"), VLC->generaltexth->zelp[103], std::bind(&CSavingScreen::saveGame, this), EShortcut::LOBBY_SAVE_GAME);
 	
 	LOCPLINT->gamePause(true);
 }
@@ -90,7 +90,7 @@ void CSavingScreen::saveGame()
 
 	if(CResourceHandler::get("local")->existsResource(ResourcePath(path, EResType::SAVEGAME)))
 	{
-		std::string hlp = CGI->generaltexth->allTexts[493]; //%s exists. Overwrite?
+		std::string hlp = VLC->generaltexth->allTexts[493]; //%s exists. Overwrite?
 		boost::algorithm::replace_first(hlp, "%s", tabSel->inputName->getText());
 		LOCPLINT->showYesNoDialog(hlp, overWrite, nullptr);
 	}

+ 2 - 2
client/lobby/CScenarioInfoScreen.cpp

@@ -12,7 +12,6 @@
 #include "CScenarioInfoScreen.h"
 #include "OptionsTab.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../gui/Shortcut.h"
@@ -24,6 +23,7 @@
 #include "../../lib/StartInfo.h"
 #include "../../lib/mapping/CMapInfo.h"
 #include "../../lib/mapping/CMapHeader.h"
+#include "../../lib/VCMI_Lib.h"
 
 CScenarioInfoScreen::CScenarioInfoScreen()
 {
@@ -45,7 +45,7 @@ CScenarioInfoScreen::CScenarioInfoScreen()
 	card->changeSelection();
 
 	card->iconDifficulty->setSelected(getCurrentDifficulty());
-	buttonBack = std::make_shared<CButton>(Point(584, 535), AnimationPath::builtin("SCNRBACK.DEF"), CGI->generaltexth->zelp[105], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
+	buttonBack = std::make_shared<CButton>(Point(584, 535), AnimationPath::builtin("SCNRBACK.DEF"), VLC->generaltexth->zelp[105], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
 }
 
 CScenarioInfoScreen::~CScenarioInfoScreen()

+ 28 - 28
client/lobby/CSelectionBase.cpp

@@ -18,7 +18,6 @@
 
 #include "../../CCallback.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"
@@ -53,6 +52,7 @@
 #include "../../lib/entities/faction/CFaction.h"
 #include "../../lib/entities/faction/CTown.h"
 #include "../../lib/entities/faction/CTownHandler.h"
+#include "../../lib/VCMI_Lib.h"
 
 ISelectionScreenInfo::ISelectionScreenInfo(ESelectionScreen ScreenType)
 	: screenType(ScreenType)
@@ -101,7 +101,7 @@ CSelectionBase::CSelectionBase(ESelectionScreen type)
 	}
 	pos = background->center();
 	card = std::make_shared<InfoCard>();
-	buttonBack = std::make_shared<CButton>(Point(581, 535), AnimationPath::builtin("SCNRBACK.DEF"), CGI->generaltexth->zelp[105], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
+	buttonBack = std::make_shared<CButton>(Point(581, 535), AnimationPath::builtin("SCNRBACK.DEF"), VLC->generaltexth->zelp[105], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
 }
 
 void CSelectionBase::toggleTab(std::shared_ptr<CIntObject> tab)
@@ -148,15 +148,15 @@ InfoCard::InfoCard()
 	chat = std::make_shared<CChatBox>(Rect(18, 126, 335, 143));
 	pvpBox = std::make_shared<PvPBox>(Rect(17, 396, 338, 105));
 
-	buttonInvitePlayers = std::make_shared<CButton>(Point(20, 365), AnimationPath::builtin("pregameInvitePlayers"), CGI->generaltexth->zelp[105], [](){ CSH->getGlobalLobby().activateRoomInviteInterface(); }, EShortcut::LOBBY_INVITE_PLAYERS );
-	buttonOpenGlobalLobby = std::make_shared<CButton>(Point(188, 365), AnimationPath::builtin("pregameReturnToLobby"), CGI->generaltexth->zelp[105], [](){ CSH->getGlobalLobby().activateInterface(); }, EShortcut::MAIN_MENU_LOBBY );
+	buttonInvitePlayers = std::make_shared<CButton>(Point(20, 365), AnimationPath::builtin("pregameInvitePlayers"), VLC->generaltexth->zelp[105], [](){ CSH->getGlobalLobby().activateRoomInviteInterface(); }, EShortcut::LOBBY_INVITE_PLAYERS );
+	buttonOpenGlobalLobby = std::make_shared<CButton>(Point(188, 365), AnimationPath::builtin("pregameReturnToLobby"), VLC->generaltexth->zelp[105], [](){ CSH->getGlobalLobby().activateInterface(); }, EShortcut::MAIN_MENU_LOBBY );
 
 	buttonInvitePlayers->setTextOverlay  (MetaString::createFromTextID("vcmi.lobby.invite.header").toString(), EFonts::FONT_SMALL, Colors::WHITE);
 	buttonOpenGlobalLobby->setTextOverlay(MetaString::createFromTextID("vcmi.lobby.backToLobby").toString(), EFonts::FONT_SMALL, Colors::WHITE);
 
 	if(SEL->screenType == ESelectionScreen::campaignList)
 	{
-		labelCampaignDescription = std::make_shared<CLabel>(26, 132, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[38]);
+		labelCampaignDescription = std::make_shared<CLabel>(26, 132, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[38]);
 	}
 	else
 	{
@@ -175,7 +175,7 @@ InfoCard::InfoCard()
 
 			for(int i = 0; i < 5; i++)
 			{
-				auto button = std::make_shared<CToggleButton>(Point(110 + i * 32, 450), AnimationPath::builtin(difButns[i]), CGI->generaltexth->zelp[24 + i]);
+				auto button = std::make_shared<CToggleButton>(Point(110 + i * 32, 450), AnimationPath::builtin(difButns[i]), VLC->generaltexth->zelp[24 + i]);
 
 				iconDifficulty->addToggle(i, button);
 				if(SEL->screenType != ESelectionScreen::newGame)
@@ -184,13 +184,13 @@ InfoCard::InfoCard()
 		}
 
 		flagbox = std::make_shared<CFlagBox>(Rect(24, 400, 335, 23));
-		labelMapDiff = std::make_shared<CLabel>(33, 430, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[494]);
-		labelPlayerDifficulty = std::make_shared<CLabel>(133, 430, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[492] + ":");
-		labelRating = std::make_shared<CLabel>(290, 430, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[218] + ":");
-		labelScenarioName = std::make_shared<CLabel>(26, 22, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[495]);
-		labelScenarioDescription = std::make_shared<CLabel>(26, 132, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[496]);
-		labelVictoryCondition = std::make_shared<CLabel>(26, 283, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[497]);
-		labelLossCondition = std::make_shared<CLabel>(26, 339, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[498]);
+		labelMapDiff = std::make_shared<CLabel>(33, 430, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[494]);
+		labelPlayerDifficulty = std::make_shared<CLabel>(133, 430, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[492] + ":");
+		labelRating = std::make_shared<CLabel>(290, 430, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[218] + ":");
+		labelScenarioName = std::make_shared<CLabel>(26, 22, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[495]);
+		labelScenarioDescription = std::make_shared<CLabel>(26, 132, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[496]);
+		labelVictoryCondition = std::make_shared<CLabel>(26, 283, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[497]);
+		labelLossCondition = std::make_shared<CLabel>(26, 339, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[498]);
 		iconsVictoryCondition = std::make_shared<CAnimImage>(AnimationPath::builtin("SCNRVICT"), 0, 0, 24, 302);
 		iconsLossCondition = std::make_shared<CAnimImage>(AnimationPath::builtin("SCNRLOSS"), 0, 0, 24, 359);
 
@@ -247,7 +247,7 @@ void InfoCard::changeSelection()
 	iconsLossCondition->setFrame(header->defeatIconIndex);
 	labelLossConditionText->setText(header->defeatMessage.toString());
 	flagbox->recreate();
-	labelDifficulty->setText(CGI->generaltexth->arraytxt[142 + vstd::to_underlying(mapInfo->mapHeader->difficulty)]);
+	labelDifficulty->setText(VLC->generaltexth->arraytxt[142 + vstd::to_underlying(mapInfo->mapHeader->difficulty)]);
 	iconDifficulty->setSelected(SEL->getCurrentDifficulty());
 	if(SEL->screenType == ESelectionScreen::loadGame || SEL->screenType == ESelectionScreen::saveGame)
 		for(auto & button : iconDifficulty->buttons)
@@ -422,35 +422,35 @@ PvPBox::PvPBox(const Rect & rect)
 		return bannedTowns;
 	};
 
-	buttonFlipCoin = std::make_shared<CButton>(Point(190, 6), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", CGI->generaltexth->translate("vcmi.lobby.pvp.coin.help")), [](){
+	buttonFlipCoin = std::make_shared<CButton>(Point(190, 6), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", VLC->generaltexth->translate("vcmi.lobby.pvp.coin.help")), [](){
 		LobbyPvPAction lpa;
 		lpa.action = LobbyPvPAction::COIN;
 		CSH->sendLobbyPack(lpa);
 	}, EShortcut::LOBBY_FLIP_COIN);
-	buttonFlipCoin->setTextOverlay(CGI->generaltexth->translate("vcmi.lobby.pvp.coin.hover"), EFonts::FONT_SMALL, Colors::WHITE);
+	buttonFlipCoin->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.pvp.coin.hover"), EFonts::FONT_SMALL, Colors::WHITE);
 
-	buttonRandomTown = std::make_shared<CButton>(Point(190, 31), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", CGI->generaltexth->translate("vcmi.lobby.pvp.randomTown.help")), [getBannedTowns](){
+	buttonRandomTown = std::make_shared<CButton>(Point(190, 31), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", VLC->generaltexth->translate("vcmi.lobby.pvp.randomTown.help")), [getBannedTowns](){
 		LobbyPvPAction lpa;
 		lpa.action = LobbyPvPAction::RANDOM_TOWN;
 		lpa.bannedTowns = getBannedTowns();
 		CSH->sendLobbyPack(lpa);
 	}, EShortcut::LOBBY_RANDOM_TOWN);
-	buttonRandomTown->setTextOverlay(CGI->generaltexth->translate("vcmi.lobby.pvp.randomTown.hover"), EFonts::FONT_SMALL, Colors::WHITE);
+	buttonRandomTown->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.pvp.randomTown.hover"), EFonts::FONT_SMALL, Colors::WHITE);
 
-	buttonRandomTownVs = std::make_shared<CButton>(Point(190, 56), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", CGI->generaltexth->translate("vcmi.lobby.pvp.randomTownVs.help")), [getBannedTowns](){
+	buttonRandomTownVs = std::make_shared<CButton>(Point(190, 56), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", VLC->generaltexth->translate("vcmi.lobby.pvp.randomTownVs.help")), [getBannedTowns](){
 		LobbyPvPAction lpa;
 		lpa.action = LobbyPvPAction::RANDOM_TOWN_VS;
 		lpa.bannedTowns = getBannedTowns();
 		CSH->sendLobbyPack(lpa);
 	}, EShortcut::LOBBY_RANDOM_TOWN_VS);
-	buttonRandomTownVs->setTextOverlay(CGI->generaltexth->translate("vcmi.lobby.pvp.randomTownVs.hover"), EFonts::FONT_SMALL, Colors::WHITE);
+	buttonRandomTownVs->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.pvp.randomTownVs.hover"), EFonts::FONT_SMALL, Colors::WHITE);
 
-	buttonHandicap = std::make_shared<CButton>(Point(190, 81), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", CGI->generaltexth->translate("vcmi.lobby.handicap")), [](){
+	buttonHandicap = std::make_shared<CButton>(Point(190, 81), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", VLC->generaltexth->translate("vcmi.lobby.handicap")), [](){
 		if(!CSH->isHost())
 			return;
 		ENGINE->windows().createAndPushWindow<OptionsTab::HandicapWindow>();
 	}, EShortcut::LOBBY_HANDICAP);
-	buttonHandicap->setTextOverlay(CGI->generaltexth->translate("vcmi.lobby.handicap"), EFonts::FONT_SMALL, Colors::WHITE);
+	buttonHandicap->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.handicap"), EFonts::FONT_SMALL, Colors::WHITE);
 }
 
 TownSelector::TownSelector(const Point & loc)
@@ -460,7 +460,7 @@ TownSelector::TownSelector(const Point & loc)
 	setRedrawParent(true);
 
 	int count = 0;
-	for(auto const & factionID : CGI->townh->getDefaultAllowed())
+	for(auto const & factionID : VLC->townh->getDefaultAllowed())
 	{
 		townsEnabled[factionID] = true;
 		count++;
@@ -489,7 +489,7 @@ void TownSelector::updateListItems()
 
 	int x = 0;
 	int y = 0;
-	for (auto const & factionID : CGI->townh->getDefaultAllowed())
+	for (auto const & factionID : VLC->townh->getDefaultAllowed())
 	{
 		if(y >= line && (y - line) < 3)
 		{
@@ -528,8 +528,8 @@ CFlagBox::CFlagBox(const Rect & rect)
 	pos.h = rect.h;
 	OBJECT_CONSTRUCTION;
 
-	labelAllies = std::make_shared<CLabel>(0, 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[390] + ":");
-	labelEnemies = std::make_shared<CLabel>(133, 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->allTexts[391] + ":");
+	labelAllies = std::make_shared<CLabel>(0, 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[390] + ":");
+	labelEnemies = std::make_shared<CLabel>(133, 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[391] + ":");
 }
 
 void CFlagBox::recreate()
@@ -566,7 +566,7 @@ CFlagBox::CFlagBoxTooltipBox::CFlagBoxTooltipBox()
 {
 	OBJECT_CONSTRUCTION;
 
-	labelTeamAlignment = std::make_shared<CLabel>(128, 30, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[657]);
+	labelTeamAlignment = std::make_shared<CLabel>(128, 30, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[657]);
 	labelGroupTeams = std::make_shared<CLabelGroup>(FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE);
 
 	std::vector<std::set<PlayerColor>> teams(PlayerColor::PLAYER_LIMIT_I);
@@ -585,7 +585,7 @@ CFlagBox::CFlagBoxTooltipBox::CFlagBoxTooltipBox()
 		if(team.empty())
 			continue;
 
-		labelGroupTeams->add(128, 65 + 50 * curIdx, boost::str(boost::format(CGI->generaltexth->allTexts[656]) % (curIdx + 1)));
+		labelGroupTeams->add(128, 65 + 50 * curIdx, boost::str(boost::format(VLC->generaltexth->allTexts[656]) % (curIdx + 1)));
 		int curx = 128 - 9 * team.size();
 		for(const auto & player : team)
 		{

+ 58 - 58
client/lobby/OptionsTab.cpp

@@ -12,7 +12,6 @@
 
 #include "CSelectionBase.h"
 
-#include "../CGameInfo.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"
 #include "../gui/Shortcut.h"
@@ -48,6 +47,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/mapping/CMapInfo.h"
 #include "../../lib/mapping/CMapHeader.h"
+#include "../../lib/VCMI_Lib.h"
 
 static JsonPath optionsTabConfigLocation()
 {
@@ -112,7 +112,7 @@ size_t OptionsTab::CPlayerSettingsHelper::getImageIndex(bool big)
 		if (playerSettings.castle == FactionID::RANDOM)
 			return TOWN_RANDOM;
 
-		return (*CGI->townh)[factionIndex]->town->clientInfo.icons[true][false] + (big ? 0 : 2);
+		return (*VLC->townh)[factionIndex]->town->clientInfo.icons[true][false] + (big ? 0 : 2);
 	}
 
 	case HERO:
@@ -127,7 +127,7 @@ size_t OptionsTab::CPlayerSettingsHelper::getImageIndex(bool big)
 			return playerSettings.heroPortrait;
 
 		auto index = playerSettings.getHeroValidated();
-		return (*CGI->heroh)[index]->imageIndex;
+		return (*VLC->heroh)[index]->imageIndex;
 	}
 
 	case BONUS:
@@ -142,7 +142,7 @@ size_t OptionsTab::CPlayerSettingsHelper::getImageIndex(bool big)
 			return GOLD;
 		case PlayerStartingBonus::RESOURCE:
 		{
-			switch((*CGI->townh)[factionIndex]->town->primaryRes.toEnum())
+			switch((*VLC->townh)[factionIndex]->town->primaryRes.toEnum())
 			{
 			case EGameResID::WOOD_AND_ORE:
 				return WOOD_ORE;
@@ -191,33 +191,33 @@ std::string OptionsTab::CPlayerSettingsHelper::getName()
 		case TOWN:
 		{
 			if (playerSettings.castle == FactionID::NONE)
-				return CGI->generaltexth->allTexts[523];
+				return VLC->generaltexth->allTexts[523];
 
 			if (playerSettings.castle == FactionID::RANDOM)
-				return CGI->generaltexth->allTexts[522];
+				return VLC->generaltexth->allTexts[522];
 
 			auto factionIndex = playerSettings.getCastleValidated();
-			return (*CGI->townh)[factionIndex]->getNameTranslated();
+			return (*VLC->townh)[factionIndex]->getNameTranslated();
 		}
 		case HERO:
 		{
 			if (playerSettings.hero == HeroTypeID::NONE)
-				return CGI->generaltexth->allTexts[523];
+				return VLC->generaltexth->allTexts[523];
 
 			if (playerSettings.hero == HeroTypeID::RANDOM)
-					return CGI->generaltexth->allTexts[522];
+					return VLC->generaltexth->allTexts[522];
 
 			if(!playerSettings.heroNameTextId.empty())
-				return CGI->generaltexth->translate(playerSettings.heroNameTextId);
+				return VLC->generaltexth->translate(playerSettings.heroNameTextId);
 			auto index = playerSettings.getHeroValidated();
-			return (*CGI->heroh)[index]->getNameTranslated();
+			return (*VLC->heroh)[index]->getNameTranslated();
 		}
 		case BONUS:
 		{
 			if (playerSettings.bonus == PlayerStartingBonus::RANDOM)
-					return CGI->generaltexth->allTexts[522];
+					return VLC->generaltexth->allTexts[522];
 
-			return CGI->generaltexth->arraytxt[214 + static_cast<int>(playerSettings.bonus)];
+			return VLC->generaltexth->arraytxt[214 + static_cast<int>(playerSettings.bonus)];
 		}
 	}
 	return "";
@@ -229,21 +229,21 @@ std::string OptionsTab::CPlayerSettingsHelper::getTitle()
 	switch(selectionType)
 	{
 	case OptionsTab::TOWN:
-		return playerSettings.castle.isValid() ? CGI->generaltexth->allTexts[80] : CGI->generaltexth->allTexts[103];
+		return playerSettings.castle.isValid() ? VLC->generaltexth->allTexts[80] : VLC->generaltexth->allTexts[103];
 	case OptionsTab::HERO:
-		return playerSettings.hero.isValid() ? CGI->generaltexth->allTexts[77] : CGI->generaltexth->allTexts[101];
+		return playerSettings.hero.isValid() ? VLC->generaltexth->allTexts[77] : VLC->generaltexth->allTexts[101];
 	case OptionsTab::BONUS:
 	{
 		switch(playerSettings.bonus)
 		{
 		case PlayerStartingBonus::RANDOM:
-			return CGI->generaltexth->allTexts[86]; //{Random Bonus}
+			return VLC->generaltexth->allTexts[86]; //{Random Bonus}
 		case PlayerStartingBonus::ARTIFACT:
-			return CGI->generaltexth->allTexts[83]; //{Artifact Bonus}
+			return VLC->generaltexth->allTexts[83]; //{Artifact Bonus}
 		case PlayerStartingBonus::GOLD:
-			return CGI->generaltexth->allTexts[84]; //{Gold Bonus}
+			return VLC->generaltexth->allTexts[84]; //{Gold Bonus}
 		case PlayerStartingBonus::RESOURCE:
-			return CGI->generaltexth->allTexts[85]; //{Resource Bonus}
+			return VLC->generaltexth->allTexts[85]; //{Resource Bonus}
 		}
 	}
 	}
@@ -261,7 +261,7 @@ std::string OptionsTab::CPlayerSettingsHelper::getSubtitle()
 	case HERO:
 	{
 		if(playerSettings.hero.isValid())
-			return getName() + " - " + (*CGI->heroh)[heroIndex]->heroClass->getNameTranslated();
+			return getName() + " - " + (*VLC->heroh)[heroIndex]->heroClass->getNameTranslated();
 		return getName();
 	}
 
@@ -270,21 +270,21 @@ std::string OptionsTab::CPlayerSettingsHelper::getSubtitle()
 		switch(playerSettings.bonus)
 		{
 		case PlayerStartingBonus::GOLD:
-			return CGI->generaltexth->allTexts[87]; //500-1000
+			return VLC->generaltexth->allTexts[87]; //500-1000
 		case PlayerStartingBonus::RESOURCE:
 		{
-			switch((*CGI->townh)[factionIndex]->town->primaryRes.toEnum())
+			switch((*VLC->townh)[factionIndex]->town->primaryRes.toEnum())
 			{
 			case EGameResID::MERCURY:
-				return CGI->generaltexth->allTexts[694];
+				return VLC->generaltexth->allTexts[694];
 			case EGameResID::SULFUR:
-				return CGI->generaltexth->allTexts[695];
+				return VLC->generaltexth->allTexts[695];
 			case EGameResID::CRYSTAL:
-				return CGI->generaltexth->allTexts[692];
+				return VLC->generaltexth->allTexts[692];
 			case EGameResID::GEMS:
-				return CGI->generaltexth->allTexts[693];
+				return VLC->generaltexth->allTexts[693];
 			case EGameResID::WOOD_AND_ORE:
-				return CGI->generaltexth->allTexts[89]; //At the start of the game, 5-10 wood and 5-10 ore are added to your Kingdom's resource pool
+				return VLC->generaltexth->allTexts[89]; //At the start of the game, 5-10 wood and 5-10 ore are added to your Kingdom's resource pool
 			}
 		}
 		}
@@ -300,33 +300,33 @@ std::string OptionsTab::CPlayerSettingsHelper::getDescription()
 	switch(selectionType)
 	{
 	case TOWN:
-		return CGI->generaltexth->allTexts[104];
+		return VLC->generaltexth->allTexts[104];
 	case HERO:
-		return CGI->generaltexth->allTexts[102];
+		return VLC->generaltexth->allTexts[102];
 	case BONUS:
 	{
 		switch(playerSettings.bonus)
 		{
 		case PlayerStartingBonus::RANDOM:
-			return CGI->generaltexth->allTexts[94]; //Gold, wood and ore, or an artifact is randomly chosen as your starting bonus
+			return VLC->generaltexth->allTexts[94]; //Gold, wood and ore, or an artifact is randomly chosen as your starting bonus
 		case PlayerStartingBonus::ARTIFACT:
-			return CGI->generaltexth->allTexts[90]; //An artifact is randomly chosen and equipped to your starting hero
+			return VLC->generaltexth->allTexts[90]; //An artifact is randomly chosen and equipped to your starting hero
 		case PlayerStartingBonus::GOLD:
-			return CGI->generaltexth->allTexts[92]; //At the start of the game, 500-1000 gold is added to your Kingdom's resource pool
+			return VLC->generaltexth->allTexts[92]; //At the start of the game, 500-1000 gold is added to your Kingdom's resource pool
 		case PlayerStartingBonus::RESOURCE:
 		{
-			switch((*CGI->townh)[factionIndex]->town->primaryRes.toEnum())
+			switch((*VLC->townh)[factionIndex]->town->primaryRes.toEnum())
 			{
 			case EGameResID::MERCURY:
-				return CGI->generaltexth->allTexts[690];
+				return VLC->generaltexth->allTexts[690];
 			case EGameResID::SULFUR:
-				return CGI->generaltexth->allTexts[691];
+				return VLC->generaltexth->allTexts[691];
 			case EGameResID::CRYSTAL:
-				return CGI->generaltexth->allTexts[688];
+				return VLC->generaltexth->allTexts[688];
 			case EGameResID::GEMS:
-				return CGI->generaltexth->allTexts[689];
+				return VLC->generaltexth->allTexts[689];
 			case EGameResID::WOOD_AND_ORE:
-				return CGI->generaltexth->allTexts[93]; //At the start of the game, 5-10 wood and 5-10 ore are added to your Kingdom's resource pool
+				return VLC->generaltexth->allTexts[93]; //At the start of the game, 5-10 wood and 5-10 ore are added to your Kingdom's resource pool
 			}
 		}
 		}
@@ -375,9 +375,9 @@ void OptionsTab::CPlayerOptionTooltipBox::genTownWindow()
 
 	pos = Rect(0, 0, 228, 290);
 	genHeader();
-	labelAssociatedCreatures = std::make_shared<CLabel>(pos.w / 2 + 8, 122, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[79]);
+	labelAssociatedCreatures = std::make_shared<CLabel>(pos.w / 2 + 8, 122, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[79]);
 	std::vector<std::shared_ptr<CComponent>> components;
-	const CTown * town = (*CGI->townh)[factionIndex]->town;
+	const CTown * town = (*VLC->townh)[factionIndex]->town;
 
 	for(auto & elem : town->creatures)
 	{
@@ -396,10 +396,10 @@ void OptionsTab::CPlayerOptionTooltipBox::genHeroWindow()
 
 	pos = Rect(0, 0, 292, 226);
 	genHeader();
-	labelHeroSpeciality = std::make_shared<CLabel>(pos.w / 2 + 4, 117, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[78]);
+	labelHeroSpeciality = std::make_shared<CLabel>(pos.w / 2 + 4, 117, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[78]);
 
-	imageSpeciality = std::make_shared<CAnimImage>(AnimationPath::builtin("UN44"), (*CGI->heroh)[heroIndex]->imageIndex, 0, pos.w / 2 - 22, 134);
-	labelSpecialityName = std::make_shared<CLabel>(pos.w / 2, 188, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, (*CGI->heroh)[heroIndex]->getSpecialtyNameTranslated());
+	imageSpeciality = std::make_shared<CAnimImage>(AnimationPath::builtin("UN44"), (*VLC->heroh)[heroIndex]->imageIndex, 0, pos.w / 2 - 22, 134);
+	labelSpecialityName = std::make_shared<CLabel>(pos.w / 2, 188, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, (*VLC->heroh)[heroIndex]->getSpecialtyNameTranslated());
 }
 
 void OptionsTab::CPlayerOptionTooltipBox::genBonusWindow()
@@ -813,7 +813,7 @@ OptionsTab::HandicapWindow::HandicapWindow()
 	backgroundTexture = std::make_shared<FilledTexturePlayerColored>(pos);
 	backgroundTexture->setPlayerColor(PlayerColor(1));
 
-	labels.push_back(std::make_shared<CLabel>(pos.w / 2 + 8, 15, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->translate("vcmi.lobby.handicap")));
+	labels.push_back(std::make_shared<CLabel>(pos.w / 2 + 8, 15, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->translate("vcmi.lobby.handicap")));
 
 	enum Columns : int32_t
 	{
@@ -841,9 +841,9 @@ OptionsTab::HandicapWindow::HandicapWindow()
 			if(i == 0)
 			{
 				if(isIncome)
-					labels.push_back(std::make_shared<CLabel>(xPos, 38, FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("core.jktext.32")));
+					labels.push_back(std::make_shared<CLabel>(xPos, 38, FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->translate("core.jktext.32")));
 				else if(isGrowth)
-					labels.push_back(std::make_shared<CLabel>(xPos, 38, FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.194")));
+					labels.push_back(std::make_shared<CLabel>(xPos, 38, FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.194")));
 				else
 					anim.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("SMALRES"), GameResID(resource), 0, 15 + xPos + (j == 0 ? 10 : 0), 35));
 			}
@@ -864,11 +864,11 @@ OptionsTab::HandicapWindow::HandicapWindow()
 			textinputs[player][resource]->setPopupCallback([isIncome, isGrowth](){
 				// Help for the textinputs
 				if(isIncome)
-					CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.lobby.handicap.income"));
+					CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.lobby.handicap.income"));
 				else if(isGrowth)
-					CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.lobby.handicap.growth"));
+					CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.lobby.handicap.growth"));
 				else
-					CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.lobby.handicap.resource"));
+					CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.lobby.handicap.resource"));
 			});
 			if(isIncome || isGrowth)
 				labels.push_back(std::make_shared<CLabel>(area.topRight().x, area.center().y, FONT_SMALL, ETextAlignment::CENTERRIGHT, Colors::WHITE, "%"));
@@ -1039,10 +1039,10 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry(const PlayerSettings & S, con
 		labelPlayerNameEdit->setText(name);
 	}
 
-	labelWhoCanPlay = std::make_shared<CMultiLineLabel>(Rect(6, 21, 45, 26), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->arraytxt[206 + whoCanPlay]);
+	labelWhoCanPlay = std::make_shared<CMultiLineLabel>(Rect(6, 21, 45, 26), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->arraytxt[206 + whoCanPlay]);
 
 	auto hasHandicap = [this](){ return s->handicap.startBonus.empty() && s->handicap.percentIncome == 100 && s->handicap.percentGrowth == 100; };
-	std::string labelHandicapText = hasHandicap() ? CGI->generaltexth->arraytxt[210] : MetaString::createFromTextID("vcmi.lobby.handicap").toString();
+	std::string labelHandicapText = hasHandicap() ? VLC->generaltexth->arraytxt[210] : MetaString::createFromTextID("vcmi.lobby.handicap").toString();
 	labelHandicap = std::make_shared<CMultiLineLabel>(Rect(55, 23, 46, 24), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, labelHandicapText);
 	handicap = std::make_shared<LRClickableArea>(Rect(53, 23, 50, 24), [](){
 		if(!CSH->isHost())
@@ -1084,12 +1084,12 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry(const PlayerSettings & S, con
 
 	if(SEL->screenType == ESelectionScreen::newGame)
 	{
-		buttonTownLeft   = std::make_shared<CButton>(Point(107, 5), AnimationPath::builtin("ADOPLFA.DEF"), CGI->generaltexth->zelp[132], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::TOWN, -1, s->color));
-		buttonTownRight  = std::make_shared<CButton>(Point(168, 5), AnimationPath::builtin("ADOPRTA.DEF"), CGI->generaltexth->zelp[133], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::TOWN, +1, s->color));
-		buttonHeroLeft   = std::make_shared<CButton>(Point(183, 5), AnimationPath::builtin("ADOPLFA.DEF"), CGI->generaltexth->zelp[148], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::HERO, -1, s->color));
-		buttonHeroRight  = std::make_shared<CButton>(Point(244, 5), AnimationPath::builtin("ADOPRTA.DEF"), CGI->generaltexth->zelp[149], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::HERO, +1, s->color));
-		buttonBonusLeft  = std::make_shared<CButton>(Point(259, 5), AnimationPath::builtin("ADOPLFA.DEF"), CGI->generaltexth->zelp[164], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::BONUS, -1, s->color));
-		buttonBonusRight = std::make_shared<CButton>(Point(320, 5), AnimationPath::builtin("ADOPRTA.DEF"), CGI->generaltexth->zelp[165], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::BONUS, +1, s->color));
+		buttonTownLeft   = std::make_shared<CButton>(Point(107, 5), AnimationPath::builtin("ADOPLFA.DEF"), VLC->generaltexth->zelp[132], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::TOWN, -1, s->color));
+		buttonTownRight  = std::make_shared<CButton>(Point(168, 5), AnimationPath::builtin("ADOPRTA.DEF"), VLC->generaltexth->zelp[133], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::TOWN, +1, s->color));
+		buttonHeroLeft   = std::make_shared<CButton>(Point(183, 5), AnimationPath::builtin("ADOPLFA.DEF"), VLC->generaltexth->zelp[148], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::HERO, -1, s->color));
+		buttonHeroRight  = std::make_shared<CButton>(Point(244, 5), AnimationPath::builtin("ADOPRTA.DEF"), VLC->generaltexth->zelp[149], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::HERO, +1, s->color));
+		buttonBonusLeft  = std::make_shared<CButton>(Point(259, 5), AnimationPath::builtin("ADOPLFA.DEF"), VLC->generaltexth->zelp[164], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::BONUS, -1, s->color));
+		buttonBonusRight = std::make_shared<CButton>(Point(320, 5), AnimationPath::builtin("ADOPRTA.DEF"), VLC->generaltexth->zelp[165], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::BONUS, +1, s->color));
 	}
 
 	hideUnavailableButtons();
@@ -1099,7 +1099,7 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry(const PlayerSettings & S, con
 		flag = std::make_shared<CButton>(
 			Point(-43, 2),
 			AnimationPath::builtin(flags[s->color.getNum()]),
-			CGI->generaltexth->zelp[180],
+			VLC->generaltexth->zelp[180],
 			std::bind(&OptionsTab::onSetPlayerClicked, &parentTab, *s)
 		);
 		flag->setHoverable(true);

+ 9 - 9
client/lobby/OptionsTabBase.cpp

@@ -17,13 +17,13 @@
 #include "../widgets/Slider.h"
 #include "../widgets/TextControls.h"
 #include "../CServerHandler.h"
-#include "../CGameInfo.h"
 
 #include "../../lib/StartInfo.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/Languages.h"
 #include "../../lib/texts/MetaString.h"
 #include "../../lib/CConfigHandler.h"
+#include "../../lib/VCMI_Lib.h"
 
 static std::string timeToString(int time)
 {
@@ -309,10 +309,10 @@ void OptionsTabBase::recreate(bool campaign)
 	auto const & generateSimturnsDurationText = [](int days) -> std::string
 	{
 		if (days == 0)
-			return CGI->generaltexth->translate("core.genrltxt.523");
+			return VLC->generaltexth->translate("core.genrltxt.523");
 
 		if (days >= 1000000) // Not "unlimited" but close enough
-			return CGI->generaltexth->translate("core.turndur.10");
+			return VLC->generaltexth->translate("core.turndur.10");
 
 		bool canUseMonth = days % 28 == 0 && days >= 28*2;
 		bool canUseWeek = days % 7 == 0 && days >= 7*2;
@@ -333,7 +333,7 @@ void OptionsTabBase::recreate(bool campaign)
 		}
 
 		MetaString message;
-		message.appendTextID(Languages::getPluralFormTextID( CGI->generaltexth->getPreferredLanguage(), value, text));
+		message.appendTextID(Languages::getPluralFormTextID( VLC->generaltexth->getPreferredLanguage(), value, text));
 		message.replaceNumber(value);
 		return message.toString();
 	};
@@ -360,17 +360,17 @@ void OptionsTabBase::recreate(bool campaign)
 	if(auto chessFieldTurnLabel = widget<CLabel>("chessFieldTurnLabel"))
 	{
 		if (SEL->getStartInfo()->turnTimerInfo.accumulatingTurnTimer)
-			chessFieldTurnLabel->setText(CGI->generaltexth->translate("vcmi.optionsTab.chessFieldTurnAccumulate.help"));
+			chessFieldTurnLabel->setText(VLC->generaltexth->translate("vcmi.optionsTab.chessFieldTurnAccumulate.help"));
 		else
-			chessFieldTurnLabel->setText(CGI->generaltexth->translate("vcmi.optionsTab.chessFieldTurnDiscard.help"));
+			chessFieldTurnLabel->setText(VLC->generaltexth->translate("vcmi.optionsTab.chessFieldTurnDiscard.help"));
 	}
 
 	if(auto chessFieldUnitLabel = widget<CLabel>("chessFieldUnitLabel"))
 	{
 		if (SEL->getStartInfo()->turnTimerInfo.accumulatingUnitTimer)
-			chessFieldUnitLabel->setText(CGI->generaltexth->translate("vcmi.optionsTab.chessFieldUnitAccumulate.help"));
+			chessFieldUnitLabel->setText(VLC->generaltexth->translate("vcmi.optionsTab.chessFieldUnitAccumulate.help"));
 		else
-			chessFieldUnitLabel->setText(CGI->generaltexth->translate("vcmi.optionsTab.chessFieldUnitDiscard.help"));
+			chessFieldUnitLabel->setText(VLC->generaltexth->translate("vcmi.optionsTab.chessFieldUnitDiscard.help"));
 	}
 
 	if(auto buttonUnitTimerAccumulate = widget<CToggleButton>("buttonUnitTimerAccumulate"))
@@ -390,7 +390,7 @@ void OptionsTabBase::recreate(bool campaign)
 				{
 					turnSlider->scrollTo(idx, false);
 					if(auto w = widget<CLabel>("labelTurnDurationValue"))
-						w->setText(CGI->generaltexth->turnDurations[idx]);
+						w->setText(VLC->generaltexth->turnDurations[idx]);
 				}
 			}
 		}

+ 0 - 1
client/lobby/RandomMapTab.cpp

@@ -14,7 +14,6 @@
 #include "CLobbyScreen.h"
 #include "SelectionTab.h"
 
-#include "../CGameInfo.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"
 #include "../gui/MouseButton.h"

+ 22 - 22
client/lobby/SelectionTab.cpp

@@ -13,7 +13,6 @@
 #include "CSelectionBase.h"
 #include "CLobbyScreen.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"
@@ -47,6 +46,7 @@
 #include "../../lib/texts/TextOperations.h"
 #include "../../lib/TerrainHandler.h"
 #include "../../lib/UnlockGuard.h"
+#include "../../lib/VCMI_Lib.h"
 
 bool mapSorter::operator()(const std::shared_ptr<ElementInfo> aaa, const std::shared_ptr<ElementInfo> bbb)
 {
@@ -169,7 +169,7 @@ SelectionTab::SelectionTab(ESelectionScreen Type)
 		pos = background->pos;
 		inputName = std::make_shared<CTextInput>(inputNameRect, Point(-32, -25), ImagePath::builtin("GSSTRIP.bmp"));
 		inputName->setFilterFilename();
-		labelMapSizes = std::make_shared<CLabel>(87, 62, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[510]);
+		labelMapSizes = std::make_shared<CLabel>(87, 62, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[510]);
 
 		// TODO: Global constants?
 		constexpr std::array sizes = {CMapHeader::MAP_SIZE_SMALL, CMapHeader::MAP_SIZE_MIDDLE, CMapHeader::MAP_SIZE_LARGE, CMapHeader::MAP_SIZE_XLARGE, 0};
@@ -177,7 +177,7 @@ SelectionTab::SelectionTab(ESelectionScreen Type)
 		constexpr std::array filterShortcuts = { EShortcut::MAPS_SIZE_S, EShortcut::MAPS_SIZE_M, EShortcut::MAPS_SIZE_L, EShortcut::MAPS_SIZE_XL, EShortcut::MAPS_SIZE_ALL };
 
 		for(int i = 0; i < 5; i++)
-			buttonsSortBy.push_back(std::make_shared<CButton>(Point(158 + 47 * i, 46), AnimationPath::builtin(filterIconNmes[i]), CGI->generaltexth->zelp[54 + i], std::bind(&SelectionTab::filter, this, sizes[i], true), filterShortcuts[i]));
+			buttonsSortBy.push_back(std::make_shared<CButton>(Point(158 + 47 * i, 46), AnimationPath::builtin(filterIconNmes[i]), VLC->generaltexth->zelp[54 + i], std::bind(&SelectionTab::filter, this, sizes[i], true), filterShortcuts[i]));
 
 		constexpr std::array xpos = {23, 55, 88, 121, 306, 339};
 		constexpr std::array sortIconNames = {"SCBUTT1.DEF", "SCBUTT2.DEF", "SCBUTCP.DEF", "SCBUTT3.DEF", "SCBUTT4.DEF", "SCBUTT5.DEF"};
@@ -188,7 +188,7 @@ SelectionTab::SelectionTab(ESelectionScreen Type)
 			if(criteria == _name)
 				criteria = generalSortingBy;
 
-			buttonsSortBy.push_back(std::make_shared<CButton>(Point(xpos[i], 86), AnimationPath::builtin(sortIconNames[i]), CGI->generaltexth->zelp[107 + i], std::bind(&SelectionTab::sortBy, this, criteria), sortShortcuts[i]));
+			buttonsSortBy.push_back(std::make_shared<CButton>(Point(xpos[i], 86), AnimationPath::builtin(sortIconNames[i]), VLC->generaltexth->zelp[107 + i], std::bind(&SelectionTab::sortBy, this, criteria), sortShortcuts[i]));
 		}
 	}
 
@@ -198,19 +198,19 @@ SelectionTab::SelectionTab(ESelectionScreen Type)
 	switch(tabType)
 	{
 	case ESelectionScreen::newGame:
-		tabTitle = "{" + CGI->generaltexth->arraytxt[229] + "}";
-		tabTitleDelete = "{red|" + CGI->generaltexth->translate("vcmi.lobby.deleteMapTitle") + "}";
+		tabTitle = "{" + VLC->generaltexth->arraytxt[229] + "}";
+		tabTitleDelete = "{red|" + VLC->generaltexth->translate("vcmi.lobby.deleteMapTitle") + "}";
 		break;
 	case ESelectionScreen::loadGame:
-		tabTitle = "{" + CGI->generaltexth->arraytxt[230] + "}";
-		tabTitleDelete = "{red|" + CGI->generaltexth->translate("vcmi.lobby.deleteSaveGameTitle") + "}";
+		tabTitle = "{" + VLC->generaltexth->arraytxt[230] + "}";
+		tabTitleDelete = "{red|" + VLC->generaltexth->translate("vcmi.lobby.deleteSaveGameTitle") + "}";
 		break;
 	case ESelectionScreen::saveGame:
 		positionsToShow = 16;
-		tabTitle = "{" + CGI->generaltexth->arraytxt[231] + "}";
+		tabTitle = "{" + VLC->generaltexth->arraytxt[231] + "}";
 		break;
 	case ESelectionScreen::campaignList:
-		tabTitle = "{" + CGI->generaltexth->allTexts[726] + "}";
+		tabTitle = "{" + VLC->generaltexth->allTexts[726] + "}";
 		setRedrawParent(true); // we use parent background so we need to make sure it's will be redrawn too
 		pos.w = parent->pos.w;
 		pos.h = parent->pos.h;
@@ -227,13 +227,13 @@ SelectionTab::SelectionTab(ESelectionScreen Type)
 
 	if(enableUiEnhancements)
 	{
-		auto sortByDate = std::make_shared<CButton>(Point(371, 85), AnimationPath::builtin("selectionTabSortDate"), CButton::tooltip("", CGI->generaltexth->translate("vcmi.lobby.sortDate")), std::bind(&SelectionTab::sortBy, this, ESortBy::_changeDate), EShortcut::MAPS_SORT_CHANGEDATE);
+		auto sortByDate = std::make_shared<CButton>(Point(371, 85), AnimationPath::builtin("selectionTabSortDate"), CButton::tooltip("", VLC->generaltexth->translate("vcmi.lobby.sortDate")), std::bind(&SelectionTab::sortBy, this, ESortBy::_changeDate), EShortcut::MAPS_SORT_CHANGEDATE);
 		sortByDate->setOverlay(std::make_shared<CPicture>(ImagePath::builtin("lobby/selectionTabSortDate")));
 		buttonsSortBy.push_back(sortByDate);
 
 		if(tabType == ESelectionScreen::loadGame || tabType == ESelectionScreen::newGame)
 		{
-			buttonDeleteMode = std::make_shared<CButton>(Point(367, 18), AnimationPath::builtin("lobby/deleteButton"), CButton::tooltip("", CGI->generaltexth->translate("vcmi.lobby.deleteMode")), [this, tabTitle, tabTitleDelete](){
+			buttonDeleteMode = std::make_shared<CButton>(Point(367, 18), AnimationPath::builtin("lobby/deleteButton"), CButton::tooltip("", VLC->generaltexth->translate("vcmi.lobby.deleteMode")), [this, tabTitle, tabTitleDelete](){
 				deleteMode = !deleteMode;
 				if(deleteMode)
 					labelTabTitle->setText(tabTitleDelete);
@@ -346,14 +346,14 @@ void SelectionTab::clickReleased(const Point & cursorPosition)
 			}
 
 			if(!curItems[py]->isFolder)
-				CInfoWindow::showYesNoDialog(CGI->generaltexth->translate("vcmi.lobby.deleteFile") + "\n\n" + curItems[py]->fullFileURI, std::vector<std::shared_ptr<CComponent>>(), [this, py](){
+				CInfoWindow::showYesNoDialog(VLC->generaltexth->translate("vcmi.lobby.deleteFile") + "\n\n" + curItems[py]->fullFileURI, std::vector<std::shared_ptr<CComponent>>(), [this, py](){
 					LobbyDelete ld;
 					ld.type = tabType == ESelectionScreen::newGame ? LobbyDelete::EType::RANDOMMAP : LobbyDelete::EType::SAVEGAME;
 					ld.name = curItems[py]->fileURI;
 					CSH->sendLobbyPack(ld);
 				}, nullptr);
 			else
-				CInfoWindow::showYesNoDialog(CGI->generaltexth->translate("vcmi.lobby.deleteFolder") + "\n\n" + curFolder + curItems[py]->folderName, std::vector<std::shared_ptr<CComponent>>(), [this, py](){
+				CInfoWindow::showYesNoDialog(VLC->generaltexth->translate("vcmi.lobby.deleteFolder") + "\n\n" + curFolder + curItems[py]->folderName, std::vector<std::shared_ptr<CComponent>>(), [this, py](){
 					LobbyDelete ld;
 					ld.type = LobbyDelete::EType::SAVEGAME_FOLDER;
 					ld.name = curFolder + curItems[py]->folderName;
@@ -773,7 +773,7 @@ void SelectionTab::selectFileName(std::string fname)
 	selectAbs(-1);
 
 	if(tabType == ESelectionScreen::saveGame && inputName->getText().empty())
-		inputName->setText(CGI->generaltexth->translate("core.genrltxt.11"));
+		inputName->setText(VLC->generaltexth->translate("core.genrltxt.11"));
 }
 
 void SelectionTab::selectNewestFile()
@@ -840,19 +840,19 @@ bool SelectionTab::isMapSupported(const CMapInfo & info)
 	switch (info.mapHeader->version)
 	{
 		case EMapFormat::ROE:
-			return CGI->engineSettings()->getValue(EGameSettings::MAP_FORMAT_RESTORATION_OF_ERATHIA)["supported"].Bool();
+			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_RESTORATION_OF_ERATHIA)["supported"].Bool();
 		case EMapFormat::AB:
-			return CGI->engineSettings()->getValue(EGameSettings::MAP_FORMAT_ARMAGEDDONS_BLADE)["supported"].Bool();
+			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_ARMAGEDDONS_BLADE)["supported"].Bool();
 		case EMapFormat::SOD:
-			return CGI->engineSettings()->getValue(EGameSettings::MAP_FORMAT_SHADOW_OF_DEATH)["supported"].Bool();
+			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_SHADOW_OF_DEATH)["supported"].Bool();
 		case EMapFormat::CHR:
-			return CGI->engineSettings()->getValue(EGameSettings::MAP_FORMAT_CHRONICLES)["supported"].Bool();
+			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_CHRONICLES)["supported"].Bool();
 		case EMapFormat::WOG:
-			return CGI->engineSettings()->getValue(EGameSettings::MAP_FORMAT_IN_THE_WAKE_OF_GODS)["supported"].Bool();
+			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_IN_THE_WAKE_OF_GODS)["supported"].Bool();
 		case EMapFormat::HOTA:
-			return CGI->engineSettings()->getValue(EGameSettings::MAP_FORMAT_HORN_OF_THE_ABYSS)["supported"].Bool();
+			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_HORN_OF_THE_ABYSS)["supported"].Bool();
 		case EMapFormat::VCMI:
-			return CGI->engineSettings()->getValue(EGameSettings::MAP_FORMAT_JSON_VCMI)["supported"].Bool();
+			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_JSON_VCMI)["supported"].Bool();
 	}
 	return false;
 }

+ 1 - 2
client/mainmenu/CCampaignScreen.cpp

@@ -13,7 +13,6 @@
 
 #include "CMainMenu.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../CServerHandler.h"
 #include "../GameEngine.h"
@@ -82,7 +81,7 @@ std::shared_ptr<CButton> CCampaignScreen::createExitButton(const JsonNode & butt
 {
 	std::pair<std::string, std::string> help;
 	if(!button["help"].isNull() && button["help"].Float() > 0)
-		help = CGI->generaltexth->zelp[(size_t)button["help"].Float()];
+		help = VLC->generaltexth->zelp[(size_t)button["help"].Float()];
 
 	return std::make_shared<CButton>(Point((int)button["x"].Float(), (int)button["y"].Float()), AnimationPath::fromJson(button["name"]), help, [=](){ close();}, EShortcut::GLOBAL_CANCEL);
 }

+ 20 - 20
client/mainmenu/CHighScoreScreen.cpp

@@ -28,7 +28,6 @@
 #include "../render/Canvas.h"
 #include "../render/IRenderHandler.h"
 
-#include "../CGameInfo.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/TextOperations.h"
 #include "../../lib/CConfigHandler.h"
@@ -36,6 +35,7 @@
 #include "../../lib/constants/EntityIdentifiers.h"
 #include "../../lib/gameState/HighScore.h"
 #include "../../lib/gameState/GameStatistics.h"
+#include "../../lib/VCMI_Lib.h"
 
 CHighScoreScreen::CHighScoreScreen(HighScorePage highscorepage, int highlighted)
 	: CWindowObject(BORDERED), highscorepage(highscorepage), highlighted(highlighted)
@@ -87,19 +87,19 @@ void CHighScoreScreen::addHighScores()
 	images.clear();
 
 	// Header
-	texts.push_back(std::make_shared<CLabel>(115, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.433"))); // rank
-	texts.push_back(std::make_shared<CLabel>(225, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.434"))); // player
+	texts.push_back(std::make_shared<CLabel>(115, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.433"))); // rank
+	texts.push_back(std::make_shared<CLabel>(225, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.434"))); // player
 
 	if(highscorepage == HighScorePage::SCENARIO)
 	{
-		texts.push_back(std::make_shared<CLabel>(405, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.435"))); // land
-		texts.push_back(std::make_shared<CLabel>(557, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.436"))); // days
-		texts.push_back(std::make_shared<CLabel>(627, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.75"))); // score
+		texts.push_back(std::make_shared<CLabel>(405, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.435"))); // land
+		texts.push_back(std::make_shared<CLabel>(557, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.436"))); // days
+		texts.push_back(std::make_shared<CLabel>(627, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.75"))); // score
 	}
 	else
 	{
-		texts.push_back(std::make_shared<CLabel>(405, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.672"))); // campaign
-		texts.push_back(std::make_shared<CLabel>(592, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.75"))); // score
+		texts.push_back(std::make_shared<CLabel>(405, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.672"))); // campaign
+		texts.push_back(std::make_shared<CLabel>(592, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.75"))); // score
 	}
 
 	// Content
@@ -128,7 +128,7 @@ void CHighScoreScreen::addHighScores()
 		}
 
 		if(curData["points"].Integer() > 0 && curData["points"].Integer() <= ((highscorepage == HighScorePage::CAMPAIGN) ? 2500 : 500))
-			images.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), (*CGI->creh)[HighScoreCalculation::getCreatureForPoints(curData["points"].Integer(), highscorepage == HighScorePage::CAMPAIGN)]->getIconIndex(), 0, 670, y - 15 + i * 50));
+			images.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), (*VLC->creh)[HighScoreCalculation::getCreatureForPoints(curData["points"].Integer(), highscorepage == HighScorePage::CAMPAIGN)]->getIconIndex(), 0, 670, y - 15 + i * 50));
 	}
 }
 
@@ -152,7 +152,7 @@ void CHighScoreScreen::buttonScenarioClick()
 void CHighScoreScreen::buttonResetClick()
 {
 	CInfoWindow::showYesNoDialog(
-		CGI->generaltexth->allTexts[666],
+		VLC->generaltexth->allTexts[666],
 		{},
 		[this]()
 		{
@@ -197,10 +197,10 @@ CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc
 		int textareaW = ((pos.w - 2 * border) / 4);
 		std::vector<std::string> t = { "438", "439", "440", "441", "676" }; // time, score, difficulty, final score, rank
 		for (int i = 0; i < 5; i++)
-			texts.push_back(std::make_shared<CMultiLineLabel>(Rect(textareaW * i + border - (textareaW / 2), 450, textareaW, 100), FONT_HIGH_SCORE, ETextAlignment::TOPCENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt." + t[i])));
+			texts.push_back(std::make_shared<CMultiLineLabel>(Rect(textareaW * i + border - (textareaW / 2), 450, textareaW, 100), FONT_HIGH_SCORE, ETextAlignment::TOPCENTER, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt." + t[i])));
 
-		std::string creatureName = (calc.calculate().cheater) ? CGI->generaltexth->translate("core.genrltxt.260") : (*CGI->creh)[HighScoreCalculation::getCreatureForPoints(calc.calculate().total, calc.isCampaign)]->getNameSingularTranslated();
-		t = { std::to_string(calc.calculate().sumDays), std::to_string(calc.calculate().basic), CGI->generaltexth->translate("core.arraytxt." + std::to_string((142 + calc.parameters[0].difficulty))), std::to_string(calc.calculate().total), creatureName };
+		std::string creatureName = (calc.calculate().cheater) ? VLC->generaltexth->translate("core.genrltxt.260") : (*VLC->creh)[HighScoreCalculation::getCreatureForPoints(calc.calculate().total, calc.isCampaign)]->getNameSingularTranslated();
+		t = { std::to_string(calc.calculate().sumDays), std::to_string(calc.calculate().basic), VLC->generaltexth->translate("core.arraytxt." + std::to_string((142 + calc.parameters[0].difficulty))), std::to_string(calc.calculate().total), creatureName };
 		for (int i = 0; i < 5; i++)
 			texts.push_back(std::make_shared<CMultiLineLabel>(Rect(textareaW * i + border - (textareaW / 2), 530, textareaW, 100), FONT_HIGH_SCORE, ETextAlignment::TOPCENTER, Colors::WHITE, t[i]));
  
@@ -214,8 +214,8 @@ CHighScoreInputScreen::CHighScoreInputScreen(bool won, HighScoreCalculation calc
 
 	if (settings["general"]["enableUiEnhancements"].Bool())
 	{
-		statisticButton = std::make_shared<CButton>(Point(726, 10), AnimationPath::builtin("TPTAV02.DEF"), CButton::tooltip(CGI->generaltexth->translate("vcmi.statisticWindow.statistics")), [this](){ ENGINE->windows().createAndPushWindow<CStatisticScreen>(stat); }, EShortcut::HIGH_SCORES_STATISTICS);
-		texts.push_back(std::make_shared<CLabel>(716, 25, EFonts::FONT_HIGH_SCORE, ETextAlignment::CENTERRIGHT, Colors::WHITE, CGI->generaltexth->translate("vcmi.statisticWindow.statistics") + ":"));
+		statisticButton = std::make_shared<CButton>(Point(726, 10), AnimationPath::builtin("TPTAV02.DEF"), CButton::tooltip(VLC->generaltexth->translate("vcmi.statisticWindow.statistics")), [this](){ ENGINE->windows().createAndPushWindow<CStatisticScreen>(stat); }, EShortcut::HIGH_SCORES_STATISTICS);
+		texts.push_back(std::make_shared<CLabel>(716, 25, EFonts::FONT_HIGH_SCORE, ETextAlignment::CENTERRIGHT, Colors::WHITE, VLC->generaltexth->translate("vcmi.statisticWindow.statistics") + ":"));
 	}
 }
 
@@ -243,9 +243,9 @@ int CHighScoreInputScreen::addEntry(std::string text) {
 	JsonNode newNode = JsonNode();
 	newNode["player"].String() = text;
 	if(calc.isCampaign)
-		newNode["campaignName"].String() = calc.calculate().cheater ? CGI->generaltexth->translate("core.genrltxt.260") : calc.parameters[0].campaignName;
+		newNode["campaignName"].String() = calc.calculate().cheater ? VLC->generaltexth->translate("core.genrltxt.260") : calc.parameters[0].campaignName;
 	else
-		newNode["scenarioName"].String() = calc.calculate().cheater ? CGI->generaltexth->translate("core.genrltxt.260") : calc.parameters[0].scenarioName;
+		newNode["scenarioName"].String() = calc.calculate().cheater ? VLC->generaltexth->translate("core.genrltxt.260") : calc.parameters[0].scenarioName;
 	newNode["days"].Integer() = calc.calculate().sumDays;
 	newNode["points"].Integer() = calc.calculate().cheater ? 0 : calc.calculate().total;
 	newNode["datetime"].String() = TextOperations::getFormattedDateTimeLocal(std::time(nullptr));
@@ -326,10 +326,10 @@ CHighScoreInput::CHighScoreInput(std::string playerName, std::function<void(std:
 	pos = center(Rect(0, 0, 232, 212));
 	updateShadow();
 
-	text = std::make_shared<CMultiLineLabel>(Rect(15, 15, 202, 202), FONT_SMALL, ETextAlignment::TOPCENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.96"));
+	text = std::make_shared<CMultiLineLabel>(Rect(15, 15, 202, 202), FONT_SMALL, ETextAlignment::TOPCENTER, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.96"));
 
-	buttonOk = std::make_shared<CButton>(Point(26, 142), AnimationPath::builtin("MUBCHCK.DEF"), CGI->generaltexth->zelp[560], std::bind(&CHighScoreInput::okay, this), EShortcut::GLOBAL_ACCEPT);
-	buttonCancel = std::make_shared<CButton>(Point(142, 142), AnimationPath::builtin("MUBCANC.DEF"), CGI->generaltexth->zelp[561], std::bind(&CHighScoreInput::abort, this), EShortcut::GLOBAL_CANCEL);
+	buttonOk = std::make_shared<CButton>(Point(26, 142), AnimationPath::builtin("MUBCHCK.DEF"), VLC->generaltexth->zelp[560], std::bind(&CHighScoreInput::okay, this), EShortcut::GLOBAL_ACCEPT);
+	buttonCancel = std::make_shared<CButton>(Point(142, 142), AnimationPath::builtin("MUBCANC.DEF"), VLC->generaltexth->zelp[561], std::bind(&CHighScoreInput::abort, this), EShortcut::GLOBAL_CANCEL);
 // FIXME: broken. Never activates?
 //	statusBar = CGStatusBar::create(std::make_shared<CPicture>(background->getSurface(), Rect(7, 186, 218, 18), 7, 186));
 	textInput = std::make_shared<CTextInput>(Rect(18, 104, 200, 25), FONT_SMALL, ETextAlignment::CENTER, true);

+ 23 - 23
client/mainmenu/CMainMenu.cpp

@@ -40,7 +40,6 @@
 #include "../windows/InfoWindows.h"
 #include "../CServerHandler.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../Client.h"
 #include "../CMT.h"
@@ -59,6 +58,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/GameConstants.h"
 #include "../../lib/CRandomGenerator.h"
+#include "../../lib/VCMI_Lib.h"
 
 std::shared_ptr<CMainMenu> CMM;
 ISelectionScreenInfo * SEL = nullptr;
@@ -206,7 +206,7 @@ static std::function<void()> genCommand(CMenuScreen * menu, std::vector<std::str
 			break;
 			case 4: //exit
 			{
-				return []() { CInfoWindow::showYesNoDialog(CGI->generaltexth->allTexts[69], std::vector<std::shared_ptr<CComponent>>(), do_quit, 0, PlayerColor(1)); };
+				return []() { CInfoWindow::showYesNoDialog(VLC->generaltexth->allTexts[69], std::vector<std::shared_ptr<CComponent>>(), do_quit, 0, PlayerColor(1)); };
 			}
 			break;
 			case 5: //highscores
@@ -226,7 +226,7 @@ std::shared_ptr<CButton> CMenuEntry::createButton(CMenuScreen * parent, const Js
 
 	std::pair<std::string, std::string> help;
 	if(!button["help"].isNull() && button["help"].Float() > 0)
-		help = CGI->generaltexth->zelp[(size_t)button["help"].Float()];
+		help = VLC->generaltexth->zelp[(size_t)button["help"].Float()];
 
 	int posx = static_cast<int>(button["x"].Float());
 	if(posx < 0)
@@ -446,7 +446,7 @@ void CMainMenu::openCampaignScreen(std::string name)
 
 	if (!campaignsFound)
 	{
-		CInfoWindow::showInfoDialog(CGI->generaltexth->translate("vcmi.client.errors.missingCampaigns"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
+		CInfoWindow::showInfoDialog(VLC->generaltexth->translate("vcmi.client.errors.missingCampaigns"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
 		return;
 	}
 
@@ -458,7 +458,7 @@ void CMainMenu::startTutorial()
 	ResourcePath tutorialMap("Maps/Tutorial.tut", EResType::MAP);
 	if(!CResourceHandler::get()->existsResource(tutorialMap))
 	{
-		CInfoWindow::showInfoDialog(CGI->generaltexth->translate("core.genrltxt.742"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
+		CInfoWindow::showInfoDialog(VLC->generaltexth->translate("core.genrltxt.742"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
 		return;
 	}
 		
@@ -509,20 +509,20 @@ CMultiMode::CMultiMode(ESelectionScreen ScreenType)
 	}
 
 	textTitle = std::make_shared<CTextBox>("", Rect(7, 18, 440, 50), 0, FONT_BIG, ETextAlignment::CENTER, Colors::WHITE);
-	textTitle->setText(CGI->generaltexth->zelp[263].second);
+	textTitle->setText(VLC->generaltexth->zelp[263].second);
 
 	statusBar = CGStatusBar::create(std::make_shared<CPicture>(background->getSurface(), Rect(7, 465, 440, 18), 7, 465));
 	playerName = std::make_shared<CTextInput>(Rect(19, 436, 334, 16), background->getSurface());
 	playerName->setText(getPlayersNames()[0]);
 	playerName->setCallback(std::bind(&CMultiMode::onNameChange, this, _1));
 
-	buttonHotseat = std::make_shared<CButton>(Point(373, 78 + 57 * 0), AnimationPath::builtin("MUBHOT.DEF"), CGI->generaltexth->zelp[266], std::bind(&CMultiMode::hostTCP, this, EShortcut::MAIN_MENU_HOTSEAT), EShortcut::MAIN_MENU_HOTSEAT);
-	buttonLobby = std::make_shared<CButton>(Point(373, 78 + 57 * 1), AnimationPath::builtin("MUBONL.DEF"), CGI->generaltexth->zelp[265], std::bind(&CMultiMode::openLobby, this), EShortcut::MAIN_MENU_LOBBY);
+	buttonHotseat = std::make_shared<CButton>(Point(373, 78 + 57 * 0), AnimationPath::builtin("MUBHOT.DEF"), VLC->generaltexth->zelp[266], std::bind(&CMultiMode::hostTCP, this, EShortcut::MAIN_MENU_HOTSEAT), EShortcut::MAIN_MENU_HOTSEAT);
+	buttonLobby = std::make_shared<CButton>(Point(373, 78 + 57 * 1), AnimationPath::builtin("MUBONL.DEF"), VLC->generaltexth->zelp[265], std::bind(&CMultiMode::openLobby, this), EShortcut::MAIN_MENU_LOBBY);
 
-	buttonHost = std::make_shared<CButton>(Point(373, 78 + 57 * 3), AnimationPath::builtin("MUBHOST.DEF"), CButton::tooltip(CGI->generaltexth->translate("vcmi.mainMenu.hostTCP"), ""), std::bind(&CMultiMode::hostTCP, this, EShortcut::MAIN_MENU_HOST_GAME), EShortcut::MAIN_MENU_HOST_GAME);
-	buttonJoin = std::make_shared<CButton>(Point(373, 78 + 57 * 4), AnimationPath::builtin("MUBJOIN.DEF"), CButton::tooltip(CGI->generaltexth->translate("vcmi.mainMenu.joinTCP"), ""), std::bind(&CMultiMode::joinTCP, this, EShortcut::MAIN_MENU_JOIN_GAME), EShortcut::MAIN_MENU_JOIN_GAME);
+	buttonHost = std::make_shared<CButton>(Point(373, 78 + 57 * 3), AnimationPath::builtin("MUBHOST.DEF"), CButton::tooltip(VLC->generaltexth->translate("vcmi.mainMenu.hostTCP"), ""), std::bind(&CMultiMode::hostTCP, this, EShortcut::MAIN_MENU_HOST_GAME), EShortcut::MAIN_MENU_HOST_GAME);
+	buttonJoin = std::make_shared<CButton>(Point(373, 78 + 57 * 4), AnimationPath::builtin("MUBJOIN.DEF"), CButton::tooltip(VLC->generaltexth->translate("vcmi.mainMenu.joinTCP"), ""), std::bind(&CMultiMode::joinTCP, this, EShortcut::MAIN_MENU_JOIN_GAME), EShortcut::MAIN_MENU_JOIN_GAME);
 
-	buttonCancel = std::make_shared<CButton>(Point(373, 424), AnimationPath::builtin("MUBCANC.DEF"), CGI->generaltexth->zelp[288], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
+	buttonCancel = std::make_shared<CButton>(Point(373, 424), AnimationPath::builtin("MUBCANC.DEF"), VLC->generaltexth->zelp[288], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
 }
 
 void CMultiMode::openLobby()
@@ -551,7 +551,7 @@ std::vector<std::string> CMultiMode::getPlayersNames()
 
 	std::string playerNameStr = settings["general"]["playerName"].String();
 	if (playerNameStr == "Player")
-		playerNameStr = CGI->generaltexth->translate("core.genrltxt.434");
+		playerNameStr = VLC->generaltexth->translate("core.genrltxt.434");
 	playerNames.push_back(playerNameStr);
 
 	for (const auto & playerName : settings["general"]["multiPlayerNames"].Vector())
@@ -583,14 +583,14 @@ CMultiPlayers::CMultiPlayers(const std::vector<std::string>& playerNames, ESelec
 	switch (shortcut)
 	{
 	case EShortcut::MAIN_MENU_HOTSEAT:
-		text = CGI->generaltexth->allTexts[446];
+		text = VLC->generaltexth->allTexts[446];
 		boost::replace_all(text, "\t", "\n");
 		break;
 	case EShortcut::MAIN_MENU_HOST_GAME:
-		text = CGI->generaltexth->translate("vcmi.mainMenu.hostTCP");
+		text = VLC->generaltexth->translate("vcmi.mainMenu.hostTCP");
 		break;
 	case EShortcut::MAIN_MENU_JOIN_GAME:
-		text = CGI->generaltexth->translate("vcmi.mainMenu.joinTCP");
+		text = VLC->generaltexth->translate("vcmi.mainMenu.joinTCP");
 		break;
 	}
 
@@ -602,8 +602,8 @@ CMultiPlayers::CMultiPlayers(const std::vector<std::string>& playerNames, ESelec
 		inputNames[i]->setCallback(std::bind(&CMultiPlayers::onChange, this, _1));
 	}
 
-	buttonOk = std::make_shared<CButton>(Point(95, 338), AnimationPath::builtin("MUBCHCK.DEF"), CGI->generaltexth->zelp[560], std::bind(&CMultiPlayers::enterSelectionScreen, this), EShortcut::GLOBAL_ACCEPT);
-	buttonCancel = std::make_shared<CButton>(Point(205, 338), AnimationPath::builtin("MUBCANC.DEF"), CGI->generaltexth->zelp[561], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
+	buttonOk = std::make_shared<CButton>(Point(95, 338), AnimationPath::builtin("MUBCHCK.DEF"), VLC->generaltexth->zelp[560], std::bind(&CMultiPlayers::enterSelectionScreen, this), EShortcut::GLOBAL_ACCEPT);
+	buttonCancel = std::make_shared<CButton>(Point(205, 338), AnimationPath::builtin("MUBCANC.DEF"), VLC->generaltexth->zelp[561], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
 	statusBar = CGStatusBar::create(std::make_shared<CPicture>(background->getSurface(), Rect(7, 381, 348, 18), 7, 381));
 
 	for(int i = 0; i < playerNames.size(); i++)
@@ -660,16 +660,16 @@ CSimpleJoinScreen::CSimpleJoinScreen(bool host)
 	textTitle = std::make_shared<CTextBox>("", Rect(20, 10, 205, 50), 0, FONT_BIG, ETextAlignment::CENTER, Colors::WHITE);
 	inputAddress = std::make_shared<CTextInput>(Rect(25, 68, 175, 16), background->getSurface());
 	inputPort = std::make_shared<CTextInput>(Rect(25, 115, 175, 16), background->getSurface());
-	buttonOk = std::make_shared<CButton>(Point(26, 142), AnimationPath::builtin("MUBCHCK.DEF"), CGI->generaltexth->zelp[560], std::bind(&CSimpleJoinScreen::connectToServer, this), EShortcut::GLOBAL_ACCEPT);
+	buttonOk = std::make_shared<CButton>(Point(26, 142), AnimationPath::builtin("MUBCHCK.DEF"), VLC->generaltexth->zelp[560], std::bind(&CSimpleJoinScreen::connectToServer, this), EShortcut::GLOBAL_ACCEPT);
 	if(host && !settings["session"]["donotstartserver"].Bool())
 	{
-		textTitle->setText(CGI->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
+		textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
 		buttonOk->block(true);
 		startConnection();
 	}
 	else
 	{
-		textTitle->setText(CGI->generaltexth->translate("vcmi.mainMenu.serverAddressEnter"));
+		textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverAddressEnter"));
 		inputAddress->setCallback(std::bind(&CSimpleJoinScreen::onChange, this, _1));
 		inputPort->setCallback(std::bind(&CSimpleJoinScreen::onChange, this, _1));
 		inputPort->setFilterNumber(0, 65535);
@@ -679,13 +679,13 @@ CSimpleJoinScreen::CSimpleJoinScreen(bool host)
 	inputPort->setText(std::to_string(host ? CSH->getLocalPort() : CSH->getRemotePort()));
 	buttonOk->block(inputAddress->getText().empty() || inputPort->getText().empty());
 
-	buttonCancel = std::make_shared<CButton>(Point(142, 142), AnimationPath::builtin("MUBCANC.DEF"), CGI->generaltexth->zelp[561], std::bind(&CSimpleJoinScreen::leaveScreen, this), EShortcut::GLOBAL_CANCEL);
+	buttonCancel = std::make_shared<CButton>(Point(142, 142), AnimationPath::builtin("MUBCANC.DEF"), VLC->generaltexth->zelp[561], std::bind(&CSimpleJoinScreen::leaveScreen, this), EShortcut::GLOBAL_CANCEL);
 	statusBar = CGStatusBar::create(std::make_shared<CPicture>(background->getSurface(), Rect(7, 186, 218, 18), 7, 186));
 }
 
 void CSimpleJoinScreen::connectToServer()
 {
-	textTitle->setText(CGI->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
+	textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
 	buttonOk->block(true);
 	ENGINE->input().stopTextInput();
 
@@ -694,7 +694,7 @@ void CSimpleJoinScreen::connectToServer()
 
 void CSimpleJoinScreen::leaveScreen()
 {
-	textTitle->setText(CGI->generaltexth->translate("vcmi.mainMenu.serverClosing"));
+	textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverClosing"));
 	CSH->setState(EClientState::CONNECTION_CANCELLED);
 }
 

+ 1 - 4
client/mainmenu/CPrologEpilogVideo.cpp

@@ -9,14 +9,11 @@
  */
 
 #include "StdInc.h"
-
 #include "CPrologEpilogVideo.h"
-#include "../CGameInfo.h"
+
 #include "../media/IMusicPlayer.h"
 #include "../media/ISoundPlayer.h"
-//#include "../gui/WindowHandler.h"
 #include "../GameEngine.h"
-//#include "../gui/FramerateManager.h"
 #include "../widgets/TextControls.h"
 #include "../widgets/VideoWidget.h"
 #include "../widgets/Images.h"

+ 41 - 42
client/mainmenu/CStatisticScreen.cpp

@@ -9,9 +9,7 @@
  */
 
 #include "StdInc.h"
-
 #include "CStatisticScreen.h"
-#include "../CGameInfo.h"
 
 #include "../GameEngine.h"
 #include "../gui/WindowHandler.h"
@@ -34,6 +32,7 @@
 #include "../../lib/gameState/CGameState.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/TextOperations.h"
+#include "../../lib/VCMI_Lib.h"
 
 #include <vstd/DateUtils.h>
 
@@ -51,15 +50,15 @@ CStatisticScreen::CStatisticScreen(const StatisticDataSet & stat)
 	filledBackground->setPlayerColor(PlayerColor(1));
 
 	contentArea = Rect(10, 40, 780, 510);
-	layout.emplace_back(std::make_shared<CLabel>(400, 20, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->translate("vcmi.statisticWindow.statistics")));
+	layout.emplace_back(std::make_shared<CLabel>(400, 20, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->translate("vcmi.statisticWindow.statistics")));
 	layout.emplace_back(std::make_shared<TransparentFilledRectangle>(contentArea, ColorRGBA(0, 0, 0, 128), ColorRGBA(64, 80, 128, 255), 1));
 	layout.emplace_back(std::make_shared<CButton>(Point(725, 558), AnimationPath::builtin("MUBCHCK"), CButton::tooltip(), [this](){ close(); }, EShortcut::GLOBAL_ACCEPT));
 
 	buttonSelect = std::make_shared<CToggleButton>(Point(10, 564), AnimationPath::builtin("GSPBUT2"), CButton::tooltip(), [this](bool on){ onSelectButton(); });
-	buttonSelect->setTextOverlay(CGI->generaltexth->translate("vcmi.statisticWindow.selectView"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonSelect->setTextOverlay(VLC->generaltexth->translate("vcmi.statisticWindow.selectView"), EFonts::FONT_SMALL, Colors::YELLOW);
 
 	buttonCsvSave = std::make_shared<CToggleButton>(Point(150, 564), AnimationPath::builtin("GSPBUT2"), CButton::tooltip(), [this](bool on){ ENGINE->input().copyToClipBoard(statistic.toCsv("\t"));	});
-	buttonCsvSave->setTextOverlay(CGI->generaltexth->translate("vcmi.statisticWindow.tsvCopy"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonCsvSave->setTextOverlay(VLC->generaltexth->translate("vcmi.statisticWindow.tsvCopy"), EFonts::FONT_SMALL, Colors::YELLOW);
 
 	mainContent = getContent(OVERVIEW, EGameResID::NONE);
 }
@@ -68,7 +67,7 @@ void CStatisticScreen::onSelectButton()
 {
 	std::vector<std::string> texts;
 	for(auto & val : contentInfo)
-		texts.emplace_back(CGI->generaltexth->translate(std::get<0>(val.second)));
+		texts.emplace_back(VLC->generaltexth->translate(std::get<0>(val.second)));
 	ENGINE->windows().createAndPushWindow<StatisticSelector>(texts, [this](int selectedIndex)
 	{
 		OBJECT_CONSTRUCTION;
@@ -80,7 +79,7 @@ void CStatisticScreen::onSelectButton()
 			auto possibleRes = std::vector<EGameResID>{EGameResID::GOLD, EGameResID::WOOD, EGameResID::MERCURY, EGameResID::ORE, EGameResID::SULFUR, EGameResID::CRYSTAL, EGameResID::GEMS};
 			std::vector<std::string> resourceText;
 			for(const auto & res : possibleRes)
-				resourceText.emplace_back(CGI->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()));
+				resourceText.emplace_back(VLC->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()));
 			
 			ENGINE->windows().createAndPushWindow<StatisticSelector>(resourceText, [this, content, possibleRes](int index)
 			{
@@ -140,18 +139,18 @@ TIcons CStatisticScreen::extractIcons() const
 	for(const auto & val : tmpData)
 	{
 		if(val.eventCapturedTown)
-			icons.push_back({ graphics->playerColors[val.player], val.day, imageTown, CGI->generaltexth->translate("vcmi.statisticWindow.icon.townCaptured") });
+			icons.push_back({ graphics->playerColors[val.player], val.day, imageTown, VLC->generaltexth->translate("vcmi.statisticWindow.icon.townCaptured") });
 		if(val.eventDefeatedStrongestHero)
-			icons.push_back({ graphics->playerColors[val.player], val.day, imageBattle, CGI->generaltexth->translate("vcmi.statisticWindow.icon.strongestHeroDefeated") });
+			icons.push_back({ graphics->playerColors[val.player], val.day, imageBattle, VLC->generaltexth->translate("vcmi.statisticWindow.icon.strongestHeroDefeated") });
 		if(val.status == EPlayerStatus::LOSER && !foundDefeated[val.player])
 		{
 			foundDefeated[val.player] = true;
-			icons.push_back({ graphics->playerColors[val.player], val.day, imageDefeated, CGI->generaltexth->translate("vcmi.statisticWindow.icon.defeated") });
+			icons.push_back({ graphics->playerColors[val.player], val.day, imageDefeated, VLC->generaltexth->translate("vcmi.statisticWindow.icon.defeated") });
 		}
 		if(val.hasGrail && !foundGrail[val.player])
 		{
 			foundGrail[val.player] = true;
-			icons.push_back({ graphics->playerColors[val.player], val.day, imageGrail, CGI->generaltexth->translate("vcmi.statisticWindow.icon.grailFound") });
+			icons.push_back({ graphics->playerColors[val.player], val.day, imageGrail, VLC->generaltexth->translate("vcmi.statisticWindow.icon.grailFound") });
 		}
 	}
 
@@ -166,55 +165,55 @@ std::shared_ptr<CIntObject> CStatisticScreen::getContent(Content c, EGameResID r
 	switch (c)
 	{
 	case OVERVIEW:
-		return std::make_shared<OverviewPanel>(contentArea.resize(-15), CGI->generaltexth->translate(std::get<0>(contentInfo[c])), statistic);
+		return std::make_shared<OverviewPanel>(contentArea.resize(-15), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), statistic);
 	
 	case CHART_RESOURCES:
 		plotData = extractData(statistic, [res](const StatisticDataSetEntry & val) -> float { return val.resources[res]; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
 	
 	case CHART_INCOME:
 		plotData = extractData(statistic, [](const StatisticDataSetEntry & val) -> float { return val.income; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
 	
 	case CHART_NUMBER_OF_HEROES:
 		plotData = extractData(statistic, [](const StatisticDataSetEntry & val) -> float { return val.numberHeroes; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
 	
 	case CHART_NUMBER_OF_TOWNS:
 		plotData = extractData(statistic, [](const StatisticDataSetEntry & val) -> float { return val.numberTowns; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
 	
 	case CHART_NUMBER_OF_ARTIFACTS:
 		plotData = extractData(statistic, [](const StatisticDataSetEntry & val) -> float { return val.numberArtifacts; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
 	
 	case CHART_NUMBER_OF_DWELLINGS:
 		plotData = extractData(statistic, [](const StatisticDataSetEntry & val) -> float { return val.numberDwellings; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
 	
 	case CHART_NUMBER_OF_MINES:
 		plotData = extractData(statistic, [res](StatisticDataSetEntry val) -> float { return val.numMines[res]; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
 	
 	case CHART_ARMY_STRENGTH:
 		plotData = extractData(statistic, [](const StatisticDataSetEntry & val) -> float { return val.armyStrength; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
 	
 	case CHART_EXPERIENCE:
 		plotData = extractData(statistic, [](const StatisticDataSetEntry & val) -> float { return val.totalExperience; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
 	
 	case CHART_RESOURCES_SPENT_ARMY:
 		plotData = extractData(statistic, [res](const StatisticDataSetEntry & val) -> float { return val.spentResourcesForArmy[res]; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
 	
 	case CHART_RESOURCES_SPENT_BUILDINGS:
 		plotData = extractData(statistic, [res](const StatisticDataSetEntry & val) -> float { return val.spentResourcesForBuildings[res]; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
 	
 	case CHART_MAP_EXPLORED:
 		plotData = extractData(statistic, [](const StatisticDataSetEntry & val) -> float { return val.mapExploredRatio; });
-		return std::make_shared<LineChart>(contentArea.resize(-5), CGI->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 1);
+		return std::make_shared<LineChart>(contentArea.resize(-5), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 1);
 	}
 
 	return nullptr;
@@ -263,12 +262,12 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 
 	dataExtract = {
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.playerName"), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.playerName"), [this](PlayerColor color){
 				return playerDataFilter(color).front().playerName;
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.daysSurvived"), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.daysSurvived"), [this](PlayerColor color){
 				auto playerData = playerDataFilter(color);
 				for(int i = 0; i < playerData.size(); i++)
 					if(playerData[i].status == EPlayerStatus::LOSER)
@@ -277,7 +276,7 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.maxHeroLevel"), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.maxHeroLevel"), [this](PlayerColor color){
 				int maxLevel = 0;
 				for(const auto & val : playerDataFilter(color))
 					if(maxLevel < val.maxHeroLevel)
@@ -286,7 +285,7 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.battleWinRatioHero"), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.battleWinRatioHero"), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				if(!val.numBattlesPlayer)
 					return std::string("");
@@ -295,7 +294,7 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.battleWinRatioNeutral"), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.battleWinRatioNeutral"), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				if(!val.numWinBattlesNeutral)
 					return std::string("");
@@ -304,25 +303,25 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.battlesHero"), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.battlesHero"), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.numBattlesPlayer);
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.battlesNeutral"), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.battlesNeutral"), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.numBattlesNeutral);
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.obeliskVisited"), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.obeliskVisited"), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(static_cast<int>(val.obeliskVisitedRatio * 100)) + " %";
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.maxArmyStrength"), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.maxArmyStrength"), [this](PlayerColor color){
 				int maxArmyStrength = 0;
 				for(const auto & val : playerDataFilter(color))
 					if(maxArmyStrength < val.armyStrength)
@@ -331,43 +330,43 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::GOLD).get()), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::GOLD).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::GOLD]);
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::WOOD).get()), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::WOOD).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::WOOD]);
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::MERCURY).get()), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::MERCURY).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::MERCURY]);
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::ORE).get()), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::ORE).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::ORE]);
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::SULFUR).get()), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::SULFUR).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::SULFUR]);
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::CRYSTAL).get()), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::CRYSTAL).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::CRYSTAL]);
 			}
 		},
 		{
-			CGI->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + CGI->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::GEMS).get()), [this](PlayerColor color){
+			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::GEMS).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::GEMS]);
 			}
@@ -533,7 +532,7 @@ LineChart::LineChart(Rect position, std::string title, TData data, TIcons icons,
 	Point p = chartArea.topLeft() + Point(chartArea.w + 10, chartArea.h + 10);
 	layout.emplace_back(std::make_shared<CLabel>(p.x, p.y, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CStatisticScreen::getDay(maxDay)));
 	p = chartArea.bottomLeft() + Point(chartArea.w / 2, + 20);
-	layout.emplace_back(std::make_shared<CLabel>(p.x, p.y, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->translate("core.genrltxt.64")));
+	layout.emplace_back(std::make_shared<CLabel>(p.x, p.y, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.64")));
 }
 
 void LineChart::updateStatusBar(const Point & cursorPosition)
@@ -546,7 +545,7 @@ void LineChart::updateStatusBar(const Point & cursorPosition)
 	{
 		float x = (static_cast<float>(maxDay - 1) / static_cast<float>(chartArea.w)) * (static_cast<float>(cursorPosition.x) - static_cast<float>(r.x)) + 1.0f;
 		float y = niceMaxVal - (niceMaxVal / static_cast<float>(chartArea.h)) * (static_cast<float>(cursorPosition.y) - static_cast<float>(r.y));
-		statusBar->write(CGI->generaltexth->translate("core.genrltxt.64") + ": " + CStatisticScreen::getDay(x) + "   " + CGI->generaltexth->translate("vcmi.statisticWindow.value") + ": " + (static_cast<int>(y) > 0 ? std::to_string(static_cast<int>(y)) : std::to_string(y)));
+		statusBar->write(VLC->generaltexth->translate("core.genrltxt.64") + ": " + CStatisticScreen::getDay(x) + "   " + VLC->generaltexth->translate("vcmi.statisticWindow.value") + ": " + (static_cast<int>(y) > 0 ? std::to_string(static_cast<int>(y)) : std::to_string(y)));
 	}
 	setRedrawParent(true);
 	redraw();

+ 0 - 1
client/mapView/MapRenderer.cpp

@@ -14,7 +14,6 @@
 #include "IMapRendererContext.h"
 #include "mapHandler.h"
 
-#include "../CGameInfo.h"
 #include "../GameEngine.h"
 #include "../render/CAnimation.h"
 #include "../render/Canvas.h"

+ 2 - 3
client/mapView/MapRendererContext.cpp

@@ -15,7 +15,6 @@
 #include "mapHandler.h"
 
 #include "../../CCallback.h"
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../PlayerLocalState.h"
 
@@ -92,7 +91,7 @@ bool MapRendererBaseContext::tileAnimated(const int3 & coordinates) const
 
 const TerrainTile & MapRendererBaseContext::getMapTile(const int3 & coordinates) const
 {
-	return CGI->mh->getMap()->getTile(coordinates);
+	return MAPHANDLER->getMap()->getTile(coordinates);
 }
 
 const MapRendererBaseContext::MapObjectsList & MapRendererBaseContext::getObjects(const int3 & coordinates) const
@@ -103,7 +102,7 @@ const MapRendererBaseContext::MapObjectsList & MapRendererBaseContext::getObject
 
 const CGObjectInstance * MapRendererBaseContext::getObject(ObjectInstanceID objectID) const
 {
-	return CGI->mh->getMap()->objects.at(objectID.getNum());
+	return MAPHANDLER->getMap()->objects.at(objectID.getNum());
 }
 
 const CGPath * MapRendererBaseContext::currentPath() const

+ 2 - 3
client/mapView/MapRendererContextState.cpp

@@ -15,7 +15,6 @@
 #include "mapHandler.h"
 
 #include "../../CCallback.h"
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../adventureMap/AdventureMapInterface.h"
 
@@ -25,7 +24,7 @@
 static bool compareObjectBlitOrder(ObjectInstanceID left, ObjectInstanceID right)
 {
 	//FIXME: remove mh access
-	return CGI->mh->compareObjectBlitOrder(CGI->mh->getMap()->objects[left.getNum()], CGI->mh->getMap()->objects[right.getNum()]);
+	return MAPHANDLER->compareObjectBlitOrder(MAPHANDLER->getMap()->objects[left.getNum()], MAPHANDLER->getMap()->objects[right.getNum()]);
 }
 
 MapRendererContextState::MapRendererContextState()
@@ -35,7 +34,7 @@ MapRendererContextState::MapRendererContextState()
 	objects.resize(boost::extents[mapSize.z][mapSize.x][mapSize.y]);
 
 	logGlobal->debug("Loading map objects");
-	for(const auto & obj : CGI->mh->getMap()->objects)
+	for(const auto & obj : MAPHANDLER->getMap()->objects)
 		addObject(obj);
 	logGlobal->debug("Done loading map objects");
 }

+ 0 - 1
client/mapView/MapView.cpp

@@ -17,7 +17,6 @@
 #include "MapViewModel.h"
 #include "mapHandler.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../adventureMap/AdventureMapInterface.h"
 #include "../GameEngine.h"

+ 0 - 1
client/mapView/MapViewActions.cpp

@@ -14,7 +14,6 @@
 #include "MapView.h"
 #include "MapViewModel.h"
 
-#include "../CGameInfo.h"
 #include "../adventureMap/AdventureMapInterface.h"
 #include "../GameEngine.h"
 #include "../gui/CursorHandler.h"

+ 7 - 6
client/mapView/mapHandler.cpp

@@ -13,7 +13,6 @@
 #include "mapHandler.h"
 
 #include "../CCallback.h"
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 
@@ -24,6 +23,8 @@
 #include "../../lib/mapObjects/ObjectTemplate.h"
 #include "../../lib/mapping/CMap.h"
 
+std::unique_ptr<CMapHandler> MAPHANDLER = nullptr;
+
 bool CMapHandler::hasOngoingAnimations()
 {
 	for(auto * observer : observers)
@@ -53,7 +54,7 @@ std::string CMapHandler::getTerrainDescr(const int3 & pos, bool rightClick) cons
 	const TerrainTile & t = map->getTile(pos);
 
 	if(t.hasFavorableWinds())
-		return CGI->objtypeh->getObjectName(Obj::FAVORABLE_WINDS, 0);
+		return VLC->objtypeh->getObjectName(Obj::FAVORABLE_WINDS, 0);
 
 	std::string result = t.getTerrain()->getNameTranslated();
 
@@ -70,7 +71,7 @@ std::string CMapHandler::getTerrainDescr(const int3 & pos, bool rightClick) cons
 	{
 		return boost::str(
 			boost::format(rightClick ? "%s\r\n%s" : "%s %s") // New line for the Message Box, space for the Status Bar
-			% result % CGI->generaltexth->allTexts[330]
+			% result % VLC->generaltexth->allTexts[330]
 		); // 'digging ok'
 	}
 
@@ -235,11 +236,11 @@ void CMapHandler::removeMapObserver(IMapObjectObserver * object)
 
 IMapObjectObserver::IMapObjectObserver()
 {
-	CGI->mh->addMapObserver(this);
+	MAPHANDLER->addMapObserver(this);
 }
 
 IMapObjectObserver::~IMapObjectObserver()
 {
-	if (CGI && CGI->mh)
-		CGI->mh->removeMapObserver(this);
+	if (VLC && MAPHANDLER)
+		MAPHANDLER->removeMapObserver(this);
 }

+ 2 - 0
client/mapView/mapHandler.h

@@ -75,3 +75,5 @@ public:
 
 	static bool compareObjectBlitOrder(const CGObjectInstance * a, const CGObjectInstance * b);
 };
+
+extern std::unique_ptr<CMapHandler> MAPHANDLER;

+ 3 - 3
client/media/CMusicHandler.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "CMusicHandler.h"
 
-#include "../CGameInfo.h"
 #include "../eventsSDL/InputHandler.h"
 #include "../GameEngine.h"
 #include "../renderSDL/SDLRWwrapper.h"
@@ -21,6 +20,7 @@
 #include "../../lib/CRandomGenerator.h"
 #include "../../lib/TerrainHandler.h"
 #include "../../lib/filesystem/Filesystem.h"
+#include "../../lib/VCMI_Lib.h"
 
 void CMusicHandler::onVolumeChange(const JsonNode & volumeNode)
 {
@@ -63,13 +63,13 @@ CMusicHandler::CMusicHandler():
 
 void CMusicHandler::loadTerrainMusicThemes()
 {
-	for(const auto & terrain : CGI->terrainTypeHandler->objects)
+	for(const auto & terrain : VLC->terrainTypeHandler->objects)
 	{
 		for(const auto & filename : terrain->musicFilename)
 			addEntryToSet("terrain_" + terrain->getJsonKey(), filename);
 	}
 
-	for(const auto & faction : CGI->townh->objects)
+	for(const auto & faction : VLC->townh->objects)
 	{
 		if (!faction || !faction->hasTown())
 			continue;

+ 0 - 1
client/media/CSoundHandler.cpp

@@ -11,7 +11,6 @@
 #include "CSoundHandler.h"
 
 #include "../GameEngine.h"
-#include "../CGameInfo.h"
 
 #include "../lib/filesystem/Filesystem.h"
 #include "../lib/CRandomGenerator.h"

+ 2 - 2
client/media/CVideoHandler.cpp

@@ -14,7 +14,6 @@
 
 #include "ISoundPlayer.h"
 
-#include "../CGameInfo.h"
 #include "../CMT.h"
 #include "../eventsSDL/InputHandler.h"
 #include "../GameEngine.h"
@@ -26,6 +25,7 @@
 #include "../../lib/filesystem/Filesystem.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/Languages.h"
+#include "../../lib/VCMI_Lib.h"
 
 #include <SDL_render.h>
 
@@ -524,7 +524,7 @@ int FFMpegStream::findAudioStream() const
 		}
 	}
 
-	std::string preferredLanguageName = CGI->generaltexth->getPreferredLanguage();
+	std::string preferredLanguageName = VLC->generaltexth->getPreferredLanguage();
 	std::string preferredTag = Languages::getLanguageOptions(preferredLanguageName).tagISO2;
 
 	for (auto const & entry : streamToLanguage)

+ 0 - 1
client/renderSDL/CBitmapFont.cpp

@@ -13,7 +13,6 @@
 #include "SDL_Extensions.h"
 #include "SDLImageScaler.h"
 
-#include "../CGameInfo.h"
 #include "../GameEngine.h"
 #include "../render/Colors.h"
 #include "../render/IImage.h"

+ 3 - 4
client/renderSDL/FontChain.cpp

@@ -13,13 +13,12 @@
 #include "CTrueTypeFont.h"
 #include "CBitmapFont.h"
 
-#include "../CGameInfo.h"
-
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/modding/CModHandler.h"
 #include "../../lib/texts/TextOperations.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/Languages.h"
+#include "../../lib/VCMI_Lib.h"
 
 void FontChain::renderText(SDL_Surface * surface, const std::string & data, const ColorRGBA & color, const Point & pos) const
 {
@@ -60,9 +59,9 @@ bool FontChain::bitmapFontsPrioritized(const std::string & bitmapFontName) const
 	if (!vstd::isAlmostEqual(1.0, settings["video"]["fontScalingFactor"].Float()))
 		return false; // If player requested non-100% scaling - use scalable fonts
 
-	std::string gameLanguage = CGI->generaltexth->getPreferredLanguage();
+	std::string gameLanguage = VLC->generaltexth->getPreferredLanguage();
 	std::string gameEncoding = Languages::getLanguageOptions(gameLanguage).encoding;
-	std::string fontEncoding = CGI->modh->findResourceEncoding(ResourcePath("data/" + bitmapFontName, EResType::BMP_FONT));
+	std::string fontEncoding = VLC->modh->findResourceEncoding(ResourcePath("data/" + bitmapFontName, EResType::BMP_FONT));
 
 	// player uses language with different encoding than his bitmap fonts
 	// for example, Polish language with English fonts or Chinese language which can't use H3 fonts at all

+ 0 - 1
client/renderSDL/ScreenHandler.cpp

@@ -11,7 +11,6 @@
 #include "StdInc.h"
 #include "ScreenHandler.h"
 
-#include "../CGameInfo.h"
 #include "../CMT.h"
 #include "../eventsSDL/NotificationHandler.h"
 #include "../GameEngine.h"

+ 3 - 3
client/widgets/Buttons.cpp

@@ -13,7 +13,6 @@
 #include "Images.h"
 #include "TextControls.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../battle/BattleInterface.h"
 #include "../battle/BattleInterfaceClasses.h"
@@ -30,6 +29,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/filesystem/Filesystem.h"
+#include "../../lib/VCMI_Lib.h"
 
 void ButtonBase::update()
 {
@@ -383,8 +383,8 @@ std::pair<std::string, std::string> CButton::tooltip()
 std::pair<std::string, std::string> CButton::tooltipLocalized(const std::string & key)
 {
 	return std::make_pair(
-		CGI->generaltexth->translate(key, "hover"),
-		CGI->generaltexth->translate(key, "help")
+		VLC->generaltexth->translate(key, "hover"),
+		VLC->generaltexth->translate(key, "help")
 	);
 }
 

+ 0 - 2
client/widgets/CArtifactsOfHeroBase.cpp

@@ -16,10 +16,8 @@
 #include "Buttons.h"
 
 #include "../CPlayerInterface.h"
-#include "../CGameInfo.h"
 
 #include "../../CCallback.h"
-
 #include "../../lib/ArtifactUtils.h"
 #include "../../lib/mapObjects/CGHeroInstance.h"
 #include "../../lib/networkPacks/ArtifactLocation.h"

+ 30 - 30
client/widgets/CComponent.cpp

@@ -23,7 +23,6 @@
 #include "../windows/CMessage.h"
 #include "../windows/InfoWindows.h"
 #include "../widgets/TextControls.h"
-#include "../CGameInfo.h"
 
 #include "../../lib/ArtifactUtils.h"
 #include "../../lib/entities/building/CBuilding.h"
@@ -37,6 +36,7 @@
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/CArtHandler.h"
 #include "../../lib/CArtifactInstance.h"
+#include "../../lib/VCMI_Lib.h"
 
 #include <vcmi/spells/Service.h>
 #include <vcmi/spells/Spell.h>
@@ -158,7 +158,7 @@ std::vector<AnimationPath> CComponent::getFileName() const
 		case ComponentType::LUCK:
 			return gen(luckArr);
 		case ComponentType::BUILDING:
-			return std::vector<AnimationPath>(4, (*CGI->townh)[data.subType.as<BuildingTypeUniqueID>().getFaction()]->town->clientInfo.buildingsIcons);
+			return std::vector<AnimationPath>(4, (*VLC->townh)[data.subType.as<BuildingTypeUniqueID>().getFaction()]->town->clientInfo.buildingsIcons);
 		case ComponentType::HERO_PORTRAIT:
 			return gen(heroArr);
 		case ComponentType::FLAG:
@@ -188,9 +188,9 @@ size_t CComponent::getIndex() const
 		case ComponentType::RESOURCE_PER_DAY:
 			return data.subType.getNum();
 		case ComponentType::CREATURE:
-			return CGI->creatures()->getById(data.subType.as<CreatureID>())->getIconIndex();
+			return VLC->creatures()->getById(data.subType.as<CreatureID>())->getIconIndex();
 		case ComponentType::ARTIFACT:
-			return CGI->artifacts()->getById(data.subType.as<ArtifactID>())->getIconIndex();
+			return VLC->artifacts()->getById(data.subType.as<ArtifactID>())->getIconIndex();
 		case ComponentType::SPELL_SCROLL:
 		case ComponentType::SPELL:
 			return (size < large) ? data.subType.getNum() + 1 : data.subType.getNum();
@@ -201,7 +201,7 @@ size_t CComponent::getIndex() const
 		case ComponentType::BUILDING:
 			return data.subType.as<BuildingTypeUniqueID>().getBuilding();
 		case ComponentType::HERO_PORTRAIT:
-			return CGI->heroTypes()->getById(data.subType.as<HeroTypeID>())->getIconIndex();
+			return VLC->heroTypes()->getById(data.subType.as<HeroTypeID>())->getIconIndex();
 		case ComponentType::FLAG:
 			return data.subType.getNum();
 		default:
@@ -215,38 +215,38 @@ std::string CComponent::getDescription() const
 	switch(data.type)
 	{
 		case ComponentType::PRIM_SKILL:
-			return CGI->generaltexth->arraytxt[2+data.subType.getNum()];
+			return VLC->generaltexth->arraytxt[2+data.subType.getNum()];
 		case ComponentType::EXPERIENCE:
 		case ComponentType::LEVEL:
-			return CGI->generaltexth->allTexts[241];
+			return VLC->generaltexth->allTexts[241];
 		case ComponentType::MANA:
-			return CGI->generaltexth->allTexts[149];
+			return VLC->generaltexth->allTexts[149];
 		case ComponentType::SEC_SKILL:
-			return CGI->skillh->getByIndex(data.subType.getNum())->getDescriptionTranslated(data.value.value_or(0));
+			return VLC->skillh->getByIndex(data.subType.getNum())->getDescriptionTranslated(data.value.value_or(0));
 		case ComponentType::RESOURCE:
 		case ComponentType::RESOURCE_PER_DAY:
-			return CGI->generaltexth->allTexts[242];
+			return VLC->generaltexth->allTexts[242];
 		case ComponentType::NONE:
 		case ComponentType::CREATURE:
 			return "";
 		case ComponentType::ARTIFACT:
-			return CGI->artifacts()->getById(data.subType.as<ArtifactID>())->getDescriptionTranslated();
+			return VLC->artifacts()->getById(data.subType.as<ArtifactID>())->getDescriptionTranslated();
 		case ComponentType::SPELL_SCROLL:
 		{
-			auto description = ArtifactID(ArtifactID::SPELL_SCROLL).toEntity(CGI)->getDescriptionTranslated();
+			auto description = ArtifactID(ArtifactID::SPELL_SCROLL).toEntity(VLC)->getDescriptionTranslated();
 			ArtifactUtils::insertScrrollSpellName(description, data.subType.as<SpellID>());
 			return description;
 		}
 		case ComponentType::SPELL:
-			return CGI->spells()->getById(data.subType.as<SpellID>())->getDescriptionTranslated(std::max(0, data.value.value_or(0)));
+			return VLC->spells()->getById(data.subType.as<SpellID>())->getDescriptionTranslated(std::max(0, data.value.value_or(0)));
 		case ComponentType::MORALE:
-			return CGI->generaltexth->heroscrn[ 4 - (data.value.value_or(0)>0) + (data.value.value_or(0)<0)];
+			return VLC->generaltexth->heroscrn[ 4 - (data.value.value_or(0)>0) + (data.value.value_or(0)<0)];
 		case ComponentType::LUCK:
-			return CGI->generaltexth->heroscrn[ 7 - (data.value.value_or(0)>0) + (data.value.value_or(0)<0)];
+			return VLC->generaltexth->heroscrn[ 7 - (data.value.value_or(0)>0) + (data.value.value_or(0)<0)];
 		case ComponentType::BUILDING:
 		{
 			auto index = data.subType.as<BuildingTypeUniqueID>();
-			return (*CGI->townh)[index.getFaction()]->town->buildings[index.getBuilding()]->getDescriptionTranslated();
+			return (*VLC->townh)[index.getFaction()]->town->buildings[index.getBuilding()]->getDescriptionTranslated();
 		}
 		case ComponentType::HERO_PORTRAIT:
 			return "";
@@ -267,41 +267,41 @@ std::string CComponent::getSubtitle() const
 	{
 		case ComponentType::PRIM_SKILL:
 			if (data.value)
-				return boost::str(boost::format("%+d %s") % data.value.value_or(0) % CGI->generaltexth->primarySkillNames[data.subType.getNum()]);
+				return boost::str(boost::format("%+d %s") % data.value.value_or(0) % VLC->generaltexth->primarySkillNames[data.subType.getNum()]);
 			else
-				return CGI->generaltexth->primarySkillNames[data.subType.getNum()];
+				return VLC->generaltexth->primarySkillNames[data.subType.getNum()];
 		case ComponentType::EXPERIENCE:
 			return std::to_string(data.value.value_or(0));
 		case ComponentType::LEVEL:
 		{
-			std::string level = CGI->generaltexth->allTexts[442];
+			std::string level = VLC->generaltexth->allTexts[442];
 			boost::replace_first(level, "1", std::to_string(data.value.value_or(0)));
 			return level;
 		}
 		case ComponentType::MANA:
-			return boost::str(boost::format("%+d %s") % data.value.value_or(0) % CGI->generaltexth->allTexts[387]);
+			return boost::str(boost::format("%+d %s") % data.value.value_or(0) % VLC->generaltexth->allTexts[387]);
 		case ComponentType::SEC_SKILL:
-			return CGI->generaltexth->levels[data.value.value_or(0)-1] + "\n" + CGI->skillh->getById(data.subType.as<SecondarySkill>())->getNameTranslated();
+			return VLC->generaltexth->levels[data.value.value_or(0)-1] + "\n" + VLC->skillh->getById(data.subType.as<SecondarySkill>())->getNameTranslated();
 		case ComponentType::RESOURCE:
 			return std::to_string(data.value.value_or(0));
 		case ComponentType::RESOURCE_PER_DAY:
-			return boost::str(boost::format(CGI->generaltexth->allTexts[3]) % data.value.value_or(0));
+			return boost::str(boost::format(VLC->generaltexth->allTexts[3]) % data.value.value_or(0));
 		case ComponentType::CREATURE:
 		{
-			auto creature = CGI->creh->getById(data.subType.as<CreatureID>());
+			auto creature = VLC->creh->getById(data.subType.as<CreatureID>());
 			if(data.value)
 				return std::to_string(*data.value) + " " + (*data.value > 1 ? creature->getNamePluralTranslated() : creature->getNameSingularTranslated());
 			else
 				return creature->getNamePluralTranslated();
 		}
 		case ComponentType::ARTIFACT:
-			return CGI->artifacts()->getById(data.subType.as<ArtifactID>())->getNameTranslated();
+			return VLC->artifacts()->getById(data.subType.as<ArtifactID>())->getNameTranslated();
 		case ComponentType::SPELL_SCROLL:
 		case ComponentType::SPELL:
 			if (data.value.value_or(0) < 0)
-				return "{#A9A9A9|" + CGI->spells()->getById(data.subType.as<SpellID>())->getNameTranslated() + "}";
+				return "{#A9A9A9|" + VLC->spells()->getById(data.subType.as<SpellID>())->getNameTranslated() + "}";
 			else
-				return CGI->spells()->getById(data.subType.as<SpellID>())->getNameTranslated();
+				return VLC->spells()->getById(data.subType.as<SpellID>())->getNameTranslated();
 		case ComponentType::NONE:
 		case ComponentType::MORALE:
 		case ComponentType::LUCK:
@@ -310,16 +310,16 @@ std::string CComponent::getSubtitle() const
 		case ComponentType::BUILDING:
 			{
 				auto index = data.subType.as<BuildingTypeUniqueID>();
-				auto building = (*CGI->townh)[index.getFaction()]->town->buildings[index.getBuilding()];
+				auto building = (*VLC->townh)[index.getFaction()]->town->buildings[index.getBuilding()];
 				if(!building)
 				{
-					logGlobal->error("Town of faction %s has no building #%d", (*CGI->townh)[index.getFaction()]->town->faction->getNameTranslated(), index.getBuilding().getNum());
+					logGlobal->error("Town of faction %s has no building #%d", (*VLC->townh)[index.getFaction()]->town->faction->getNameTranslated(), index.getBuilding().getNum());
 					return (boost::format("Missing building #%d") % index.getBuilding().getNum()).str();
 				}
 				return building->getNameTranslated();
 			}
 		case ComponentType::FLAG:
-			return CGI->generaltexth->capColors[data.subType.as<PlayerColor>().getNum()];
+			return VLC->generaltexth->capColors[data.subType.as<PlayerColor>().getNum()];
 		default:
 			assert(0);
 			return "";
@@ -524,7 +524,7 @@ void CComponentBox::placeComponents(bool selectable)
 				{
 					Point orPos = Point(currentX - freeSpace, currentY) + getOrTextPos(prevComp.get(), iter->get());
 
-					orLabels.push_back(std::make_shared<CLabel>(orPos.x, orPos.y, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[4]));
+					orLabels.push_back(std::make_shared<CLabel>(orPos.x, orPos.y, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[4]));
 				}
 				currentX += getDistance(prevComp.get(), iter->get());
 			}

+ 7 - 8
client/widgets/CComponentHolder.cpp

@@ -20,7 +20,6 @@
 #include "../render/Colors.h"
 #include "../render/IRenderHandler.h"
 #include "../CPlayerInterface.h"
-#include "../CGameInfo.h"
 
 #include "../../CCallback.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
@@ -168,7 +167,7 @@ void CCommanderArtPlace::returnArtToHeroCallback()
 	ArtifactPosition freeSlot = ArtifactUtils::getArtBackpackPosition(commanderOwner, getArtifactId());
 	if(freeSlot == ArtifactPosition::PRE_FIRST)
 	{
-		LOCPLINT->showInfoDialog(CGI->generaltexth->translate("core.genrltxt.152"));
+		LOCPLINT->showInfoDialog(VLC->generaltexth->translate("core.genrltxt.152"));
 	}
 	else
 	{
@@ -188,7 +187,7 @@ void CCommanderArtPlace::returnArtToHeroCallback()
 void CCommanderArtPlace::clickPressed(const Point & cursorPosition)
 {
 	if(getArtifactId() != ArtifactID::NONE && text.size())
-		LOCPLINT->showYesNoDialog(CGI->generaltexth->translate("vcmi.commanderWindow.artifactMessage"), [this]() { returnArtToHeroCallback(); }, []() {});
+		LOCPLINT->showYesNoDialog(VLC->generaltexth->translate("vcmi.commanderWindow.artifactMessage"), [this]() { returnArtToHeroCallback(); }, []() {});
 }
 
 void CCommanderArtPlace::showPopupWindow(const Point & cursorPosition)
@@ -203,18 +202,18 @@ void CArtPlace::lockSlot(bool on)
 	if(on)
 	{
 		image->setFrame(ArtifactID::ART_LOCK);
-		hoverText = CGI->generaltexth->allTexts[507];
+		hoverText = VLC->generaltexth->allTexts[507];
 	}
 	else if(artId != ArtifactID::NONE)
 	{
 		image->setFrame(imageIndex);
-		auto hoverText = MetaString::createFromRawString(CGI->generaltexth->heroscrn[1]);
+		auto hoverText = MetaString::createFromRawString(VLC->generaltexth->heroscrn[1]);
 		hoverText.replaceName(artId);
 		this->hoverText = hoverText.toString();
 	}
 	else
 	{
-		hoverText = CGI->generaltexth->allTexts[507];
+		hoverText = VLC->generaltexth->allTexts[507];
 	}
 }
 
@@ -298,8 +297,8 @@ void CSecSkillPlace::setLevel(const uint8_t level)
 		const auto secSkill = skillId.toSkill();
 		image->setFrame(secSkill->getIconIndex(level - 1));
 		image->enable();
-		auto hoverText = MetaString::createFromRawString(CGI->generaltexth->heroscrn[21]);
-		hoverText.replaceRawString(CGI->generaltexth->levels[level - 1]);
+		auto hoverText = MetaString::createFromRawString(VLC->generaltexth->heroscrn[21]);
+		hoverText.replaceRawString(VLC->generaltexth->levels[level - 1]);
 		hoverText.replaceTextID(secSkill->getNameTextID());
 		this->hoverText = hoverText.toString();
 		component.value = level;

+ 10 - 11
client/widgets/CGarrisonInt.cpp

@@ -20,7 +20,6 @@
 #include "../windows/CCreatureWindow.h"
 #include "../windows/CWindowWithArtifacts.h"
 #include "../windows/GUIClasses.h"
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 
 #include "../../CCallback.h"
@@ -55,17 +54,17 @@ void CGarrisonSlot::hover (bool on)
 			{
 				if(owner->getSelection() == this)
 				{
-					temp = CGI->generaltexth->tcommands[4]; //View %s
+					temp = VLC->generaltexth->tcommands[4]; //View %s
 					boost::algorithm::replace_first(temp,"%s",creature->getNameSingularTranslated());
 				}
 				else if (owner->getSelection()->creature == creature)
 				{
-					temp = CGI->generaltexth->tcommands[2]; //Combine %s armies
+					temp = VLC->generaltexth->tcommands[2]; //Combine %s armies
 					boost::algorithm::replace_first(temp,"%s",creature->getNameSingularTranslated());
 				}
 				else if (owner->getSelection()->creature)
 				{
-					temp = CGI->generaltexth->tcommands[7]; //Exchange %s with %s
+					temp = VLC->generaltexth->tcommands[7]; //Exchange %s with %s
 					boost::algorithm::replace_first(temp,"%s",owner->getSelection()->creature->getNameSingularTranslated());
 					boost::algorithm::replace_first(temp,"%s",creature->getNameSingularTranslated());
 				}
@@ -85,15 +84,15 @@ void CGarrisonSlot::hover (bool on)
 
 				if(isHeroOnMap)
 				{
-					temp = CGI->generaltexth->allTexts[481]; //Select %s
+					temp = VLC->generaltexth->allTexts[481]; //Select %s
 				}
 				else if(upg == EGarrisonType::UPPER)
 				{
-					temp = CGI->generaltexth->tcommands[12]; //Select %s (in garrison)
+					temp = VLC->generaltexth->tcommands[12]; //Select %s (in garrison)
 				}
 				else // Hero is visiting some object (town, mine, etc)
 				{
-					temp = CGI->generaltexth->tcommands[32]; //Select %s (visiting)
+					temp = VLC->generaltexth->tcommands[32]; //Select %s (visiting)
 				}
 				boost::algorithm::replace_first(temp,"%s",creature->getNameSingularTranslated());
 			}
@@ -108,17 +107,17 @@ void CGarrisonSlot::hover (bool on)
 				  && owner->getSelection()->upg != upg	//we're moving it to the other garrison
 				  )
 				{
-					temp = CGI->generaltexth->tcommands[5]; //Cannot move last army to garrison
+					temp = VLC->generaltexth->tcommands[5]; //Cannot move last army to garrison
 				}
 				else
 				{
-					temp = CGI->generaltexth->tcommands[6]; //Move %s
+					temp = VLC->generaltexth->tcommands[6]; //Move %s
 					boost::algorithm::replace_first(temp,"%s",owner->getSelection()->creature->getNameSingularTranslated());
 				}
 			}
 			else
 			{
-				temp = CGI->generaltexth->tcommands[11]; //Empty
+				temp = VLC->generaltexth->tcommands[11]; //Empty
 			}
 		}
 		ENGINE->statusbar()->write(temp);
@@ -514,7 +513,7 @@ bool CGarrisonSlot::handleSplittingShortcuts()
 	{
 		auto dismiss = getDismiss();
 		if(dismiss)
-			LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[12], dismiss, nullptr);
+			LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[12], dismiss, nullptr);
 	}
 	else if(isAlt)
 	{

+ 0 - 1
client/widgets/Images.cpp

@@ -23,7 +23,6 @@
 #include "../battle/BattleInterface.h"
 #include "../battle/BattleInterfaceClasses.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 
 #include "../../CCallback.h"

+ 13 - 14
client/widgets/MiscWidgets.cpp

@@ -17,7 +17,6 @@
 
 #include "../CMT.h"
 #include "../CPlayerInterface.h"
-#include "../CGameInfo.h"
 #include "../PlayerLocalState.h"
 #include "../gui/WindowHandler.h"
 #include "../eventsSDL/InputHandler.h"
@@ -216,9 +215,9 @@ std::string CMinorResDataBar::buildDateString()
 	std::string pattern = "%s: %d, %s: %d, %s: %d";
 
 	auto formatted = boost::format(pattern)
-		% CGI->generaltexth->translate("core.genrltxt.62") % LOCPLINT->cb->getDate(Date::MONTH)
-		% CGI->generaltexth->translate("core.genrltxt.63") % LOCPLINT->cb->getDate(Date::WEEK)
-		% CGI->generaltexth->translate("core.genrltxt.64") % LOCPLINT->cb->getDate(Date::DAY_OF_WEEK);
+		% VLC->generaltexth->translate("core.genrltxt.62") % LOCPLINT->cb->getDate(Date::MONTH)
+		% VLC->generaltexth->translate("core.genrltxt.63") % LOCPLINT->cb->getDate(Date::WEEK)
+		% VLC->generaltexth->translate("core.genrltxt.64") % LOCPLINT->cb->getDate(Date::DAY_OF_WEEK);
 
 	return boost::str(formatted);
 }
@@ -298,7 +297,7 @@ void CArmyTooltip::init(const InfoAboutArmy &army)
 				}
 				else
 				{
-					subtitle = CGI->generaltexth->arraytxt[171 + 3*(slot.second.count)];
+					subtitle = VLC->generaltexth->arraytxt[171 + 3*(slot.second.count)];
 				}
 			}
 		}
@@ -482,7 +481,7 @@ void CInteractableTownTooltip::init(const CGTownInstance * town)
 				return;
 			}
 		}
-		LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
+		LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
 	});
 
 	assert(townInfo.tType);
@@ -576,16 +575,16 @@ void MoraleLuckBox::set(const AFactionMember * node)
 		component.value = morale ? node->moraleValAndBonusList(modifierList) : node->luckValAndBonusList(modifierList);
 
 	int mrlt = (component.value>0)-(component.value<0); //signum: -1 - bad luck / morale, 0 - neutral, 1 - good
-	hoverText = CGI->generaltexth->heroscrn[hoverTextBase[morale] - mrlt];
+	hoverText = VLC->generaltexth->heroscrn[hoverTextBase[morale] - mrlt];
 	component.type = componentType[morale];
-	text = CGI->generaltexth->arraytxt[textId[morale]];
-	boost::algorithm::replace_first(text,"%s",CGI->generaltexth->arraytxt[neutralDescr[morale]-mrlt]);
+	text = VLC->generaltexth->arraytxt[textId[morale]];
+	boost::algorithm::replace_first(text,"%s",VLC->generaltexth->arraytxt[neutralDescr[morale]-mrlt]);
 
 	if (morale && node && (node->getBonusBearer()->hasBonusOfType(BonusType::UNDEAD)
 			|| node->getBonusBearer()->hasBonusOfType(BonusType::NON_LIVING)
 			|| node->getBonusBearer()->hasBonusOfType(BonusType::MECHANICAL)))
 	{
-		text += CGI->generaltexth->arraytxt[113]; //unaffected by morale
+		text += VLC->generaltexth->arraytxt[113]; //unaffected by morale
 		component.value = 0;
 	}
 	else if(morale && node && node->getBonusBearer()->hasBonusOfType(BonusType::NO_MORALE))
@@ -614,7 +613,7 @@ void MoraleLuckBox::set(const AFactionMember * node)
 			}
 		}
 		text = addInfo.empty() 
-			? text + CGI->generaltexth->arraytxt[noneTxtId] 
+			? text + VLC->generaltexth->arraytxt[noneTxtId] 
 			: text + addInfo;
 	}
 	std::string imageName;
@@ -644,7 +643,7 @@ CCreaturePic::CCreaturePic(int x, int y, const CCreature * cre, bool Big, bool A
 
 	auto faction = cre->getFactionID();
 
-	assert(CGI->townh->size() > faction);
+	assert(VLC->townh->size() > faction);
 
 	if (cre->animDefName.empty())
 	{
@@ -656,9 +655,9 @@ CCreaturePic::CCreaturePic(int x, int y, const CCreature * cre, bool Big, bool A
 	}
 
 	if(Big)
-		bg = std::make_shared<CPicture>((*CGI->townh)[faction]->creatureBg130);
+		bg = std::make_shared<CPicture>((*VLC->townh)[faction]->creatureBg130);
 	else
-		bg = std::make_shared<CPicture>((*CGI->townh)[faction]->creatureBg120);
+		bg = std::make_shared<CPicture>((*VLC->townh)[faction]->creatureBg120);
 	anim = std::make_shared<CCreatureAnim>(0, 0, cre->animDefName);
 	anim->clipRect(cre->isDoubleWide()?170:150, 155, bg->pos.w, bg->pos.h);
 	anim->startPreview(cre->hasBonusOfType(BonusType::SIEGE_WEAPON));

+ 2 - 2
client/widgets/RadialMenu.cpp

@@ -17,9 +17,9 @@
 #include "../GameEngine.h"
 #include "../gui/WindowHandler.h"
 #include "../render/IImage.h"
-#include "../CGameInfo.h"
 
 #include "../../lib/texts/CGeneralTextHandler.h"
+#include "../../lib/VCMI_Lib.h"
 
 RadialMenuItem::RadialMenuItem(const std::string & imageName, const std::string & hoverText, const std::function<void()> & callback, bool alternativeLayout)
 	: callback(callback)
@@ -72,7 +72,7 @@ void RadialMenu::addItem(const Point & offset, bool enabled, const std::string &
 	if (!enabled)
 		return;
 
-	auto item = std::make_shared<RadialMenuItem>(path, CGI->generaltexth->translate(hoverText), callback, alternativeLayout);
+	auto item = std::make_shared<RadialMenuItem>(path, VLC->generaltexth->translate(hoverText), callback, alternativeLayout);
 
 	item->moveBy(offset);
 

+ 0 - 1
client/widgets/VideoWidget.cpp

@@ -12,7 +12,6 @@
 #include "TextControls.h"
 #include "IVideoHolder.h"
 
-#include "../CGameInfo.h"
 #include "../GameEngine.h"
 #include "../media/ISoundPlayer.h"
 #include "../media/IVideoPlayer.h"

+ 6 - 7
client/widgets/markets/CAltarArtifacts.cpp

@@ -16,7 +16,6 @@
 #include "../../widgets/Buttons.h"
 #include "../../widgets/TextControls.h"
 
-#include "../../CGameInfo.h"
 #include "../../CPlayerInterface.h"
 
 #include "../../../CCallback.h"
@@ -35,16 +34,16 @@ CAltarArtifacts::CAltarArtifacts(const IMarket * market, const CGHeroInstance *
 	altarArtifactsStorage = market->getArtifactsStorage();
 
 	deal = std::make_shared<CButton>(Point(269, 520), AnimationPath::builtin("ALTSACR.DEF"),
-		CGI->generaltexth->zelp[585], [this]() {CAltarArtifacts::makeDeal(); }, EShortcut::MARKET_DEAL);
-	labels.emplace_back(std::make_shared<CLabel>(450, 32, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[477]));
-	labels.emplace_back(std::make_shared<CLabel>(302, 424, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[478]));
+		VLC->generaltexth->zelp[585], [this]() {CAltarArtifacts::makeDeal(); }, EShortcut::MARKET_DEAL);
+	labels.emplace_back(std::make_shared<CLabel>(450, 32, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[477]));
+	labels.emplace_back(std::make_shared<CLabel>(302, 424, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[478]));
 
 	sacrificeAllButton = std::make_shared<CButton>(Point(393, 520), AnimationPath::builtin("ALTFILL.DEF"),
-		CGI->generaltexth->zelp[571], std::bind(&CExperienceAltar::sacrificeAll, this), EShortcut::MARKET_SACRIFICE_ALL);
+		VLC->generaltexth->zelp[571], std::bind(&CExperienceAltar::sacrificeAll, this), EShortcut::MARKET_SACRIFICE_ALL);
 	sacrificeAllButton->block(hero->artifactsInBackpack.empty() && hero->artifactsWorn.empty());
 
 	sacrificeBackpackButton = std::make_shared<CButton>(Point(147, 520), AnimationPath::builtin("ALTEMBK.DEF"),
-		CGI->generaltexth->zelp[570], std::bind(&CAltarArtifacts::sacrificeBackpack, this), EShortcut::MARKET_SACRIFICE_BACKPACK);
+		VLC->generaltexth->zelp[570], std::bind(&CAltarArtifacts::sacrificeBackpack, this), EShortcut::MARKET_SACRIFICE_BACKPACK);
 	sacrificeBackpackButton->block(hero->artifactsInBackpack.empty());
 
 	// Hero's artifacts
@@ -188,7 +187,7 @@ CMarketBase::MarketShowcasesParams CAltarArtifacts::getShowcasesParams() const
 		return MarketShowcasesParams
 		{
 			std::nullopt,
-			ShowcaseParams {std::to_string(offerQty), CGI->artifacts()->getByIndex(art->getTypeId())->getIconIndex()}
+			ShowcaseParams {std::to_string(offerQty), VLC->artifacts()->getByIndex(art->getTypeId())->getIconIndex()}
 		};
 	return MarketShowcasesParams {std::nullopt, std::nullopt};
 }

+ 9 - 10
client/widgets/markets/CAltarCreatures.cpp

@@ -16,7 +16,6 @@
 #include "../../widgets/Buttons.h"
 #include "../../widgets/TextControls.h"
 
-#include "../../CGameInfo.h"
 #include "../../CPlayerInterface.h"
 
 #include "../../../CCallback.h"
@@ -33,18 +32,18 @@ CAltarCreatures::CAltarCreatures(const IMarket * market, const CGHeroInstance *
 	OBJECT_CONSTRUCTION;
 
 	deal = std::make_shared<CButton>(dealButtonPosWithSlider, AnimationPath::builtin("ALTSACR.DEF"),
-		CGI->generaltexth->zelp[584], [this]() {CAltarCreatures::makeDeal();}, EShortcut::MARKET_DEAL);
+		VLC->generaltexth->zelp[584], [this]() {CAltarCreatures::makeDeal();}, EShortcut::MARKET_DEAL);
 	labels.emplace_back(std::make_shared<CLabel>(155, 30, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW,
-		boost::str(boost::format(CGI->generaltexth->allTexts[272]) % hero->getNameTranslated())));
-	labels.emplace_back(std::make_shared<CLabel>(450, 30, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[479]));
-	texts.emplace_back(std::make_unique<CTextBox>(CGI->generaltexth->allTexts[480], Rect(320, 56, 256, 40), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW));
+		boost::str(boost::format(VLC->generaltexth->allTexts[272]) % hero->getNameTranslated())));
+	labels.emplace_back(std::make_shared<CLabel>(450, 30, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[479]));
+	texts.emplace_back(std::make_unique<CTextBox>(VLC->generaltexth->allTexts[480], Rect(320, 56, 256, 40), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW));
 	offerSlider->moveTo(pos.topLeft() + Point(231, 481));
-	maxAmount->setHelp(CGI->generaltexth->zelp[578]);
+	maxAmount->setHelp(VLC->generaltexth->zelp[578]);
 
 	unitsOnAltar.resize(GameConstants::ARMY_SIZE, 0);
 	expPerUnit.resize(GameConstants::ARMY_SIZE, 0);
 	sacrificeAllButton = std::make_shared<CButton>(
-		Point(393, 520), AnimationPath::builtin("ALTARMY.DEF"), CGI->generaltexth->zelp[579], std::bind(&CExperienceAltar::sacrificeAll, this), EShortcut::MARKET_SACRIFICE_ALL);
+		Point(393, 520), AnimationPath::builtin("ALTARMY.DEF"), VLC->generaltexth->zelp[579], std::bind(&CExperienceAltar::sacrificeAll, this), EShortcut::MARKET_SACRIFICE_ALL);
 
 	// Hero creatures panel
 	assert(bidTradePanel);
@@ -175,9 +174,9 @@ CMarketBase::MarketShowcasesParams CAltarCreatures::getShowcasesParams() const
 	std::optional<ShowcaseParams> bidSelected = std::nullopt;
 	std::optional<ShowcaseParams> offerSelected = std::nullopt;
 	if(bidTradePanel->isHighlighted())
-		bidSelected = ShowcaseParams {std::to_string(offerSlider->getValue()), CGI->creatures()->getByIndex(bidTradePanel->getHighlightedItemId())->getIconIndex()};
+		bidSelected = ShowcaseParams {std::to_string(offerSlider->getValue()), VLC->creatures()->getByIndex(bidTradePanel->getHighlightedItemId())->getIconIndex()};
 	if(offerTradePanel->isHighlighted() && offerSlider->getValue() > 0)
-		offerSelected = ShowcaseParams {offerTradePanel->highlightedSlot->subtitle->getText(), CGI->creatures()->getByIndex(offerTradePanel->getHighlightedItemId())->getIconIndex()};
+		offerSelected = ShowcaseParams {offerTradePanel->highlightedSlot->subtitle->getText(), VLC->creatures()->getByIndex(offerTradePanel->getHighlightedItemId())->getIconIndex()};
 	return MarketShowcasesParams {bidSelected, offerSelected};
 }
 
@@ -214,7 +213,7 @@ void CAltarCreatures::updateAltarSlot(const std::shared_ptr<CTradeableItem> & sl
 	const auto [oppositeSlot, oppositePanel] = getOpposite(slot);
 	slot->setID(units > 0 ? oppositeSlot->id : CreatureID::NONE);
 	slot->subtitle->setText(units > 0 ?
-		boost::str(boost::format(CGI->generaltexth->allTexts[122]) % std::to_string(hero->calculateXp(units * expPerUnit[slot->serial]))) : "");
+		boost::str(boost::format(VLC->generaltexth->allTexts[122]) % std::to_string(hero->calculateXp(units * expPerUnit[slot->serial]))) : "");
 }
 
 void CAltarCreatures::onOfferSliderMoved(int newVal)

+ 5 - 6
client/widgets/markets/CArtifactsBuying.cpp

@@ -15,7 +15,6 @@
 #include "../../widgets/Buttons.h"
 #include "../../widgets/TextControls.h"
 
-#include "../../CGameInfo.h"
 #include "../../CPlayerInterface.h"
 
 #include "../../../CCallback.h"
@@ -32,8 +31,8 @@ CArtifactsBuying::CArtifactsBuying(const IMarket * market, const CGHeroInstance
 
 	labels.emplace_back(std::make_shared<CLabel>(titlePos.x, titlePos.y, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, title));
 	deal = std::make_shared<CButton>(dealButtonPos, AnimationPath::builtin("TPMRKB.DEF"),
-		CGI->generaltexth->zelp[595], [this](){CArtifactsBuying::makeDeal();}, EShortcut::MARKET_DEAL);
-	labels.emplace_back(std::make_shared<CLabel>(445, 148, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[168]));
+		VLC->generaltexth->zelp[595], [this](){CArtifactsBuying::makeDeal();}, EShortcut::MARKET_DEAL);
+	labels.emplace_back(std::make_shared<CLabel>(445, 148, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[168]));
 
 	// Player's resources
 	assert(bidTradePanel);
@@ -75,7 +74,7 @@ void CArtifactsBuying::makeDeal()
 	}
 	else
 	{
-		LOCPLINT->showInfoDialog(CGI->generaltexth->translate("core.genrltxt.326"));
+		LOCPLINT->showInfoDialog(VLC->generaltexth->translate("core.genrltxt.326"));
 	}
 }
 
@@ -85,7 +84,7 @@ CMarketBase::MarketShowcasesParams CArtifactsBuying::getShowcasesParams() const
 		return MarketShowcasesParams
 		{
 			ShowcaseParams {std::to_string(deal->isBlocked() ? 0 : bidQty), bidTradePanel->getHighlightedItemId()},
-			ShowcaseParams {std::to_string(deal->isBlocked() ? 0 : offerQty), CGI->artifacts()->getByIndex(offerTradePanel->getHighlightedItemId())->getIconIndex()}
+			ShowcaseParams {std::to_string(deal->isBlocked() ? 0 : offerQty), VLC->artifacts()->getByIndex(offerTradePanel->getHighlightedItemId())->getIconIndex()}
 		};
 	else
 		return MarketShowcasesParams {std::nullopt, std::nullopt};
@@ -115,6 +114,6 @@ std::string CArtifactsBuying::getTraderText()
 	}
 	else
 	{
-		return madeTransaction ? CGI->generaltexth->allTexts[162] : CGI->generaltexth->allTexts[163];
+		return madeTransaction ? VLC->generaltexth->allTexts[162] : VLC->generaltexth->allTexts[163];
 	}
 }

+ 6 - 7
client/widgets/markets/CArtifactsSelling.cpp

@@ -16,7 +16,6 @@
 #include "../../widgets/Buttons.h"
 #include "../../widgets/TextControls.h"
 
-#include "../../CGameInfo.h"
 #include "../../CPlayerInterface.h"
 
 #include "../../../CCallback.h"
@@ -35,9 +34,9 @@ CArtifactsSelling::CArtifactsSelling(const IMarket * market, const CGHeroInstanc
 	OBJECT_CONSTRUCTION;
 
 	labels.emplace_back(std::make_shared<CLabel>(titlePos.x, titlePos.y, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, title));
-	labels.push_back(std::make_shared<CLabel>(155, 56, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, boost::str(boost::format(CGI->generaltexth->allTexts[271]) % hero->getNameTranslated())));
+	labels.push_back(std::make_shared<CLabel>(155, 56, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, boost::str(boost::format(VLC->generaltexth->allTexts[271]) % hero->getNameTranslated())));
 	deal = std::make_shared<CButton>(dealButtonPos, AnimationPath::builtin("TPMRKB.DEF"),
-		CGI->generaltexth->zelp[595], [this](){CArtifactsSelling::makeDeal();}, EShortcut::MARKET_DEAL);
+		VLC->generaltexth->zelp[595], [this](){CArtifactsSelling::makeDeal();}, EShortcut::MARKET_DEAL);
 	bidSelectedSlot = std::make_shared<CTradeableItem>(Rect(Point(123, 470), Point(69, 66)), EType::ARTIFACT_TYPE, 0, 0);
 
 	// Market resources panel
@@ -59,7 +58,7 @@ CArtifactsSelling::CArtifactsSelling(const IMarket * market, const CGHeroInstanc
 	heroArts->onClickNotTradableCallback = []()
 	{
 		// This item can't be traded
-		LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[21]);
+		LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[21]);
 	};
 	CArtifactsSelling::updateShowcases();
 	CArtifactsSelling::deselect();
@@ -90,7 +89,7 @@ void CArtifactsSelling::updateShowcases()
 	{
 		bidSelectedSlot->image->enable();
 		bidSelectedSlot->setID(art->getTypeId().num);
-		bidSelectedSlot->image->setFrame(CGI->artifacts()->getByIndex(art->getTypeId())->getIconIndex());
+		bidSelectedSlot->image->setFrame(VLC->artifacts()->getByIndex(art->getTypeId())->getIconIndex());
 		bidSelectedSlot->subtitle->setText(std::to_string(bidQty));
 	}
 	else
@@ -161,13 +160,13 @@ std::string CArtifactsSelling::getTraderText()
 	{
 		MetaString message = MetaString::createFromTextID("core.genrltxt.268");
 		message.replaceNumber(offerQty);
-		message.replaceRawString(offerQty == 1 ? CGI->generaltexth->allTexts[161] : CGI->generaltexth->allTexts[160]);
+		message.replaceRawString(offerQty == 1 ? VLC->generaltexth->allTexts[161] : VLC->generaltexth->allTexts[160]);
 		message.replaceName(GameResID(offerTradePanel->getHighlightedItemId()));
 		message.replaceName(art->getTypeId());
 		return message.toString();
 	}
 	else
 	{
-		return madeTransaction ? CGI->generaltexth->allTexts[162] : CGI->generaltexth->allTexts[163];
+		return madeTransaction ? VLC->generaltexth->allTexts[162] : VLC->generaltexth->allTexts[163];
 	}
 }

+ 5 - 6
client/widgets/markets/CFreelancerGuild.cpp

@@ -16,7 +16,6 @@
 #include "../../widgets/Buttons.h"
 #include "../../widgets/TextControls.h"
 
-#include "../../CGameInfo.h"
 #include "../../CPlayerInterface.h"
 
 #include "../../../CCallback.h"
@@ -37,9 +36,9 @@ CFreelancerGuild::CFreelancerGuild(const IMarket * market, const CGHeroInstance
 	labels.emplace_back(std::make_shared<CLabel>(titlePos.x, titlePos.y, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW,
 		VLC->generaltexth->translate("object.core.freelancersGuild.name")));
 	labels.emplace_back(std::make_shared<CLabel>(155, 103, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE,
-		boost::str(boost::format(CGI->generaltexth->allTexts[272]) % hero->getNameTranslated())));
+		boost::str(boost::format(VLC->generaltexth->allTexts[272]) % hero->getNameTranslated())));
 	deal = std::make_shared<CButton>(dealButtonPosWithSlider, AnimationPath::builtin("TPMRKB.DEF"),
-		CGI->generaltexth->zelp[595], [this]() {CFreelancerGuild::makeDeal();}, EShortcut::MARKET_DEAL);
+		VLC->generaltexth->zelp[595], [this]() {CFreelancerGuild::makeDeal();}, EShortcut::MARKET_DEAL);
 	offerSlider->moveTo(pos.topLeft() + Point(232, 489));
 
 	// Hero creatures panel
@@ -80,7 +79,7 @@ CMarketBase::MarketShowcasesParams CFreelancerGuild::getShowcasesParams() const
 	if(bidTradePanel->isHighlighted() && offerTradePanel->isHighlighted())
 		return MarketShowcasesParams
 		{
-			ShowcaseParams {std::to_string(bidQty * offerSlider->getValue()), CGI->creatures()->getByIndex(bidTradePanel->getHighlightedItemId())->getIconIndex()},
+			ShowcaseParams {std::to_string(bidQty * offerSlider->getValue()), VLC->creatures()->getByIndex(bidTradePanel->getHighlightedItemId())->getIconIndex()},
 			ShowcaseParams {std::to_string(offerQty * offerSlider->getValue()), offerTradePanel->getHighlightedItemId()}
 		};
 	else
@@ -108,7 +107,7 @@ std::string CFreelancerGuild::getTraderText()
 	{
 		MetaString message = MetaString::createFromTextID("core.genrltxt.269");
 		message.replaceNumber(offerQty);
-		message.replaceRawString(offerQty == 1 ? CGI->generaltexth->allTexts[161] : CGI->generaltexth->allTexts[160]);
+		message.replaceRawString(offerQty == 1 ? VLC->generaltexth->allTexts[161] : VLC->generaltexth->allTexts[160]);
 		message.replaceName(GameResID(offerTradePanel->getHighlightedItemId()));
 		message.replaceNumber(bidQty);
 		if(bidQty == 1)
@@ -119,6 +118,6 @@ std::string CFreelancerGuild::getTraderText()
 	}
 	else
 	{
-		return madeTransaction ? CGI->generaltexth->allTexts[162] : CGI->generaltexth->allTexts[163];
+		return madeTransaction ? VLC->generaltexth->allTexts[162] : VLC->generaltexth->allTexts[163];
 	}
 }

+ 6 - 7
client/widgets/markets/CMarketBase.cpp

@@ -18,7 +18,6 @@
 #include "../../widgets/Buttons.h"
 #include "../../widgets/TextControls.h"
 
-#include "../../CGameInfo.h"
 #include "../../CPlayerInterface.h"
 
 #include "../../../CCallback.h"
@@ -125,9 +124,9 @@ CExperienceAltar::CExperienceAltar()
 	OBJECT_CONSTRUCTION;
 
 	// Experience needed to reach next level
-	texts.emplace_back(std::make_shared<CTextBox>(CGI->generaltexth->allTexts[475], Rect(15, 415, 125, 50), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW));
+	texts.emplace_back(std::make_shared<CTextBox>(VLC->generaltexth->allTexts[475], Rect(15, 415, 125, 50), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW));
 	// Total experience on the Altar
-	texts.emplace_back(std::make_shared<CTextBox>(CGI->generaltexth->allTexts[476], Rect(15, 495, 125, 40), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW));
+	texts.emplace_back(std::make_shared<CTextBox>(VLC->generaltexth->allTexts[476], Rect(15, 495, 125, 40), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW));
 	expToLevel = std::make_shared<CLabel>(76, 477, FONT_SMALL, ETextAlignment::CENTER);
 	expForHero = std::make_shared<CLabel>(76, 545, FONT_SMALL, ETextAlignment::CENTER);
 }
@@ -139,7 +138,7 @@ void CExperienceAltar::deselect()
 
 void CExperienceAltar::update()
 {
-	expToLevel->setText(std::to_string(CGI->heroh->reqExp(CGI->heroh->level(hero->exp) + 1) - hero->exp));
+	expToLevel->setText(std::to_string(VLC->heroh->reqExp(VLC->heroh->level(hero->exp) + 1) - hero->exp));
 }
 
 CCreaturesSelling::CCreaturesSelling()
@@ -175,7 +174,7 @@ CResourcesBuying::CResourcesBuying(const CTradeableItem::ClickPressedFunctor & c
 
 	offerTradePanel = std::make_shared<ResourcesPanel>(clickPressedCallback, updSlotsCallback);
 	offerTradePanel->moveTo(pos.topLeft() + Point(327, 182));
-	labels.emplace_back(std::make_shared<CLabel>(445, 148, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[168]));
+	labels.emplace_back(std::make_shared<CLabel>(445, 148, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[168]));
 }
 
 CResourcesSelling::CResourcesSelling(const CTradeableItem::ClickPressedFunctor & clickPressedCallback)
@@ -183,7 +182,7 @@ CResourcesSelling::CResourcesSelling(const CTradeableItem::ClickPressedFunctor &
 	OBJECT_CONSTRUCTION;
 
 	bidTradePanel = std::make_shared<ResourcesPanel>(clickPressedCallback, std::bind(&CResourcesSelling::updateSubtitles, this));
-	labels.emplace_back(std::make_shared<CLabel>(156, 148, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[270]));
+	labels.emplace_back(std::make_shared<CLabel>(156, 148, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[270]));
 }
 
 void CResourcesSelling::updateSubtitles() const
@@ -197,7 +196,7 @@ CMarketSlider::CMarketSlider(const CSlider::SliderMovingFunctor & movingCallback
 	OBJECT_CONSTRUCTION;
 
 	offerSlider = std::make_shared<CSlider>(Point(230, 489), 137, movingCallback, 0, 0, 0, Orientation::HORIZONTAL);
-	maxAmount = std::make_shared<CButton>(Point(228, 520), AnimationPath::builtin("IRCBTNS.DEF"), CGI->generaltexth->zelp[596],
+	maxAmount = std::make_shared<CButton>(Point(228, 520), AnimationPath::builtin("IRCBTNS.DEF"), VLC->generaltexth->zelp[596],
 		[this]()
 		{
 			offerSlider->scrollToMax();

+ 7 - 7
client/widgets/markets/CMarketResources.cpp

@@ -16,13 +16,13 @@
 #include "../../widgets/Buttons.h"
 #include "../../widgets/TextControls.h"
 
-#include "../../CGameInfo.h"
 #include "../../CPlayerInterface.h"
 
 #include "../../../CCallback.h"
 
 #include "../../../lib/texts/CGeneralTextHandler.h"
 #include "../../../lib/mapObjects/IMarket.h"
+#include "../../../lib/VCMI_Lib.h"
 
 CMarketResources::CMarketResources(const IMarket * market, const CGHeroInstance * hero)
 	: CMarketBase(market, hero)
@@ -34,9 +34,9 @@ CMarketResources::CMarketResources(const IMarket * market, const CGHeroInstance
 {
 	OBJECT_CONSTRUCTION;
 
-	labels.emplace_back(std::make_shared<CLabel>(titlePos.x, titlePos.y, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[158]));
+	labels.emplace_back(std::make_shared<CLabel>(titlePos.x, titlePos.y, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[158]));
 	deal = std::make_shared<CButton>(dealButtonPosWithSlider, AnimationPath::builtin("TPMRKB.DEF"),
-		CGI->generaltexth->zelp[595], [this]() {CMarketResources::makeDeal(); }, EShortcut::MARKET_DEAL);
+		VLC->generaltexth->zelp[595], [this]() {CMarketResources::makeDeal(); }, EShortcut::MARKET_DEAL);
 
 	// Player's resources
 	assert(bidTradePanel);
@@ -99,7 +99,7 @@ void CMarketResources::updateSubtitles()
 {
 	CMarketBase::updateSubtitlesForBid(EMarketMode::RESOURCE_RESOURCE, bidTradePanel->getHighlightedItemId());
 	if(bidTradePanel->highlightedSlot)
-		offerTradePanel->slots[bidTradePanel->highlightedSlot->serial]->subtitle->setText(CGI->generaltexth->allTexts[164]); // n/a
+		offerTradePanel->slots[bidTradePanel->highlightedSlot->serial]->subtitle->setText(VLC->generaltexth->allTexts[164]); // n/a
 }
 
 std::string CMarketResources::getTraderText()
@@ -109,15 +109,15 @@ std::string CMarketResources::getTraderText()
 	{
 		MetaString message = MetaString::createFromTextID("core.genrltxt.157");
 		message.replaceNumber(offerQty);
-		message.replaceRawString(offerQty == 1 ? CGI->generaltexth->allTexts[161] : CGI->generaltexth->allTexts[160]);
+		message.replaceRawString(offerQty == 1 ? VLC->generaltexth->allTexts[161] : VLC->generaltexth->allTexts[160]);
 		message.replaceName(GameResID(bidTradePanel->getHighlightedItemId()));
 		message.replaceNumber(bidQty);
-		message.replaceRawString(bidQty == 1 ? CGI->generaltexth->allTexts[161] : CGI->generaltexth->allTexts[160]);
+		message.replaceRawString(bidQty == 1 ? VLC->generaltexth->allTexts[161] : VLC->generaltexth->allTexts[160]);
 		message.replaceName(GameResID(offerTradePanel->getHighlightedItemId()));
 		return message.toString();
 	}
 	else
 	{
-		return madeTransaction ? CGI->generaltexth->allTexts[162] : CGI->generaltexth->allTexts[163];
+		return madeTransaction ? VLC->generaltexth->allTexts[162] : VLC->generaltexth->allTexts[163];
 	}
 }

+ 6 - 6
client/widgets/markets/CTransferResources.cpp

@@ -16,7 +16,6 @@
 #include "../../widgets/Buttons.h"
 #include "../../widgets/TextControls.h"
 
-#include "../../CGameInfo.h"
 #include "../../CPlayerInterface.h"
 
 #include "../../../CCallback.h"
@@ -24,6 +23,7 @@
 #include "../../../lib/texts/CGeneralTextHandler.h"
 #include "../../../lib/mapObjects/IMarket.h"
 #include "../../../lib/texts/MetaString.h"
+#include "../../../lib/VCMI_Lib.h"
 
 CTransferResources::CTransferResources(const IMarket * market, const CGHeroInstance * hero)
 	: CMarketBase(market, hero)
@@ -33,10 +33,10 @@ CTransferResources::CTransferResources(const IMarket * market, const CGHeroInsta
 {
 	OBJECT_CONSTRUCTION;
 
-	labels.emplace_back(std::make_shared<CLabel>(titlePos.x, titlePos.y, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[158]));
-	labels.emplace_back(std::make_shared<CLabel>(445, 56, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[169]));
+	labels.emplace_back(std::make_shared<CLabel>(titlePos.x, titlePos.y, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[158]));
+	labels.emplace_back(std::make_shared<CLabel>(445, 56, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[169]));
 	deal = std::make_shared<CButton>(dealButtonPosWithSlider, AnimationPath::builtin("TPMRKB.DEF"),
-		CGI->generaltexth->zelp[595], [this](){CTransferResources::makeDeal();}, EShortcut::MARKET_DEAL);
+		VLC->generaltexth->zelp[595], [this](){CTransferResources::makeDeal();}, EShortcut::MARKET_DEAL);
 
 	// Player's resources
 	assert(bidTradePanel);
@@ -77,7 +77,7 @@ CMarketBase::MarketShowcasesParams CTransferResources::getShowcasesParams() cons
 		return MarketShowcasesParams
 		{
 			ShowcaseParams {std::to_string(offerSlider->getValue()), bidTradePanel->getHighlightedItemId()},
-			ShowcaseParams {CGI->generaltexth->capColors[offerTradePanel->getHighlightedItemId()], offerTradePanel->getHighlightedItemId()}
+			ShowcaseParams {VLC->generaltexth->capColors[offerTradePanel->getHighlightedItemId()], offerTradePanel->getHighlightedItemId()}
 		};
 	else
 		return MarketShowcasesParams {std::nullopt, std::nullopt};
@@ -108,6 +108,6 @@ std::string CTransferResources::getTraderText()
 	}
 	else
 	{
-		return madeTransaction ? CGI->generaltexth->allTexts[166] : CGI->generaltexth->allTexts[167];
+		return madeTransaction ? VLC->generaltexth->allTexts[166] : VLC->generaltexth->allTexts[167];
 	}
 }

+ 9 - 10
client/widgets/markets/TradePanels.cpp

@@ -15,7 +15,6 @@
 #include "../../widgets/TextControls.h"
 #include "../../windows/InfoWindows.h"
 
-#include "../../CGameInfo.h"
 #include "../../CPlayerInterface.h"
 
 #include "../../../CCallback.h"
@@ -139,9 +138,9 @@ int CTradeableItem::getIndex()
 		return id;
 	case EType::ARTIFACT_TYPE:
 	case EType::ARTIFACT:
-		return CGI->artifacts()->getByIndex(id)->getIconIndex();
+		return VLC->artifacts()->getByIndex(id)->getIconIndex();
 	case EType::CREATURE:
-		return CGI->creatures()->getByIndex(id)->getIconIndex();
+		return VLC->creatures()->getByIndex(id)->getIconIndex();
 	default:
 		return -1;
 	}
@@ -164,20 +163,20 @@ void CTradeableItem::hover(bool on)
 	switch(type)
 	{
 	case EType::CREATURE:
-		ENGINE->statusbar()->write(boost::str(boost::format(CGI->generaltexth->allTexts[481]) % CGI->creh->objects[id]->getNamePluralTranslated()));
+		ENGINE->statusbar()->write(boost::str(boost::format(VLC->generaltexth->allTexts[481]) % VLC->creh->objects[id]->getNamePluralTranslated()));
 		break;
 	case EType::ARTIFACT_TYPE:
 	case EType::ARTIFACT:
 		if(id < 0)
-			ENGINE->statusbar()->write(CGI->generaltexth->zelp[582].first);
+			ENGINE->statusbar()->write(VLC->generaltexth->zelp[582].first);
 		else
-			ENGINE->statusbar()->write(CGI->artifacts()->getByIndex(id)->getNameTranslated());
+			ENGINE->statusbar()->write(VLC->artifacts()->getByIndex(id)->getNameTranslated());
 		break;
 	case EType::RESOURCE:
-		ENGINE->statusbar()->write(CGI->generaltexth->restypes[id]);
+		ENGINE->statusbar()->write(VLC->generaltexth->restypes[id]);
 		break;
 	case EType::PLAYER:
-		ENGINE->statusbar()->write(CGI->generaltexth->capColors[id]);
+		ENGINE->statusbar()->write(VLC->generaltexth->capColors[id]);
 		break;
 	}
 }
@@ -191,7 +190,7 @@ void CTradeableItem::showPopupWindow(const Point & cursorPosition)
 	case EType::ARTIFACT_TYPE:
 	case EType::ARTIFACT:
 		if (id >= 0)
-			CRClickPopup::createAndPush(CGI->artifacts()->getByIndex(id)->getDescriptionTranslated());
+			CRClickPopup::createAndPush(VLC->artifacts()->getByIndex(id)->getDescriptionTranslated());
 		break;
 	}
 }
@@ -316,7 +315,7 @@ PlayersPanel::PlayersPanel(const CTradeableItem::ClickPressedFunctor & clickPres
 		slot = std::make_shared<CTradeableItem>(Rect(slotsPos[slotNum], slotDimension), EType::PLAYER, players[slotNum].num, slotNum);
 		slot->clickPressedCallback = clickPressedCallback;
 		slot->setSelectionWidth(selectionWidth);
-		slot->subtitle->setText(CGI->generaltexth->capColors[players[slotNum].num]);
+		slot->subtitle->setText(VLC->generaltexth->capColors[players[slotNum].num]);
 		slotNum++;
 	}
 	showcaseSlot = std::make_shared<CTradeableItem>(Rect(selectedPos, slotDimension), EType::PLAYER, 0, 0);

+ 65 - 66
client/windows/CCastleInterface.cpp

@@ -17,7 +17,6 @@
 #include "QuickRecruitmentWindow.h"
 #include "CCreatureWindow.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../PlayerLocalState.h"
@@ -250,7 +249,7 @@ std::string CBuildingRect::getSubtitle()//hover text for building
 		if(availableCreatures.size())
 		{
 			int creaID = availableCreatures.back();//taking last of available creatures
-			return CGI->generaltexth->allTexts[16] + " " + CGI->creh->objects.at(creaID)->getNamePluralTranslated();
+			return VLC->generaltexth->allTexts[16] + " " + VLC->creh->objects.at(creaID)->getNamePluralTranslated();
 		}
 		else
 		{
@@ -288,8 +287,8 @@ CDwellingInfoBox::CDwellingInfoBox(int centerX, int centerY, const CGTownInstanc
 	animation = std::make_shared<CCreaturePic>(30, 44, creature, true, true);
 
 	std::string text = std::to_string(Town->creatures.at(level).first);
-	available = std::make_shared<CLabel>(80,190, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[217] + text);
-	costPerTroop = std::make_shared<CLabel>(80, 227, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[346]);
+	available = std::make_shared<CLabel>(80,190, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[217] + text);
+	costPerTroop = std::make_shared<CLabel>(80, 227, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[346]);
 
 	for(int i = 0; i<GameConstants::RESOURCE_QUANTITY; i++)
 	{
@@ -392,7 +391,7 @@ void CHeroGSlot::gesture(bool on, const Point & initialPosition, const Point & f
 	auto upgradeAll = [upgradableSlots, obj](){
 		if(!upgradableSlots.canAffordAny)
 		{
-			LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.townWindow.upgradeAll.notUpgradable"));
+			LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.townWindow.upgradeAll.notUpgradable"));
 			return;
 		}
 
@@ -405,7 +404,7 @@ void CHeroGSlot::gesture(bool on, const Point & initialPosition, const Point & f
 			
 		std::string textID = upgradableSlots.canAffordAll ? "core.genrltxt.207" : "vcmi.townWindow.upgradeAll.notAllUpgradable";
 
-		LOCPLINT->showYesNoDialog(CGI->generaltexth->translate(textID), [upgradableSlots, obj](){
+		LOCPLINT->showYesNoDialog(VLC->generaltexth->translate(textID), [upgradableSlots, obj](){
 			for(auto & upgradeInfo : upgradableSlots.upgradeInfos)
 				LOCPLINT->cb->upgradeCreature(obj, upgradeInfo.first, upgradeInfo.second.getUpgrade());
 		}, nullptr, resComps);
@@ -441,7 +440,7 @@ void CHeroGSlot::gesture(bool on, const Point & initialPosition, const Point & f
 		{ RadialMenuConfig::ITEM_SE, twoHeroes, "swapArtifacts", "vcmi.radialWheel.heroSwapArtifacts", [heroId, heroOtherId](){CExchangeController(heroId, heroOtherId).swapArtifacts(true, true);} }
 	};
 	RadialMenuConfig upgradeSlot = { RadialMenuConfig::ITEM_WW, true, "upgradeCreatures", "vcmi.radialWheel.upgradeCreatures", [upgradeAll](){ upgradeAll(); } };
-	RadialMenuConfig dismissSlot = { RadialMenuConfig::ITEM_WW, true, "dismissHero", "vcmi.radialWheel.heroDismiss", [this](){ LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[22], [=](){ LOCPLINT->cb->dismissHero(hero); }, nullptr); } };
+	RadialMenuConfig dismissSlot = { RadialMenuConfig::ITEM_WW, true, "dismissHero", "vcmi.radialWheel.heroDismiss", [this](){ LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[22], [=](){ LOCPLINT->cb->dismissHero(hero); }, nullptr); } };
 
 	if(upgradableSlots.isCreatureUpgradePossible)
 		menuElements.push_back(upgradeSlot);
@@ -464,12 +463,12 @@ void CHeroGSlot::hover(bool on)
 	{
 		if(isSelected())//view NNN
 		{
-			temp = CGI->generaltexth->tcommands[4];
+			temp = VLC->generaltexth->tcommands[4];
 			boost::algorithm::replace_first(temp,"%s",hero->getNameTranslated());
 		}
 		else if(other->hero && other->isSelected())//exchange
 		{
-			temp = CGI->generaltexth->tcommands[7];
+			temp = VLC->generaltexth->tcommands[7];
 			boost::algorithm::replace_first(temp,"%s",hero->getNameTranslated());
 			boost::algorithm::replace_first(temp,"%s",other->hero->getNameTranslated());
 		}
@@ -477,12 +476,12 @@ void CHeroGSlot::hover(bool on)
 		{
 			if(upg)//down - visiting
 			{
-				temp = CGI->generaltexth->tcommands[32];
+				temp = VLC->generaltexth->tcommands[32];
 				boost::algorithm::replace_first(temp,"%s",hero->getNameTranslated());
 			}
 			else //up - garrison
 			{
-				temp = CGI->generaltexth->tcommands[12];
+				temp = VLC->generaltexth->tcommands[12];
 				boost::algorithm::replace_first(temp,"%s",hero->getNameTranslated());
 			}
 		}
@@ -491,12 +490,12 @@ void CHeroGSlot::hover(bool on)
 	{
 		if(other->isSelected() && other->hero) //move NNNN
 		{
-			temp = CGI->generaltexth->tcommands[6];
+			temp = VLC->generaltexth->tcommands[6];
 			boost::algorithm::replace_first(temp,"%s",other->hero->getNameTranslated());
 		}
 		else //empty
 		{
-			temp = CGI->generaltexth->allTexts[507];
+			temp = VLC->generaltexth->allTexts[507];
 		}
 	}
 	if(temp.size())
@@ -614,7 +613,7 @@ void HeroSlots::swapArmies()
 	{
 		if (!town->visitingHero && LOCPLINT->cb->howManyHeroes(false) >= LOCPLINT->cb->getSettings().getInteger(EGameSettings::HEROES_PER_PLAYER_ON_MAP_CAP))
 		{
-			std::string text = CGI->generaltexth->translate("core.genrltxt.18"); //You already have %d adventuring heroes under your command.
+			std::string text = VLC->generaltexth->translate("core.genrltxt.18"); //You already have %d adventuring heroes under your command.
 			boost::algorithm::replace_first(text,"%d",std::to_string(LOCPLINT->cb->howManyHeroes(false)));
 
 			LOCPLINT->showInfoDialog(text, std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
@@ -623,7 +622,7 @@ void HeroSlots::swapArmies()
 		else if (town->garrisonHero->stacksCount() == 0)
 		{
 			//This hero has no creatures.  A hero must have creatures before he can brave the dangers of the countryside.
-			LOCPLINT->showInfoDialog(CGI->generaltexth->translate("core.genrltxt.19"), {}, soundBase::sound_todo);
+			LOCPLINT->showInfoDialog(VLC->generaltexth->translate("core.genrltxt.19"), {}, soundBase::sound_todo);
 			allow = false;
 		}
 	}
@@ -632,7 +631,7 @@ void HeroSlots::swapArmies()
 	{
 		if(!town->visitingHero->canBeMergedWith(*town))
 		{
-			LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[275], std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
+			LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[275], std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
 			allow = false;
 		}
 	}
@@ -870,7 +869,7 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
 				if(getHero())
 					ENGINE->windows().createAndPushWindow<CMarketWindow>(town, getHero(), nullptr, *b->marketModes.begin());
 				else
-					LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % b->getNameTranslated())); //Only visiting heroes may use the %s.
+					LOCPLINT->showInfoDialog(boost::str(boost::format(VLC->generaltexth->allTexts[273]) % b->getNameTranslated())); //Only visiting heroes may use the %s.
 				return true;
 		}
 	}
@@ -910,7 +909,7 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
 				}
 				else if(town->shipyardStatus() == IBoatGenerator::BOAT_ALREADY_BUILT)
 				{
-					LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]);
+					LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[51]);
 					return true;
 				}
 				return false;
@@ -929,7 +928,7 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
 				return true;
 
 		case BuildingID::SHIP:
-			LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]); //Cannot build another boat
+			LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[51]); //Cannot build another boat
 			return true;
 
 		case BuildingID::SPECIAL_1:
@@ -952,7 +951,7 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
 
 				case BuildingSubID::PORTAL_OF_SUMMONING:
 						if (town->creatures[town->getTown()->creatures.size()].second.empty())//No creatures
-							LOCPLINT->showInfoDialog(CGI->generaltexth->tcommands[30]);
+							LOCPLINT->showInfoDialog(VLC->generaltexth->tcommands[30]);
 						else
 							enterDwelling(town->getTown()->creatures.size());
 						return true;
@@ -999,7 +998,7 @@ void CCastleBuildings::enterBlacksmith(BuildingID building, ArtifactID artifactI
 	const CGHeroInstance *hero = town->visitingHero;
 	if(!hero)
 	{
-		LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % town->getTown()->buildings.find(building)->second->getNameTranslated()));
+		LOCPLINT->showInfoDialog(boost::str(boost::format(VLC->generaltexth->allTexts[273]) % town->getTown()->buildings.find(building)->second->getNameTranslated()));
 		return;
 	}
 	auto art = artifactID.toArtifact();
@@ -1036,7 +1035,7 @@ void CCastleBuildings::enterCastleGate(BuildingID building)
 {
 	if (!town->visitingHero)
 	{
-		LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[126]);
+		LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[126]);
 		return;//only visiting hero can use castle gates
 	}
 	std::vector <int> availableTowns;
@@ -1060,8 +1059,8 @@ void CCastleBuildings::enterCastleGate(BuildingID building)
 	}
 
 	auto gateIcon = std::make_shared<CAnimImage>(town->getTown()->clientInfo.buildingsIcons, building);//will be deleted by selection window
-	auto wnd = std::make_shared<CObjectListWindow>(availableTowns, gateIcon, CGI->generaltexth->jktexts[40],
-		CGI->generaltexth->jktexts[41], std::bind (&CCastleInterface::castleTeleport, LOCPLINT->castleInt, _1), 0, images);
+	auto wnd = std::make_shared<CObjectListWindow>(availableTowns, gateIcon, VLC->generaltexth->jktexts[40],
+		VLC->generaltexth->jktexts[41], std::bind (&CCastleInterface::castleTeleport, LOCPLINT->castleInt, _1), 0, images);
 	wnd->onPopup = [availableTowns](int index) { CRClickPopup::createAndPush(LOCPLINT->cb->getObjInstance(ObjectInstanceID(availableTowns[index])), ENGINE->getCursorPosition()); };
 	ENGINE->windows().pushWindow(wnd);
 }
@@ -1093,7 +1092,7 @@ void CCastleBuildings::enterToTheQuickRecruitmentWindow()
 	if(hasSomeoneToRecruit)
 		ENGINE->windows().createAndPushWindow<QuickRecruitmentWindow>(town, pos);
 	else
-		CInfoWindow::showInfoDialog(CGI->generaltexth->translate("vcmi.townHall.noCreaturesToRecruit"), {});
+		CInfoWindow::showInfoDialog(VLC->generaltexth->translate("vcmi.townHall.noCreaturesToRecruit"), {});
 }
 
 void CCastleBuildings::enterFountain(const BuildingID & building, BuildingSubID::EBuildingSubID subID, BuildingID upgrades)
@@ -1103,8 +1102,8 @@ void CCastleBuildings::enterFountain(const BuildingID & building, BuildingSubID:
 	std::string hasNotProduced;
 	std::string hasProduced;
 
-	hasNotProduced = CGI->generaltexth->allTexts[677];
-	hasProduced = CGI->generaltexth->allTexts[678];
+	hasNotProduced = VLC->generaltexth->allTexts[677];
+	hasProduced = VLC->generaltexth->allTexts[678];
 
 	bool isMysticPondOrItsUpgrade = subID == BuildingSubID::MYSTIC_POND
 		|| (upgrades != BuildingID::NONE
@@ -1120,7 +1119,7 @@ void CCastleBuildings::enterFountain(const BuildingID & building, BuildingSubID:
 		else //Mystic Pond produced something;
 		{
 			descr += "\n\n" + hasProduced;
-			boost::algorithm::replace_first(descr,"%s",CGI->generaltexth->restypes[town->bonusValue.first]);
+			boost::algorithm::replace_first(descr,"%s",VLC->generaltexth->restypes[town->bonusValue.first]);
 			boost::algorithm::replace_first(descr,"%d",std::to_string(town->bonusValue.second));
 		}
 	}
@@ -1138,12 +1137,12 @@ void CCastleBuildings::enterMagesGuild()
 		if(hero->isCampaignYog())
 		{
 			// "Yog has given up magic in all its forms..."
-			LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[736]);
+			LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[736]);
 		}
 		else if(LOCPLINT->cb->getResourceAmount(EGameResID::GOLD) < 500) //not enough gold to buy spellbook
 		{
 			openMagesGuild();
-			LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[213]);
+			LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[213]);
 		}
 		else
 		{
@@ -1152,7 +1151,7 @@ void CCastleBuildings::enterMagesGuild()
 			onYes += [hero](){ LOCPLINT->cb->buyArtifact(hero, ArtifactID::SPELLBOOK); };
 			std::vector<std::shared_ptr<CComponent>> components(1, std::make_shared<CComponent>(ComponentType::ARTIFACT, ArtifactID(ArtifactID::SPELLBOOK)));
 
-			LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[214], onYes, onNo, components);
+			LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[214], onYes, onNo, components);
 		}
 	}
 	else
@@ -1168,13 +1167,13 @@ void CCastleBuildings::enterTownHall()
 	{
 		if(!vstd::contains(town->forbiddenBuildings, BuildingID::GRAIL))
 		{
-			LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[597], //Do you wish this to be the permanent home of the Grail?
+			LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[597], //Do you wish this to be the permanent home of the Grail?
 										[&](){ LOCPLINT->cb->buildBuilding(town, BuildingID::GRAIL); },
 										[&](){ openTownHall(); });
 		}
 		else
 		{
-			LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[673]);
+			LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[673]);
 			assert(ENGINE->windows().topWindow<CInfoWindow>() != nullptr);
 			ENGINE->windows().topWindow<CInfoWindow>()->buttons[0]->addCallback(std::bind(&CCastleBuildings::openTownHall, this));
 		}
@@ -1207,7 +1206,7 @@ void CCastleBuildings::enterAnyThievesGuild()
 			return;
 		}
 	}
-	LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"));
+	LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"));
 }
 
 void CCastleBuildings::enterBank(BuildingID building)
@@ -1216,12 +1215,12 @@ void CCastleBuildings::enterBank(BuildingID building)
 	if(town->bonusValue.second > 0)
 	{
 		components.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE_PER_DAY, GameResID(GameResID::GOLD), -500));
-		LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.townStructure.bank.payBack"), components);
+		LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.townStructure.bank.payBack"), components);
 	}
 	else{
 	
 		components.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE, GameResID(GameResID::GOLD), 2500));
-		LOCPLINT->showYesNoDialog(CGI->generaltexth->translate("vcmi.townStructure.bank.borrow"), [this, building](){ LOCPLINT->cb->visitTownBuilding(town, building); }, nullptr, components);
+		LOCPLINT->showYesNoDialog(VLC->generaltexth->translate("vcmi.townStructure.bank.borrow"), [this, building](){ LOCPLINT->cb->visitTownBuilding(town, building); }, nullptr, components);
 	}
 }
 
@@ -1242,7 +1241,7 @@ void CCastleBuildings::enterAnyMarket()
 			return;
 		}
 	}
-	LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
+	LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
 }
 
 CCreaInfo::CCreaInfo(Point position, const CGTownInstance * Town, int Level, bool compact, bool _showAvailable):
@@ -1429,10 +1428,10 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
 	income = std::make_shared<CLabel>(195, 443, FONT_SMALL, ETextAlignment::CENTER);
 	icon = std::make_shared<CAnimImage>(AnimationPath::builtin("ITPT"), 0, 0, 15, 387);
 
-	exit = std::make_shared<CButton>(Point(744, 544), AnimationPath::builtin("TSBTNS"), CButton::tooltip(CGI->generaltexth->tcommands[8]), [&](){close();}, EShortcut::GLOBAL_RETURN);
+	exit = std::make_shared<CButton>(Point(744, 544), AnimationPath::builtin("TSBTNS"), CButton::tooltip(VLC->generaltexth->tcommands[8]), [&](){close();}, EShortcut::GLOBAL_RETURN);
 	exit->setImageOrder(4, 5, 6, 7);
 
-	auto split = std::make_shared<CButton>(Point(744, 382), AnimationPath::builtin("TSBTNS"), CButton::tooltip(CGI->generaltexth->tcommands[3]), [this]() { garr->splitClick(); }, EShortcut::HERO_ARMY_SPLIT);
+	auto split = std::make_shared<CButton>(Point(744, 382), AnimationPath::builtin("TSBTNS"), CButton::tooltip(VLC->generaltexth->tcommands[3]), [this]() { garr->splitClick(); }, EShortcut::HERO_ARMY_SPLIT);
 	garr->addSplitBtn(split);
 
 	Rect barRect(9, 182, 732, 18);
@@ -1678,11 +1677,11 @@ void CHallInterface::CBuildingBox::hover(bool on)
 	{
 		std::string toPrint;
 		if(state==EBuildingState::PREREQUIRES || state == EBuildingState::MISSING_BASE)
-			toPrint = CGI->generaltexth->hcommands[5];
+			toPrint = VLC->generaltexth->hcommands[5];
 		else if(state==EBuildingState::CANT_BUILD_TODAY)
-			toPrint = CGI->generaltexth->allTexts[223];
+			toPrint = VLC->generaltexth->allTexts[223];
 		else
-			toPrint = CGI->generaltexth->hcommands[static_cast<int>(state)];
+			toPrint = VLC->generaltexth->hcommands[static_cast<int>(state)];
 		boost::algorithm::replace_first(toPrint,"%s",building->getNameTranslated());
 		ENGINE->statusbar()->write(toPrint);
 	}
@@ -1716,7 +1715,7 @@ CHallInterface::CHallInterface(const CGTownInstance * Town):
 	statusbar = CGStatusBar::create(statusbarBackground);
 
 	title = std::make_shared<CLabel>(399, 12, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, town->getTown()->buildings.at(BuildingID(town->hallLevel()+BuildingID::VILLAGE_HALL))->getNameTranslated());
-	exit = std::make_shared<CButton>(Point(748, 556), AnimationPath::builtin("TPMAGE1.DEF"), CButton::tooltip(CGI->generaltexth->hcommands[8]), [&](){close();}, EShortcut::GLOBAL_RETURN);
+	exit = std::make_shared<CButton>(Point(748, 556), AnimationPath::builtin("TPMAGE1.DEF"), CButton::tooltip(VLC->generaltexth->hcommands[8]), [&](){close();}, EShortcut::GLOBAL_RETURN);
 
 	auto & boxList = town->getTown()->clientInfo.hallSlots;
 	boxes.resize(boxList.size());
@@ -1831,7 +1830,7 @@ std::string CBuildWindow::getTextForState(EBuildingState state)
 {
 	std::string ret;
 	if(state < EBuildingState::ALLOWED)
-		ret =  CGI->generaltexth->hcommands[static_cast<int>(state)];
+		ret =  VLC->generaltexth->hcommands[static_cast<int>(state)];
 	switch (state)
 	{
 	case EBuildingState::ALREADY_PRESENT:
@@ -1840,7 +1839,7 @@ std::string CBuildWindow::getTextForState(EBuildingState state)
 		ret.replace(ret.find_first_of("%s"), 2, building->getNameTranslated());
 		break;
 	case EBuildingState::ALLOWED:
-		return CGI->generaltexth->allTexts[219]; //all prereq. are met
+		return VLC->generaltexth->allTexts[219]; //all prereq. are met
 	case EBuildingState::PREREQUIRES:
 		{
 			auto toStr = [&](const BuildingID build) -> std::string
@@ -1848,13 +1847,13 @@ std::string CBuildWindow::getTextForState(EBuildingState state)
 				return town->getTown()->buildings.at(build)->getNameTranslated();
 			};
 
-			ret = CGI->generaltexth->allTexts[52];
+			ret = VLC->generaltexth->allTexts[52];
 			ret += "\n" + town->genBuildingRequirements(building->bid).toString(toStr);
 			break;
 		}
 	case EBuildingState::MISSING_BASE:
 		{
-			std::string msg = CGI->generaltexth->translate("vcmi.townHall.missingBase");
+			std::string msg = VLC->generaltexth->translate("vcmi.townHall.missingBase");
 			ret = boost::str(boost::format(msg) % town->getTown()->buildings.at(building->upgrade)->getNameTranslated());
 			break;
 		}
@@ -1921,7 +1920,7 @@ CFortScreen::CFortScreen(const CGTownInstance * town):
 	const CBuilding * fortBuilding = town->getTown()->buildings.at(BuildingID(town->fortLevel()+6));
 	title = std::make_shared<CLabel>(400, 12, FONT_BIG, ETextAlignment::CENTER, Colors::WHITE, fortBuilding->getNameTranslated());
 
-	std::string text = boost::str(boost::format(CGI->generaltexth->fcommands[6]) % fortBuilding->getNameTranslated());
+	std::string text = boost::str(boost::format(VLC->generaltexth->fcommands[6]) % fortBuilding->getNameTranslated());
 	exit = std::make_shared<CButton>(Point(748, 556), AnimationPath::builtin("TPMAGE1"), CButton::tooltip(text), [&](){ close(); }, EShortcut::GLOBAL_RETURN);
 
 	std::vector<Point> positions =
@@ -2018,29 +2017,29 @@ CFortScreen::RecruitArea::RecruitArea(int posX, int posY, const CGTownInstance *
 		if(town->hasBuilt(getMyBuilding()->bid))
 		{
 			ui32 available = town->creatures[level].first;
-			std::string availableText = CGI->generaltexth->allTexts[217]+ std::to_string(available);
+			std::string availableText = VLC->generaltexth->allTexts[217]+ std::to_string(available);
 			availableCount = std::make_shared<CLabel>(78, 119, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, availableText);
 		}
 	}
 
 	if(getMyCreature() != nullptr)
 	{
-		hoverText = boost::str(boost::format(CGI->generaltexth->tcommands[21]) % getMyCreature()->getNamePluralTranslated());
+		hoverText = boost::str(boost::format(VLC->generaltexth->tcommands[21]) % getMyCreature()->getNamePluralTranslated());
 		new CCreaturePic(159, 4, getMyCreature(), false);
 		new CLabel(78,  11, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, getMyCreature()->getNamePluralTranslated(), 152);
 
 		Rect sizes(287, 4, 96, 18);
-		values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[190], CGI->generaltexth->fcommands[0], getMyCreature()->getAttack(false)));
+		values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[190], VLC->generaltexth->fcommands[0], getMyCreature()->getAttack(false)));
 		sizes.y+=20;
-		values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[191], CGI->generaltexth->fcommands[1], getMyCreature()->getDefense(false)));
+		values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[191], VLC->generaltexth->fcommands[1], getMyCreature()->getDefense(false)));
 		sizes.y+=21;
-		values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[199], CGI->generaltexth->fcommands[2], getMyCreature()->getMinDamage(false), getMyCreature()->getMaxDamage(false)));
+		values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[199], VLC->generaltexth->fcommands[2], getMyCreature()->getMinDamage(false), getMyCreature()->getMaxDamage(false)));
 		sizes.y+=20;
-		values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[388], CGI->generaltexth->fcommands[3], getMyCreature()->getMaxHealth()));
+		values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[388], VLC->generaltexth->fcommands[3], getMyCreature()->getMaxHealth()));
 		sizes.y+=21;
-		values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[193], CGI->generaltexth->fcommands[4], getMyCreature()->valOfBonuses(BonusType::STACKS_SPEED)));
+		values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[193], VLC->generaltexth->fcommands[4], getMyCreature()->valOfBonuses(BonusType::STACKS_SPEED)));
 		sizes.y+=20;
-		values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[194], CGI->generaltexth->fcommands[5], town->creatureGrowth(level)));
+		values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[194], VLC->generaltexth->fcommands[5], town->creatureGrowth(level)));
 	}
 }
 
@@ -2086,7 +2085,7 @@ void CFortScreen::RecruitArea::creaturesChangedEventHandler()
 {
 	if(availableCount)
 	{
-		std::string availableText = CGI->generaltexth->allTexts[217] + std::to_string(town->creatures[level].first);
+		std::string availableText = VLC->generaltexth->allTexts[217] + std::to_string(town->creatures[level].first);
 		availableCount->setText(availableText);
 	}
 }
@@ -2117,7 +2116,7 @@ CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner, const ImagePath & i
 	auto statusbarBackground = std::make_shared<CPicture>(background->getSurface(), barRect, 7, 556);
 	statusbar = CGStatusBar::create(statusbarBackground);
 
-	exit = std::make_shared<CButton>(Point(748, 556), AnimationPath::builtin("TPMAGE1.DEF"), CButton::tooltip(CGI->generaltexth->allTexts[593]), [&](){ close(); }, EShortcut::GLOBAL_RETURN);
+	exit = std::make_shared<CButton>(Point(748, 556), AnimationPath::builtin("TPMAGE1.DEF"), CButton::tooltip(VLC->generaltexth->allTexts[593]), [&](){ close(); }, EShortcut::GLOBAL_RETURN);
 
 	updateSpells(townId);
 }
@@ -2180,7 +2179,7 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition)
 				
 		if(town->spellResearchCounterDay >= LOCPLINT->cb->getSettings().getValue(EGameSettings::TOWNS_SPELL_RESEARCH_PER_DAY).Vector()[level].Float())
 		{
-			LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.spellResearch.comeAgain"));
+			LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.spellResearch.comeAgain"));
 			return;
 		}
 
@@ -2193,7 +2192,7 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition)
 		int index = town->spellsAtLevel(level, false);
 		if (index >= town->spells[level].size())
 		{
-			LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.spellResearch.noMoreSpells"));
+			LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.spellResearch.noMoreSpells"));
 			return;
 		}
 		auto newSpell = town->spells[level].at(index);
@@ -2209,20 +2208,20 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition)
 		for(int i = 0; i < 3; i++)
 			pom.emplace_back(AnimationPath::builtin("settingsWindow/button80"), nullptr);
 
-		auto text = CGI->generaltexth->translate(LOCPLINT->cb->getResourceAmount().canAfford(cost) ? "vcmi.spellResearch.pay" : "vcmi.spellResearch.canNotAfford");
+		auto text = VLC->generaltexth->translate(LOCPLINT->cb->getResourceAmount().canAfford(cost) ? "vcmi.spellResearch.pay" : "vcmi.spellResearch.canNotAfford");
 		boost::replace_first(text, "%SPELL1", spell->id.toSpell()->getNameTranslated());
 		boost::replace_first(text, "%SPELL2", newSpell.toSpell()->getNameTranslated());
 		auto temp = std::make_shared<CInfoWindow>(text, LOCPLINT->playerID, resComps, pom);
 
 		temp->buttons[0]->setOverlay(std::make_shared<CPicture>(ImagePath::builtin("spellResearch/accept")));
 		temp->buttons[0]->addCallback([this, town](){ LOCPLINT->cb->spellResearch(town, spell->id, true); });
-		temp->buttons[0]->addPopupCallback([](){ CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.spellResearch.research")); });
+		temp->buttons[0]->addPopupCallback([](){ CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.spellResearch.research")); });
 		temp->buttons[0]->setEnabled(LOCPLINT->cb->getResourceAmount().canAfford(cost));
 		temp->buttons[1]->setOverlay(std::make_shared<CPicture>(ImagePath::builtin("spellResearch/reroll")));
 		temp->buttons[1]->addCallback([this, town](){ LOCPLINT->cb->spellResearch(town, spell->id, false); });
-		temp->buttons[1]->addPopupCallback([](){ CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.spellResearch.skip")); });
+		temp->buttons[1]->addPopupCallback([](){ CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.spellResearch.skip")); });
 		temp->buttons[2]->setOverlay(std::make_shared<CPicture>(ImagePath::builtin("spellResearch/close")));
-		temp->buttons[2]->addPopupCallback([](){ CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.spellResearch.abort")); });
+		temp->buttons[2]->addPopupCallback([](){ CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.spellResearch.abort")); });
 
 		ENGINE->windows().pushWindow(temp);
 	}
@@ -2273,10 +2272,10 @@ CBlacksmithDialog::CBlacksmithDialog(bool possible, CreatureID creMachineID, Art
 	cancelText.appendTextID("core.genrltxt.596");
 	cancelText.replaceTextID(creature->getNameSingularTextID());
 
-	std::string costString = std::to_string(aid.toEntity(CGI)->getPrice());
+	std::string costString = std::to_string(aid.toEntity(VLC)->getPrice());
 
 	title = std::make_shared<CLabel>(165, 28, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, titleString.toString());
-	costText = std::make_shared<CLabel>(165, 218, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->jktexts[43]);
+	costText = std::make_shared<CLabel>(165, 218, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->jktexts[43]);
 	costValue = std::make_shared<CLabel>(165, 292, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, costString);
 	buy = std::make_shared<CButton>(Point(42, 312), AnimationPath::builtin("IBUY30.DEF"), CButton::tooltip(buyText.toString()), [&](){ close(); }, EShortcut::GLOBAL_ACCEPT);
 	cancel = std::make_shared<CButton>(Point(224, 312), AnimationPath::builtin("ICANCEL.DEF"), CButton::tooltip(cancelText.toString()), [&](){ close(); }, EShortcut::GLOBAL_CANCEL);

+ 39 - 40
client/windows/CCreatureWindow.cpp

@@ -13,7 +13,6 @@
 #include <vcmi/spells/Spell.h>
 #include <vcmi/spells/Service.h>
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../render/Canvas.h"
 #include "../widgets/Buttons.h"
@@ -221,7 +220,7 @@ CStackWindow::ActiveSpellsSection::ActiveSpellsSection(CStackWindow * owner, int
 	std::vector<SpellID> spells = battleStack->activeSpells();
 	for(SpellID effect : spells)
 	{
-		const spells::Spell * spell = CGI->spells()->getById(effect);
+		const spells::Spell * spell = VLC->spells()->getById(effect);
 
 		std::string spellText;
 
@@ -231,7 +230,7 @@ CStackWindow::ActiveSpellsSection::ActiveSpellsSection(CStackWindow * owner, int
 
 		if (hasGraphics)
 		{
-			spellText = CGI->generaltexth->allTexts[610]; //"%s, duration: %d rounds."
+			spellText = VLC->generaltexth->allTexts[610]; //"%s, duration: %d rounds."
 			boost::replace_first(spellText, "%s", spell->getNameTranslated());
 			//FIXME: support permanent duration
 			auto spellBonuses = battleStack->getBonuses(Selector::source(BonusSource::SPELL_EFFECT, BonusSourceID(effect)));
@@ -275,18 +274,18 @@ CStackWindow::BonusLineSection::BonusLineSection(CStackWindow * owner, size_t li
 		};
 		
 		std::map<BonusSource, std::string> bonusNames = {
-			{BonusSource::ARTIFACT,          CGI->generaltexth->translate("vcmi.bonusSource.artifact")},
-			{BonusSource::ARTIFACT_INSTANCE, CGI->generaltexth->translate("vcmi.bonusSource.artifact")},
-			{BonusSource::CREATURE_ABILITY,  CGI->generaltexth->translate("vcmi.bonusSource.creature")},
-			{BonusSource::SPELL_EFFECT,      CGI->generaltexth->translate("vcmi.bonusSource.spell")},
-			{BonusSource::SECONDARY_SKILL,   CGI->generaltexth->translate("vcmi.bonusSource.hero")},
-			{BonusSource::HERO_SPECIAL,      CGI->generaltexth->translate("vcmi.bonusSource.hero")},
-			{BonusSource::STACK_EXPERIENCE,  CGI->generaltexth->translate("vcmi.bonusSource.commander")},
-			{BonusSource::COMMANDER,         CGI->generaltexth->translate("vcmi.bonusSource.commander")},
+			{BonusSource::ARTIFACT,          VLC->generaltexth->translate("vcmi.bonusSource.artifact")},
+			{BonusSource::ARTIFACT_INSTANCE, VLC->generaltexth->translate("vcmi.bonusSource.artifact")},
+			{BonusSource::CREATURE_ABILITY,  VLC->generaltexth->translate("vcmi.bonusSource.creature")},
+			{BonusSource::SPELL_EFFECT,      VLC->generaltexth->translate("vcmi.bonusSource.spell")},
+			{BonusSource::SECONDARY_SKILL,   VLC->generaltexth->translate("vcmi.bonusSource.hero")},
+			{BonusSource::HERO_SPECIAL,      VLC->generaltexth->translate("vcmi.bonusSource.hero")},
+			{BonusSource::STACK_EXPERIENCE,  VLC->generaltexth->translate("vcmi.bonusSource.commander")},
+			{BonusSource::COMMANDER,         VLC->generaltexth->translate("vcmi.bonusSource.commander")},
 		};
 
 		auto c = bonusColors.count(bi.bonusSource) ? bonusColors[bi.bonusSource] : ColorRGBA(192, 192, 192);
-		std::string t = bonusNames.count(bi.bonusSource) ? bonusNames[bi.bonusSource] : CGI->generaltexth->translate("vcmi.bonusSource.other");
+		std::string t = bonusNames.count(bi.bonusSource) ? bonusNames[bi.bonusSource] : VLC->generaltexth->translate("vcmi.bonusSource.other");
 		int maxLen = 50;
 		EFonts f = FONT_TINY;
 		Point pText = p + Point(4, 38);
@@ -354,9 +353,9 @@ CStackWindow::ButtonsSection::ButtonsSection(CStackWindow * owner, int yOffset)
 		};
 		auto onClick = [=] ()
 		{
-			LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[12], onDismiss, nullptr);
+			LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[12], onDismiss, nullptr);
 		};
-		dismiss = std::make_shared<CButton>(Point(5, 5),AnimationPath::builtin("IVIEWCR2.DEF"), CGI->generaltexth->zelp[445], onClick, EShortcut::HERO_DISMISS);
+		dismiss = std::make_shared<CButton>(Point(5, 5),AnimationPath::builtin("IVIEWCR2.DEF"), VLC->generaltexth->zelp[445], onClick, EShortcut::HERO_DISMISS);
 	}
 
 	if(parent->info->upgradeInfo && !parent->info->commander)
@@ -386,14 +385,14 @@ CStackWindow::ButtonsSection::ButtonsSection(CStackWindow * owner, int yOffset)
 
 				if(LOCPLINT->cb->getResourceAmount().canAfford(totalCost))
 				{
-					LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[207], onUpgrade, nullptr, resComps);
+					LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[207], onUpgrade, nullptr, resComps);
 				}
 				else
 				{
-					LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[314], resComps);
+					LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[314], resComps);
 				}
 			};
-			auto upgradeBtn = std::make_shared<CButton>(Point(221 + (int)buttonIndex * 40, 5), AnimationPath::builtin("stackWindow/upgradeButton"), CGI->generaltexth->zelp[446], onClick);
+			auto upgradeBtn = std::make_shared<CButton>(Point(221 + (int)buttonIndex * 40, 5), AnimationPath::builtin("stackWindow/upgradeButton"), VLC->generaltexth->zelp[446], onClick);
 
 			upgradeBtn->setOverlay(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), VLC->creh->objects[upgradeInfo.info.getAvailableUpgrades()[buttonIndex]]->getIconIndex()));
 
@@ -426,7 +425,7 @@ CStackWindow::ButtonsSection::ButtonsSection(CStackWindow * owner, int yOffset)
 		parent->switchButtons[parent->activeTab]->disable();
 	}
 
-	exit = std::make_shared<CButton>(Point(382, 5), AnimationPath::builtin("hsbtns.def"), CGI->generaltexth->zelp[447], [=](){ parent->close(); }, EShortcut::GLOBAL_RETURN);
+	exit = std::make_shared<CButton>(Point(382, 5), AnimationPath::builtin("hsbtns.def"), VLC->generaltexth->zelp[447], [=](){ parent->close(); }, EShortcut::GLOBAL_RETURN);
 }
 
 CStackWindow::CommanderMainSection::CommanderMainSection(CStackWindow * owner, int yOffset)
@@ -508,7 +507,7 @@ CStackWindow::CommanderMainSection::CommanderMainSection(CStackWindow * owner, i
 			{
 				if(index == 0 && skillID >= 100)
 				{
-					const auto bonuses = CGI->creh->skillRequirements[skillID-100].first;
+					const auto bonuses = VLC->creh->skillRequirements[skillID-100].first;
 					const CStackInstance * stack = parent->info->commander;
 					auto icon = std::make_shared<CCommanderSkillIcon>(std::make_shared<CPicture>(stack->bonusToGraphics(bonuses[0])), true, [](){});
 					icon->callback = [=]()
@@ -552,15 +551,15 @@ CStackWindow::MainSection::MainSection(CStackWindow * owner, int yOffset, bool s
 
 	statNames =
 	{
-		CGI->generaltexth->primarySkillNames[0], //ATTACK
-		CGI->generaltexth->primarySkillNames[1],//DEFENCE
-		CGI->generaltexth->allTexts[198],//SHOTS
-		CGI->generaltexth->allTexts[199],//DAMAGE
-
-		CGI->generaltexth->allTexts[388],//HEALTH
-		CGI->generaltexth->allTexts[200],//HEALTH_LEFT
-		CGI->generaltexth->zelp[441].first,//SPEED
-		CGI->generaltexth->allTexts[399]//MANA
+		VLC->generaltexth->primarySkillNames[0], //ATTACK
+		VLC->generaltexth->primarySkillNames[1],//DEFENCE
+		VLC->generaltexth->allTexts[198],//SHOTS
+		VLC->generaltexth->allTexts[199],//DAMAGE
+
+		VLC->generaltexth->allTexts[388],//HEALTH
+		VLC->generaltexth->allTexts[200],//HEALTH_LEFT
+		VLC->generaltexth->zelp[441].first,//SPEED
+		VLC->generaltexth->allTexts[399]//MANA
 	};
 
 	statFormats =
@@ -658,10 +657,10 @@ CStackWindow::MainSection::MainSection(CStackWindow * owner, int yOffset, bool s
 
 			auto area = std::make_shared<LRClickableAreaWTextComp>(Rect(pos.x, pos.y, 44, 44), ComponentType::EXPERIENCE);
 			expArea = area;
-			area->text = CGI->generaltexth->allTexts[2];
+			area->text = VLC->generaltexth->allTexts[2];
 			area->component.value = commander->getExpRank();
 			boost::replace_first(area->text, "%d", std::to_string(commander->getExpRank()));
-			boost::replace_first(area->text, "%d", std::to_string(CGI->heroh->reqExp(commander->getExpRank() + 1)));
+			boost::replace_first(area->text, "%d", std::to_string(VLC->heroh->reqExp(commander->getExpRank() + 1)));
 			boost::replace_first(area->text, "%d", std::to_string(commander->experience));
 		}
 		else
@@ -959,31 +958,31 @@ std::string CStackWindow::generateStackExpDescription()
 	if (!vstd::iswithin(tier, 1, 7))
 		tier = 0;
 	int number;
-	std::string expText = CGI->generaltexth->translate("vcmi.stackExperience.description");
+	std::string expText = VLC->generaltexth->translate("vcmi.stackExperience.description");
 	boost::replace_first(expText, "%s", creature->getNamePluralTranslated());
-	boost::replace_first(expText, "%s", CGI->generaltexth->translate("vcmi.stackExperience.rank", rank));
+	boost::replace_first(expText, "%s", VLC->generaltexth->translate("vcmi.stackExperience.rank", rank));
 	boost::replace_first(expText, "%i", std::to_string(rank));
 	boost::replace_first(expText, "%i", std::to_string(stack->experience));
-	number = static_cast<int>(CGI->creh->expRanks[tier][rank] - stack->experience);
+	number = static_cast<int>(VLC->creh->expRanks[tier][rank] - stack->experience);
 	boost::replace_first(expText, "%i", std::to_string(number));
 
-	number = CGI->creh->maxExpPerBattle[tier]; //percent
+	number = VLC->creh->maxExpPerBattle[tier]; //percent
 	boost::replace_first(expText, "%i%", std::to_string(number));
-	number *= CGI->creh->expRanks[tier].back() / 100; //actual amount
+	number *= VLC->creh->expRanks[tier].back() / 100; //actual amount
 	boost::replace_first(expText, "%i", std::to_string(number));
 
 	boost::replace_first(expText, "%i", std::to_string(stack->count)); //Number of Creatures in stack
 
-	int expmin = std::max(CGI->creh->expRanks[tier][std::max(rank-1, 0)], (ui32)1);
+	int expmin = std::max(VLC->creh->expRanks[tier][std::max(rank-1, 0)], (ui32)1);
 	number = static_cast<int>((stack->count * (stack->experience - expmin)) / expmin); //Maximum New Recruits without losing current Rank
 	boost::replace_first(expText, "%i", std::to_string(number)); //TODO
 
 	boost::replace_first(expText, "%.2f", std::to_string(1)); //TODO Experience Multiplier
-	number = CGI->creh->expAfterUpgrade;
+	number = VLC->creh->expAfterUpgrade;
 	boost::replace_first(expText, "%.2f", std::to_string(number) + "%"); //Upgrade Multiplier
 
-	expmin = CGI->creh->expRanks[tier][9];
-	int expmax = CGI->creh->expRanks[tier][10];
+	expmin = VLC->creh->expRanks[tier][9];
+	int expmax = VLC->creh->expRanks[tier][10];
 	number = expmax - expmin;
 	boost::replace_first(expText, "%i", std::to_string(number)); //Experience after Rank 10
 	number = (stack->count * (expmax - expmin)) / expmin;
@@ -1005,7 +1004,7 @@ std::string CStackWindow::getCommanderSkillDescription(int skillIndex, int skill
 
 	std::string textID = TextIdentifier("vcmi", "commander", "skill", skillNames.at(skillIndex), skillLevel).get();
 
-	return CGI->generaltexth->translate(textID);
+	return VLC->generaltexth->translate(textID);
 }
 
 void CStackWindow::setSelection(si32 newSkill, std::shared_ptr<CCommanderSkillIcon> newIcon)

+ 23 - 24
client/windows/CExchangeWindow.cpp

@@ -12,7 +12,6 @@
 
 #include "CHeroBackpackWindow.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 
 #include "../GameEngine.h"
@@ -57,7 +56,7 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
 
 	auto genTitle = [](const CGHeroInstance * h)
 	{
-		boost::format fmt(CGI->generaltexth->allTexts[138]);
+		boost::format fmt(VLC->generaltexth->allTexts[138]);
 		fmt % h->getNameTranslated() % h->level % h->getClassNameTranslated();
 		return boost::str(fmt);
 	};
@@ -116,10 +115,10 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
 			primSkillAreas[g]->pos = Rect(Point(pos.x + 324, pos.y + 12 + 26 * g), Point(152, 22));
 		else
 			primSkillAreas[g]->pos = Rect(Point(pos.x + 329, pos.y + 19 + 36 * g), Point(140, 32));
-		primSkillAreas[g]->text = CGI->generaltexth->arraytxt[2+g];
+		primSkillAreas[g]->text = VLC->generaltexth->arraytxt[2+g];
 		primSkillAreas[g]->component = Component( ComponentType::PRIM_SKILL, PrimarySkill(g));
-		primSkillAreas[g]->hoverText = CGI->generaltexth->heroscrn[1];
-		boost::replace_first(primSkillAreas[g]->hoverText, "%s", CGI->generaltexth->primarySkillNames[g]);
+		primSkillAreas[g]->hoverText = VLC->generaltexth->heroscrn[1];
+		boost::replace_first(primSkillAreas[g]->hoverText, "%s", VLC->generaltexth->primarySkillNames[g]);
 	}
 
 	//heroes related thing
@@ -136,21 +135,21 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
 
 		specialtyAreas[b] = std::make_shared<LRClickableAreaWText>();
 		specialtyAreas[b]->pos = Rect(Point(pos.x + 69 + 490 * b, pos.y + (qeLayout ? 41 : 45)), Point(32, 32));
-		specialtyAreas[b]->hoverText = CGI->generaltexth->heroscrn[27];
+		specialtyAreas[b]->hoverText = VLC->generaltexth->heroscrn[27];
 		specialtyAreas[b]->text = hero->getHeroType()->getSpecialtyDescriptionTranslated();
 
 		experienceAreas[b] = std::make_shared<LRClickableAreaWText>();
 		experienceAreas[b]->pos = Rect(Point(pos.x + 105 + 490 * b, pos.y + (qeLayout ? 41 : 45)), Point(32, 32));
-		experienceAreas[b]->hoverText = CGI->generaltexth->heroscrn[9];
-		experienceAreas[b]->text = CGI->generaltexth->allTexts[2];
+		experienceAreas[b]->hoverText = VLC->generaltexth->heroscrn[9];
+		experienceAreas[b]->text = VLC->generaltexth->allTexts[2];
 		boost::algorithm::replace_first(experienceAreas[b]->text, "%d", std::to_string(hero->level));
-		boost::algorithm::replace_first(experienceAreas[b]->text, "%d", std::to_string(CGI->heroh->reqExp(hero->level+1)));
+		boost::algorithm::replace_first(experienceAreas[b]->text, "%d", std::to_string(VLC->heroh->reqExp(hero->level+1)));
 		boost::algorithm::replace_first(experienceAreas[b]->text, "%d", std::to_string(hero->exp));
 
 		spellPointsAreas[b] = std::make_shared<LRClickableAreaWText>();
 		spellPointsAreas[b]->pos = Rect(Point(pos.x + 141 + 490 * b, pos.y + (qeLayout ? 41 : 45)), Point(32, 32));
-		spellPointsAreas[b]->hoverText = CGI->generaltexth->heroscrn[22];
-		spellPointsAreas[b]->text = CGI->generaltexth->allTexts[205];
+		spellPointsAreas[b]->hoverText = VLC->generaltexth->heroscrn[22];
+		spellPointsAreas[b]->text = VLC->generaltexth->allTexts[205];
 		boost::algorithm::replace_first(spellPointsAreas[b]->text, "%s", hero->getNameTranslated());
 		boost::algorithm::replace_first(spellPointsAreas[b]->text, "%d", std::to_string(hero->mana));
 		boost::algorithm::replace_first(spellPointsAreas[b]->text, "%d", std::to_string(hero->manaLimit()));
@@ -159,12 +158,12 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
 		luck[b] = std::make_shared<MoraleLuckBox>(false,  Rect(Point(212 + 490 * b, 39), Point(32, 32)), true);
 	}
 
-	quit = std::make_shared<CButton>(Point(732, 567), AnimationPath::builtin("IOKAY.DEF"), CGI->generaltexth->zelp[600], std::bind(&CExchangeWindow::close, this), EShortcut::GLOBAL_ACCEPT);
+	quit = std::make_shared<CButton>(Point(732, 567), AnimationPath::builtin("IOKAY.DEF"), VLC->generaltexth->zelp[600], std::bind(&CExchangeWindow::close, this), EShortcut::GLOBAL_ACCEPT);
 	if(queryID.getNum() > 0)
 		quit->addCallback([=](){ LOCPLINT->cb->selectionMade(0, queryID); });
 
-	questlogButton[0] = std::make_shared<CButton>(Point( 10, qeLayout ? 39 : 44), AnimationPath::builtin("hsbtns4.def"), CButton::tooltip(CGI->generaltexth->heroscrn[0]), std::bind(&CExchangeWindow::questLogShortcut, this));
-	questlogButton[1] = std::make_shared<CButton>(Point(740, qeLayout ? 39 : 44), AnimationPath::builtin("hsbtns4.def"), CButton::tooltip(CGI->generaltexth->heroscrn[0]), std::bind(&CExchangeWindow::questLogShortcut, this));
+	questlogButton[0] = std::make_shared<CButton>(Point( 10, qeLayout ? 39 : 44), AnimationPath::builtin("hsbtns4.def"), CButton::tooltip(VLC->generaltexth->heroscrn[0]), std::bind(&CExchangeWindow::questLogShortcut, this));
+	questlogButton[1] = std::make_shared<CButton>(Point(740, qeLayout ? 39 : 44), AnimationPath::builtin("hsbtns4.def"), CButton::tooltip(VLC->generaltexth->heroscrn[0]), std::bind(&CExchangeWindow::questLogShortcut, this));
 
 	Rect barRect(5, 578, 725, 18);
 	statusbar = CGStatusBar::create(std::make_shared<CPicture>(background->getSurface(), barRect, 5, 578));
@@ -173,43 +172,43 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
 
 	garr = std::make_shared<CGarrisonInt>(Point(69, qeLayout ? 122 : 131), 4, Point(418,0), heroInst[0], heroInst[1], true, true);
 	auto splitButtonCallback = [&](){ garr->splitClick(); };
-	garr->addSplitBtn(std::make_shared<CButton>( Point( 10, qeLayout ? 122 : 132), AnimationPath::builtin("TSBTNS.DEF"), CButton::tooltip(CGI->generaltexth->tcommands[3]), splitButtonCallback, EShortcut::HERO_ARMY_SPLIT));
-	garr->addSplitBtn(std::make_shared<CButton>( Point(744, qeLayout ? 122 : 132), AnimationPath::builtin("TSBTNS.DEF"), CButton::tooltip(CGI->generaltexth->tcommands[3]), splitButtonCallback, EShortcut::HERO_ARMY_SPLIT));
+	garr->addSplitBtn(std::make_shared<CButton>( Point( 10, qeLayout ? 122 : 132), AnimationPath::builtin("TSBTNS.DEF"), CButton::tooltip(VLC->generaltexth->tcommands[3]), splitButtonCallback, EShortcut::HERO_ARMY_SPLIT));
+	garr->addSplitBtn(std::make_shared<CButton>( Point(744, qeLayout ? 122 : 132), AnimationPath::builtin("TSBTNS.DEF"), CButton::tooltip(VLC->generaltexth->tcommands[3]), splitButtonCallback, EShortcut::HERO_ARMY_SPLIT));
 
 	if(qeLayout)
 	{
 		buttonMoveUnitsFromLeftToRight = std::make_shared<CButton>(
 			Point(325, 118),
 			AnimationPath::builtin("quick-exchange/armRight.DEF"),
-			CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.moveAllUnits")),
+			CButton::tooltip(VLC->generaltexth->translate("vcmi.quickExchange.moveAllUnits")),
 			[this](){ this->moveUnitsShortcut(true); });
 
 		buttonMoveUnitsFromRightToLeft = std::make_shared<CButton>(
 			Point(425, 118),
 			AnimationPath::builtin("quick-exchange/armLeft.DEF"),
-			CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.moveAllUnits")),
+			CButton::tooltip(VLC->generaltexth->translate("vcmi.quickExchange.moveAllUnits")),
 			[this](){ this->moveUnitsShortcut(false); });
 
 		buttonMoveArtifactsFromLeftToRight = std::make_shared<CButton>(
 			Point(325, 154), AnimationPath::builtin("quick-exchange/artRight.DEF"),
-			CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.moveAllArtifacts")),
+			CButton::tooltip(VLC->generaltexth->translate("vcmi.quickExchange.moveAllArtifacts")),
 			[this](){ this->moveArtifactsCallback(true);});
 
 		buttonMoveArtifactsFromRightToLeft = std::make_shared<CButton>(
 			Point(425, 154), AnimationPath::builtin("quick-exchange/artLeft.DEF"),
-			CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.moveAllArtifacts")),
+			CButton::tooltip(VLC->generaltexth->translate("vcmi.quickExchange.moveAllArtifacts")),
 			[this](){ this->moveArtifactsCallback(false);});
 
 		exchangeUnitsButton = std::make_shared<CButton>(
 			Point(377, 118),
 			AnimationPath::builtin("quick-exchange/swapAll.DEF"),
-			CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.swapAllUnits")),
+			CButton::tooltip(VLC->generaltexth->translate("vcmi.quickExchange.swapAllUnits")),
 			[this](){ controller.swapArmy(); });
 
 		exchangeArtifactsButton  = std::make_shared<CButton>(
 			Point(377, 154),
 			AnimationPath::builtin("quick-exchange/swapAll.DEF"),
-			CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.swapAllArtifacts")),
+			CButton::tooltip(VLC->generaltexth->translate("vcmi.quickExchange.swapAllArtifacts")),
 			[this](){ this->swapArtifactsCallback(); });
 
 		backpackButtonLeft = std::make_shared<CButton>(
@@ -247,7 +246,7 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
 				std::make_shared<CButton>(
 					Point(484 + 35 * i, 154),
 					AnimationPath::builtin("quick-exchange/unitLeft.DEF"),
-					CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.moveUnit")),
+					CButton::tooltip(VLC->generaltexth->translate("vcmi.quickExchange.moveUnit")),
 					[this, i]() { creatureArrowButtonCallback(false, SlotID(i)); }));
 			moveUnitFromRightToLeftButtons.back()->block(leftHeroBlock);
 
@@ -255,7 +254,7 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
 				std::make_shared<CButton>(
 					Point(66 + 35 * i, 154),
 					AnimationPath::builtin("quick-exchange/unitRight.DEF"),
-					CButton::tooltip(CGI->generaltexth->translate("vcmi.quickExchange.moveUnit")),
+					CButton::tooltip(VLC->generaltexth->translate("vcmi.quickExchange.moveUnit")),
 					[this, i]() { creatureArrowButtonCallback(true, SlotID(i)); }));
 			moveUnitFromLeftToRightButtons.back()->block(rightHeroBlock);
 		}

+ 32 - 31
client/windows/CHeroOverview.cpp

@@ -11,7 +11,6 @@
 #include "CHeroOverview.h"
 
 #include "../CCallback.h"
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../GameEngine.h"
 #include "../render/Canvas.h"
@@ -32,6 +31,8 @@
 #include "../../lib/CCreatureHandler.h"
 #include "../../lib/CSkillHandler.h"
 #include "../../lib/spells/CSpellHandler.h"
+#include "../../lib/VCMI_Lib.h"
+
 
 CHeroOverview::CHeroOverview(const HeroTypeID & h)
 	: CWindowObject(BORDERED | RCLICK_POPUP), hero { h }
@@ -58,18 +59,18 @@ void CHeroOverview::genControls()
 {
     Rect r = Rect();
 
-	labelTitle = std::make_shared<CLabel>(pos.w / 2 + 8, 21, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[77]);
+	labelTitle = std::make_shared<CLabel>(pos.w / 2 + 8, 21, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[77]);
 
     // hero image
     r = Rect(borderOffset, borderOffset + yOffset, 58, 64);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
-	imageHero = std::make_shared<CAnimImage>(AnimationPath::builtin("PortraitsLarge"), (*CGI->heroh)[heroIdx]->imageIndex, 0, r.x, r.y);
+	imageHero = std::make_shared<CAnimImage>(AnimationPath::builtin("PortraitsLarge"), (*VLC->heroh)[heroIdx]->imageIndex, 0, r.x, r.y);
 
     // hero name
     r = Rect(64 + borderOffset, borderOffset + yOffset, 220, 64);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
-	labelHeroName = std::make_shared<CLabel>(r.x + 110, r.y + 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, (*CGI->heroh)[heroIdx]->getNameTranslated());
-	labelHeroClass = std::make_shared<CLabel>(r.x + 110, r.y + 45, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, (*CGI->heroh)[heroIdx]->heroClass->getNameTranslated());
+	labelHeroName = std::make_shared<CLabel>(r.x + 110, r.y + 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, (*VLC->heroh)[heroIdx]->getNameTranslated());
+	labelHeroClass = std::make_shared<CLabel>(r.x + 110, r.y + 45, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, (*VLC->heroh)[heroIdx]->heroClass->getNameTranslated());
 
     // vertical line
     backgroundLines.push_back(std::make_shared<SimpleLine>(Point(295, borderOffset + yOffset - 1), Point(295, borderOffset + yOffset - 2 + 439), borderColor));
@@ -78,7 +79,7 @@ void CHeroOverview::genControls()
     r = Rect(borderOffset, 2 * borderOffset + yOffset + 64, 284, 20);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
     for(int i = 0; i < 4; i++)
-        labelSkillHeader.push_back(std::make_shared<CLabel>((r.w / 4) * i + 42, r.y + 10, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->jktexts[1 + i]));
+        labelSkillHeader.push_back(std::make_shared<CLabel>((r.w / 4) * i + 42, r.y + 10, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->jktexts[1 + i]));
 
     // skill
     const int tmp[] = {0, 1, 2, 5};
@@ -95,44 +96,44 @@ void CHeroOverview::genControls()
     for(int i = 0; i < 4; i++)
     {
         r = Rect((284 / 4) * i + 42, r.y, r.w, r.h);
-        labelSkillFooter.push_back(std::make_shared<CLabel>(r.x, r.y + 10, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, std::to_string((*CGI->heroh)[heroIdx]->heroClass->primarySkillInitial[i])));
+        labelSkillFooter.push_back(std::make_shared<CLabel>(r.x, r.y + 10, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, std::to_string((*VLC->heroh)[heroIdx]->heroClass->primarySkillInitial[i])));
     } 
 
     // hero biography
     r = Rect(borderOffset, 5 * borderOffset + yOffset + 148, 284, 130);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
-    labelHeroBiography = std::make_shared<CTextBox>((*CGI->heroh)[heroIdx]->getBiographyTranslated(), r.resize(-borderOffset), CSlider::EStyle::BROWN, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE);
+    labelHeroBiography = std::make_shared<CTextBox>((*VLC->heroh)[heroIdx]->getBiographyTranslated(), r.resize(-borderOffset), CSlider::EStyle::BROWN, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE);
     if(labelHeroBiography->slider && ENGINE->input().getCurrentInputMode() != InputMode::TOUCH)
         labelHeroBiography->slider->clearScrollBounds();
 
     // speciality name
     r = Rect(2 * borderOffset + 44, 6 * borderOffset + yOffset + 278, 235, 44);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
-	labelHeroSpeciality = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->allTexts[78]);
-	labelSpecialityName = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset + 20, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*CGI->heroh)[heroIdx]->getSpecialtyNameTranslated());
+	labelHeroSpeciality = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[78]);
+	labelSpecialityName = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset + 20, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*VLC->heroh)[heroIdx]->getSpecialtyNameTranslated());
 
     // speciality image
     r = Rect(borderOffset, 6 * borderOffset + yOffset + 278, 44, 44);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
-    imageSpeciality = std::make_shared<CAnimImage>(AnimationPath::builtin("UN44"), (*CGI->heroh)[heroIdx]->imageIndex, 0, r.x, r.y);
+    imageSpeciality = std::make_shared<CAnimImage>(AnimationPath::builtin("UN44"), (*VLC->heroh)[heroIdx]->imageIndex, 0, r.x, r.y);
 
     // speciality description
     r = Rect(borderOffset, 7 * borderOffset + yOffset + 322, 284, 85);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
-	labelSpecialityDescription = std::make_shared<CTextBox>((*CGI->heroh)[heroIdx]->getSpecialtyDescriptionTranslated(), r.resize(-borderOffset), CSlider::EStyle::BROWN, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE);
+	labelSpecialityDescription = std::make_shared<CTextBox>((*VLC->heroh)[heroIdx]->getSpecialtyDescriptionTranslated(), r.resize(-borderOffset), CSlider::EStyle::BROWN, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE);
     if(labelSpecialityDescription->slider && ENGINE->input().getCurrentInputMode() != InputMode::TOUCH)
         labelSpecialityDescription->slider->clearScrollBounds();
 
     // army title
     r = Rect(302, borderOffset + yOffset, 292, 30);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
-    labelArmyTitle = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset + 2, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->translate("vcmi.heroOverview.startingArmy"));
+    labelArmyTitle = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset + 2, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->translate("vcmi.heroOverview.startingArmy"));
 
     // army numbers
     r = Rect(302, 3 * borderOffset + yOffset + 62, 292, 32);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
 
-    auto stacksCountChances = CGI->engineSettings()->getVector(EGameSettings::HEROES_STARTING_STACKS_CHANCES);
+    auto stacksCountChances = VLC->engineSettings()->getVector(EGameSettings::HEROES_STARTING_STACKS_CHANCES);
 
     // army
     int space = (260 - 7 * 32) / 6;
@@ -143,11 +144,11 @@ void CHeroOverview::genControls()
     }
     int i = 0;
     int iStack = 0;
-    for(auto & army : (*CGI->heroh)[heroIdx]->initialArmy)
+    for(auto & army : (*VLC->heroh)[heroIdx]->initialArmy)
     {
-        if((*CGI->creh)[army.creature]->warMachine == ArtifactID::NONE)
+        if((*VLC->creh)[army.creature]->warMachine == ArtifactID::NONE)
         {
-            imageArmy.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), (*CGI->creh)[army.creature]->getIconIndex(), 0, 302 + i * (32 + space) + 16, 2 * borderOffset + yOffset + 30));
+            imageArmy.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), (*VLC->creh)[army.creature]->getIconIndex(), 0, 302 + i * (32 + space) + 16, 2 * borderOffset + yOffset + 30));
             labelArmyCount.push_back(std::make_shared<CLabel>(302 + i * (32 + space) + 32, 3 * borderOffset + yOffset + 72, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, (army.minAmount == army.maxAmount) ? std::to_string(army.minAmount) : std::to_string(army.minAmount) + "-" + std::to_string(army.maxAmount)));
             if(iStack<stacksCountChances.size())
                 labelArmyCount.push_back(std::make_shared<CLabel>(302 + i * (32 + space) + 32, 3 * borderOffset + yOffset + 86, FONT_SMALL, ETextAlignment::CENTER, grayedColor, std::to_string(stacksCountChances[iStack]) + "%"));
@@ -159,7 +160,7 @@ void CHeroOverview::genControls()
     // war machine title
     r = Rect(302, 4 * borderOffset + yOffset + 94, 292, 30);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
-    labelWarMachineTitle = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset + 2, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->translate("vcmi.heroOverview.warMachine"));
+    labelWarMachineTitle = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset + 2, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->translate("vcmi.heroOverview.warMachine"));
 
     // war machine
     space = (260 - 4 * 32) / 3;
@@ -170,17 +171,17 @@ void CHeroOverview::genControls()
     }
     i = 0;
     iStack = 0;
-    for(auto & army : (*CGI->heroh)[heroIdx]->initialArmy)
+    for(auto & army : (*VLC->heroh)[heroIdx]->initialArmy)
     {
         if(i == 0)
         {
-            imageWarMachine.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), (*CGI->creh)[army.creature.CATAPULT]->getIconIndex(), 0, 302 + i * (32 + space) + 16, 5 * borderOffset + yOffset + 124));
+            imageWarMachine.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), (*VLC->creh)[army.creature.CATAPULT]->getIconIndex(), 0, 302 + i * (32 + space) + 16, 5 * borderOffset + yOffset + 124));
             labelArmyCount.push_back(std::make_shared<CLabel>(302 + i * (32 + space) + 51, 5 * borderOffset + yOffset + 144, FONT_SMALL, ETextAlignment::TOPLEFT, grayedColor, "100%"));
             i++;
         }
-        if((*CGI->creh)[army.creature]->warMachine != ArtifactID::NONE)
+        if((*VLC->creh)[army.creature]->warMachine != ArtifactID::NONE)
         {
-            imageWarMachine.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), (*CGI->creh)[army.creature]->getIconIndex(), 0, 302 + i * (32 + space) + 16, 5 * borderOffset + yOffset + 124));
+            imageWarMachine.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), (*VLC->creh)[army.creature]->getIconIndex(), 0, 302 + i * (32 + space) + 16, 5 * borderOffset + yOffset + 124));
             if(iStack<stacksCountChances.size())
                 labelArmyCount.push_back(std::make_shared<CLabel>(302 + i * (32 + space) + 51, 5 * borderOffset + yOffset + 144, FONT_SMALL, ETextAlignment::TOPLEFT, grayedColor, std::to_string(stacksCountChances[iStack]) + "%"));
             i++;
@@ -191,7 +192,7 @@ void CHeroOverview::genControls()
     // secskill title
     r = Rect(302, 6 * borderOffset + yOffset + 156, (292 / 2) - 2 * borderOffset, 30);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
-    labelSecSkillTitle = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset + 2, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->translate("vcmi.heroOverview.secondarySkills"));
+    labelSecSkillTitle = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset + 2, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->translate("vcmi.heroOverview.secondarySkills"));
 
     // vertical line
     backgroundLines.push_back(std::make_shared<SimpleLine>(Point(302 + (292 / 2), 6 * borderOffset + yOffset + 156 - 1), Point(302 + (292 / 2), 6 * borderOffset + yOffset + 156 - 2 + 254), borderColor));
@@ -199,7 +200,7 @@ void CHeroOverview::genControls()
     // spell title
     r = Rect(302 + (292 / 2) + 2 * borderOffset, 6 * borderOffset + yOffset + 156, (292 / 2) - 2 * borderOffset, 30);
     backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
-    labelSpellTitle = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset + 2, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->translate("vcmi.heroOverview.spells"));
+    labelSpellTitle = std::make_shared<CLabel>(r.x + borderOffset, r.y + borderOffset + 2, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->translate("vcmi.heroOverview.spells"));
 
     // secskill
     for(int i = 0; i < 6; i++)
@@ -210,12 +211,12 @@ void CHeroOverview::genControls()
         backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
     }
     i = 0;
-    for(auto & skill : (*CGI->heroh)[heroIdx]->secSkillsInit)
+    for(auto & skill : (*VLC->heroh)[heroIdx]->secSkillsInit)
     {
         secSkills.push_back(std::make_shared<CSecSkillPlace>(Point(302, 7 * borderOffset + yOffset + 186 + i * (32 + borderOffset)),
             CSecSkillPlace::ImageSize::SMALL, skill.first, skill.second));
-        labelSecSkillsNames.push_back(std::make_shared<CLabel>(334 + 2 * borderOffset, 8 * borderOffset + yOffset + 186 + i * (32 + borderOffset) - 5, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->levels[skill.second - 1]));
-        labelSecSkillsNames.push_back(std::make_shared<CLabel>(334 + 2 * borderOffset, 8 * borderOffset + yOffset + 186 + i * (32 + borderOffset) + 10, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*CGI->skillh)[skill.first]->getNameTranslated()));
+        labelSecSkillsNames.push_back(std::make_shared<CLabel>(334 + 2 * borderOffset, 8 * borderOffset + yOffset + 186 + i * (32 + borderOffset) - 5, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->levels[skill.second - 1]));
+        labelSecSkillsNames.push_back(std::make_shared<CLabel>(334 + 2 * borderOffset, 8 * borderOffset + yOffset + 186 + i * (32 + borderOffset) + 10, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*VLC->skillh)[skill.first]->getNameTranslated()));
         i++;
     }
 
@@ -228,19 +229,19 @@ void CHeroOverview::genControls()
         backgroundRectangles.push_back(std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor));
     }
     i = 0;
-    for(auto & spell : (*CGI->heroh)[heroIdx]->spells)
+    for(auto & spell : (*VLC->heroh)[heroIdx]->spells)
     {
         if(i == 0)
         {
-            if((*CGI->heroh)[heroIdx]->haveSpellBook)
+            if((*VLC->heroh)[heroIdx]->haveSpellBook)
             {
                 imageSpells.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("ARTIFACT"), 0, Rect(302 + (292 / 2) + 2 * borderOffset, 7 * borderOffset + yOffset + 186 + i * (32 + borderOffset), 32, 32), 0));
             }
             i++;
         }
 
-        imageSpells.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("SPELLBON"), (*CGI->spellh)[spell]->getIconIndex(), Rect(302 + (292 / 2) + 2 * borderOffset, 7 * borderOffset + yOffset + 186 + i * (32 + borderOffset), 32, 32), 0));
-        labelSpellsNames.push_back(std::make_shared<CLabel>(302 + (292 / 2) + 3 * borderOffset + 32 + borderOffset, 8 * borderOffset + yOffset + 186 + i * (32 + borderOffset) + 3, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*CGI->spellh)[spell]->getNameTranslated()));
+        imageSpells.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("SPELLBON"), (*VLC->spellh)[spell]->getIconIndex(), Rect(302 + (292 / 2) + 2 * borderOffset, 7 * borderOffset + yOffset + 186 + i * (32 + borderOffset), 32, 32), 0));
+        labelSpellsNames.push_back(std::make_shared<CLabel>(302 + (292 / 2) + 3 * borderOffset + 32 + borderOffset, 8 * borderOffset + yOffset + 186 + i * (32 + borderOffset) + 3, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, (*VLC->spellh)[spell]->getNameTranslated()));
         i++;
     }
 }

+ 28 - 29
client/windows/CHeroWindow.cpp

@@ -15,7 +15,6 @@
 #include "CKingdomInterface.h"
 #include "CExchangeWindow.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 
 #include "../GameEngine.h"
@@ -72,7 +71,7 @@ CHeroSwitcher::CHeroSwitcher(CHeroWindow * owner_, Point pos_, const CGHeroInsta
 CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
 	: CWindowObject(PLAYER_COLORED, ImagePath::builtin("HeroScr4"))
 {
-	auto & heroscrn = CGI->generaltexth->heroscrn;
+	auto & heroscrn = VLC->generaltexth->heroscrn;
 
 	OBJECT_CONSTRUCTION;
 	curHero = hero;
@@ -94,8 +93,8 @@ CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
 	}
 	else
 	{
-		dismissLabel = std::make_shared<CTextBox>(CGI->generaltexth->jktexts[8], Rect(370, 430, 65, 35), 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE);
-		questlogLabel = std::make_shared<CTextBox>(CGI->generaltexth->jktexts[9], Rect(510, 430, 65, 35), 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE);
+		dismissLabel = std::make_shared<CTextBox>(VLC->generaltexth->jktexts[8], Rect(370, 430, 65, 35), 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE);
+		questlogLabel = std::make_shared<CTextBox>(VLC->generaltexth->jktexts[9], Rect(510, 430, 65, 35), 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE);
 		dismissButton = std::make_shared<CButton>(Point(454, 429), AnimationPath::builtin("hsbtns2.def"), CButton::tooltip(heroscrn[28]), [=](){ dismissCurrent(); }, EShortcut::HERO_DISMISS);
 		questlogButton = std::make_shared<CButton>(Point(314, 429), AnimationPath::builtin("hsbtns4.def"), CButton::tooltip(heroscrn[0]), [=](){ LOCPLINT->showQuestLog(); }, EShortcut::ADVENTURE_QUEST_LOG);
 	}
@@ -121,9 +120,9 @@ CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
 	for(int v = 0; v < GameConstants::PRIMARY_SKILLS; ++v)
 	{
 		auto area = std::make_shared<LRClickableAreaWTextComp>(Rect(30 + 70 * v, 109, 42, 64), ComponentType::PRIM_SKILL);
-		area->text = CGI->generaltexth->arraytxt[2+v];
+		area->text = VLC->generaltexth->arraytxt[2+v];
 		area->component.subType = PrimarySkill(v);
-		area->hoverText = boost::str(boost::format(CGI->generaltexth->heroscrn[1]) % CGI->generaltexth->primarySkillNames[v]);
+		area->hoverText = boost::str(boost::format(VLC->generaltexth->heroscrn[1]) % VLC->generaltexth->primarySkillNames[v]);
 		primSkillAreas.push_back(area);
 
 		auto value = std::make_shared<CLabel>(53 + 70 * v, 166, FONT_SMALL, ETextAlignment::CENTER);
@@ -138,13 +137,13 @@ CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
 	primSkillImages.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("PSKIL42"), 5, 0, 242, 111));
 
 	specImage = std::make_shared<CAnimImage>(AnimationPath::builtin("UN44"), 0, 0, 18, 180);
-	specArea = std::make_shared<LRClickableAreaWText>(Rect(18, 180, 136, 42), CGI->generaltexth->heroscrn[27]);
+	specArea = std::make_shared<LRClickableAreaWText>(Rect(18, 180, 136, 42), VLC->generaltexth->heroscrn[27]);
 	specName = std::make_shared<CLabel>(69, 205);
 
-	expArea = std::make_shared<LRClickableAreaWText>(Rect(18, 228, 136, 42), CGI->generaltexth->heroscrn[9]);
+	expArea = std::make_shared<LRClickableAreaWText>(Rect(18, 228, 136, 42), VLC->generaltexth->heroscrn[9]);
 	morale = std::make_shared<MoraleLuckBox>(true, Rect(175, 179, 53, 45));
 	luck = std::make_shared<MoraleLuckBox>(false, Rect(233, 179, 53, 45));
-	spellPointsArea = std::make_shared<LRClickableAreaWText>(Rect(162,228, 136, 42), CGI->generaltexth->heroscrn[22]);
+	spellPointsArea = std::make_shared<LRClickableAreaWText>(Rect(162,228, 136, 42), VLC->generaltexth->heroscrn[22]);
 
 	expValue = std::make_shared<CLabel>(68, 252);
 	manaValue = std::make_shared<CLabel>(211, 252);
@@ -162,14 +161,14 @@ CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
 	}
 
 	// various texts
-	labels.push_back(std::make_shared<CLabel>(52, 99, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->jktexts[1]));
-	labels.push_back(std::make_shared<CLabel>(123, 99, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->jktexts[2]));
-	labels.push_back(std::make_shared<CLabel>(193, 99, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->jktexts[3]));
-	labels.push_back(std::make_shared<CLabel>(262, 99, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->jktexts[4]));
+	labels.push_back(std::make_shared<CLabel>(52, 99, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->jktexts[1]));
+	labels.push_back(std::make_shared<CLabel>(123, 99, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->jktexts[2]));
+	labels.push_back(std::make_shared<CLabel>(193, 99, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->jktexts[3]));
+	labels.push_back(std::make_shared<CLabel>(262, 99, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->jktexts[4]));
 
-	labels.push_back(std::make_shared<CLabel>(69, 183, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->jktexts[5]));
-	labels.push_back(std::make_shared<CLabel>(69, 232, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->jktexts[6]));
-	labels.push_back(std::make_shared<CLabel>(213, 232, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, CGI->generaltexth->jktexts[7]));
+	labels.push_back(std::make_shared<CLabel>(69, 183, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->jktexts[5]));
+	labels.push_back(std::make_shared<CLabel>(69, 232, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->jktexts[6]));
+	labels.push_back(std::make_shared<CLabel>(213, 232, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->jktexts[7]));
 
 	CHeroWindow::update();
 }
@@ -177,21 +176,21 @@ CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
 void CHeroWindow::update()
 {
 	CWindowWithArtifacts::update();
-	auto & heroscrn = CGI->generaltexth->heroscrn;
+	auto & heroscrn = VLC->generaltexth->heroscrn;
 	assert(curHero);
 
 	name->setText(curHero->getNameTranslated());
-	title->setText((boost::format(CGI->generaltexth->allTexts[342]) % curHero->level % curHero->getClassNameTranslated()).str());
+	title->setText((boost::format(VLC->generaltexth->allTexts[342]) % curHero->level % curHero->getClassNameTranslated()).str());
 
 	specArea->text = curHero->getHeroType()->getSpecialtyDescriptionTranslated();
 	specImage->setFrame(curHero->getHeroType()->imageIndex);
 	specName->setText(curHero->getHeroType()->getSpecialtyNameTranslated());
 
 	tacticsButton = std::make_shared<CToggleButton>(Point(539, 483), AnimationPath::builtin("hsbtns8.def"), std::make_pair(heroscrn[26], heroscrn[31]), 0, EShortcut::HERO_TOGGLE_TACTICS);
-	tacticsButton->addHoverText(EButtonState::HIGHLIGHTED, CGI->generaltexth->heroscrn[25]);
+	tacticsButton->addHoverText(EButtonState::HIGHLIGHTED, VLC->generaltexth->heroscrn[25]);
 
-	dismissButton->addHoverText(EButtonState::NORMAL, boost::str(boost::format(CGI->generaltexth->heroscrn[16]) % curHero->getNameTranslated() % curHero->getClassNameTranslated()));
-	portraitArea->hoverText = boost::str(boost::format(CGI->generaltexth->allTexts[15]) % curHero->getNameTranslated() % curHero->getClassNameTranslated());
+	dismissButton->addHoverText(EButtonState::NORMAL, boost::str(boost::format(VLC->generaltexth->heroscrn[16]) % curHero->getNameTranslated() % curHero->getClassNameTranslated()));
+	portraitArea->hoverText = boost::str(boost::format(VLC->generaltexth->allTexts[15]) % curHero->getNameTranslated() % curHero->getClassNameTranslated());
 	portraitArea->text = curHero->getBiographyTranslated();
 	portraitImage->setFrame(curHero->getIconIndex());
 
@@ -201,10 +200,10 @@ void CHeroWindow::update()
 		{
 			bool removableTroops = curHero->getOwner() == LOCPLINT->playerID;
 			std::string helpBox = heroscrn[32];
-			boost::algorithm::replace_first(helpBox, "%s", CGI->generaltexth->allTexts[43]);
+			boost::algorithm::replace_first(helpBox, "%s", VLC->generaltexth->allTexts[43]);
 
 			garr = std::make_shared<CGarrisonInt>(Point(15, 485), 8, Point(), curHero, nullptr, removableTroops);
-			auto split = std::make_shared<CButton>(Point(539, 519), AnimationPath::builtin("hsbtns9.def"), CButton::tooltip(CGI->generaltexth->allTexts[256], helpBox), [this](){ garr->splitClick(); }, EShortcut::HERO_ARMY_SPLIT);
+			auto split = std::make_shared<CButton>(Point(539, 519), AnimationPath::builtin("hsbtns9.def"), CButton::tooltip(VLC->generaltexth->allTexts[256], helpBox), [this](){ garr->splitClick(); }, EShortcut::HERO_ARMY_SPLIT);
 			garr->addSplitBtn(split);
 		}
 		if(!arts)
@@ -238,8 +237,8 @@ void CHeroWindow::update()
 	{
 		SecondarySkill skill = curHero->secSkills[g].first;
 		int	level = curHero->getSecSkillLevel(skill);
-		std::string skillName = CGI->skillh->getByIndex(skill)->getNameTranslated();
-		std::string skillValue = CGI->generaltexth->levels[level-1];
+		std::string skillName = VLC->skillh->getByIndex(skill)->getNameTranslated();
+		std::string skillValue = VLC->generaltexth->levels[level-1];
 
 		secSkillNames[g]->setText(skillName);
 		secSkillValues[g]->setText(skillValue);
@@ -255,13 +254,13 @@ void CHeroWindow::update()
 	manaValue->setText(manastr.str());
 
 	//printing experience - original format does not support ui64
-	expArea->text = CGI->generaltexth->allTexts[2];
+	expArea->text = VLC->generaltexth->allTexts[2];
 	boost::replace_first(expArea->text, "%d", std::to_string(curHero->level));
-	boost::replace_first(expArea->text, "%d", std::to_string(CGI->heroh->reqExp(curHero->level+1)));
+	boost::replace_first(expArea->text, "%d", std::to_string(VLC->heroh->reqExp(curHero->level+1)));
 	boost::replace_first(expArea->text, "%d", std::to_string(curHero->exp));
 
 	//printing spell points, boost::format can't be used due to locale issues
-	spellPointsArea->text = CGI->generaltexth->allTexts[205];
+	spellPointsArea->text = VLC->generaltexth->allTexts[205];
 	boost::replace_first(spellPointsArea->text, "%s", curHero->getNameTranslated());
 	boost::replace_first(spellPointsArea->text, "%d", std::to_string(curHero->mana));
 	boost::replace_first(spellPointsArea->text, "%d", std::to_string(curHero->manaLimit()));
@@ -307,7 +306,7 @@ void CHeroWindow::update()
 
 void CHeroWindow::dismissCurrent()
 {
-	LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[22], [this]()
+	LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[22], [this]()
 		{
 			arts->putBackPickedArtifact();
 			close();

+ 38 - 39
client/windows/CKingdomInterface.cpp

@@ -14,7 +14,6 @@
 #include "CPlayerState.h"
 #include "InfoWindows.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../PlayerLocalState.h"
 #include "../adventureMap/CResDataBar.h"
@@ -134,12 +133,12 @@ std::string InfoBoxAbstractHeroData::getValueText()
 	case HERO_PRIMARY_SKILL:
 		return std::to_string(getValue());
 	case HERO_SPECIAL:
-		return CGI->generaltexth->jktexts[5];
+		return VLC->generaltexth->jktexts[5];
 	case HERO_SECONDARY_SKILL:
 		{
 			si64 value = getValue();
 			if (value)
-				return CGI->generaltexth->levels[value];
+				return VLC->generaltexth->levels[value];
 			else
 				return "";
 		}
@@ -154,16 +153,16 @@ std::string InfoBoxAbstractHeroData::getNameText()
 	switch (type)
 	{
 	case HERO_PRIMARY_SKILL:
-		return CGI->generaltexth->primarySkillNames[getSubID()];
+		return VLC->generaltexth->primarySkillNames[getSubID()];
 	case HERO_MANA:
-		return CGI->generaltexth->allTexts[387];
+		return VLC->generaltexth->allTexts[387];
 	case HERO_EXPERIENCE:
-		return CGI->generaltexth->jktexts[6];
+		return VLC->generaltexth->jktexts[6];
 	case HERO_SPECIAL:
-		return CGI->heroh->objects[getSubID()]->getSpecialtyNameTranslated();
+		return VLC->heroh->objects[getSubID()]->getSpecialtyNameTranslated();
 	case HERO_SECONDARY_SKILL:
 		if (getValue())
-			return CGI->skillh->getByIndex(getSubID())->getNameTranslated();
+			return VLC->skillh->getByIndex(getSubID())->getNameTranslated();
 		else
 			return "";
 	default:
@@ -226,7 +225,7 @@ size_t InfoBoxAbstractHeroData::getImageIndex()
 	switch (type)
 	{
 	case HERO_SPECIAL:
-		return CGI->heroh->objects[getSubID()]->imageIndex;
+		return VLC->heroh->objects[getSubID()]->imageIndex;
 	case HERO_PRIMARY_SKILL:
 		return getSubID();
 	case HERO_MANA:
@@ -253,17 +252,17 @@ void InfoBoxAbstractHeroData::prepareMessage(std::string & text, std::shared_ptr
 	switch (type)
 	{
 	case HERO_SPECIAL:
-		text = CGI->heroh->objects[getSubID()]->getSpecialtyDescriptionTranslated();
+		text = VLC->heroh->objects[getSubID()]->getSpecialtyDescriptionTranslated();
 		break;
 	case HERO_PRIMARY_SKILL:
-		text = CGI->generaltexth->arraytxt[2+getSubID()];
+		text = VLC->generaltexth->arraytxt[2+getSubID()];
 		comp = std::make_shared<CComponent>(ComponentType::PRIM_SKILL, PrimarySkill(getSubID()), getValue());
 		break;
 	case HERO_MANA:
-		text = CGI->generaltexth->allTexts[149];
+		text = VLC->generaltexth->allTexts[149];
 		break;
 	case HERO_EXPERIENCE:
-		text = CGI->generaltexth->allTexts[241];
+		text = VLC->generaltexth->allTexts[241];
 		break;
 	case HERO_SECONDARY_SKILL:
 		{
@@ -271,7 +270,7 @@ void InfoBoxAbstractHeroData::prepareMessage(std::string & text, std::shared_ptr
 			int  subID = getSubID();
 			if(value)
 			{
-				text = CGI->skillh->getByIndex(subID)->getDescriptionTranslated((int)value);
+				text = VLC->skillh->getByIndex(subID)->getDescriptionTranslated((int)value);
 				comp = std::make_shared<CComponent>(ComponentType::SEC_SKILL, SecondarySkill(subID), (int)value);
 			}
 			break;
@@ -341,19 +340,19 @@ std::string InfoBoxHeroData::getHoverText()
 	switch (type)
 	{
 	case HERO_PRIMARY_SKILL:
-		return boost::str(boost::format(CGI->generaltexth->heroscrn[1]) % CGI->generaltexth->primarySkillNames[index]);
+		return boost::str(boost::format(VLC->generaltexth->heroscrn[1]) % VLC->generaltexth->primarySkillNames[index]);
 	case HERO_MANA:
-		return CGI->generaltexth->heroscrn[22];
+		return VLC->generaltexth->heroscrn[22];
 	case HERO_EXPERIENCE:
-		return CGI->generaltexth->heroscrn[9];
+		return VLC->generaltexth->heroscrn[9];
 	case HERO_SPECIAL:
-		return CGI->generaltexth->heroscrn[27];
+		return VLC->generaltexth->heroscrn[27];
 	case HERO_SECONDARY_SKILL:
 		if (hero->secSkills.size() > index)
 		{
-			std::string level = CGI->generaltexth->levels[hero->secSkills[index].second-1];
-			std::string skill = CGI->skillh->getByIndex(hero->secSkills[index].first)->getNameTranslated();
-			return boost::str(boost::format(CGI->generaltexth->heroscrn[21]) % level % skill);
+			std::string level = VLC->generaltexth->levels[hero->secSkills[index].second-1];
+			std::string skill = VLC->skillh->getByIndex(hero->secSkills[index].first)->getNameTranslated();
+			return boost::str(boost::format(VLC->generaltexth->heroscrn[21]) % level % skill);
 		}
 		else
 		{
@@ -386,15 +385,15 @@ void InfoBoxHeroData::prepareMessage(std::string & text, std::shared_ptr<CCompon
 	switch(type)
 	{
 	case HERO_MANA:
-		text = CGI->generaltexth->allTexts[205];
+		text = VLC->generaltexth->allTexts[205];
 		boost::replace_first(text, "%s", hero->getNameTranslated());
 		boost::replace_first(text, "%d", std::to_string(hero->mana));
 		boost::replace_first(text, "%d", std::to_string(hero->manaLimit()));
 		break;
 	case HERO_EXPERIENCE:
-		text = CGI->generaltexth->allTexts[2];
+		text = VLC->generaltexth->allTexts[2];
 		boost::replace_first(text, "%d", std::to_string(hero->level));
-		boost::replace_first(text, "%d", std::to_string(CGI->heroh->reqExp(hero->level+1)));
+		boost::replace_first(text, "%d", std::to_string(VLC->heroh->reqExp(hero->level+1)));
 		boost::replace_first(text, "%d", std::to_string(hero->exp));
 		break;
 	default:
@@ -599,13 +598,13 @@ void CKingdomInterface::generateMinesList(const std::vector<const CGObjectInstan
 	for(int i=0; i<7; i++)
 	{
 		std::string value = std::to_string(minesCount[i]);
-		auto data = std::make_shared<InfoBoxCustom>(value, "", AnimationPath::builtin("OVMINES"), i, CGI->generaltexth->translate("core.minename", i));
+		auto data = std::make_shared<InfoBoxCustom>(value, "", AnimationPath::builtin("OVMINES"), i, VLC->generaltexth->translate("core.minename", i));
 		minesBox[i] = std::make_shared<InfoBox>(Point(20+i*80, 31+footerPos), InfoBox::POS_INSIDE, InfoBox::SIZE_SMALL, data);
 		minesBox[i]->removeUsedEvents(LCLICK|SHOW_POPUP); //fixes #890 - mines boxes ignore clicks
 	}
 	incomeArea = std::make_shared<CHoverableArea>();
 	incomeArea->pos = Rect(pos.x+580, pos.y+31+footerPos, 136, 68);
-	incomeArea->hoverText = CGI->generaltexth->allTexts[255];
+	incomeArea->hoverText = VLC->generaltexth->allTexts[255];
 	incomeAmount = std::make_shared<CLabel>(628, footerPos + 70, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, std::to_string(totalIncome));
 }
 
@@ -614,14 +613,14 @@ void CKingdomInterface::generateButtons()
 	ui32 footerPos = OVERVIEW_SIZE * 116;
 
 	//Main control buttons
-	btnHeroes = std::make_shared<CButton>(Point(748, 28+footerPos), AnimationPath::builtin("OVBUTN1.DEF"), CButton::tooltip(CGI->generaltexth->overview[11], CGI->generaltexth->overview[6]),
+	btnHeroes = std::make_shared<CButton>(Point(748, 28+footerPos), AnimationPath::builtin("OVBUTN1.DEF"), CButton::tooltip(VLC->generaltexth->overview[11], VLC->generaltexth->overview[6]),
 		std::bind(&CKingdomInterface::activateTab, this, 0), EShortcut::KINGDOM_HEROES_TAB);
 	btnHeroes->block(true);
 
-	btnTowns = std::make_shared<CButton>(Point(748, 64+footerPos), AnimationPath::builtin("OVBUTN6.DEF"), CButton::tooltip(CGI->generaltexth->overview[12], CGI->generaltexth->overview[7]),
+	btnTowns = std::make_shared<CButton>(Point(748, 64+footerPos), AnimationPath::builtin("OVBUTN6.DEF"), CButton::tooltip(VLC->generaltexth->overview[12], VLC->generaltexth->overview[7]),
 		std::bind(&CKingdomInterface::activateTab, this, 1), EShortcut::KINGDOM_TOWNS_TAB);
 
-	btnExit = std::make_shared<CButton>(Point(748,99+footerPos), AnimationPath::builtin("OVBUTN1.DEF"), CButton::tooltip(CGI->generaltexth->allTexts[600]),
+	btnExit = std::make_shared<CButton>(Point(748,99+footerPos), AnimationPath::builtin("OVBUTN1.DEF"), CButton::tooltip(VLC->generaltexth->allTexts[600]),
 		std::bind(&CKingdomInterface::close, this), EShortcut::GLOBAL_RETURN);
 	btnExit->setImageOrder(3, 4, 5, 6);
 
@@ -680,8 +679,8 @@ CKingdHeroList::CKingdHeroList(size_t maxSize, const CreateHeroItemFunctor & onC
 	OBJECT_CONSTRUCTION;
 	title = std::make_shared<CPicture>(ImagePath::builtin("OVTITLE"),16,0);
 	title->setPlayerColor(LOCPLINT->playerID);
-	heroLabel = std::make_shared<CLabel>(150, 10, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->overview[0]);
-	skillsLabel = std::make_shared<CLabel>(500, 10, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->overview[1]);
+	heroLabel = std::make_shared<CLabel>(150, 10, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->overview[0]);
+	skillsLabel = std::make_shared<CLabel>(500, 10, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->overview[1]);
 
 	ui32 townCount = LOCPLINT->cb->howManyHeroes(false);
 	ui32 size = OVERVIEW_SIZE*116 + 19;
@@ -724,9 +723,9 @@ CKingdTownList::CKingdTownList(size_t maxSize)
 	OBJECT_CONSTRUCTION;
 	title = std::make_shared<CPicture>(ImagePath::builtin("OVTITLE"), 16, 0);
 	title->setPlayerColor(LOCPLINT->playerID);
-	townLabel = std::make_shared<CLabel>(146, 10,FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->overview[3]);
-	garrHeroLabel = std::make_shared<CLabel>(375, 10, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->overview[4]);
-	visitHeroLabel = std::make_shared<CLabel>(608, 10, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->overview[5]);
+	townLabel = std::make_shared<CLabel>(146, 10,FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->overview[3]);
+	garrHeroLabel = std::make_shared<CLabel>(375, 10, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->overview[4]);
+	visitHeroLabel = std::make_shared<CLabel>(608, 10, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->overview[5]);
 
 	ui32 townCount = LOCPLINT->cb->howManyTowns();
 	ui32 size = OVERVIEW_SIZE*116 + 19;
@@ -825,7 +824,7 @@ CTownItem::CTownItem(const CGTownInstance * Town)
 				return;
 			}
 		}
-		LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
+		LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
 	});
 	fastTown = std::make_shared<LRClickableArea>(Rect(67, 6, 165, 20), [&]()
 	{
@@ -953,11 +952,11 @@ CHeroItem::CHeroItem(const CGHeroInstance * Hero)
 	{
 		int stringID[3] = {259, 261, 262};
 
-		std::string hover = CGI->generaltexth->overview[13+it];
-		std::string overlay = CGI->generaltexth->overview[8+it];
+		std::string hover = VLC->generaltexth->overview[13+it];
+		std::string overlay = VLC->generaltexth->overview[8+it];
 
 		auto button = std::make_shared<CToggleButton>(Point(364+(int)it*112, 46), AnimationPath::builtin("OVBUTN3"), CButton::tooltip(hover, overlay), 0);
-		button->setTextOverlay(CGI->generaltexth->allTexts[stringID[it]], FONT_SMALL, Colors::YELLOW);
+		button->setTextOverlay(VLC->generaltexth->allTexts[stringID[it]], FONT_SMALL, Colors::YELLOW);
 		artButtons->addToggle((int)it, button);
 	}
 	artButtons->addCallback(std::bind(&CTabbedInt::setActive, artsTabs, _1));
@@ -970,7 +969,7 @@ CHeroItem::CHeroItem(const CGHeroInstance * Hero)
 	heroArea = std::make_shared<CHeroArea>(5, 6, hero);
 
 	name = std::make_shared<CLabel>(73, 7, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, hero->getNameTranslated());
-	artsText = std::make_shared<CLabel>(320, 55, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->overview[2]);
+	artsText = std::make_shared<CLabel>(320, 55, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->overview[2]);
 
 	for(size_t i=0; i<GameConstants::PRIMARY_SKILLS; i++)
 	{

+ 14 - 15
client/windows/CMarketWindow.cpp

@@ -24,7 +24,6 @@
 #include "../widgets/markets/CMarketResources.h"
 #include "../widgets/markets/CTransferResources.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 
 #include "../../lib/entities/building/CBuilding.h"
@@ -143,28 +142,28 @@ void CMarketWindow::createChangeModeButtons(EMarketMode currentMode, const IMark
 	};
 
 	if(isButtonVisible(EMarketMode::RESOURCE_PLAYER))
-		addButton(AnimationPath::builtin("TPMRKBU1.DEF"), CGI->generaltexth->zelp[612], std::bind(&CMarketWindow::createTransferResources, this, market, hero), EShortcut::MARKET_RESOURCE_PLAYER);
+		addButton(AnimationPath::builtin("TPMRKBU1.DEF"), VLC->generaltexth->zelp[612], std::bind(&CMarketWindow::createTransferResources, this, market, hero), EShortcut::MARKET_RESOURCE_PLAYER);
 	if(isButtonVisible(EMarketMode::ARTIFACT_RESOURCE))
-		addButton(AnimationPath::builtin("TPMRKBU3.DEF"), CGI->generaltexth->zelp[613], std::bind(&CMarketWindow::createArtifactsSelling, this, market, hero), EShortcut::MARKET_ARTIFACT_RESOURCE);
+		addButton(AnimationPath::builtin("TPMRKBU3.DEF"), VLC->generaltexth->zelp[613], std::bind(&CMarketWindow::createArtifactsSelling, this, market, hero), EShortcut::MARKET_ARTIFACT_RESOURCE);
 	if(isButtonVisible(EMarketMode::RESOURCE_ARTIFACT))
-		addButton(AnimationPath::builtin("TPMRKBU2.DEF"), CGI->generaltexth->zelp[598], std::bind(&CMarketWindow::createArtifactsBuying, this, market, hero), EShortcut::MARKET_RESOURCE_ARTIFACT);
+		addButton(AnimationPath::builtin("TPMRKBU2.DEF"), VLC->generaltexth->zelp[598], std::bind(&CMarketWindow::createArtifactsBuying, this, market, hero), EShortcut::MARKET_RESOURCE_ARTIFACT);
 
 	buttonPos = Point(516, 520 - buttonHeightWithMargin);
 	if(isButtonVisible(EMarketMode::CREATURE_RESOURCE))
-		addButton(AnimationPath::builtin("TPMRKBU4.DEF"), CGI->generaltexth->zelp[599], std::bind(&CMarketWindow::createFreelancersGuild, this, market, hero), EShortcut::MARKET_CREATURE_RESOURCE);
+		addButton(AnimationPath::builtin("TPMRKBU4.DEF"), VLC->generaltexth->zelp[599], std::bind(&CMarketWindow::createFreelancersGuild, this, market, hero), EShortcut::MARKET_CREATURE_RESOURCE);
 	if(isButtonVisible(EMarketMode::RESOURCE_RESOURCE))
-		addButton(AnimationPath::builtin("TPMRKBU5.DEF"), CGI->generaltexth->zelp[605], std::bind(&CMarketWindow::createMarketResources, this, market, hero), EShortcut::MARKET_RESOURCE_RESOURCE);
+		addButton(AnimationPath::builtin("TPMRKBU5.DEF"), VLC->generaltexth->zelp[605], std::bind(&CMarketWindow::createMarketResources, this, market, hero), EShortcut::MARKET_RESOURCE_RESOURCE);
 	
 	buttonPos = Point(516, 421);
 	if(isButtonVisible(EMarketMode::CREATURE_EXP))
 	{
-		addButton(AnimationPath::builtin("ALTSACC.DEF"), CGI->generaltexth->zelp[572], std::bind(&CMarketWindow::createAltarCreatures, this, market, hero), EShortcut::MARKET_CREATURE_EXPERIENCE);
+		addButton(AnimationPath::builtin("ALTSACC.DEF"), VLC->generaltexth->zelp[572], std::bind(&CMarketWindow::createAltarCreatures, this, market, hero), EShortcut::MARKET_CREATURE_EXPERIENCE);
 		if(marketWidget->hero->getAlignment() == EAlignment::GOOD)
 			changeModeButtons.back()->block(true);
 	}
 	if(isButtonVisible(EMarketMode::ARTIFACT_EXP))
 	{
-		addButton(AnimationPath::builtin("ALTART.DEF"), CGI->generaltexth->zelp[580], std::bind(&CMarketWindow::createAltarArtifacts, this, market, hero), EShortcut::MARKET_ARTIFACT_EXPERIENCE);
+		addButton(AnimationPath::builtin("ALTART.DEF"), VLC->generaltexth->zelp[580], std::bind(&CMarketWindow::createAltarArtifacts, this, market, hero), EShortcut::MARKET_ARTIFACT_EXPERIENCE);
 		if(marketWidget->hero->getAlignment() == EAlignment::EVIL)
 			changeModeButtons.back()->block(true);
 	}
@@ -205,7 +204,7 @@ void CMarketWindow::createArtifactsBuying(const IMarket * market, const CGHeroIn
 
 	background = createBg(ImagePath::builtin("TPMRKABS.bmp"), PLAYER_COLORED);
 	marketWidget = std::make_shared<CArtifactsBuying>(market, hero, getMarketTitle(market->getObjInstanceID(), EMarketMode::RESOURCE_ARTIFACT));
-	initWidgetInternals(EMarketMode::RESOURCE_ARTIFACT, CGI->generaltexth->zelp[600]);
+	initWidgetInternals(EMarketMode::RESOURCE_ARTIFACT, VLC->generaltexth->zelp[600]);
 }
 
 void CMarketWindow::createArtifactsSelling(const IMarket * market, const CGHeroInstance * hero)
@@ -221,7 +220,7 @@ void CMarketWindow::createArtifactsSelling(const IMarket * market, const CGHeroI
 	const auto heroArts = artsSellingMarket->getAOHset();
 	addSet(heroArts);
 	marketWidget = artsSellingMarket;
-	initWidgetInternals(EMarketMode::ARTIFACT_RESOURCE, CGI->generaltexth->zelp[600]);
+	initWidgetInternals(EMarketMode::ARTIFACT_RESOURCE, VLC->generaltexth->zelp[600]);
 }
 
 void CMarketWindow::createMarketResources(const IMarket * market, const CGHeroInstance * hero)
@@ -230,7 +229,7 @@ void CMarketWindow::createMarketResources(const IMarket * market, const CGHeroIn
 
 	background = createBg(ImagePath::builtin("TPMRKRES.bmp"), PLAYER_COLORED);
 	marketWidget = std::make_shared<CMarketResources>(market, hero);
-	initWidgetInternals(EMarketMode::RESOURCE_RESOURCE, CGI->generaltexth->zelp[600]);
+	initWidgetInternals(EMarketMode::RESOURCE_RESOURCE, VLC->generaltexth->zelp[600]);
 }
 
 void CMarketWindow::createFreelancersGuild(const IMarket * market, const CGHeroInstance * hero)
@@ -239,7 +238,7 @@ void CMarketWindow::createFreelancersGuild(const IMarket * market, const CGHeroI
 
 	background = createBg(ImagePath::builtin("TPMRKCRS.bmp"), PLAYER_COLORED);
 	marketWidget = std::make_shared<CFreelancerGuild>(market, hero);
-	initWidgetInternals(EMarketMode::CREATURE_RESOURCE, CGI->generaltexth->zelp[600]);
+	initWidgetInternals(EMarketMode::CREATURE_RESOURCE, VLC->generaltexth->zelp[600]);
 }
 
 void CMarketWindow::createTransferResources(const IMarket * market, const CGHeroInstance * hero)
@@ -248,7 +247,7 @@ void CMarketWindow::createTransferResources(const IMarket * market, const CGHero
 
 	background = createBg(ImagePath::builtin("TPMRKPTS.bmp"), PLAYER_COLORED);
 	marketWidget = std::make_shared<CTransferResources>(market, hero);
-	initWidgetInternals(EMarketMode::RESOURCE_PLAYER, CGI->generaltexth->zelp[600]);
+	initWidgetInternals(EMarketMode::RESOURCE_PLAYER, VLC->generaltexth->zelp[600]);
 }
 
 void CMarketWindow::createAltarArtifacts(const IMarket * market, const CGHeroInstance * hero)
@@ -273,7 +272,7 @@ void CMarketWindow::createAltarArtifacts(const IMarket * market, const CGHeroIns
 		showQuickBackpackWindow(heroArts->getHero(), artPlace.slot, cursorPosition);
 	};
 	addSet(heroArts);
-	initWidgetInternals(EMarketMode::ARTIFACT_EXP, CGI->generaltexth->zelp[568]);
+	initWidgetInternals(EMarketMode::ARTIFACT_EXP, VLC->generaltexth->zelp[568]);
 	updateExperience();
 	quitButton->addCallback([altarArtifactsStorage](){altarArtifactsStorage->putBackArtifacts();});
 }
@@ -284,6 +283,6 @@ void CMarketWindow::createAltarCreatures(const IMarket * market, const CGHeroIns
 
 	background = createBg(ImagePath::builtin("ALTARMON.bmp"), PLAYER_COLORED);
 	marketWidget = std::make_shared<CAltarCreatures>(market, hero);
-	initWidgetInternals(EMarketMode::CREATURE_EXP, CGI->generaltexth->zelp[568]);
+	initWidgetInternals(EMarketMode::CREATURE_EXP, VLC->generaltexth->zelp[568]);
 	updateExperience();
 }

+ 5 - 4
client/windows/CPuzzleWindow.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "CPuzzleWindow.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../adventureMap/CResDataBar.h"
 #include "../GameEngine.h"
@@ -27,6 +26,8 @@
 #include "../../lib/entities/faction/CTownHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/StartInfo.h"
+#include "../../lib/VCMI_Lib.h"
+
 
 CPuzzleWindow::CPuzzleWindow(const int3 & GrailPos, double discoveredRatio)
 	: CWindowObject(PLAYER_COLORED | BORDERED, ImagePath::builtin("PUZZLE")),
@@ -37,18 +38,18 @@ CPuzzleWindow::CPuzzleWindow(const int3 & GrailPos, double discoveredRatio)
 
 	ENGINE->sound().playSound(soundBase::OBELISK);
 
-	quitb = std::make_shared<CButton>(Point(670, 538), AnimationPath::builtin("IOK6432.DEF"), CButton::tooltip(CGI->generaltexth->allTexts[599]), std::bind(&CPuzzleWindow::close, this), EShortcut::GLOBAL_RETURN);
+	quitb = std::make_shared<CButton>(Point(670, 538), AnimationPath::builtin("IOK6432.DEF"), CButton::tooltip(VLC->generaltexth->allTexts[599]), std::bind(&CPuzzleWindow::close, this), EShortcut::GLOBAL_RETURN);
 	quitb->setBorderColor(Colors::METALLIC_GOLD);
 
 	mapView = std::make_shared<PuzzleMapView>(Point(8,9), Point(591, 544), grailPos);
 
 	logo = std::make_shared<CPicture>(ImagePath::builtin("PUZZLOGO"), 607, 3);
-	title = std::make_shared<CLabel>(700, 95, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[463]);
+	title = std::make_shared<CLabel>(700, 95, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[463]);
 	resDataBar = std::make_shared<CResDataBar>(ImagePath::builtin("ARESBAR.bmp"), 3, 575, 32, 2, 85, 85);
 
 	int faction = LOCPLINT->cb->getStartInfo()->playerInfos.find(LOCPLINT->playerID)->second.castle;
 
-	auto & puzzleMap = (*CGI->townh)[faction]->puzzleMap;
+	auto & puzzleMap = (*VLC->townh)[faction]->puzzleMap;
 
 	for(auto & elem : puzzleMap)
 	{

+ 2 - 3
client/windows/CQuestLog.cpp

@@ -10,7 +10,6 @@
 #include "StdInc.h"
 #include "CQuestLog.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 
 #include "../GameEngine.h"
@@ -126,10 +125,10 @@ CQuestLog::CQuestLog (const std::vector<QuestInfo> & Quests)
 	minimap = std::make_shared<CQuestMinimap>(Rect(12, 12, 169, 169));
 	// TextBox have it's own 4 pixel padding from top at least for English. To achieve 10px from both left and top only add 6px margin
 	description = std::make_shared<CTextBox>("", Rect(205, 18, 385, DESCRIPTION_HEIGHT_MAX), CSlider::BROWN, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE);
-	ok = std::make_shared<CButton>(Point(539, 398), AnimationPath::builtin("IOKAY.DEF"), CGI->generaltexth->zelp[445], std::bind(&CQuestLog::close, this), EShortcut::GLOBAL_RETURN);
+	ok = std::make_shared<CButton>(Point(539, 398), AnimationPath::builtin("IOKAY.DEF"), VLC->generaltexth->zelp[445], std::bind(&CQuestLog::close, this), EShortcut::GLOBAL_RETURN);
 	// Both button and label 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<CToggleButton>(Point(10, 396), AnimationPath::builtin("sysopchk.def"), CButton::tooltipLocalized("vcmi.questLog.hideComplete"), std::bind(&CQuestLog::toggleComplete, this, _1));
-	hideCompleteLabel = std::make_shared<CLabel>(46, 398, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("vcmi.questLog.hideComplete.hover"));
+	hideCompleteLabel = std::make_shared<CLabel>(46, 398, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->translate("vcmi.questLog.hideComplete.hover"));
 	slider = std::make_shared<CSlider>(Point(166, 195), 191, std::bind(&CQuestLog::sliderMoved, this, _1), QUEST_COUNT, 0, 0, Orientation::VERTICAL, CSlider::BROWN);
 	slider->setPanningStep(32);
 

+ 16 - 17
client/windows/CSpellWindow.cpp

@@ -16,7 +16,6 @@
 #include "InfoWindows.h"
 #include "CCastleInterface.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 #include "../PlayerLocalState.h"
 
@@ -50,8 +49,8 @@ CSpellWindow::InteractiveArea::InteractiveArea(const Rect & myRect, std::functio
 	addUsedEvents(LCLICK | SHOW_POPUP | HOVER);
 	pos = myRect;
 	onLeft = funcL;
-	hoverText = CGI->generaltexth->zelp[helpTextId].first;
-	helpText = CGI->generaltexth->zelp[helpTextId].second;
+	hoverText = VLC->generaltexth->zelp[helpTextId].first;
+	helpText = VLC->generaltexth->zelp[helpTextId].second;
 	owner = _owner;
 }
 
@@ -136,7 +135,7 @@ CSpellWindow::CSpellWindow(const CGHeroInstance * _myHero, CPlayerInterface * _m
 		const ColorRGBA borderColor = ColorRGBA(128, 100, 75);
 		const ColorRGBA grayedColor = ColorRGBA(158, 130, 105);
 		searchBoxRectangle = std::make_shared<TransparentFilledRectangle>(r.resize(1), rectangleColor, borderColor);
-		searchBoxDescription = std::make_shared<CLabel>(r.center().x, r.center().y, FONT_SMALL, ETextAlignment::CENTER, grayedColor, CGI->generaltexth->translate("vcmi.spellBook.search"));
+		searchBoxDescription = std::make_shared<CLabel>(r.center().x, r.center().y, FONT_SMALL, ETextAlignment::CENTER, grayedColor, VLC->generaltexth->translate("vcmi.spellBook.search"));
 
 		searchBox = std::make_shared<CTextInput>(r, FONT_SMALL, ETextAlignment::CENTER, false);
 		searchBox->setCallback(std::bind(&CSpellWindow::searchInput, this));
@@ -145,8 +144,8 @@ CSpellWindow::CSpellWindow(const CGHeroInstance * _myHero, CPlayerInterface * _m
 	if(onSpellSelect)
 	{
 		Point boxPos = r.bottomLeft() + Point(-2, 5);
-		showAllSpells = std::make_shared<CToggleButton>(boxPos, AnimationPath::builtin("sysopchk.def"), CButton::tooltip(CGI->generaltexth->translate("core.help.458.hover"), CGI->generaltexth->translate("core.help.458.hover")), [this](bool state){ searchInput(); });
-		showAllSpellsDescription = std::make_shared<CLabel>(boxPos.x + 40, boxPos.y + 12, FONT_SMALL, ETextAlignment::CENTERLEFT, Colors::WHITE, CGI->generaltexth->translate("core.help.458.hover"));
+		showAllSpells = std::make_shared<CToggleButton>(boxPos, AnimationPath::builtin("sysopchk.def"), CButton::tooltip(VLC->generaltexth->translate("core.help.458.hover"), VLC->generaltexth->translate("core.help.458.hover")), [this](bool state){ searchInput(); });
+		showAllSpellsDescription = std::make_shared<CLabel>(boxPos.x + 40, boxPos.y + 12, FONT_SMALL, ETextAlignment::CENTERLEFT, Colors::WHITE, VLC->generaltexth->translate("core.help.458.hover"));
 	}
 
 	processSpells();
@@ -238,8 +237,8 @@ void CSpellWindow::processSpells()
 	mySpells.clear();
 
 	//initializing castable spells
-	mySpells.reserve(CGI->spellh->objects.size());
-	for(auto const & spell : CGI->spellh->objects)
+	mySpells.reserve(VLC->spellh->objects.size());
+	for(auto const & spell : VLC->spellh->objects)
 	{
 		bool searchTextFound = !searchBox || TextOperations::textSearchSimilar(searchBox->getText(), spell->getNameTranslated());
 
@@ -603,7 +602,7 @@ void CSpellWindow::SpellArea::clickPressed(const Point & cursorPosition)
 		auto spellCost = owner->myInt->cb->getSpellCost(mySpell, owner->myHero);
 		if(spellCost > owner->myHero->mana) //insufficient mana
 		{
-			LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[206]) % spellCost % owner->myHero->mana));
+			LOCPLINT->showInfoDialog(boost::str(boost::format(VLC->generaltexth->allTexts[206]) % spellCost % owner->myHero->mana));
 			return;
 		}
 
@@ -640,7 +639,7 @@ void CSpellWindow::SpellArea::clickPressed(const Point & cursorPosition)
 				if(!texts.empty())
 					LOCPLINT->showInfoDialog(texts.front());
 				else
-					LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.spellUnknownProblem"));
+					LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.spellUnknownProblem"));
 			}
 		}
 		else //adventure spell
@@ -673,7 +672,7 @@ void CSpellWindow::SpellArea::clickPressed(const Point & cursorPosition)
 				if(!texts.empty())
 					LOCPLINT->showInfoDialog(texts.front());
 				else
-					LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.spellUnknownProblem"));
+					LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.spellUnknownProblem"));
 			}
 		}
 	}
@@ -689,7 +688,7 @@ void CSpellWindow::SpellArea::showPopupWindow(const Point & cursorPosition)
 			dmgInfo.clear();
 		else
 		{
-			dmgInfo = CGI->generaltexth->allTexts[343];
+			dmgInfo = VLC->generaltexth->allTexts[343];
 			boost::algorithm::replace_first(dmgInfo, "%d", std::to_string(causedDmg));
 		}
 
@@ -702,7 +701,7 @@ void CSpellWindow::SpellArea::hover(bool on)
 	if(mySpell)
 	{
 		if(on)
-			owner->statusBar->write(boost::str(boost::format("%s (%s)") % mySpell->getNameTranslated() % CGI->generaltexth->allTexts[171+mySpell->getLevel()]));
+			owner->statusBar->write(boost::str(boost::format("%s (%s)") % mySpell->getNameTranslated() % VLC->generaltexth->allTexts[171+mySpell->getLevel()]));
 		else
 			owner->statusBar->clear();
 	}
@@ -764,16 +763,16 @@ void CSpellWindow::SpellArea::setSpell(const CSpell * spell)
 		if(schoolLevel > 0)
 		{
 			boost::format fmt("%s/%s");
-			fmt % CGI->generaltexth->allTexts[171 + mySpell->getLevel()];
-			fmt % CGI->generaltexth->levels[3+(schoolLevel-1)];//lines 4-6
+			fmt % VLC->generaltexth->allTexts[171 + mySpell->getLevel()];
+			fmt % VLC->generaltexth->levels[3+(schoolLevel-1)];//lines 4-6
 			level->setText(fmt.str());
 		}
 		else
-			level->setText(CGI->generaltexth->allTexts[171 + mySpell->getLevel()]);
+			level->setText(VLC->generaltexth->allTexts[171 + mySpell->getLevel()]);
 
 		cost->color = secondLineColor;
 		boost::format costfmt("%s: %d");
-		costfmt % CGI->generaltexth->allTexts[387] % spellCost;
+		costfmt % VLC->generaltexth->allTexts[387] % spellCost;
 		cost->setText(costfmt.str());
 	}
 }

+ 3 - 3
client/windows/CTutorialWindow.cpp

@@ -14,8 +14,8 @@
 #include "../../lib/CConfigHandler.h"
 #include "../ConditionalWait.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
+#include "../../lib/VCMI_Lib.h"
 #include "../CPlayerInterface.h"
-#include "../CGameInfo.h"
 
 #include "../GameEngine.h"
 #include "../gui/Shortcut.h"
@@ -43,7 +43,7 @@ CTutorialWindow::CTutorialWindow(const TutorialMode & m)
 	if(mode == TutorialMode::TOUCH_ADVENTUREMAP) videos = { "RightClick", "MapPanning", "MapZooming", "RadialWheel" };
 	else if(mode == TutorialMode::TOUCH_BATTLE) videos = { "BattleDirection", "BattleDirectionAbort", "AbortSpell" };
 
-	labelTitle = std::make_shared<CLabel>(190, 15, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->translate("vcmi.tutorialWindow.title"));
+	labelTitle = std::make_shared<CLabel>(190, 15, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->translate("vcmi.tutorialWindow.title"));
 	labelInformation = std::make_shared<CMultiLineLabel>(Rect(5, 40, 370, 60), EFonts::FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, "");
 	buttonOk = std::make_shared<CButton>(Point(159, 367), AnimationPath::builtin("IOKAY"), CButton::tooltip(), std::bind(&CTutorialWindow::exit, this), EShortcut::GLOBAL_RETURN); //62x28
 	buttonLeft = std::make_shared<CButton>(Point(5, 217), AnimationPath::builtin("HSBTNS3"), CButton::tooltip(), std::bind(&CTutorialWindow::previous, this), EShortcut::MOVE_LEFT); //22x46
@@ -62,7 +62,7 @@ void CTutorialWindow::setContent()
 	buttonLeft->block(page<1);
 	buttonRight->block(page>videos.size() - 2);
 
-	labelInformation->setText(CGI->generaltexth->translate("vcmi.tutorialWindow.decription." + videos[page]));
+	labelInformation->setText(VLC->generaltexth->translate("vcmi.tutorialWindow.decription." + videos[page]));
 }
 
 void CTutorialWindow::openWindowFirstTime(const TutorialMode & m)

+ 0 - 1
client/windows/CWindowObject.cpp

@@ -25,7 +25,6 @@
 #include "../render/Canvas.h"
 #include "../render/CanvasImage.h"
 
-#include "../CGameInfo.h"
 #include "../CPlayerInterface.h"
 
 #include "../../CCallback.h"

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio