Selaa lähdekoodia

Renamed `LibClasses * VLC` to `GameLibrary * LIBRARY`

Ivan Savenko 8 kuukautta sitten
vanhempi
sitoutus
645b95ba02
100 muutettua tiedostoa jossa 591 lisäystä ja 591 poistoa
  1. 1 1
      AI/BattleAI/AttackPossibility.cpp
  2. 2 2
      AI/BattleAI/BattleEvaluator.cpp
  3. 1 1
      AI/BattleAI/BattleExchangeVariant.cpp
  4. 1 1
      AI/Nullkiller/AIGateway.h
  5. 6 6
      AI/Nullkiller/AIUtility.cpp
  6. 1 1
      AI/Nullkiller/AIUtility.h
  7. 1 1
      AI/Nullkiller/Analyzers/ArmyManager.cpp
  8. 1 1
      AI/Nullkiller/Analyzers/ArmyManager.h
  9. 1 1
      AI/Nullkiller/Analyzers/HeroManager.h
  10. 1 1
      AI/Nullkiller/Behaviors/BuildingBehavior.h
  11. 1 1
      AI/Nullkiller/Behaviors/BuyArmyBehavior.h
  12. 1 1
      AI/Nullkiller/Behaviors/CaptureObjectsBehavior.h
  13. 1 1
      AI/Nullkiller/Behaviors/ClusterBehavior.h
  14. 1 1
      AI/Nullkiller/Behaviors/DefenceBehavior.h
  15. 1 1
      AI/Nullkiller/Behaviors/ExplorationBehavior.h
  16. 1 1
      AI/Nullkiller/Behaviors/GatherArmyBehavior.h
  17. 1 1
      AI/Nullkiller/Behaviors/RecruitHeroBehavior.h
  18. 1 1
      AI/Nullkiller/Behaviors/StartupBehavior.h
  19. 1 1
      AI/Nullkiller/Behaviors/StayAtTownBehavior.h
  20. 3 3
      AI/Nullkiller/Engine/PriorityEvaluator.cpp
  21. 1 1
      AI/Nullkiller/Engine/Settings.cpp
  22. 1 1
      AI/Nullkiller/Goals/AbstractGoal.cpp
  23. 1 1
      AI/Nullkiller/Goals/AbstractGoal.h
  24. 2 2
      AI/Nullkiller/Goals/CompleteQuest.cpp
  25. 1 1
      AI/Nullkiller/Helpers/ArmyFormation.h
  26. 1 1
      AI/Nullkiller/Helpers/ExplorationHelper.h
  27. 1 1
      AI/VCAI/AIUtility.cpp
  28. 1 1
      AI/VCAI/AIUtility.h
  29. 1 1
      AI/VCAI/ArmyManager.h
  30. 1 1
      AI/VCAI/BuildingManager.h
  31. 1 1
      AI/VCAI/Goals/AbstractGoal.cpp
  32. 1 1
      AI/VCAI/Goals/AbstractGoal.h
  33. 1 1
      AI/VCAI/Goals/CompleteQuest.h
  34. 2 2
      AI/VCAI/Goals/GatherTroops.cpp
  35. 5 5
      AI/VCAI/MapObjectsEvaluator.cpp
  36. 1 1
      AI/VCAI/ResourceManager.h
  37. 1 1
      AI/VCAI/VCAI.cpp
  38. 1 1
      AI/VCAI/VCAI.h
  39. 3 3
      client/ArtifactsUIController.cpp
  40. 5 5
      client/CPlayerInterface.cpp
  41. 6 6
      client/CServerHandler.cpp
  42. 4 4
      client/Client.cpp
  43. 4 4
      client/ClientCommandManager.cpp
  44. 2 2
      client/GameChatHandler.cpp
  45. 1 1
      client/NetPacksClient.cpp
  46. 3 3
      client/adventureMap/AdventureMapInterface.cpp
  47. 9 9
      client/adventureMap/AdventureMapShortcuts.cpp
  48. 2 2
      client/adventureMap/AdventureOptions.cpp
  49. 6 6
      client/adventureMap/CInfoBar.cpp
  50. 2 2
      client/adventureMap/CList.cpp
  51. 2 2
      client/adventureMap/CMinimap.cpp
  52. 4 4
      client/adventureMap/CResDataBar.cpp
  53. 25 25
      client/battle/BattleActionsController.cpp
  54. 1 1
      client/battle/BattleEffectsController.cpp
  55. 1 1
      client/battle/BattleInterface.cpp
  56. 30 30
      client/battle/BattleInterfaceClasses.cpp
  57. 1 1
      client/battle/BattleStacksController.cpp
  58. 8 8
      client/battle/BattleWindow.cpp
  59. 5 5
      client/globalLobby/GlobalLobbyClient.cpp
  60. 6 6
      client/globalLobby/GlobalLobbyLoginWindow.cpp
  61. 4 4
      client/globalLobby/GlobalLobbyRoomWindow.cpp
  62. 9 9
      client/globalLobby/GlobalLobbyServerSetup.cpp
  63. 4 4
      client/gui/InterfaceObjectConfigurable.cpp
  64. 13 13
      client/lobby/CBonusSelection.cpp
  65. 18 18
      client/lobby/CLobbyScreen.cpp
  66. 3 3
      client/lobby/CSavingScreen.cpp
  67. 2 2
      client/lobby/CScenarioInfoScreen.cpp
  68. 28 28
      client/lobby/CSelectionBase.cpp
  69. 58 58
      client/lobby/OptionsTab.cpp
  70. 9 9
      client/lobby/OptionsTabBase.cpp
  71. 3 3
      client/lobby/RandomMapTab.cpp
  72. 22 22
      client/lobby/SelectionTab.cpp
  73. 1 1
      client/mainmenu/CCampaignScreen.cpp
  74. 20 20
      client/mainmenu/CHighScoreScreen.cpp
  75. 23 23
      client/mainmenu/CMainMenu.cpp
  76. 41 41
      client/mainmenu/CStatisticScreen.cpp
  77. 6 6
      client/mapView/MapRenderer.cpp
  78. 3 3
      client/mapView/mapHandler.cpp
  79. 3 3
      client/media/CMusicHandler.cpp
  80. 2 2
      client/media/CVideoHandler.cpp
  81. 4 4
      client/render/AssetGenerator.cpp
  82. 2 2
      client/render/Graphics.cpp
  83. 1 1
      client/render/IRenderHandler.h
  84. 2 2
      client/renderSDL/CBitmapFont.cpp
  85. 3 3
      client/renderSDL/FontChain.cpp
  86. 3 3
      client/widgets/Buttons.cpp
  87. 30 30
      client/widgets/CComponent.cpp
  88. 7 7
      client/widgets/CComponentHolder.cpp
  89. 10 10
      client/widgets/CGarrisonInt.cpp
  90. 13 13
      client/widgets/MiscWidgets.cpp
  91. 2 2
      client/widgets/RadialMenu.cpp
  92. 6 6
      client/widgets/markets/CAltarArtifacts.cpp
  93. 9 9
      client/widgets/markets/CAltarCreatures.cpp
  94. 5 5
      client/widgets/markets/CArtifactsBuying.cpp
  95. 6 6
      client/widgets/markets/CArtifactsSelling.cpp
  96. 6 6
      client/widgets/markets/CFreelancerGuild.cpp
  97. 6 6
      client/widgets/markets/CMarketBase.cpp
  98. 7 7
      client/widgets/markets/CMarketResources.cpp
  99. 6 6
      client/widgets/markets/CTransferResources.cpp
  100. 9 9
      client/widgets/markets/TradePanels.cpp

+ 1 - 1
AI/BattleAI/AttackPossibility.cpp

@@ -38,7 +38,7 @@ void DamageCache::buildObstacleDamageCache(std::shared_ptr<HypotheticBattle> hb,
 		if(!spellObstacle || !obst->triggersEffects())
 			continue;
 
-		auto triggerAbility = VLC->spells()->getById(obst->getTrigger());
+		auto triggerAbility = LIBRARY->spells()->getById(obst->getTrigger());
 		auto triggerIsNegative = triggerAbility->isNegative() || triggerAbility->isDamage();
 
 		if(!triggerIsNegative)

+ 2 - 2
AI/BattleAI/BattleEvaluator.cpp

@@ -426,7 +426,7 @@ BattleAction BattleEvaluator::goTowardsNearest(const CStack * stack, const Battl
 		{
 			if(obst->triggersEffects())
 			{
-				auto triggerAbility =  VLC->spells()->getById(obst->getTrigger());
+				auto triggerAbility =  LIBRARY->spells()->getById(obst->getTrigger());
 				auto triggerIsNegative = triggerAbility->isNegative() || triggerAbility->isDamage();
 
 				if(triggerIsNegative)
@@ -494,7 +494,7 @@ bool BattleEvaluator::attemptCastingSpell(const CStack * activeStack)
 	//Get all spells we can cast
 	std::vector<const CSpell*> possibleSpells;
 
-	for (auto const & s : VLC->spellh->objects)
+	for (auto const & s : LIBRARY->spellh->objects)
 		if (s->canBeCast(cb->getBattle(battleID).get(), spells::Mode::HERO, hero))
 			possibleSpells.push_back(s.get());
 

+ 1 - 1
AI/BattleAI/BattleExchangeVariant.cpp

@@ -349,7 +349,7 @@ MoveTarget BattleExchangeEvaluator::findMoveTowardsUnreachable(
 		logAi->trace(
 			"Checking movement towards %d of %s",
 			enemy->getCount(),
-			VLC->creatures()->getById(enemy->creatureId())->getJsonKey());
+			LIBRARY->creatures()->getById(enemy->creatureId())->getJsonKey());
 
 		auto distance = dists.distToNearestNeighbour(activeStack, enemy);
 

+ 1 - 1
AI/Nullkiller/AIGateway.h

@@ -15,7 +15,7 @@
 #include "../../CCallback.h"
 #include "../../lib/CThreadHelper.h"
 #include "../../lib/GameConstants.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 #include "../../lib/CCreatureHandler.h"
 #include "../../lib/mapObjects/MiscObjects.h"
 #include "../../lib/spells/CSpellHandler.h"

+ 6 - 6
AI/Nullkiller/AIUtility.cpp

@@ -328,9 +328,9 @@ double getArtifactBonusRelevance(const CGHeroInstance * hero, const std::shared_
 		uint64_t totalWeight = 0;
 		uint64_t knownWeight = 0;
 
-		for (auto spellID : VLC->spellh->getDefaultAllowed())
+		for (auto spellID : LIBRARY->spellh->getDefaultAllowed())
 		{
-			auto spell = spellID.toEntity(VLC);
+			auto spell = spellID.toEntity(LIBRARY);
 			if (!spell->hasSchool(school))
 				continue;
 
@@ -351,9 +351,9 @@ double getArtifactBonusRelevance(const CGHeroInstance * hero, const std::shared_
 		uint64_t totalWeight = 0;
 		uint64_t knownWeight = 0;
 
-		for (auto spellID : VLC->spellh->getDefaultAllowed())
+		for (auto spellID : LIBRARY->spellh->getDefaultAllowed())
 		{
-			auto spell = spellID.toEntity(VLC);
+			auto spell = spellID.toEntity(LIBRARY);
 			if (spell->getLevel() != level)
 				continue;
 
@@ -468,7 +468,7 @@ int32_t getArtifactBonusScoreImpl(const std::shared_ptr<Bonus> & bonus)
 		case BonusType::UNDEAD_RAISE_PERCENTAGE:
 			return bonus->val * 400;
 		case BonusType::GENERATE_RESOURCE:
-			return bonus->val * VLC->objh->resVals.at(bonus->subtype.as<GameResID>().getNum()) * 10;
+			return bonus->val * LIBRARY->objh->resVals.at(bonus->subtype.as<GameResID>().getNum()) * 10;
 		case BonusType::SPELL_DURATION:
 			return bonus->val * 200;
 		case BonusType::MAGIC_RESISTANCE:
@@ -569,7 +569,7 @@ int64_t getArtifactScoreForHero(const CGHeroInstance * hero, const CArtifactInst
 	if (artifact->isScroll())
 	{
 		auto spellID = artifact->getScrollSpellID();
-		auto spell = spellID.toEntity(VLC);
+		auto spell = spellID.toEntity(LIBRARY);
 
 		if (hero->getSpellsInSpellbook().count(spellID))
 			return 0;

+ 1 - 1
AI/Nullkiller/AIUtility.h

@@ -39,7 +39,7 @@
 
 /*********************** TBB.h ********************/
 
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 #include "../../lib/CCreatureHandler.h"
 #include "../../lib/spells/CSpellHandler.h"
 #include "../../lib/CStopWatch.h"

+ 1 - 1
AI/Nullkiller/Analyzers/ArmyManager.cpp

@@ -121,7 +121,7 @@ std::vector<SlotInfo>::iterator ArmyManager::getBestUnitForScout(std::vector<Slo
 		totalPower += unit.power;
 
 	int baseMovementCost = cb->getSettings().getInteger(EGameSettings::HEROES_MOVEMENT_COST_BASE);
-	bool terrainHasPenalty = armyTerrain.hasValue() && armyTerrain.toEntity(VLC)->moveCost != baseMovementCost;
+	bool terrainHasPenalty = armyTerrain.hasValue() && armyTerrain.toEntity(LIBRARY)->moveCost != baseMovementCost;
 
 	// arbitrary threshold - don't give scout more than specified part of total AI value of our army
 	uint64_t maxUnitValue = totalPower / 100;

+ 1 - 1
AI/Nullkiller/Analyzers/ArmyManager.h

@@ -13,7 +13,7 @@
 #include "../AIUtility.h"
 
 #include "../../../lib/GameConstants.h"
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 
 namespace NKAI
 {

+ 1 - 1
AI/Nullkiller/Analyzers/HeroManager.h

@@ -13,7 +13,7 @@
 #include "../AIUtility.h"
 
 #include "../../../lib/GameConstants.h"
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 
 namespace NKAI
 {

+ 1 - 1
AI/Nullkiller/Behaviors/BuildingBehavior.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "lib/VCMI_Lib.h"
+#include "lib/GameLibrary.h"
 #include "../AIUtility.h"
 #include "../Goals/CGoal.h"
 

+ 1 - 1
AI/Nullkiller/Behaviors/BuyArmyBehavior.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "lib/VCMI_Lib.h"
+#include "lib/GameLibrary.h"
 #include "../AIUtility.h"
 #include "../Goals/CGoal.h"
 

+ 1 - 1
AI/Nullkiller/Behaviors/CaptureObjectsBehavior.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 #include "../AIUtility.h"
 #include "../Goals/CGoal.h"
 #include "../Pathfinding/AINodeStorage.h"

+ 1 - 1
AI/Nullkiller/Behaviors/ClusterBehavior.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "lib/VCMI_Lib.h"
+#include "lib/GameLibrary.h"
 #include "../Goals/CGoal.h"
 #include "../AIUtility.h"
 

+ 1 - 1
AI/Nullkiller/Behaviors/DefenceBehavior.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "lib/VCMI_Lib.h"
+#include "lib/GameLibrary.h"
 #include "../Goals/CGoal.h"
 #include "../AIUtility.h"
 

+ 1 - 1
AI/Nullkiller/Behaviors/ExplorationBehavior.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "lib/VCMI_Lib.h"
+#include "lib/GameLibrary.h"
 #include "../Goals/CGoal.h"
 #include "../AIUtility.h"
 

+ 1 - 1
AI/Nullkiller/Behaviors/GatherArmyBehavior.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "lib/VCMI_Lib.h"
+#include "lib/GameLibrary.h"
 #include "../Goals/CGoal.h"
 #include "../AIUtility.h"
 

+ 1 - 1
AI/Nullkiller/Behaviors/RecruitHeroBehavior.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "lib/VCMI_Lib.h"
+#include "lib/GameLibrary.h"
 #include "../Goals/CGoal.h"
 #include "../AIUtility.h"
 

+ 1 - 1
AI/Nullkiller/Behaviors/StartupBehavior.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "lib/VCMI_Lib.h"
+#include "lib/GameLibrary.h"
 #include "../Goals/CGoal.h"
 #include "../AIUtility.h"
 

+ 1 - 1
AI/Nullkiller/Behaviors/StayAtTownBehavior.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "lib/VCMI_Lib.h"
+#include "lib/GameLibrary.h"
 #include "../Goals/CGoal.h"
 #include "../AIUtility.h"
 

+ 3 - 3
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -18,7 +18,7 @@
 #include "../../../lib/mapping/CMapDefines.h"
 #include "../../../lib/RoadHandler.h"
 #include "../../../lib/CCreatureHandler.h"
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 #include "../../../lib/StartInfo.h"
 #include "../../../CCallback.h"
 #include "../../../lib/filesystem/Filesystem.h"
@@ -309,7 +309,7 @@ uint64_t RewardEvaluator::getArmyReward(
 			{
 				for(auto artID : info.reward.artifacts)
 				{
-					const auto * art = dynamic_cast<const CArtifact *>(VLC->artifacts()->getById(artID));
+					const auto * art = dynamic_cast<const CArtifact *>(LIBRARY->artifacts()->getById(artID));
 
 					rewardValue += evaluateArtifactArmyValue(art);
 				}
@@ -694,7 +694,7 @@ float RewardEvaluator::getSkillReward(const CGObjectInstance * target, const CGH
 			{
 				for(auto spellID : info.reward.spells)
 				{
-					const spells::Spell * spell = VLC->spells()->getById(spellID);
+					const spells::Spell * spell = LIBRARY->spells()->getById(spellID);
 						
 					if(hero->canLearnSpell(spell) && !hero->spellbookContainsSpell(spellID))
 					{

+ 1 - 1
AI/Nullkiller/Engine/Settings.cpp

@@ -18,7 +18,7 @@
 #include "../../../lib/mapObjectConstructors/CBankInstanceConstructor.h"
 #include "../../../lib/mapObjects/MapObjects.h"
 #include "../../../lib/modding/CModHandler.h"
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 #include "../../../lib/filesystem/Filesystem.h"
 #include "../../../lib/json/JsonUtils.h"
 

+ 1 - 1
AI/Nullkiller/Goals/AbstractGoal.cpp

@@ -55,7 +55,7 @@ std::string AbstractGoal::toString() const
 		desc = "GATHER TROOPS";
 		break;
 	case GET_ART_TYPE:
-		desc = "GET ARTIFACT OF TYPE " + VLC->artifacts()->getByIndex(aid)->getNameTranslated();
+		desc = "GET ARTIFACT OF TYPE " + LIBRARY->artifacts()->getByIndex(aid)->getNameTranslated();
 		break;
 	case DIG_AT_TILE:
 		desc = "DIG AT TILE " + tile.toString();

+ 1 - 1
AI/Nullkiller/Goals/AbstractGoal.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 #include "../../../lib/mapObjects/CGTownInstance.h"
 #include "../../../lib/mapObjects/CGHeroInstance.h"
 #include "../AIUtility.h"

+ 2 - 2
AI/Nullkiller/Goals/CompleteQuest.cpp

@@ -11,7 +11,7 @@
 #include "CompleteQuest.h"
 #include "../Behaviors/CaptureObjectsBehavior.h"
 #include "../AIGateway.h"
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 #include "../../../lib/texts/CGeneralTextHandler.h"
 
 namespace NKAI
@@ -91,7 +91,7 @@ std::string CompleteQuest::questToString() const
 {
 	if(isKeyMaster(q))
 	{
-		return "find " + VLC->generaltexth->tentColors[q.obj->subID] + " keymaster tent";
+		return "find " + LIBRARY->generaltexth->tentColors[q.obj->subID] + " keymaster tent";
 	}
 
 	if(q.quest->questName == CQuest::missionName(EQuestMission::NONE))

+ 1 - 1
AI/Nullkiller/Helpers/ArmyFormation.h

@@ -12,7 +12,7 @@
 #include "../AIUtility.h"
 
 #include "../../../lib/GameConstants.h"
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 
 namespace NKAI
 {

+ 1 - 1
AI/Nullkiller/Helpers/ExplorationHelper.h

@@ -12,7 +12,7 @@
 #include "../AIUtility.h"
 
 #include "../../../lib/GameConstants.h"
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 #include "../Goals/AbstractGoal.h"
 
 namespace NKAI

+ 1 - 1
AI/VCAI/AIUtility.cpp

@@ -224,7 +224,7 @@ creInfo infoFromDC(const dwellingContent & dc)
 	ci.creID = dc.second.size() ? dc.second.back() : CreatureID(-1); //should never be accessed
 	if (ci.creID != CreatureID::NONE)
 	{
-		ci.cre = VLC->creatures()->getById(ci.creID);
+		ci.cre = LIBRARY->creatures()->getById(ci.creID);
 		ci.level = ci.cre->getLevel(); //this is creature tier, while tryRealize expects dwelling level. Ignore.
 	}
 	else

+ 1 - 1
AI/VCAI/AIUtility.h

@@ -9,7 +9,7 @@
  */
 #pragma once
 
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 #include "../../lib/CCreatureHandler.h"
 #include "../../lib/spells/CSpellHandler.h"
 #include "../../lib/CStopWatch.h"

+ 1 - 1
AI/VCAI/ArmyManager.h

@@ -13,7 +13,7 @@
 #include "AIUtility.h"
 
 #include "../../lib/GameConstants.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 #include "VCAI.h"
 
 struct SlotInfo

+ 1 - 1
AI/VCAI/BuildingManager.h

@@ -13,7 +13,7 @@
 #include "AIUtility.h"
 
 #include "../../lib/GameConstants.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 #include "VCAI.h"
 
 struct DLL_EXPORT PotentialBuilding

+ 1 - 1
AI/VCAI/Goals/AbstractGoal.cpp

@@ -85,7 +85,7 @@ std::string AbstractGoal::name() const //TODO: virtualize
 	}
 	break;
 	case GET_ART_TYPE:
-		desc = "GET ARTIFACT OF TYPE " + VLC->artifacts()->getByIndex(aid)->getNameTranslated();
+		desc = "GET ARTIFACT OF TYPE " + LIBRARY->artifacts()->getByIndex(aid)->getNameTranslated();
 		break;
 	case VISIT_TILE:
 		desc = "VISIT TILE " + tile.toString();

+ 1 - 1
AI/VCAI/Goals/AbstractGoal.h

@@ -9,7 +9,7 @@
 */
 #pragma once
 
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 #include "../../../lib/CCreatureHandler.h"
 #include "../AIUtility.h"
 

+ 1 - 1
AI/VCAI/Goals/CompleteQuest.h

@@ -10,7 +10,7 @@
 #pragma once
 
 #include "CGoal.h"
-#include "../../../lib/VCMI_Lib.h"
+#include "../../../lib/GameLibrary.h"
 #include "../../../lib/gameState/QuestInfo.h"
 
 namespace Goals

+ 2 - 2
AI/VCAI/Goals/GatherTroops.cpp

@@ -87,7 +87,7 @@ TGoalVec GatherTroops::getAllPossibleSubgoals()
 			continue;
 		}
 
-		auto creature = VLC->creatures()->getByIndex(objid);
+		auto creature = LIBRARY->creatures()->getByIndex(objid);
 		if(t->getFactionID() == creature->getFactionID()) //TODO: how to force AI to build unupgraded creatures? :O
 		{
 			auto tryFindCreature = [&]() -> std::optional<std::vector<CreatureID>>
@@ -135,7 +135,7 @@ TGoalVec GatherTroops::getAllPossibleSubgoals()
 			{
 				for(auto type : creature.second)
 				{
-					if(type.getNum() == objid && ai->ah->freeResources().canAfford(VLC->creatures()->getById(type)->getFullRecruitCost()))
+					if(type.getNum() == objid && ai->ah->freeResources().canAfford(LIBRARY->creatures()->getById(type)->getFullRecruitCost()))
 						vstd::concatenate(solutions, ai->ah->howToVisitObj(obj));
 				}
 			}

+ 5 - 5
AI/VCAI/MapObjectsEvaluator.cpp

@@ -10,7 +10,7 @@
 #include "StdInc.h"
 #include "MapObjectsEvaluator.h"
 #include "../../lib/GameConstants.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 #include "../../lib/CCreatureHandler.h"
 #include "../../lib/mapObjects/CompoundMapObjectID.h"
 #include "../../lib/mapObjectConstructors/AObjectTypeHandler.h"
@@ -31,11 +31,11 @@ MapObjectsEvaluator & MapObjectsEvaluator::getInstance()
 
 MapObjectsEvaluator::MapObjectsEvaluator()
 {
-	for(auto primaryID : VLC->objtypeh->knownObjects())
+	for(auto primaryID : LIBRARY->objtypeh->knownObjects())
 	{
-		for(auto secondaryID : VLC->objtypeh->knownSubObjects(primaryID))
+		for(auto secondaryID : LIBRARY->objtypeh->knownSubObjects(primaryID))
 		{
-			auto handler = VLC->objtypeh->getHandlerFor(primaryID, secondaryID);
+			auto handler = LIBRARY->objtypeh->getHandlerFor(primaryID, secondaryID);
 			if(handler && !handler->isStaticObject())
 			{
 				if(handler->getAiValue() != std::nullopt)
@@ -83,7 +83,7 @@ std::optional<int> MapObjectsEvaluator::getObjectValue(const CGObjectInstance *
 		{
 			for(auto & creatureID : creLevel.second)
 			{
-				auto creature = VLC->creatures()->getById(creatureID);
+				auto creature = LIBRARY->creatures()->getById(creatureID);
 				aiValue += (creature->getAIValue() * creature->getGrowth());
 			}
 		}

+ 1 - 1
AI/VCAI/ResourceManager.h

@@ -11,7 +11,7 @@
 
 #include "AIUtility.h"
 #include "../../lib/GameConstants.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 #include "VCAI.h"
 #include <boost/heap/binomial_heap.hpp>
 

+ 1 - 1
AI/VCAI/VCAI.cpp

@@ -1264,7 +1264,7 @@ void VCAI::recruitCreatures(const CGDwelling * d, const CArmedInstance * recruit
 		int count = d->creatures[i].first;
 		CreatureID creID = d->creatures[i].second.back();
 
-		vstd::amin(count, ah->freeResources() / VLC->creatures()->getById(creID)->getFullRecruitCost());
+		vstd::amin(count, ah->freeResources() / LIBRARY->creatures()->getById(creID)->getFullRecruitCost());
 		if(count > 0)
 			cb->recruitCreatures(d, recruiter, creID, count, i);
 	}

+ 1 - 1
AI/VCAI/VCAI.h

@@ -17,7 +17,7 @@
 #include "../../lib/CThreadHelper.h"
 
 #include "../../lib/GameConstants.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 #include "../../lib/CCreatureHandler.h"
 #include "../../lib/mapObjects/MiscObjects.h"
 #include "../../lib/spells/CSpellHandler.h"

+ 3 - 3
client/ArtifactsUIController.cpp

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

+ 5 - 5
client/CPlayerInterface.cpp

@@ -328,7 +328,7 @@ void CPlayerInterface::yourTurn(QueryID queryID)
 			adventureInt->onHotseatWaitStarted(playerID);
 
 			makingTurn = true;
-			std::string msg = VLC->generaltexth->allTexts[13];
+			std::string msg = LIBRARY->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));
@@ -1495,7 +1495,7 @@ void CPlayerInterface::playerBlocked(int reason, bool start)
 			GAME->setInterfaceInstance(this);
 			ENGINE->curInt = this;
 			adventureInt->onCurrentPlayerChanged(playerID);
-			std::string msg = VLC->generaltexth->translate("vcmi.adventureMap.playerAttacked");
+			std::string msg = LIBRARY->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));
@@ -1574,7 +1574,7 @@ void CPlayerInterface::gameOver(PlayerColor player, const EVictoryLossCheckResul
 	if (player == playerID)
 	{
 		if (victoryLossCheckResult.loss())
-			showInfoDialog(VLC->generaltexth->allTexts[95]);
+			showInfoDialog(LIBRARY->generaltexth->allTexts[95]);
 
 		assert(ENGINE->curInt == GAME->interface());
 		auto previousInterface = GAME->interface(); //without multiple player interfaces some of lines below are useless, but for hotseat we wanna swap player interface temporarily
@@ -1662,7 +1662,7 @@ void CPlayerInterface::tryDigging(const CGHeroInstance * h)
 	if(msgToShow < 0)
 		cb->dig(h);
 	else
-		showInfoDialog(VLC->generaltexth->allTexts[msgToShow]);
+		showInfoDialog(LIBRARY->generaltexth->allTexts[msgToShow]);
 }
 
 void CPlayerInterface::battleNewRoundFirst(const BattleID & battleID)
@@ -1815,7 +1815,7 @@ void CPlayerInterface::waitForAllDialogs()
 void CPlayerInterface::proposeLoadingGame()
 {
 	showYesNoDialog(
-		VLC->generaltexth->allTexts[68],
+		LIBRARY->generaltexth->allTexts[68],
 		[]()
 		{
 			GAME->server().endGameplay();

+ 6 - 6
client/CServerHandler.cpp

@@ -142,7 +142,7 @@ void CServerHandler::resetStateForLobby(EStartMode mode, ESelectionScreen screen
 	{
 		std::string playerName = settings["general"]["playerName"].String();
 		if(playerName == "Player")
-			playerName = VLC->generaltexth->translate("core.genrltxt.434");
+			playerName = LIBRARY->generaltexth->translate("core.genrltxt.434");
 		localPlayerNames.push_back(playerName);
 	}
 
@@ -228,7 +228,7 @@ void CServerHandler::onConnectionFailed(const std::string & errorMessage)
 	{
 		// remote server refused connection - show error message
 		setState(EClientState::NONE);
-		CInfoWindow::showInfoDialog(VLC->generaltexth->translate("vcmi.mainMenu.serverConnectionFailed"), {});
+		CInfoWindow::showInfoDialog(LIBRARY->generaltexth->translate("vcmi.mainMenu.serverConnectionFailed"), {});
 	}
 }
 
@@ -564,12 +564,12 @@ bool CServerHandler::validateGameStart(bool allowOnlyAI) const
 		std::string errorMsg;
 		if(!e.whatMissing().empty())
 		{
-			errorMsg += VLC->generaltexth->translate("vcmi.server.errors.modsToEnable") + '\n';
+			errorMsg += LIBRARY->generaltexth->translate("vcmi.server.errors.modsToEnable") + '\n';
 			errorMsg += e.whatMissing();
 		}
 		if(!e.whatExcessive().empty())
 		{
-			errorMsg += VLC->generaltexth->translate("vcmi.server.errors.modsToDisable") + '\n';
+			errorMsg += LIBRARY->generaltexth->translate("vcmi.server.errors.modsToDisable") + '\n';
 			errorMsg += e.whatExcessive();
 		}
 		showServerError(errorMsg);
@@ -892,7 +892,7 @@ void CServerHandler::onDisconnected(const std::shared_ptr<INetworkConnection> &
 	{
 		endGameplay();
 		CMM->menu->switchToTab("main");
-		showServerError(VLC->generaltexth->translate("vcmi.server.errors.disconnected"));
+		showServerError(LIBRARY->generaltexth->translate("vcmi.server.errors.disconnected"));
 	}
 	else
 	{
@@ -921,7 +921,7 @@ void CServerHandler::waitForServerShutdown()
 	{
 		if (getState() == EClientState::CONNECTING)
 		{
-			showServerError(VLC->generaltexth->translate("vcmi.server.errors.existingProcess"));
+			showServerError(LIBRARY->generaltexth->translate("vcmi.server.errors.existingProcess"));
 			setState(EClientState::CONNECTION_CANCELLED); // stop attempts to reconnect
 		}
 		logNetwork->error("Error: server failed to close correctly or crashed!");

+ 4 - 4
client/Client.cpp

@@ -58,7 +58,7 @@ CPlayerEnvironment::CPlayerEnvironment(PlayerColor player_, CClient * cl_, std::
 
 const Services * CPlayerEnvironment::services() const
 {
-	return VLC;
+	return LIBRARY;
 }
 
 vstd::CLoggerBase * CPlayerEnvironment::logger() const
@@ -91,7 +91,7 @@ CClient::~CClient() = default;
 
 const Services * CClient::services() const
 {
-	return VLC; //todo: this should be VLC
+	return LIBRARY; //todo: this should be LIBRARY
 }
 
 const CClient::BattleCb * CClient::battle(const BattleID & battleID) const
@@ -120,7 +120,7 @@ void CClient::newGame(CGameState * initializedGameState)
 	CMapService mapService;
 	assert(initializedGameState);
 	gs = initializedGameState;
-	gs->preInit(VLC, this);
+	gs->preInit(LIBRARY, this);
 	logNetwork->trace("\tCreating gamestate: %i", GAME->server().th->getDiff());
 	if(!initializedGameState)
 	{
@@ -142,7 +142,7 @@ void CClient::loadGame(CGameState * initializedGameState)
 	logNetwork->info("Game state was transferred over network, loading.");
 	gs = initializedGameState;
 
-	gs->preInit(VLC, this);
+	gs->preInit(LIBRARY, this);
 	gs->updateOnLoad(GAME->server().si.get());
 	logNetwork->info("Game loaded, initialize interfaces.");
 

+ 4 - 4
client/ClientCommandManager.cpp

@@ -188,7 +188,7 @@ void ClientCommandManager::handleRedrawCommand()
 void ClientCommandManager::handleTranslateGameCommand(bool onlyMissing)
 {
 	std::map<std::string, std::map<std::string, std::string>> textsByMod;
-	VLC->generaltexth->exportAllTexts(textsByMod, onlyMissing);
+	LIBRARY->generaltexth->exportAllTexts(textsByMod, onlyMissing);
 
 	const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / ( onlyMissing ? "translationMissing" : "translation");
 	boost::filesystem::create_directories(outPath);
@@ -267,7 +267,7 @@ void ClientCommandManager::handleTranslateMapsCommand()
 	}
 
 	std::map<std::string, std::map<std::string, std::string>> textsByMod;
-	VLC->generaltexth->exportAllTexts(textsByMod, false);
+	LIBRARY->generaltexth->exportAllTexts(textsByMod, false);
 
 	const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / "translation";
 	boost::filesystem::create_directories(outPath);
@@ -308,7 +308,7 @@ void ClientCommandManager::handleGetConfigCommand()
 
 	for(auto contentName : contentNames)
 	{
-		auto const & handler = *VLC->modh->content;
+		auto const & handler = *LIBRARY->modh->content;
 		auto const & content = handler[contentName];
 
 		auto contentOutPath = outPath / contentName;
@@ -346,7 +346,7 @@ void ClientCommandManager::handleGetScriptsCommand()
 
 	boost::filesystem::create_directories(outPath);
 
-	for(const auto & kv : VLC->scriptHandler->objects)
+	for(const auto & kv : LIBRARY->scriptHandler->objects)
 	{
 		std::string name = kv.first;
 		boost::algorithm::replace_all(name,":","_");

+ 2 - 2
client/GameChatHandler.cpp

@@ -24,7 +24,7 @@
 #include "../lib/networkPacks/PacksForLobby.h"
 #include "../lib/mapObjects/CArmedInstance.h"
 #include "../lib/CConfigHandler.h"
-#include "../lib/VCMI_Lib.h"
+#include "../lib/GameLibrary.h"
 #include "../lib/texts/CGeneralTextHandler.h"
 #include "../lib/texts/TextOperations.h"
 
@@ -94,7 +94,7 @@ void GameChatHandler::onNewGameMessageReceived(PlayerColor sender, const std::st
 		playerName = GAME->interface()->cb->getStartInfo()->playerInfos.at(sender).name;
 
 	if (sender.isSpectator())
-		playerName = VLC->generaltexth->translate("vcmi.lobby.login.spectator");
+		playerName = LIBRARY->generaltexth->translate("vcmi.lobby.login.spectator");
 
 	chatHistory.push_back({playerName, messageText, timeFormatted});
 

+ 1 - 1
client/NetPacksClient.cpp

@@ -32,7 +32,7 @@
 #include "../lib/filesystem/FileInfo.h"
 #include "../lib/serializer/Connection.h"
 #include "../lib/texts/CGeneralTextHandler.h"
-#include "../lib/VCMI_Lib.h"
+#include "../lib/GameLibrary.h"
 #include "../lib/mapping/CMap.h"
 #include "../lib/VCMIDirs.h"
 #include "../lib/spells/CSpellHandler.h"

+ 3 - 3
client/adventureMap/AdventureMapInterface.cpp

@@ -787,7 +787,7 @@ void AdventureMapInterface::showMoveDetailsInStatusbar(const CGHeroInstance & he
 
 	totalMovementCost -= pathNode.moveRemains;
 
-	std::string result = VLC->generaltexth->translate("vcmi.adventureMap", pathNode.turns > 0 ? "moveCostDetails" : "moveCostDetailsNoTurns");
+	std::string result = LIBRARY->generaltexth->translate("vcmi.adventureMap", pathNode.turns > 0 ? "moveCostDetails" : "moveCostDetailsNoTurns");
 
 	boost::replace_first(result, "%TURNS", std::to_string(pathNode.turns));
 	boost::replace_first(result, "%POINTS", std::to_string(movementPointsLastTurnCost));
@@ -810,7 +810,7 @@ void AdventureMapInterface::onTileRightClicked(const int3 &mapPos)
 
 	if(!GAME->interface()->cb->isVisible(mapPos))
 	{
-		CRClickPopup::createAndPush(VLC->generaltexth->allTexts[61]); //Uncharted Territory
+		CRClickPopup::createAndPush(LIBRARY->generaltexth->allTexts[61]); //Uncharted Territory
 		return;
 	}
 
@@ -853,7 +853,7 @@ void AdventureMapInterface::exitCastingMode()
 void AdventureMapInterface::hotkeyAbortCastingMode()
 {
 	exitCastingMode();
-	GAME->interface()->showInfoDialog(VLC->generaltexth->allTexts[731]); //Spell cancelled
+	GAME->interface()->showInfoDialog(LIBRARY->generaltexth->allTexts[731]); //Spell cancelled
 }
 
 void AdventureMapInterface::performSpellcasting(const int3 & dest)

+ 9 - 9
client/adventureMap/AdventureMapShortcuts.cpp

@@ -289,14 +289,14 @@ void AdventureMapShortcuts::endTurn()
 
 				if(!GAME->interface()->localState->hasPath(hero))
 				{
-					GAME->interface()->showYesNoDialog( VLC->generaltexth->allTexts[55], [this](){ owner.hotkeyEndingTurn(); }, nullptr);
+					GAME->interface()->showYesNoDialog( LIBRARY->generaltexth->allTexts[55], [this](){ owner.hotkeyEndingTurn(); }, nullptr);
 					return;
 				}
 
 				auto path = GAME->interface()->localState->getPath(hero);
 				if (path.nodes.size() < 2 || path.nodes[path.nodes.size() - 2].turns)
 				{
-					GAME->interface()->showYesNoDialog( VLC->generaltexth->allTexts[55], [this](){ owner.hotkeyEndingTurn(); }, nullptr);
+					GAME->interface()->showYesNoDialog( LIBRARY->generaltexth->allTexts[55], [this](){ owner.hotkeyEndingTurn(); }, nullptr);
 					return;
 				}
 			}
@@ -316,7 +316,7 @@ void AdventureMapShortcuts::showThievesGuild()
 	if(itr != GAME->interface()->localState->getOwnedTowns().end())
 		GAME->interface()->showThievesGuildWindow(*itr);
 	else
-		GAME->interface()->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"));
+		GAME->interface()->showInfoDialog(LIBRARY->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"));
 }
 
 void AdventureMapShortcuts::showScenarioInfo()
@@ -327,7 +327,7 @@ void AdventureMapShortcuts::showScenarioInfo()
 void AdventureMapShortcuts::toMainMenu()
 {
 	GAME->interface()->showYesNoDialog(
-		VLC->generaltexth->allTexts[578],
+		LIBRARY->generaltexth->allTexts[578],
 		[]()
 		{
 			GAME->server().endGameplay();
@@ -340,7 +340,7 @@ void AdventureMapShortcuts::toMainMenu()
 void AdventureMapShortcuts::newGame()
 {
 	GAME->interface()->showYesNoDialog(
-		VLC->generaltexth->allTexts[578],
+		LIBRARY->generaltexth->allTexts[578],
 		[]()
 		{
 			GAME->server().endGameplay();
@@ -353,7 +353,7 @@ void AdventureMapShortcuts::newGame()
 void AdventureMapShortcuts::quitGame()
 {
 	GAME->interface()->showYesNoDialog(
-		VLC->generaltexth->allTexts[578],
+		LIBRARY->generaltexth->allTexts[578],
 		[]()
 		{
 			ENGINE->dispatchMainThread( []()
@@ -391,7 +391,7 @@ void AdventureMapShortcuts::viewPuzzleMap()
 void AdventureMapShortcuts::restartGame()
 {
 	GAME->interface()->showYesNoDialog(
-		VLC->generaltexth->translate("vcmi.adventureMap.confirmRestartGame"),
+		LIBRARY->generaltexth->translate("vcmi.adventureMap.confirmRestartGame"),
 		[]()
 		{
 			ENGINE->dispatchMainThread(
@@ -440,7 +440,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
-		GAME->interface()->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
+		GAME->interface()->showInfoDialog(LIBRARY->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
 }
 
 void AdventureMapShortcuts::firstTown()
@@ -516,7 +516,7 @@ void AdventureMapShortcuts::search(bool next)
 	if(next)
 		selectObjOnMap(lastSel);
 	else
-		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);
+		ENGINE->windows().createAndPushWindow<CObjectListWindow>(texts, nullptr, LIBRARY->generaltexth->translate("vcmi.adventureMap.search.hover"), LIBRARY->generaltexth->translate("vcmi.adventureMap.search.help"), [selectObjOnMap](int index){ selectObjOnMap(index); }, lastSel, std::vector<std::shared_ptr<IImage>>(), true);
 }
 
 void AdventureMapShortcuts::nextObject()

+ 2 - 2
client/adventureMap/AdventureOptions.cpp

@@ -22,7 +22,7 @@
 #include "../widgets/Buttons.h"
 
 #include "../../CCallback.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 #include "../../lib/StartInfo.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 
@@ -47,7 +47,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([]{ GAME->interface()->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.replayOpponentTurnNotImplemented")); });
+	replay->addCallback([]{ GAME->interface()->showInfoDialog(LIBRARY->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);
 }

+ 6 - 6
client/adventureMap/CInfoBar.cpp

@@ -80,9 +80,9 @@ CInfoBar::VisibleDateInfo::VisibleDateInfo()
 
 	std::string labelText;
 	if(GAME->interface()->cb->getDate(Date::DAY_OF_WEEK) == 1 && GAME->interface()->cb->getDate(Date::DAY) != 1) // monday of any week but first - show new week info
-		labelText = VLC->generaltexth->allTexts[63] + " " + std::to_string(GAME->interface()->cb->getDate(Date::WEEK));
+		labelText = LIBRARY->generaltexth->allTexts[63] + " " + std::to_string(GAME->interface()->cb->getDate(Date::WEEK));
 	else
-		labelText = VLC->generaltexth->allTexts[64] + " " + std::to_string(GAME->interface()->cb->getDate(Date::DAY_OF_WEEK));
+		labelText = LIBRARY->generaltexth->allTexts[64] + " " + std::to_string(GAME->interface()->cb->getDate(Date::DAY_OF_WEEK));
 
 	label = std::make_shared<CLabel>(95, 31, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, labelText);
 
@@ -151,8 +151,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, VLC->generaltexth->allTexts[390] + ":");
-	enemyLabel = std::make_shared<CLabel>(10, 136, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[391] + ":");
+	allyLabel = std::make_shared<CLabel>(10, 106, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[390] + ":");
+	enemyLabel = std::make_shared<CLabel>(10, 136, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[391] + ":");
 
 	int posx = allyLabel->pos.w + allyLabel->pos.x - pos.x + 4;
 	for(PlayerColor & player : allies)
@@ -308,13 +308,13 @@ void CInfoBar::clickReleased(const Point & cursorPosition, bool lastActivated)
 
 void CInfoBar::showPopupWindow(const Point & cursorPosition)
 {
-	CRClickPopup::createAndPush(VLC->generaltexth->allTexts[109]);
+	CRClickPopup::createAndPush(LIBRARY->generaltexth->allTexts[109]);
 }
 
 void CInfoBar::hover(bool on)
 {
 	if(on)
-		ENGINE->statusbar()->write(VLC->generaltexth->zelp[292].first);
+		ENGINE->statusbar()->write(LIBRARY->generaltexth->zelp[292].first);
 	else
 		ENGINE->statusbar()->clear();
 }

+ 2 - 2
client/adventureMap/CList.cpp

@@ -265,7 +265,7 @@ void CHeroList::CHeroItem::showTooltip()
 
 std::string CHeroList::CHeroItem::getHoverText()
 {
-	return boost::str(boost::format(VLC->generaltexth->allTexts[15]) % hero->getNameTranslated() % hero->getClassNameTranslated()) + hero->getMovementPointsTextIfOwner(hero->getOwner());
+	return boost::str(boost::format(LIBRARY->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 +315,7 @@ void CHeroList::CHeroItem::keyPressed(EShortcut key)
 
 	if(key == EShortcut::LIST_HERO_DISMISS)
 	{
-		GAME->interface()->showYesNoDialog(VLC->generaltexth->allTexts[22], [=](){ GAME->interface()->cb->dismissHero(hero); }, nullptr);
+		GAME->interface()->showYesNoDialog(LIBRARY->generaltexth->allTexts[22], [=](){ GAME->interface()->cb->dismissHero(hero); }, nullptr);
 		return;
 	}
 

+ 2 - 2
client/adventureMap/CMinimap.cpp

@@ -159,13 +159,13 @@ void CMinimap::clickPressed(const Point & cursorPosition)
 
 void CMinimap::showPopupWindow(const Point & cursorPosition)
 {
-	CRClickPopup::createAndPush(VLC->generaltexth->zelp[291].second);
+	CRClickPopup::createAndPush(LIBRARY->generaltexth->zelp[291].second);
 }
 
 void CMinimap::hover(bool on)
 {
 	if(on)
-		ENGINE->statusbar()->write(VLC->generaltexth->zelp[291].first);
+		ENGINE->statusbar()->write(LIBRARY->generaltexth->zelp[291].first);
 	else
 		ENGINE->statusbar()->clear();
 }

+ 4 - 4
client/adventureMap/CResDataBar.cpp

@@ -23,7 +23,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/ResourceSet.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 CResDataBar::CResDataBar(const ImagePath & imageName, const Point & position)
 {
@@ -62,9 +62,9 @@ std::string CResDataBar::buildDateString()
 	std::string pattern = "%s: %d, %s: %d, %s: %d";
 
 	auto formatted = boost::format(pattern)
-		% VLC->generaltexth->translate("core.genrltxt.62") % GAME->interface()->cb->getDate(Date::MONTH)
-		% VLC->generaltexth->translate("core.genrltxt.63") % GAME->interface()->cb->getDate(Date::WEEK)
-		% VLC->generaltexth->translate("core.genrltxt.64") % GAME->interface()->cb->getDate(Date::DAY_OF_WEEK);
+		% LIBRARY->generaltexth->translate("core.genrltxt.62") % GAME->interface()->cb->getDate(Date::MONTH)
+		% LIBRARY->generaltexth->translate("core.genrltxt.63") % GAME->interface()->cb->getDate(Date::WEEK)
+		% LIBRARY->generaltexth->translate("core.genrltxt.64") % GAME->interface()->cb->getDate(Date::DAY_OF_WEEK);
 
 	return boost::str(formatted);
 }

+ 25 - 25
client/battle/BattleActionsController.cpp

@@ -55,8 +55,8 @@ static std::string replacePlaceholders(std::string input, const TextReplacementL
 static std::string translatePlural(int amount, const std::string& baseTextID)
 {
 	if(amount == 1)
-		return VLC->generaltexth->translate(baseTextID + ".1");
-	return VLC->generaltexth->translate(baseTextID);
+		return LIBRARY->generaltexth->translate(baseTextID + ".1");
+	return LIBRARY->generaltexth->translate(baseTextID);
 }
 
 static std::string formatPluralImpl(int amount, const std::string & amountString, const std::string & baseTextID)
@@ -93,7 +93,7 @@ static std::string formatAttack(const DamageEstimation & estimation, const std::
 		{ "%KILLS", formatPlural(estimation.kills, "vcmi.battleWindow.damageEstimation.kills") },
 	};
 
-	return replacePlaceholders(VLC->generaltexth->translate(baseTextID), replacements);
+	return replacePlaceholders(LIBRARY->generaltexth->translate(baseTextID), replacements);
 }
 
 static std::string formatMeleeAttack(const DamageEstimation & estimation, const std::string & creatureName)
@@ -117,7 +117,7 @@ static std::string formatRangedAttack(const DamageEstimation & estimation, const
 static std::string formatRetaliation(const DamageEstimation & estimation, bool mayBeKilled)
 {
 	if (estimation.damage.max == 0)
-		return VLC->generaltexth->translate("vcmi.battleWindow.damageRetaliation.never");
+		return LIBRARY->generaltexth->translate("vcmi.battleWindow.damageRetaliation.never");
 
 	std::string baseTextID = estimation.kills.max == 0 ?
 								 "vcmi.battleWindow.damageRetaliation.damage" :
@@ -127,7 +127,7 @@ static std::string formatRetaliation(const DamageEstimation & estimation, bool m
 		"vcmi.battleWindow.damageRetaliation.may" :
 		"vcmi.battleWindow.damageRetaliation.will";
 
-	return VLC->generaltexth->translate(prefixTextID) + formatAttack(estimation, "", baseTextID, 0);
+	return LIBRARY->generaltexth->translate(prefixTextID) + formatAttack(estimation, "", baseTextID, 0);
 }
 
 BattleActionsController::BattleActionsController(BattleInterface & owner):
@@ -507,14 +507,14 @@ std::string BattleActionsController::actionGetStatusMessage(PossiblePlayerBattle
 	switch (action.get()) //display console message, realize selected action
 	{
 		case PossiblePlayerBattleAction::CHOOSE_TACTICS_STACK:
-			return (boost::format(VLC->generaltexth->allTexts[481]) % targetStack->getName()).str(); //Select %s
+			return (boost::format(LIBRARY->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(VLC->generaltexth->allTexts[295]) % owner.stacksController->getActiveStack()->getName()).str(); //Fly %s here
+				return (boost::format(LIBRARY->generaltexth->allTexts[295]) % owner.stacksController->getActiveStack()->getName()).str(); //Fly %s here
 			else
-				return (boost::format(VLC->generaltexth->allTexts[294]) % owner.stacksController->getActiveStack()->getName()).str(); //Move %s here
+				return (boost::format(LIBRARY->generaltexth->allTexts[294]) % owner.stacksController->getActiveStack()->getName()).str(); //Move %s here
 
 		case PossiblePlayerBattleAction::ATTACK:
 		case PossiblePlayerBattleAction::WALK_AND_ATTACK:
@@ -539,7 +539,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(VLC->generaltexth->allTexts[26]) % spellLikeAttackBonus->subtype.as<SpellID>().toSpell()->getNameTranslated());
+				return boost::str(boost::format(LIBRARY->generaltexth->allTexts[26]) % spellLikeAttackBonus->subtype.as<SpellID>().toSpell()->getNameTranslated());
 			}
 
 			const auto * shooter = owner.stacksController->getActiveStack();
@@ -553,37 +553,37 @@ std::string BattleActionsController::actionGetStatusMessage(PossiblePlayerBattle
 		}
 
 		case PossiblePlayerBattleAction::AIMED_SPELL_CREATURE:
-			return boost::str(boost::format(VLC->generaltexth->allTexts[27]) % action.spell().toSpell()->getNameTranslated() % targetStack->getName()); //Cast %s on %s
+			return boost::str(boost::format(LIBRARY->generaltexth->allTexts[27]) % action.spell().toSpell()->getNameTranslated() % targetStack->getName()); //Cast %s on %s
 
 		case PossiblePlayerBattleAction::ANY_LOCATION:
-			return boost::str(boost::format(VLC->generaltexth->allTexts[26]) % action.spell().toSpell()->getNameTranslated()); //Cast %s
+			return boost::str(boost::format(LIBRARY->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(VLC->generaltexth->allTexts[301]) % targetStack->getName()); //Cast a spell on %
+			return boost::str(boost::format(LIBRARY->generaltexth->allTexts[301]) % targetStack->getName()); //Cast a spell on %
 
 		case PossiblePlayerBattleAction::TELEPORT:
-			return VLC->generaltexth->allTexts[25]; //Teleport Here
+			return LIBRARY->generaltexth->allTexts[25]; //Teleport Here
 
 		case PossiblePlayerBattleAction::OBSTACLE:
-			return VLC->generaltexth->allTexts[550];
+			return LIBRARY->generaltexth->allTexts[550];
 
 		case PossiblePlayerBattleAction::SACRIFICE:
-			return (boost::format(VLC->generaltexth->allTexts[549]) % targetStack->getName()).str(); //sacrifice the %s
+			return (boost::format(LIBRARY->generaltexth->allTexts[549]) % targetStack->getName()).str(); //sacrifice the %s
 
 		case PossiblePlayerBattleAction::FREE_LOCATION:
-			return boost::str(boost::format(VLC->generaltexth->allTexts[26]) % action.spell().toSpell()->getNameTranslated()); //Cast %s
+			return boost::str(boost::format(LIBRARY->generaltexth->allTexts[26]) % action.spell().toSpell()->getNameTranslated()); //Cast %s
 
 		case PossiblePlayerBattleAction::HEAL:
-			return (boost::format(VLC->generaltexth->allTexts[419]) % targetStack->getName()).str(); //Apply first aid to the %s
+			return (boost::format(LIBRARY->generaltexth->allTexts[419]) % targetStack->getName()).str(); //Apply first aid to the %s
 
 		case PossiblePlayerBattleAction::CATAPULT:
 			return ""; // TODO
 
 		case PossiblePlayerBattleAction::CREATURE_INFO:
-			return (boost::format(VLC->generaltexth->allTexts[297]) % targetStack->getName()).str();
+			return (boost::format(LIBRARY->generaltexth->allTexts[297]) % targetStack->getName()).str();
 
 		case PossiblePlayerBattleAction::HERO_INFO:
-			return  VLC->generaltexth->translate("core.genrltxt.417"); // "View Hero Stats"
+			return  LIBRARY->generaltexth->translate("core.genrltxt.417"); // "View Hero Stats"
 	}
 	assert(0);
 	return "";
@@ -595,16 +595,16 @@ std::string BattleActionsController::actionGetStatusMessageBlocked(PossiblePlaye
 	{
 		case PossiblePlayerBattleAction::AIMED_SPELL_CREATURE:
 		case PossiblePlayerBattleAction::RANDOM_GENIE_SPELL:
-			return VLC->generaltexth->allTexts[23];
+			return LIBRARY->generaltexth->allTexts[23];
 			break;
 		case PossiblePlayerBattleAction::TELEPORT:
-			return VLC->generaltexth->allTexts[24]; //Invalid Teleport Destination
+			return LIBRARY->generaltexth->allTexts[24]; //Invalid Teleport Destination
 			break;
 		case PossiblePlayerBattleAction::SACRIFICE:
-			return VLC->generaltexth->allTexts[543]; //choose army to sacrifice
+			return LIBRARY->generaltexth->allTexts[543]; //choose army to sacrifice
 			break;
 		case PossiblePlayerBattleAction::FREE_LOCATION:
-			return boost::str(boost::format(VLC->generaltexth->allTexts[181]) % action.spell().toSpell()->getNameTranslated()); //No room to place %s here
+			return boost::str(boost::format(LIBRARY->generaltexth->allTexts[181]) % action.spell().toSpell()->getNameTranslated()); //No room to place %s here
 			break;
 		default:
 			return "";
@@ -874,7 +874,7 @@ void BattleActionsController::onHexHovered(const BattleHex & hoveredHex)
 {
 	if (owner.openingPlaying())
 	{
-		currentConsoleMsg = VLC->generaltexth->translate("vcmi.battleWindow.pressKeyToSkipIntro");
+		currentConsoleMsg = LIBRARY->generaltexth->translate("vcmi.battleWindow.pressKeyToSkipIntro");
 		ENGINE->statusbar()->write(currentConsoleMsg);
 		return;
 	}
@@ -1064,7 +1064,7 @@ void BattleActionsController::onHexRightClicked(const BattleHex & clickedHex)
 	if (heroSpellcastingModeActive() || isCurrentStackInSpellcastMode)
 	{
 		endCastingSpell();
-		CRClickPopup::createAndPush(VLC->generaltexth->translate("core.genrltxt.731")); // spell cancelled
+		CRClickPopup::createAndPush(LIBRARY->generaltexth->translate("core.genrltxt.731")); // spell cancelled
 		return;
 	}
 

+ 1 - 1
client/battle/BattleEffectsController.cpp

@@ -82,7 +82,7 @@ void BattleEffectsController::battleTriggerEffect(const BattleTriggerEffect & bt
 			break;
 		case BonusType::MORALE:
 		{
-			std::string hlp = VLC->generaltexth->allTexts[33];
+			std::string hlp = LIBRARY->generaltexth->allTexts[33];
 			boost::algorithm::replace_first(hlp,"%s",(stack->getName()));
 			displayEffect(EBattleEffect::GOOD_MORALE, AudioPath::builtin("GOODMRLE"), stack->getPosition());
 			owner.appendBattleLog(hlp);

+ 1 - 1
client/battle/BattleInterface.cpp

@@ -257,7 +257,7 @@ void BattleInterface::newRoundFirst()
 
 void BattleInterface::newRound()
 {
-	console->addText(VLC->generaltexth->allTexts[412]);
+	console->addText(LIBRARY->generaltexth->allTexts[412]);
 	round++;
 }
 

+ 30 - 30
client/battle/BattleInterfaceClasses.cpp

@@ -462,7 +462,7 @@ std::vector<std::tuple<SpellID, bool>> QuickSpellPanel::getSpells() const
 		if(spellIds[i] != SpellID::NONE)
 			continue;
 
-		for(const auto & availableSpellID : VLC->spellh->getDefaultAllowed())
+		for(const auto & availableSpellID : LIBRARY->spellh->getDefaultAllowed())
 		{
 			const auto * availableSpell = availableSpellID.toSpell();
 			if(!availableSpell->isAdventure() && !availableSpell->isCreatureAbility() && hero->canCastThisSpell(availableSpell) && !vstd::contains(spellIds, availableSpell->getId()))
@@ -572,10 +572,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, 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>(9, 75, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[380] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 87, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[381] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 99, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[382] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 111, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->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 +583,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, VLC->generaltexth->allTexts[384] + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 143, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[385] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 131, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[384] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 143, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->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, VLC->generaltexth->allTexts[387]));
+	labels.push_back(std::make_shared<CLabel>(39, 174, EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->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 +633,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(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 attack = std::to_string(LIBRARY->creatures()->getByIndex(stack->creatureIndex())->getAttack(stack->isShooter())) + "(" + std::to_string(stack->getAttack(stack->isShooter())) + ")";
+	auto defense = std::to_string(LIBRARY->creatures()->getByIndex(stack->creatureIndex())->getDefense(stack->isShooter())) + "(" + std::to_string(stack->getDefense(stack->isShooter())) + ")";
+	auto damage = std::to_string(LIBRARY->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 +644,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, 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>(9, 75, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[380] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 87, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[381] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 99, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[386] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 111, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->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 +655,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, VLC->generaltexth->allTexts[384] + ":"));
-	labels.push_back(std::make_shared<CLabel>(9, 143, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[385] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 131, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[384] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 143, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->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, VLC->generaltexth->allTexts[389] + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 168, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->translate("vcmi.battleWindow.killed") + ":"));
+	labels.push_back(std::make_shared<CLabel>(9, 180, EFonts::FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->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 +702,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, VLC->generaltexth->allTexts[674]));
+		labelsMultiline.push_back(std::make_shared<CMultiLineLabel>(Rect(firstPos.x, firstPos.y, 48, 36), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->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 +750,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, VLC->generaltexth->translate("vcmi.battleResultsWindow.applyResultsLabel")));
+		labels.push_back(std::make_shared<CLabel>(232, 520, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->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, VLC->generaltexth->allTexts[410]));
+		labels.push_back(std::make_shared<CLabel>(59, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[410]));
 	}
 	else
 	{
-		labels.push_back(std::make_shared<CLabel>(59, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[411]));
+		labels.push_back(std::make_shared<CLabel>(59, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[411]));
 	}
 	
 	if(br.winner == BattleSide::DEFENDER)
 	{
-		labels.push_back(std::make_shared<CLabel>(412, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[410]));
+		labels.push_back(std::make_shared<CLabel>(412, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[410]));
 	}
 	else
 	{
-		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>(408, 124, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[411]));
 	}
 
-	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]));
+	labels.push_back(std::make_shared<CLabel>(232, 302, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW,  LIBRARY->generaltexth->allTexts[407]));
+	labels.push_back(std::make_shared<CLabel>(232, 332, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[408]));
+	labels.push_back(std::make_shared<CLabel>(232, 428, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[409]));
 
 	std::string sideNames[2] = {"N/A", "N/A"};
 
@@ -817,7 +817,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, VLC->generaltexth->allTexts[523]));
+			labels.push_back(std::make_shared<CLabel>(235, 360 + 97 * static_cast<int>(step), FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[523]));
 		}
 		else
 		{
@@ -825,7 +825,7 @@ BattleResultWindow::BattleResultWindow(const BattleResult & br, CPlayerInterface
 			int yPos = 344 + static_cast<int>(step) * 97;
 			for(auto & elem : br.casualties[step])
 			{
-				auto creature = VLC->creatures()->getByIndex(elem.first);
+				auto creature = LIBRARY->creatures()->getByIndex(elem.first);
 				if (creature->getId() == CreatureID::ARROW_TOWERS )
 					continue; // do not show destroyed towers in battle results
 

+ 1 - 1
client/battle/BattleStacksController.cpp

@@ -262,7 +262,7 @@ std::shared_ptr<IImage> BattleStacksController::getStackAmountBox(const CStack *
 
 	for(const auto & spellID : activeSpells)
 	{
-		auto positiveness = VLC->spells()->getByIndex(spellID)->getPositiveness();
+		auto positiveness = LIBRARY->spells()->getByIndex(spellID)->getPositiveness();
 		if(!boost::logic::indeterminate(positiveness))
 		{
 			if(positiveness)

+ 8 - 8
client/battle/BattleWindow.cpp

@@ -561,7 +561,7 @@ void BattleWindow::bSurrenderf()
 			enemyHeroName = "#ENEMY#";
 		}
 
-		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."
+		std::string surrenderMessage = boost::str(boost::format(LIBRARY->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 +574,7 @@ void BattleWindow::bFleef()
 	if ( owner.getBattle()->battleCanFlee() )
 	{
 		auto ony = std::bind(&BattleWindow::reallyFlee,this);
-		owner.curInt->showYesNoDialog(VLC->generaltexth->allTexts[28], ony, nullptr); //Are you sure you want to retreat?
+		owner.curInt->showYesNoDialog(LIBRARY->generaltexth->allTexts[28], ony, nullptr); //Are you sure you want to retreat?
 	}
 	else
 	{
@@ -588,7 +588,7 @@ void BattleWindow::bFleef()
 			if (owner.defendingHeroInstance->tempOwner == owner.curInt->cb->getPlayerID())
 				heroName = owner.defendingHeroInstance->getNameTranslated();
 		//calculating text
-		auto txt = boost::format(VLC->generaltexth->allTexts[340]) % heroName; //The Shackles of War are present.  %s can not retreat!
+		auto txt = boost::format(LIBRARY->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 +605,7 @@ void BattleWindow::reallySurrender()
 {
 	if (owner.curInt->cb->getResourceAmount(EGameResID::GOLD) < owner.getBattle()->battleGetSurrenderCost())
 	{
-		owner.curInt->showInfoDialog(VLC->generaltexth->allTexts[29]); //You don't have enough gold!
+		owner.curInt->showInfoDialog(LIBRARY->generaltexth->allTexts[29]); //You don't have enough gold!
 	}
 	else
 	{
@@ -746,13 +746,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.
-			GAME->interface()->showInfoDialog(boost::str(boost::format(VLC->generaltexth->allTexts[683])
-										% heroName % VLC->artifacts()->getByIndex(artID)->getNameTranslated()));
+			GAME->interface()->showInfoDialog(boost::str(boost::format(LIBRARY->generaltexth->allTexts[683])
+										% heroName % LIBRARY->artifacts()->getByIndex(artID)->getNameTranslated()));
 		}
 		else if(blockingBonus->source == BonusSource::OBJECT_TYPE)
 		{
 			if(blockingBonus->sid.as<MapObjectID>() == Obj::GARRISON || blockingBonus->sid.as<MapObjectID>() == Obj::GARRISON2)
-				GAME->interface()->showInfoDialog(VLC->generaltexth->allTexts[684]);
+				GAME->interface()->showInfoDialog(LIBRARY->generaltexth->allTexts[684]);
 		}
 	}
 	else
@@ -892,7 +892,7 @@ void BattleWindow::endWithAutocombat()
 		return;
 
 	GAME->interface()->showYesNoDialog(
-		VLC->generaltexth->translate("vcmi.battleWindow.endWithAutocombat"),
+		LIBRARY->generaltexth->translate("vcmi.battleWindow.endWithAutocombat"),
 		[this]()
 		{
 			owner.curInt->isAutoFightEndBattle = true;

+ 5 - 5
client/globalLobby/GlobalLobbyClient.cpp

@@ -29,7 +29,7 @@
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/MetaString.h"
 #include "../../lib/texts/TextOperations.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 GlobalLobbyClient::GlobalLobbyClient()
 {
@@ -38,8 +38,8 @@ GlobalLobbyClient::GlobalLobbyClient()
 	if (customChannels.empty())
 	{
 		activeChannels.emplace_back("english");
-		if (VLC->generaltexth->getPreferredLanguage() != "english")
-			activeChannels.emplace_back(VLC->generaltexth->getPreferredLanguage());
+		if (LIBRARY->generaltexth->getPreferredLanguage() != "english")
+			activeChannels.emplace_back(LIBRARY->generaltexth->getPreferredLanguage());
 	}
 	else
 	{
@@ -380,7 +380,7 @@ void GlobalLobbyClient::sendClientRegister(const std::string & accountName)
 	JsonNode toSend;
 	toSend["type"].String() = "clientRegister";
 	toSend["displayName"].String() = accountName;
-	toSend["language"].String() = VLC->generaltexth->getPreferredLanguage();
+	toSend["language"].String() = LIBRARY->generaltexth->getPreferredLanguage();
 	toSend["version"].String() = VCMI_VERSION_STRING;
 	sendMessage(toSend);
 }
@@ -391,7 +391,7 @@ void GlobalLobbyClient::sendClientLogin()
 	toSend["type"].String() = "clientLogin";
 	toSend["accountID"].String() = getAccountID();
 	toSend["accountCookie"].String() = getAccountCookie();
-	toSend["language"].String() = VLC->generaltexth->getPreferredLanguage();
+	toSend["language"].String() = LIBRARY->generaltexth->getPreferredLanguage();
 	toSend["version"].String() = VCMI_VERSION_STRING;
 
 	for (const auto & language : activeChannels)

+ 6 - 6
client/globalLobby/GlobalLobbyLoginWindow.cpp

@@ -27,7 +27,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/MetaString.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 GlobalLobbyLoginWindow::GlobalLobbyLoginWindow()
 	: CWindowObject(BORDERED)
@@ -42,8 +42,8 @@ GlobalLobbyLoginWindow::GlobalLobbyLoginWindow()
 	loginAs.replaceRawString(GAME->server().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, 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"));
+	labelTitle = std::make_shared<CLabel>( pos.w / 2, 20, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->translate("vcmi.lobby.login.title"));
+	labelUsernameTitle = std::make_shared<CLabel>( 10, 65, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->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);
@@ -53,8 +53,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(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);
+	buttonRegister->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.lobby.login.create"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonLogin->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.lobby.login.login"), EFonts::FONT_SMALL, Colors::YELLOW);
 
 	toggleMode = std::make_shared<CToggleGroup>(nullptr);
 	toggleMode->addToggle(0, buttonRegister);
@@ -110,7 +110,7 @@ void GlobalLobbyLoginWindow::onClose()
 
 void GlobalLobbyLoginWindow::onLogin()
 {
-	labelStatus->setText(VLC->generaltexth->translate("vcmi.lobby.login.connecting"));
+	labelStatus->setText(LIBRARY->generaltexth->translate("vcmi.lobby.login.connecting"));
 	if(!GAME->server().getGlobalLobby().isConnected())
 		GAME->server().getGlobalLobby().connect();
 	else

+ 4 - 4
client/globalLobby/GlobalLobbyRoomWindow.cpp

@@ -30,7 +30,7 @@
 #include "../../lib/modding/ModDescription.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/MetaString.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 GlobalLobbyRoomAccountCard::GlobalLobbyRoomAccountCard(const GlobalLobbyAccount & accountDescription)
 {
@@ -64,7 +64,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, VLC->generaltexth->translate("vcmi.lobby.mod.state." + statusToString.at(modInfo.status)));
+	labelStatus = std::make_shared<CLabel>(5, 30, FONT_SMALL, ETextAlignment::CENTERLEFT, statusColor, LIBRARY->generaltexth->translate("vcmi.lobby.mod.state." + statusToString.at(modInfo.status)));
 }
 
 static std::string getJoinRoomErrorMessage(const GlobalLobbyRoom & roomDescription, const std::vector<GlobalLobbyRoomModInfo> & modVerificationList)
@@ -129,14 +129,14 @@ GlobalLobbyRoomWindow::GlobalLobbyRoomWindow(GlobalLobbyWindow * window, const s
 		GlobalLobbyRoomModInfo modInfo;
 		modInfo.status = modEntry.second;
 		if (modEntry.second == ModVerificationStatus::EXCESSIVE)
-			modInfo.version = VLC->modh->getModInfo(modEntry.first).getVersion().toString();
+			modInfo.version = LIBRARY->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 = VLC->modh->getModInfo(modEntry.first).getName();
+			modInfo.modName = LIBRARY->modh->getModInfo(modEntry.first).getName();
 
 		modVerificationList.push_back(modInfo);
 	}

+ 9 - 9
client/globalLobby/GlobalLobbyServerSetup.cpp

@@ -25,7 +25,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/MetaString.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 GlobalLobbyServerSetup::GlobalLobbyServerSetup()
 	: CWindowObject(BORDERED)
@@ -36,10 +36,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, 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"));
+	labelTitle = std::make_shared<CLabel>( pos.w / 2, 20, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->translate("vcmi.lobby.room.create"));
+	labelPlayerLimit = std::make_shared<CLabel>( pos.w / 2, 48, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->translate("vcmi.lobby.room.players.limit"));
+	labelRoomType = std::make_shared<CLabel>( pos.w / 2, 108, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->translate("vcmi.lobby.room.type"));
+	labelGameMode = std::make_shared<CLabel>( pos.w / 2, 158, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->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));
@@ -54,8 +54,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(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);
+	buttonPublic->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.lobby.room.state.public"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonPrivate->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.lobby.room.state.private"), EFonts::FONT_SMALL, Colors::YELLOW);
 
 	toggleRoomType = std::make_shared<CToggleGroup>(nullptr);
 	toggleRoomType->addToggle(0, buttonPublic);
@@ -65,8 +65,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(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);
+	buttonNewGame->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.lobby.room.new"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonLoadGame->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.lobby.room.load"), EFonts::FONT_SMALL, Colors::YELLOW);
 
 	toggleGameMode = std::make_shared<CToggleGroup>(nullptr);
 	toggleGameMode->addToggle(0, buttonNewGame);

+ 4 - 4
client/gui/InterfaceObjectConfigurable.cpp

@@ -35,7 +35,7 @@
 #include "../../lib/json/JsonUtils.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/filesystem/ResourcePath.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 InterfaceObjectConfigurable::InterfaceObjectConfigurable(const JsonNode & config, int used, Point offset):
 	InterfaceObjectConfigurable(used, offset)
@@ -186,7 +186,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 VLC->generaltexth->translate(s);
+	return LIBRARY->generaltexth->translate(s);
 }
 
 Point InterfaceObjectConfigurable::readPosition(const JsonNode & config) const
@@ -304,8 +304,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  = VLC->generaltexth->translate( config.String(), "hover");
-			result.second = VLC->generaltexth->translate( config.String(), "help");
+			result.first  = LIBRARY->generaltexth->translate( config.String(), "hover");
+			result.second = LIBRARY->generaltexth->translate( config.String(), "help");
 		}
 	}
 	return result;

+ 13 - 13
client/lobby/CBonusSelection.cpp

@@ -92,29 +92,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, VLC->generaltexth->allTexts[38]);
+	labelCampaignDescription = std::make_shared<CLabel>(481, 63, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, LIBRARY->generaltexth->allTexts[38]);
 	campaignDescription = std::make_shared<CTextBox>(getCampaign()->getDescriptionTranslated(), Rect(480, 86, 286, 117), 1);
 
 	bool videoButtonActive = GAME->server().getState() == EClientState::GAMEPLAY;
 	int availableSpace = videoButtonActive ? 225 : 285;
 	mapName = std::make_shared<CLabel>(481, 219, FONT_BIG, ETextAlignment::TOPLEFT, Colors::YELLOW, GAME->server().mi->getNameTranslated(), availableSpace );
-	labelMapDescription = std::make_shared<CLabel>(481, 253, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, VLC->generaltexth->allTexts[496]);
+	labelMapDescription = std::make_shared<CLabel>(481, 253, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, LIBRARY->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, VLC->generaltexth->allTexts[71]);
+	labelChooseBonus = std::make_shared<CLabel>(475, 432, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[71]);
 	groupBonuses = std::make_shared<CToggleGroup>(std::bind(&IServerAPI::setCampaignBonus, &GAME->server(), _1));
 
 	flagbox = std::make_shared<CFlagBox>(Rect(486, 407, 335, 23));
 
 	std::vector<std::string> difficulty;
-	std::string difficultyString = VLC->generaltexth->allTexts[492];
+	std::string difficultyString = LIBRARY->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(VLC->generaltexth->zelp[24 + b].second); });
+		difficultyIconAreas[b] = std::make_shared<LRClickableArea>(difficultyIcons[b]->pos - pos.topLeft(), nullptr, [b]() { CRClickPopup::createAndPush(LIBRARY->generaltexth->zelp[24 + b].second); });
 	}
 
 	if(getCampaign()->playerSelectedDifficulty())
@@ -145,8 +145,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"), 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);
+		buttonExtraOptions = std::make_shared<CButton>(Point(643, 431), AnimationPath::builtin("GSPBUT2.DEF"), LIBRARY->generaltexth->zelp[46], [this]{ tabExtraOptions->setEnabled(!tabExtraOptions->isActive()); ENGINE->windows().totalRedraw(); }, EShortcut::LOBBY_EXTRA_OPTIONS);
+		buttonExtraOptions->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.optionsTab.extraOptions.hover"), FONT_SMALL, Colors::WHITE);
 	}
 }
 
@@ -213,8 +213,8 @@ void CBonusSelection::createBonusesIcons()
 			picName = graphics->ERMUtoPicture[faction][buildID];
 			picNumber = -1;
 
-			if(vstd::contains((*VLC->townh)[faction]->town->buildings, buildID))
-				desc.appendTextID((*VLC->townh)[faction]->town->buildings.find(buildID)->second->getNameTextID());
+			if(vstd::contains((*LIBRARY->townh)[faction]->town->buildings, buildID))
+				desc.appendTextID((*LIBRARY->townh)[faction]->town->buildings.find(buildID)->second->getNameTextID());
 			break;
 		}
 		case CampaignBonusType::ARTIFACT:
@@ -248,7 +248,7 @@ void CBonusSelection::createBonusesIcons()
 			for(int v = 0; v < toPrint.size(); ++v)
 			{
 				substitute += std::to_string(toPrint[v].second);
-				substitute += " " + VLC->generaltexth->primarySkillNames[toPrint[v].first];
+				substitute += " " + LIBRARY->generaltexth->primarySkillNames[toPrint[v].first];
 				if(v != toPrint.size() - 1)
 				{
 					substitute += ", ";
@@ -314,7 +314,7 @@ void CBonusSelection::createBonusesIcons()
 			else
 			{
 				desc.appendLocalString(EMetaText::GENERAL_TXT, 715); // Start with %s
-				desc.replaceTextID(VLC->heroh->objects[bonDescs[i].info2]->getNameTextID());
+				desc.replaceTextID(LIBRARY->heroh->objects[bonDescs[i].info2]->getNameTextID());
 			}
 			break;
 		}
@@ -450,7 +450,7 @@ void CBonusSelection::startMap()
 	if(GAME->interface()) // we're currently ingame, so ask for starting new map and end game
 	{
 		close();
-		GAME->interface()->showYesNoDialog(VLC->generaltexth->allTexts[67], [=]()
+		GAME->interface()->showYesNoDialog(LIBRARY->generaltexth->allTexts[67], [=]()
 		{
 			showPrologVideo();
 		}, 0);
@@ -465,7 +465,7 @@ void CBonusSelection::restartMap()
 {
 	close();
 	GAME->interface()->showYesNoDialog(
-		VLC->generaltexth->allTexts[67],
+		LIBRARY->generaltexth->allTexts[67],
 		[=]()
 		{
 			ENGINE->dispatchMainThread(

+ 18 - 18
client/lobby/CLobbyScreen.cpp

@@ -35,7 +35,7 @@
 #include "../../lib/mapping/CMapInfo.h"
 #include "../../lib/networkPacks/PacksForLobby.h"
 #include "../../lib/rmg/CMapGenOptions.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 	: CSelectionBase(screenType), bonusSel(nullptr)
@@ -48,7 +48,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 	{
 		tabSel->callOnSelect = std::bind(&IServerAPI::setMapInfo, &GAME->server(), _1, nullptr);
 
-		buttonSelect = std::make_shared<CButton>(Point(411, 80), AnimationPath::builtin("GSPBUTT.DEF"), VLC->generaltexth->zelp[45], 0, EShortcut::LOBBY_SELECT_SCENARIO);
+		buttonSelect = std::make_shared<CButton>(Point(411, 80), AnimationPath::builtin("GSPBUTT.DEF"), LIBRARY->generaltexth->zelp[45], 0, EShortcut::LOBBY_SELECT_SCENARIO);
 		buttonSelect->addCallback([=]()
 		{
 			toggleTab(tabSel);
@@ -56,16 +56,16 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 				GAME->server().setMapInfo(tabSel->getSelectedMapInfo());
 		});
 
-		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);
+		buttonOptions = std::make_shared<CButton>(Point(411, 510), AnimationPath::builtin("GSPBUTT.DEF"), LIBRARY->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"), 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);
+			buttonTurnOptions = std::make_shared<CButton>(Point(619, 105), AnimationPath::builtin("GSPBUT2.DEF"), LIBRARY->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"), LIBRARY->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"), VLC->generaltexth->zelp[48], std::bind(&CLobbyScreen::toggleChat, this), EShortcut::LOBBY_TOGGLE_CHAT);
-	buttonChat->setTextOverlay(VLC->generaltexth->allTexts[532], FONT_SMALL, Colors::WHITE);
+	buttonChat = std::make_shared<CButton>(Point(619, 80), AnimationPath::builtin("GSPBUT2.DEF"), LIBRARY->generaltexth->zelp[48], std::bind(&CLobbyScreen::toggleChat, this), EShortcut::LOBBY_TOGGLE_CHAT);
+	buttonChat->setTextOverlay(LIBRARY->generaltexth->allTexts[532], FONT_SMALL, Colors::WHITE);
 
 	switch(screenType)
 	{
@@ -76,7 +76,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 		tabExtraOptions = std::make_shared<ExtraOptionsTab>();
 		tabRand = std::make_shared<RandomMapTab>();
 		tabRand->mapInfoChanged += std::bind(&IServerAPI::setMapInfo, &GAME->server(), _1, _2);
-		buttonRMG = std::make_shared<CButton>(Point(411, 105), AnimationPath::builtin("GSPBUTT.DEF"), VLC->generaltexth->zelp[47], 0, EShortcut::LOBBY_RANDOM_MAP);
+		buttonRMG = std::make_shared<CButton>(Point(411, 105), AnimationPath::builtin("GSPBUTT.DEF"), LIBRARY->generaltexth->zelp[47], 0, EShortcut::LOBBY_RANDOM_MAP);
 		buttonRMG->addCallback([this]()
 		{
 			toggleTab(tabRand);
@@ -86,7 +86,7 @@ CLobbyScreen::CLobbyScreen(ESelectionScreen screenType, bool hideScreen)
 
 		card->iconDifficulty->addCallback(std::bind(&IServerAPI::setDifficulty, &GAME->server(), _1));
 
-		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);
+		buttonStart = std::make_shared<CButton>(Point(411, 535), AnimationPath::builtin("SCNRBEG.DEF"), LIBRARY->generaltexth->zelp[103], std::bind(&CLobbyScreen::startScenario, this, false), EShortcut::LOBBY_BEGIN_STANDARD_GAME);
 		initLobby();
 		break;
 	}
@@ -95,7 +95,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"), VLC->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"), LIBRARY->generaltexth->zelp[103], std::bind(&CLobbyScreen::startScenario, this, false), EShortcut::LOBBY_LOAD_GAME);
 		initLobby();
 		break;
 	}
@@ -107,7 +107,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"), VLC->generaltexth->zelp[105], [&]()
+	buttonBack = std::make_shared<CButton>(Point(581, 535), AnimationPath::builtin("SCNRBACK.DEF"), LIBRARY->generaltexth->zelp[105], [&]()
 	{
 		bool wasInLobbyRoom = GAME->server().inLobbyRoom();
 		GAME->server().sendClientDisconnecting();
@@ -196,18 +196,18 @@ void CLobbyScreen::toggleMode(bool host)
 		return;
 
 	auto buttonColor = host ? Colors::WHITE : Colors::ORANGE;
-	buttonSelect->setTextOverlay("  " + VLC->generaltexth->allTexts[500], FONT_SMALL, buttonColor);
-	buttonOptions->setTextOverlay(VLC->generaltexth->allTexts[501], FONT_SMALL, buttonColor);
+	buttonSelect->setTextOverlay("  " + LIBRARY->generaltexth->allTexts[500], FONT_SMALL, buttonColor);
+	buttonOptions->setTextOverlay(LIBRARY->generaltexth->allTexts[501], FONT_SMALL, buttonColor);
 
 	if (buttonTurnOptions)
-		buttonTurnOptions->setTextOverlay(VLC->generaltexth->translate("vcmi.optionsTab.turnOptions.hover"), FONT_SMALL, buttonColor);
+		buttonTurnOptions->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.optionsTab.turnOptions.hover"), FONT_SMALL, buttonColor);
 
 	if (buttonExtraOptions)
-		buttonExtraOptions->setTextOverlay(VLC->generaltexth->translate("vcmi.optionsTab.extraOptions.hover"), FONT_SMALL, buttonColor);
+		buttonExtraOptions->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.optionsTab.extraOptions.hover"), FONT_SMALL, buttonColor);
 
 	if(buttonRMG)
 	{
-		buttonRMG->setTextOverlay("  " + VLC->generaltexth->allTexts[740], FONT_SMALL, buttonColor);
+		buttonRMG->setTextOverlay("  " + LIBRARY->generaltexth->allTexts[740], FONT_SMALL, buttonColor);
 		buttonRMG->block(!host);
 	}
 	buttonSelect->block(!host);
@@ -231,9 +231,9 @@ void CLobbyScreen::toggleChat()
 {
 	card->toggleChat();
 	if(card->showChat)
-		buttonChat->setTextOverlay(VLC->generaltexth->allTexts[531], FONT_SMALL, Colors::WHITE);
+		buttonChat->setTextOverlay(LIBRARY->generaltexth->allTexts[531], FONT_SMALL, Colors::WHITE);
 	else
-		buttonChat->setTextOverlay(VLC->generaltexth->allTexts[532], FONT_SMALL, Colors::WHITE);
+		buttonChat->setTextOverlay(LIBRARY->generaltexth->allTexts[532], FONT_SMALL, Colors::WHITE);
 }
 
 void CLobbyScreen::updateAfterStateChange()

+ 3 - 3
client/lobby/CSavingScreen.cpp

@@ -26,7 +26,7 @@
 #include "../../lib/filesystem/Filesystem.h"
 #include "../../lib/mapping/CMapInfo.h"
 #include "../../lib/mapping/CMapHeader.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 CSavingScreen::CSavingScreen()
 	: CSelectionBase(ESelectionScreen::saveGame)
@@ -41,7 +41,7 @@ CSavingScreen::CSavingScreen()
 	tabSel->toggleMode();
 	curTab = tabSel;
 		
-	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);
+	buttonStart = std::make_shared<CButton>(Point(411, 535), AnimationPath::builtin("SCNRSAV.DEF"), LIBRARY->generaltexth->zelp[103], std::bind(&CSavingScreen::saveGame, this), EShortcut::LOBBY_SAVE_GAME);
 	
 	GAME->interface()->gamePause(true);
 }
@@ -91,7 +91,7 @@ void CSavingScreen::saveGame()
 
 	if(CResourceHandler::get("local")->existsResource(ResourcePath(path, EResType::SAVEGAME)))
 	{
-		std::string hlp = VLC->generaltexth->allTexts[493]; //%s exists. Overwrite?
+		std::string hlp = LIBRARY->generaltexth->allTexts[493]; //%s exists. Overwrite?
 		boost::algorithm::replace_first(hlp, "%s", tabSel->inputName->getText());
 		GAME->interface()->showYesNoDialog(hlp, overWrite, nullptr);
 	}

+ 2 - 2
client/lobby/CScenarioInfoScreen.cpp

@@ -24,7 +24,7 @@
 #include "../../lib/StartInfo.h"
 #include "../../lib/mapping/CMapInfo.h"
 #include "../../lib/mapping/CMapHeader.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 CScenarioInfoScreen::CScenarioInfoScreen()
 {
@@ -46,7 +46,7 @@ CScenarioInfoScreen::CScenarioInfoScreen()
 	card->changeSelection();
 
 	card->iconDifficulty->setSelected(getCurrentDifficulty());
-	buttonBack = std::make_shared<CButton>(Point(584, 535), AnimationPath::builtin("SCNRBACK.DEF"), VLC->generaltexth->zelp[105], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
+	buttonBack = std::make_shared<CButton>(Point(584, 535), AnimationPath::builtin("SCNRBACK.DEF"), LIBRARY->generaltexth->zelp[105], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
 }
 
 CScenarioInfoScreen::~CScenarioInfoScreen()

+ 28 - 28
client/lobby/CSelectionBase.cpp

@@ -53,7 +53,7 @@
 #include "../../lib/entities/faction/CFaction.h"
 #include "../../lib/entities/faction/CTown.h"
 #include "../../lib/entities/faction/CTownHandler.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 ISelectionScreenInfo::ISelectionScreenInfo(ESelectionScreen ScreenType)
 	: screenType(ScreenType)
@@ -102,7 +102,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"), VLC->generaltexth->zelp[105], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
+	buttonBack = std::make_shared<CButton>(Point(581, 535), AnimationPath::builtin("SCNRBACK.DEF"), LIBRARY->generaltexth->zelp[105], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
 }
 
 void CSelectionBase::toggleTab(std::shared_ptr<CIntObject> tab)
@@ -149,15 +149,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"), VLC->generaltexth->zelp[105], [](){ GAME->server().getGlobalLobby().activateRoomInviteInterface(); }, EShortcut::LOBBY_INVITE_PLAYERS );
-	buttonOpenGlobalLobby = std::make_shared<CButton>(Point(188, 365), AnimationPath::builtin("pregameReturnToLobby"), VLC->generaltexth->zelp[105], [](){ GAME->server().getGlobalLobby().activateInterface(); }, EShortcut::MAIN_MENU_LOBBY );
+	buttonInvitePlayers = std::make_shared<CButton>(Point(20, 365), AnimationPath::builtin("pregameInvitePlayers"), LIBRARY->generaltexth->zelp[105], [](){ GAME->server().getGlobalLobby().activateRoomInviteInterface(); }, EShortcut::LOBBY_INVITE_PLAYERS );
+	buttonOpenGlobalLobby = std::make_shared<CButton>(Point(188, 365), AnimationPath::builtin("pregameReturnToLobby"), LIBRARY->generaltexth->zelp[105], [](){ GAME->server().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, VLC->generaltexth->allTexts[38]);
+		labelCampaignDescription = std::make_shared<CLabel>(26, 132, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, LIBRARY->generaltexth->allTexts[38]);
 	}
 	else
 	{
@@ -176,7 +176,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]), VLC->generaltexth->zelp[24 + i]);
+				auto button = std::make_shared<CToggleButton>(Point(110 + i * 32, 450), AnimationPath::builtin(difButns[i]), LIBRARY->generaltexth->zelp[24 + i]);
 
 				iconDifficulty->addToggle(i, button);
 				if(SEL->screenType != ESelectionScreen::newGame)
@@ -185,13 +185,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, 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]);
+		labelMapDiff = std::make_shared<CLabel>(33, 430, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, LIBRARY->generaltexth->allTexts[494]);
+		labelPlayerDifficulty = std::make_shared<CLabel>(133, 430, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, LIBRARY->generaltexth->allTexts[492] + ":");
+		labelRating = std::make_shared<CLabel>(290, 430, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, LIBRARY->generaltexth->allTexts[218] + ":");
+		labelScenarioName = std::make_shared<CLabel>(26, 22, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, LIBRARY->generaltexth->allTexts[495]);
+		labelScenarioDescription = std::make_shared<CLabel>(26, 132, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, LIBRARY->generaltexth->allTexts[496]);
+		labelVictoryCondition = std::make_shared<CLabel>(26, 283, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, LIBRARY->generaltexth->allTexts[497]);
+		labelLossCondition = std::make_shared<CLabel>(26, 339, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::YELLOW, LIBRARY->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);
 
@@ -248,7 +248,7 @@ void InfoCard::changeSelection()
 	iconsLossCondition->setFrame(header->defeatIconIndex);
 	labelLossConditionText->setText(header->defeatMessage.toString());
 	flagbox->recreate();
-	labelDifficulty->setText(VLC->generaltexth->arraytxt[142 + vstd::to_underlying(mapInfo->mapHeader->difficulty)]);
+	labelDifficulty->setText(LIBRARY->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)
@@ -423,35 +423,35 @@ PvPBox::PvPBox(const Rect & rect)
 		return bannedTowns;
 	};
 
-	buttonFlipCoin = std::make_shared<CButton>(Point(190, 6), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", VLC->generaltexth->translate("vcmi.lobby.pvp.coin.help")), [](){
+	buttonFlipCoin = std::make_shared<CButton>(Point(190, 6), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", LIBRARY->generaltexth->translate("vcmi.lobby.pvp.coin.help")), [](){
 		LobbyPvPAction lpa;
 		lpa.action = LobbyPvPAction::COIN;
 		GAME->server().sendLobbyPack(lpa);
 	}, EShortcut::LOBBY_FLIP_COIN);
-	buttonFlipCoin->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.pvp.coin.hover"), EFonts::FONT_SMALL, Colors::WHITE);
+	buttonFlipCoin->setTextOverlay(LIBRARY->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("", VLC->generaltexth->translate("vcmi.lobby.pvp.randomTown.help")), [getBannedTowns](){
+	buttonRandomTown = std::make_shared<CButton>(Point(190, 31), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", LIBRARY->generaltexth->translate("vcmi.lobby.pvp.randomTown.help")), [getBannedTowns](){
 		LobbyPvPAction lpa;
 		lpa.action = LobbyPvPAction::RANDOM_TOWN;
 		lpa.bannedTowns = getBannedTowns();
 		GAME->server().sendLobbyPack(lpa);
 	}, EShortcut::LOBBY_RANDOM_TOWN);
-	buttonRandomTown->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.pvp.randomTown.hover"), EFonts::FONT_SMALL, Colors::WHITE);
+	buttonRandomTown->setTextOverlay(LIBRARY->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("", VLC->generaltexth->translate("vcmi.lobby.pvp.randomTownVs.help")), [getBannedTowns](){
+	buttonRandomTownVs = std::make_shared<CButton>(Point(190, 56), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", LIBRARY->generaltexth->translate("vcmi.lobby.pvp.randomTownVs.help")), [getBannedTowns](){
 		LobbyPvPAction lpa;
 		lpa.action = LobbyPvPAction::RANDOM_TOWN_VS;
 		lpa.bannedTowns = getBannedTowns();
 		GAME->server().sendLobbyPack(lpa);
 	}, EShortcut::LOBBY_RANDOM_TOWN_VS);
-	buttonRandomTownVs->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.pvp.randomTownVs.hover"), EFonts::FONT_SMALL, Colors::WHITE);
+	buttonRandomTownVs->setTextOverlay(LIBRARY->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("", VLC->generaltexth->translate("vcmi.lobby.handicap")), [](){
+	buttonHandicap = std::make_shared<CButton>(Point(190, 81), AnimationPath::builtin("GSPBUT2.DEF"), CButton::tooltip("", LIBRARY->generaltexth->translate("vcmi.lobby.handicap")), [](){
 		if(!GAME->server().isHost())
 			return;
 		ENGINE->windows().createAndPushWindow<OptionsTab::HandicapWindow>();
 	}, EShortcut::LOBBY_HANDICAP);
-	buttonHandicap->setTextOverlay(VLC->generaltexth->translate("vcmi.lobby.handicap"), EFonts::FONT_SMALL, Colors::WHITE);
+	buttonHandicap->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.lobby.handicap"), EFonts::FONT_SMALL, Colors::WHITE);
 }
 
 TownSelector::TownSelector(const Point & loc)
@@ -461,7 +461,7 @@ TownSelector::TownSelector(const Point & loc)
 	setRedrawParent(true);
 
 	int count = 0;
-	for(auto const & factionID : VLC->townh->getDefaultAllowed())
+	for(auto const & factionID : LIBRARY->townh->getDefaultAllowed())
 	{
 		townsEnabled[factionID] = true;
 		count++;
@@ -490,7 +490,7 @@ void TownSelector::updateListItems()
 
 	int x = 0;
 	int y = 0;
-	for (auto const & factionID : VLC->townh->getDefaultAllowed())
+	for (auto const & factionID : LIBRARY->townh->getDefaultAllowed())
 	{
 		if(y >= line && (y - line) < 3)
 		{
@@ -529,8 +529,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, VLC->generaltexth->allTexts[390] + ":");
-	labelEnemies = std::make_shared<CLabel>(133, 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->allTexts[391] + ":");
+	labelAllies = std::make_shared<CLabel>(0, 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[390] + ":");
+	labelEnemies = std::make_shared<CLabel>(133, 0, FONT_SMALL, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->allTexts[391] + ":");
 }
 
 void CFlagBox::recreate()
@@ -567,7 +567,7 @@ CFlagBox::CFlagBoxTooltipBox::CFlagBoxTooltipBox()
 {
 	OBJECT_CONSTRUCTION;
 
-	labelTeamAlignment = std::make_shared<CLabel>(128, 30, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, VLC->generaltexth->allTexts[657]);
+	labelTeamAlignment = std::make_shared<CLabel>(128, 30, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->allTexts[657]);
 	labelGroupTeams = std::make_shared<CLabelGroup>(FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE);
 
 	std::vector<std::set<PlayerColor>> teams(PlayerColor::PLAYER_LIMIT_I);
@@ -586,7 +586,7 @@ CFlagBox::CFlagBoxTooltipBox::CFlagBoxTooltipBox()
 		if(team.empty())
 			continue;
 
-		labelGroupTeams->add(128, 65 + 50 * curIdx, boost::str(boost::format(VLC->generaltexth->allTexts[656]) % (curIdx + 1)));
+		labelGroupTeams->add(128, 65 + 50 * curIdx, boost::str(boost::format(LIBRARY->generaltexth->allTexts[656]) % (curIdx + 1)));
 		int curx = 128 - 9 * team.size();
 		for(const auto & player : team)
 		{

+ 58 - 58
client/lobby/OptionsTab.cpp

@@ -48,7 +48,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/mapping/CMapInfo.h"
 #include "../../lib/mapping/CMapHeader.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 static JsonPath optionsTabConfigLocation()
 {
@@ -113,7 +113,7 @@ size_t OptionsTab::CPlayerSettingsHelper::getImageIndex(bool big)
 		if (playerSettings.castle == FactionID::RANDOM)
 			return TOWN_RANDOM;
 
-		return (*VLC->townh)[factionIndex]->town->clientInfo.icons[true][false] + (big ? 0 : 2);
+		return (*LIBRARY->townh)[factionIndex]->town->clientInfo.icons[true][false] + (big ? 0 : 2);
 	}
 
 	case HERO:
@@ -128,7 +128,7 @@ size_t OptionsTab::CPlayerSettingsHelper::getImageIndex(bool big)
 			return playerSettings.heroPortrait;
 
 		auto index = playerSettings.getHeroValidated();
-		return (*VLC->heroh)[index]->imageIndex;
+		return (*LIBRARY->heroh)[index]->imageIndex;
 	}
 
 	case BONUS:
@@ -143,7 +143,7 @@ size_t OptionsTab::CPlayerSettingsHelper::getImageIndex(bool big)
 			return GOLD;
 		case PlayerStartingBonus::RESOURCE:
 		{
-			switch((*VLC->townh)[factionIndex]->town->primaryRes.toEnum())
+			switch((*LIBRARY->townh)[factionIndex]->town->primaryRes.toEnum())
 			{
 			case EGameResID::WOOD_AND_ORE:
 				return WOOD_ORE;
@@ -192,33 +192,33 @@ std::string OptionsTab::CPlayerSettingsHelper::getName()
 		case TOWN:
 		{
 			if (playerSettings.castle == FactionID::NONE)
-				return VLC->generaltexth->allTexts[523];
+				return LIBRARY->generaltexth->allTexts[523];
 
 			if (playerSettings.castle == FactionID::RANDOM)
-				return VLC->generaltexth->allTexts[522];
+				return LIBRARY->generaltexth->allTexts[522];
 
 			auto factionIndex = playerSettings.getCastleValidated();
-			return (*VLC->townh)[factionIndex]->getNameTranslated();
+			return (*LIBRARY->townh)[factionIndex]->getNameTranslated();
 		}
 		case HERO:
 		{
 			if (playerSettings.hero == HeroTypeID::NONE)
-				return VLC->generaltexth->allTexts[523];
+				return LIBRARY->generaltexth->allTexts[523];
 
 			if (playerSettings.hero == HeroTypeID::RANDOM)
-					return VLC->generaltexth->allTexts[522];
+					return LIBRARY->generaltexth->allTexts[522];
 
 			if(!playerSettings.heroNameTextId.empty())
-				return VLC->generaltexth->translate(playerSettings.heroNameTextId);
+				return LIBRARY->generaltexth->translate(playerSettings.heroNameTextId);
 			auto index = playerSettings.getHeroValidated();
-			return (*VLC->heroh)[index]->getNameTranslated();
+			return (*LIBRARY->heroh)[index]->getNameTranslated();
 		}
 		case BONUS:
 		{
 			if (playerSettings.bonus == PlayerStartingBonus::RANDOM)
-					return VLC->generaltexth->allTexts[522];
+					return LIBRARY->generaltexth->allTexts[522];
 
-			return VLC->generaltexth->arraytxt[214 + static_cast<int>(playerSettings.bonus)];
+			return LIBRARY->generaltexth->arraytxt[214 + static_cast<int>(playerSettings.bonus)];
 		}
 	}
 	return "";
@@ -230,21 +230,21 @@ std::string OptionsTab::CPlayerSettingsHelper::getTitle()
 	switch(selectionType)
 	{
 	case OptionsTab::TOWN:
-		return playerSettings.castle.isValid() ? VLC->generaltexth->allTexts[80] : VLC->generaltexth->allTexts[103];
+		return playerSettings.castle.isValid() ? LIBRARY->generaltexth->allTexts[80] : LIBRARY->generaltexth->allTexts[103];
 	case OptionsTab::HERO:
-		return playerSettings.hero.isValid() ? VLC->generaltexth->allTexts[77] : VLC->generaltexth->allTexts[101];
+		return playerSettings.hero.isValid() ? LIBRARY->generaltexth->allTexts[77] : LIBRARY->generaltexth->allTexts[101];
 	case OptionsTab::BONUS:
 	{
 		switch(playerSettings.bonus)
 		{
 		case PlayerStartingBonus::RANDOM:
-			return VLC->generaltexth->allTexts[86]; //{Random Bonus}
+			return LIBRARY->generaltexth->allTexts[86]; //{Random Bonus}
 		case PlayerStartingBonus::ARTIFACT:
-			return VLC->generaltexth->allTexts[83]; //{Artifact Bonus}
+			return LIBRARY->generaltexth->allTexts[83]; //{Artifact Bonus}
 		case PlayerStartingBonus::GOLD:
-			return VLC->generaltexth->allTexts[84]; //{Gold Bonus}
+			return LIBRARY->generaltexth->allTexts[84]; //{Gold Bonus}
 		case PlayerStartingBonus::RESOURCE:
-			return VLC->generaltexth->allTexts[85]; //{Resource Bonus}
+			return LIBRARY->generaltexth->allTexts[85]; //{Resource Bonus}
 		}
 	}
 	}
@@ -262,7 +262,7 @@ std::string OptionsTab::CPlayerSettingsHelper::getSubtitle()
 	case HERO:
 	{
 		if(playerSettings.hero.isValid())
-			return getName() + " - " + (*VLC->heroh)[heroIndex]->heroClass->getNameTranslated();
+			return getName() + " - " + (*LIBRARY->heroh)[heroIndex]->heroClass->getNameTranslated();
 		return getName();
 	}
 
@@ -271,21 +271,21 @@ std::string OptionsTab::CPlayerSettingsHelper::getSubtitle()
 		switch(playerSettings.bonus)
 		{
 		case PlayerStartingBonus::GOLD:
-			return VLC->generaltexth->allTexts[87]; //500-1000
+			return LIBRARY->generaltexth->allTexts[87]; //500-1000
 		case PlayerStartingBonus::RESOURCE:
 		{
-			switch((*VLC->townh)[factionIndex]->town->primaryRes.toEnum())
+			switch((*LIBRARY->townh)[factionIndex]->town->primaryRes.toEnum())
 			{
 			case EGameResID::MERCURY:
-				return VLC->generaltexth->allTexts[694];
+				return LIBRARY->generaltexth->allTexts[694];
 			case EGameResID::SULFUR:
-				return VLC->generaltexth->allTexts[695];
+				return LIBRARY->generaltexth->allTexts[695];
 			case EGameResID::CRYSTAL:
-				return VLC->generaltexth->allTexts[692];
+				return LIBRARY->generaltexth->allTexts[692];
 			case EGameResID::GEMS:
-				return VLC->generaltexth->allTexts[693];
+				return LIBRARY->generaltexth->allTexts[693];
 			case EGameResID::WOOD_AND_ORE:
-				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
+				return LIBRARY->generaltexth->allTexts[89]; //At the start of the game, 5-10 wood and 5-10 ore are added to your Kingdom's resource pool
 			}
 		}
 		}
@@ -301,33 +301,33 @@ std::string OptionsTab::CPlayerSettingsHelper::getDescription()
 	switch(selectionType)
 	{
 	case TOWN:
-		return VLC->generaltexth->allTexts[104];
+		return LIBRARY->generaltexth->allTexts[104];
 	case HERO:
-		return VLC->generaltexth->allTexts[102];
+		return LIBRARY->generaltexth->allTexts[102];
 	case BONUS:
 	{
 		switch(playerSettings.bonus)
 		{
 		case PlayerStartingBonus::RANDOM:
-			return VLC->generaltexth->allTexts[94]; //Gold, wood and ore, or an artifact is randomly chosen as your starting bonus
+			return LIBRARY->generaltexth->allTexts[94]; //Gold, wood and ore, or an artifact is randomly chosen as your starting bonus
 		case PlayerStartingBonus::ARTIFACT:
-			return VLC->generaltexth->allTexts[90]; //An artifact is randomly chosen and equipped to your starting hero
+			return LIBRARY->generaltexth->allTexts[90]; //An artifact is randomly chosen and equipped to your starting hero
 		case PlayerStartingBonus::GOLD:
-			return VLC->generaltexth->allTexts[92]; //At the start of the game, 500-1000 gold is added to your Kingdom's resource pool
+			return LIBRARY->generaltexth->allTexts[92]; //At the start of the game, 500-1000 gold is added to your Kingdom's resource pool
 		case PlayerStartingBonus::RESOURCE:
 		{
-			switch((*VLC->townh)[factionIndex]->town->primaryRes.toEnum())
+			switch((*LIBRARY->townh)[factionIndex]->town->primaryRes.toEnum())
 			{
 			case EGameResID::MERCURY:
-				return VLC->generaltexth->allTexts[690];
+				return LIBRARY->generaltexth->allTexts[690];
 			case EGameResID::SULFUR:
-				return VLC->generaltexth->allTexts[691];
+				return LIBRARY->generaltexth->allTexts[691];
 			case EGameResID::CRYSTAL:
-				return VLC->generaltexth->allTexts[688];
+				return LIBRARY->generaltexth->allTexts[688];
 			case EGameResID::GEMS:
-				return VLC->generaltexth->allTexts[689];
+				return LIBRARY->generaltexth->allTexts[689];
 			case EGameResID::WOOD_AND_ORE:
-				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
+				return LIBRARY->generaltexth->allTexts[93]; //At the start of the game, 5-10 wood and 5-10 ore are added to your Kingdom's resource pool
 			}
 		}
 		}
@@ -376,9 +376,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, VLC->generaltexth->allTexts[79]);
+	labelAssociatedCreatures = std::make_shared<CLabel>(pos.w / 2 + 8, 122, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->allTexts[79]);
 	std::vector<std::shared_ptr<CComponent>> components;
-	const CTown * town = (*VLC->townh)[factionIndex]->town;
+	const CTown * town = (*LIBRARY->townh)[factionIndex]->town;
 
 	for(auto & elem : town->creatures)
 	{
@@ -397,10 +397,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, VLC->generaltexth->allTexts[78]);
+	labelHeroSpeciality = std::make_shared<CLabel>(pos.w / 2 + 4, 117, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->allTexts[78]);
 
-	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());
+	imageSpeciality = std::make_shared<CAnimImage>(AnimationPath::builtin("UN44"), (*LIBRARY->heroh)[heroIndex]->imageIndex, 0, pos.w / 2 - 22, 134);
+	labelSpecialityName = std::make_shared<CLabel>(pos.w / 2, 188, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, (*LIBRARY->heroh)[heroIndex]->getSpecialtyNameTranslated());
 }
 
 void OptionsTab::CPlayerOptionTooltipBox::genBonusWindow()
@@ -814,7 +814,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, VLC->generaltexth->translate("vcmi.lobby.handicap")));
+	labels.push_back(std::make_shared<CLabel>(pos.w / 2 + 8, 15, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->translate("vcmi.lobby.handicap")));
 
 	enum Columns : int32_t
 	{
@@ -842,9 +842,9 @@ OptionsTab::HandicapWindow::HandicapWindow()
 			if(i == 0)
 			{
 				if(isIncome)
-					labels.push_back(std::make_shared<CLabel>(xPos, 38, FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->translate("core.jktext.32")));
+					labels.push_back(std::make_shared<CLabel>(xPos, 38, FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->generaltexth->translate("core.jktext.32")));
 				else if(isGrowth)
-					labels.push_back(std::make_shared<CLabel>(xPos, 38, FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, VLC->generaltexth->translate("core.genrltxt.194")));
+					labels.push_back(std::make_shared<CLabel>(xPos, 38, FONT_TINY, ETextAlignment::TOPLEFT, Colors::WHITE, LIBRARY->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));
 			}
@@ -865,11 +865,11 @@ OptionsTab::HandicapWindow::HandicapWindow()
 			textinputs[player][resource]->setPopupCallback([isIncome, isGrowth](){
 				// Help for the textinputs
 				if(isIncome)
-					CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.lobby.handicap.income"));
+					CRClickPopup::createAndPush(LIBRARY->generaltexth->translate("vcmi.lobby.handicap.income"));
 				else if(isGrowth)
-					CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.lobby.handicap.growth"));
+					CRClickPopup::createAndPush(LIBRARY->generaltexth->translate("vcmi.lobby.handicap.growth"));
 				else
-					CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.lobby.handicap.resource"));
+					CRClickPopup::createAndPush(LIBRARY->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, "%"));
@@ -1040,10 +1040,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, VLC->generaltexth->arraytxt[206 + whoCanPlay]);
+	labelWhoCanPlay = std::make_shared<CMultiLineLabel>(Rect(6, 21, 45, 26), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->arraytxt[206 + whoCanPlay]);
 
 	auto hasHandicap = [this](){ return s->handicap.startBonus.empty() && s->handicap.percentIncome == 100 && s->handicap.percentGrowth == 100; };
-	std::string labelHandicapText = hasHandicap() ? VLC->generaltexth->arraytxt[210] : MetaString::createFromTextID("vcmi.lobby.handicap").toString();
+	std::string labelHandicapText = hasHandicap() ? LIBRARY->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(!GAME->server().isHost())
@@ -1085,12 +1085,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"), VLC->generaltexth->zelp[132], std::bind(&IServerAPI::setPlayerOption, &GAME->server(), 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, &GAME->server(), 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, &GAME->server(), 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, &GAME->server(), 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, &GAME->server(), 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, &GAME->server(), LobbyChangePlayerOption::BONUS, +1, s->color));
+		buttonTownLeft   = std::make_shared<CButton>(Point(107, 5), AnimationPath::builtin("ADOPLFA.DEF"), LIBRARY->generaltexth->zelp[132], std::bind(&IServerAPI::setPlayerOption, &GAME->server(), LobbyChangePlayerOption::TOWN, -1, s->color));
+		buttonTownRight  = std::make_shared<CButton>(Point(168, 5), AnimationPath::builtin("ADOPRTA.DEF"), LIBRARY->generaltexth->zelp[133], std::bind(&IServerAPI::setPlayerOption, &GAME->server(), LobbyChangePlayerOption::TOWN, +1, s->color));
+		buttonHeroLeft   = std::make_shared<CButton>(Point(183, 5), AnimationPath::builtin("ADOPLFA.DEF"), LIBRARY->generaltexth->zelp[148], std::bind(&IServerAPI::setPlayerOption, &GAME->server(), LobbyChangePlayerOption::HERO, -1, s->color));
+		buttonHeroRight  = std::make_shared<CButton>(Point(244, 5), AnimationPath::builtin("ADOPRTA.DEF"), LIBRARY->generaltexth->zelp[149], std::bind(&IServerAPI::setPlayerOption, &GAME->server(), LobbyChangePlayerOption::HERO, +1, s->color));
+		buttonBonusLeft  = std::make_shared<CButton>(Point(259, 5), AnimationPath::builtin("ADOPLFA.DEF"), LIBRARY->generaltexth->zelp[164], std::bind(&IServerAPI::setPlayerOption, &GAME->server(), LobbyChangePlayerOption::BONUS, -1, s->color));
+		buttonBonusRight = std::make_shared<CButton>(Point(320, 5), AnimationPath::builtin("ADOPRTA.DEF"), LIBRARY->generaltexth->zelp[165], std::bind(&IServerAPI::setPlayerOption, &GAME->server(), LobbyChangePlayerOption::BONUS, +1, s->color));
 	}
 
 	hideUnavailableButtons();
@@ -1100,7 +1100,7 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry(const PlayerSettings & S, con
 		flag = std::make_shared<CButton>(
 			Point(-43, 2),
 			AnimationPath::builtin(flags[s->color.getNum()]),
-			VLC->generaltexth->zelp[180],
+			LIBRARY->generaltexth->zelp[180],
 			std::bind(&OptionsTab::onSetPlayerClicked, &parentTab, *s)
 		);
 		flag->setHoverable(true);

+ 9 - 9
client/lobby/OptionsTabBase.cpp

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

+ 3 - 3
client/lobby/RandomMapTab.cpp

@@ -114,7 +114,7 @@ RandomMapTab::RandomMapTab():
 		ENGINE->windows().createAndPushWindow<TeamAlignments>(*this);
 	});
 	
-	for(const auto & road : VLC->roadTypeHandler->objects)
+	for(const auto & road : LIBRARY->roadTypeHandler->objects)
 	{
 		std::string cbRoadType = "selectRoad_" + road->getJsonKey();
 		addCallback(cbRoadType, [&, roadID = road->getId()](bool on)
@@ -141,7 +141,7 @@ RandomMapTab::RandomMapTab():
 	if(auto w = widget<ComboBox>("templateList"))
 	{
 		w->onConstructItems = [](std::vector<const void *> & curItems){
-			auto templates = VLC->tplh->getTemplates();
+			auto templates = LIBRARY->tplh->getTemplates();
 		
 			boost::range::sort(templates, [](const CRmgTemplate * a, const CRmgTemplate * b){
 				return a->getName() < b->getName();
@@ -372,7 +372,7 @@ void RandomMapTab::setMapGenOptions(std::shared_ptr<CMapGenOptions> opts)
 		else
 			w->setTextOverlay(readText(variables["randomTemplate"]), EFonts::FONT_SMALL, Colors::WHITE);
 	}
-	for(const auto & r : VLC->roadTypeHandler->objects)
+	for(const auto & r : LIBRARY->roadTypeHandler->objects)
 	{
 		// Workaround for vcmi-extras bug
 		std::string jsonKey = r->getJsonKey();

+ 22 - 22
client/lobby/SelectionTab.cpp

@@ -47,7 +47,7 @@
 #include "../../lib/texts/TextOperations.h"
 #include "../../lib/TerrainHandler.h"
 #include "../../lib/UnlockGuard.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 bool mapSorter::operator()(const std::shared_ptr<ElementInfo> aaa, const std::shared_ptr<ElementInfo> bbb)
 {
@@ -170,7 +170,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, VLC->generaltexth->allTexts[510]);
+		labelMapSizes = std::make_shared<CLabel>(87, 62, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->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};
@@ -178,7 +178,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]), VLC->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]), LIBRARY->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"};
@@ -189,7 +189,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]), VLC->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]), LIBRARY->generaltexth->zelp[107 + i], std::bind(&SelectionTab::sortBy, this, criteria), sortShortcuts[i]));
 		}
 	}
 
@@ -199,19 +199,19 @@ SelectionTab::SelectionTab(ESelectionScreen Type)
 	switch(tabType)
 	{
 	case ESelectionScreen::newGame:
-		tabTitle = "{" + VLC->generaltexth->arraytxt[229] + "}";
-		tabTitleDelete = "{red|" + VLC->generaltexth->translate("vcmi.lobby.deleteMapTitle") + "}";
+		tabTitle = "{" + LIBRARY->generaltexth->arraytxt[229] + "}";
+		tabTitleDelete = "{red|" + LIBRARY->generaltexth->translate("vcmi.lobby.deleteMapTitle") + "}";
 		break;
 	case ESelectionScreen::loadGame:
-		tabTitle = "{" + VLC->generaltexth->arraytxt[230] + "}";
-		tabTitleDelete = "{red|" + VLC->generaltexth->translate("vcmi.lobby.deleteSaveGameTitle") + "}";
+		tabTitle = "{" + LIBRARY->generaltexth->arraytxt[230] + "}";
+		tabTitleDelete = "{red|" + LIBRARY->generaltexth->translate("vcmi.lobby.deleteSaveGameTitle") + "}";
 		break;
 	case ESelectionScreen::saveGame:
 		positionsToShow = 16;
-		tabTitle = "{" + VLC->generaltexth->arraytxt[231] + "}";
+		tabTitle = "{" + LIBRARY->generaltexth->arraytxt[231] + "}";
 		break;
 	case ESelectionScreen::campaignList:
-		tabTitle = "{" + VLC->generaltexth->allTexts[726] + "}";
+		tabTitle = "{" + LIBRARY->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;
@@ -228,13 +228,13 @@ SelectionTab::SelectionTab(ESelectionScreen Type)
 
 	if(enableUiEnhancements)
 	{
-		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);
+		auto sortByDate = std::make_shared<CButton>(Point(371, 85), AnimationPath::builtin("selectionTabSortDate"), CButton::tooltip("", LIBRARY->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("", VLC->generaltexth->translate("vcmi.lobby.deleteMode")), [this, tabTitle, tabTitleDelete](){
+			buttonDeleteMode = std::make_shared<CButton>(Point(367, 18), AnimationPath::builtin("lobby/deleteButton"), CButton::tooltip("", LIBRARY->generaltexth->translate("vcmi.lobby.deleteMode")), [this, tabTitle, tabTitleDelete](){
 				deleteMode = !deleteMode;
 				if(deleteMode)
 					labelTabTitle->setText(tabTitleDelete);
@@ -347,14 +347,14 @@ void SelectionTab::clickReleased(const Point & cursorPosition)
 			}
 
 			if(!curItems[py]->isFolder)
-				CInfoWindow::showYesNoDialog(VLC->generaltexth->translate("vcmi.lobby.deleteFile") + "\n\n" + curItems[py]->fullFileURI, std::vector<std::shared_ptr<CComponent>>(), [this, py](){
+				CInfoWindow::showYesNoDialog(LIBRARY->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;
 					GAME->server().sendLobbyPack(ld);
 				}, nullptr);
 			else
-				CInfoWindow::showYesNoDialog(VLC->generaltexth->translate("vcmi.lobby.deleteFolder") + "\n\n" + curFolder + curItems[py]->folderName, std::vector<std::shared_ptr<CComponent>>(), [this, py](){
+				CInfoWindow::showYesNoDialog(LIBRARY->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;
@@ -774,7 +774,7 @@ void SelectionTab::selectFileName(std::string fname)
 	selectAbs(-1);
 
 	if(tabType == ESelectionScreen::saveGame && inputName->getText().empty())
-		inputName->setText(VLC->generaltexth->translate("core.genrltxt.11"));
+		inputName->setText(LIBRARY->generaltexth->translate("core.genrltxt.11"));
 }
 
 void SelectionTab::selectNewestFile()
@@ -841,19 +841,19 @@ bool SelectionTab::isMapSupported(const CMapInfo & info)
 	switch (info.mapHeader->version)
 	{
 		case EMapFormat::ROE:
-			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_RESTORATION_OF_ERATHIA)["supported"].Bool();
+			return LIBRARY->engineSettings()->getValue(EGameSettings::MAP_FORMAT_RESTORATION_OF_ERATHIA)["supported"].Bool();
 		case EMapFormat::AB:
-			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_ARMAGEDDONS_BLADE)["supported"].Bool();
+			return LIBRARY->engineSettings()->getValue(EGameSettings::MAP_FORMAT_ARMAGEDDONS_BLADE)["supported"].Bool();
 		case EMapFormat::SOD:
-			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_SHADOW_OF_DEATH)["supported"].Bool();
+			return LIBRARY->engineSettings()->getValue(EGameSettings::MAP_FORMAT_SHADOW_OF_DEATH)["supported"].Bool();
 		case EMapFormat::CHR:
-			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_CHRONICLES)["supported"].Bool();
+			return LIBRARY->engineSettings()->getValue(EGameSettings::MAP_FORMAT_CHRONICLES)["supported"].Bool();
 		case EMapFormat::WOG:
-			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_IN_THE_WAKE_OF_GODS)["supported"].Bool();
+			return LIBRARY->engineSettings()->getValue(EGameSettings::MAP_FORMAT_IN_THE_WAKE_OF_GODS)["supported"].Bool();
 		case EMapFormat::HOTA:
-			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_HORN_OF_THE_ABYSS)["supported"].Bool();
+			return LIBRARY->engineSettings()->getValue(EGameSettings::MAP_FORMAT_HORN_OF_THE_ABYSS)["supported"].Bool();
 		case EMapFormat::VCMI:
-			return VLC->engineSettings()->getValue(EGameSettings::MAP_FORMAT_JSON_VCMI)["supported"].Bool();
+			return LIBRARY->engineSettings()->getValue(EGameSettings::MAP_FORMAT_JSON_VCMI)["supported"].Bool();
 	}
 	return false;
 }

+ 1 - 1
client/mainmenu/CCampaignScreen.cpp

@@ -81,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 = VLC->generaltexth->zelp[(size_t)button["help"].Float()];
+		help = LIBRARY->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

@@ -35,7 +35,7 @@
 #include "../../lib/constants/EntityIdentifiers.h"
 #include "../../lib/gameState/HighScore.h"
 #include "../../lib/gameState/GameStatistics.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.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, 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
+	texts.push_back(std::make_shared<CLabel>(115, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->translate("core.genrltxt.433"))); // rank
+	texts.push_back(std::make_shared<CLabel>(225, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->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, 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
+		texts.push_back(std::make_shared<CLabel>(405, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->translate("core.genrltxt.435"))); // land
+		texts.push_back(std::make_shared<CLabel>(557, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->translate("core.genrltxt.436"))); // days
+		texts.push_back(std::make_shared<CLabel>(627, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->translate("core.genrltxt.75"))); // score
 	}
 	else
 	{
-		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
+		texts.push_back(std::make_shared<CLabel>(405, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->translate("core.genrltxt.672"))); // campaign
+		texts.push_back(std::make_shared<CLabel>(592, 20, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->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"), (*VLC->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"), (*LIBRARY->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(
-		VLC->generaltexth->allTexts[666],
+		LIBRARY->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, VLC->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, LIBRARY->generaltexth->translate("core.genrltxt." + t[i])));
 
-		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 };
+		std::string creatureName = (calc.calculate().cheater) ? LIBRARY->generaltexth->translate("core.genrltxt.260") : (*LIBRARY->creh)[HighScoreCalculation::getCreatureForPoints(calc.calculate().total, calc.isCampaign)]->getNameSingularTranslated();
+		t = { std::to_string(calc.calculate().sumDays), std::to_string(calc.calculate().basic), LIBRARY->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(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") + ":"));
+		statisticButton = std::make_shared<CButton>(Point(726, 10), AnimationPath::builtin("TPTAV02.DEF"), CButton::tooltip(LIBRARY->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, LIBRARY->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 ? VLC->generaltexth->translate("core.genrltxt.260") : calc.parameters[0].campaignName;
+		newNode["campaignName"].String() = calc.calculate().cheater ? LIBRARY->generaltexth->translate("core.genrltxt.260") : calc.parameters[0].campaignName;
 	else
-		newNode["scenarioName"].String() = calc.calculate().cheater ? VLC->generaltexth->translate("core.genrltxt.260") : calc.parameters[0].scenarioName;
+		newNode["scenarioName"].String() = calc.calculate().cheater ? LIBRARY->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, VLC->generaltexth->translate("core.genrltxt.96"));
+	text = std::make_shared<CMultiLineLabel>(Rect(15, 15, 202, 202), FONT_SMALL, ETextAlignment::TOPCENTER, Colors::WHITE, LIBRARY->generaltexth->translate("core.genrltxt.96"));
 
-	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);
+	buttonOk = std::make_shared<CButton>(Point(26, 142), AnimationPath::builtin("MUBCHCK.DEF"), LIBRARY->generaltexth->zelp[560], std::bind(&CHighScoreInput::okay, this), EShortcut::GLOBAL_ACCEPT);
+	buttonCancel = std::make_shared<CButton>(Point(142, 142), AnimationPath::builtin("MUBCANC.DEF"), LIBRARY->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

@@ -59,7 +59,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/GameConstants.h"
 #include "../../lib/CRandomGenerator.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 std::shared_ptr<CMainMenu> CMM;
 ISelectionScreenInfo * SEL = nullptr;
@@ -207,7 +207,7 @@ static std::function<void()> genCommand(CMenuScreen * menu, std::vector<std::str
 			break;
 			case 4: //exit
 			{
-				return []() { CInfoWindow::showYesNoDialog(VLC->generaltexth->allTexts[69], std::vector<std::shared_ptr<CComponent>>(), do_quit, 0, PlayerColor(1)); };
+				return []() { CInfoWindow::showYesNoDialog(LIBRARY->generaltexth->allTexts[69], std::vector<std::shared_ptr<CComponent>>(), do_quit, 0, PlayerColor(1)); };
 			}
 			break;
 			case 5: //highscores
@@ -227,7 +227,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 = VLC->generaltexth->zelp[(size_t)button["help"].Float()];
+		help = LIBRARY->generaltexth->zelp[(size_t)button["help"].Float()];
 
 	int posx = static_cast<int>(button["x"].Float());
 	if(posx < 0)
@@ -447,7 +447,7 @@ void CMainMenu::openCampaignScreen(std::string name)
 
 	if (!campaignsFound)
 	{
-		CInfoWindow::showInfoDialog(VLC->generaltexth->translate("vcmi.client.errors.missingCampaigns"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
+		CInfoWindow::showInfoDialog(LIBRARY->generaltexth->translate("vcmi.client.errors.missingCampaigns"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
 		return;
 	}
 
@@ -459,7 +459,7 @@ void CMainMenu::startTutorial()
 	ResourcePath tutorialMap("Maps/Tutorial.tut", EResType::MAP);
 	if(!CResourceHandler::get()->existsResource(tutorialMap))
 	{
-		CInfoWindow::showInfoDialog(VLC->generaltexth->translate("core.genrltxt.742"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
+		CInfoWindow::showInfoDialog(LIBRARY->generaltexth->translate("core.genrltxt.742"), std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
 		return;
 	}
 		
@@ -510,20 +510,20 @@ CMultiMode::CMultiMode(ESelectionScreen ScreenType)
 	}
 
 	textTitle = std::make_shared<CTextBox>("", Rect(7, 18, 440, 50), 0, FONT_BIG, ETextAlignment::CENTER, Colors::WHITE);
-	textTitle->setText(VLC->generaltexth->zelp[263].second);
+	textTitle->setText(LIBRARY->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"), 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);
+	buttonHotseat = std::make_shared<CButton>(Point(373, 78 + 57 * 0), AnimationPath::builtin("MUBHOT.DEF"), LIBRARY->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"), LIBRARY->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(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);
+	buttonHost = std::make_shared<CButton>(Point(373, 78 + 57 * 3), AnimationPath::builtin("MUBHOST.DEF"), CButton::tooltip(LIBRARY->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(LIBRARY->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"), VLC->generaltexth->zelp[288], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
+	buttonCancel = std::make_shared<CButton>(Point(373, 424), AnimationPath::builtin("MUBCANC.DEF"), LIBRARY->generaltexth->zelp[288], [=](){ close();}, EShortcut::GLOBAL_CANCEL);
 }
 
 void CMultiMode::openLobby()
@@ -552,7 +552,7 @@ std::vector<std::string> CMultiMode::getPlayersNames()
 
 	std::string playerNameStr = settings["general"]["playerName"].String();
 	if (playerNameStr == "Player")
-		playerNameStr = VLC->generaltexth->translate("core.genrltxt.434");
+		playerNameStr = LIBRARY->generaltexth->translate("core.genrltxt.434");
 	playerNames.push_back(playerNameStr);
 
 	for (const auto & playerName : settings["general"]["multiPlayerNames"].Vector())
@@ -584,14 +584,14 @@ CMultiPlayers::CMultiPlayers(const std::vector<std::string>& playerNames, ESelec
 	switch (shortcut)
 	{
 	case EShortcut::MAIN_MENU_HOTSEAT:
-		text = VLC->generaltexth->allTexts[446];
+		text = LIBRARY->generaltexth->allTexts[446];
 		boost::replace_all(text, "\t", "\n");
 		break;
 	case EShortcut::MAIN_MENU_HOST_GAME:
-		text = VLC->generaltexth->translate("vcmi.mainMenu.hostTCP");
+		text = LIBRARY->generaltexth->translate("vcmi.mainMenu.hostTCP");
 		break;
 	case EShortcut::MAIN_MENU_JOIN_GAME:
-		text = VLC->generaltexth->translate("vcmi.mainMenu.joinTCP");
+		text = LIBRARY->generaltexth->translate("vcmi.mainMenu.joinTCP");
 		break;
 	}
 
@@ -603,8 +603,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"), 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);
+	buttonOk = std::make_shared<CButton>(Point(95, 338), AnimationPath::builtin("MUBCHCK.DEF"), LIBRARY->generaltexth->zelp[560], std::bind(&CMultiPlayers::enterSelectionScreen, this), EShortcut::GLOBAL_ACCEPT);
+	buttonCancel = std::make_shared<CButton>(Point(205, 338), AnimationPath::builtin("MUBCANC.DEF"), LIBRARY->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++)
@@ -661,16 +661,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"), VLC->generaltexth->zelp[560], std::bind(&CSimpleJoinScreen::connectToServer, this), EShortcut::GLOBAL_ACCEPT);
+	buttonOk = std::make_shared<CButton>(Point(26, 142), AnimationPath::builtin("MUBCHCK.DEF"), LIBRARY->generaltexth->zelp[560], std::bind(&CSimpleJoinScreen::connectToServer, this), EShortcut::GLOBAL_ACCEPT);
 	if(host && !settings["session"]["donotstartserver"].Bool())
 	{
-		textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
+		textTitle->setText(LIBRARY->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
 		buttonOk->block(true);
 		startConnection();
 	}
 	else
 	{
-		textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverAddressEnter"));
+		textTitle->setText(LIBRARY->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);
@@ -680,13 +680,13 @@ CSimpleJoinScreen::CSimpleJoinScreen(bool host)
 	inputPort->setText(std::to_string(host ? GAME->server().getLocalPort() : GAME->server().getRemotePort()));
 	buttonOk->block(inputAddress->getText().empty() || inputPort->getText().empty());
 
-	buttonCancel = std::make_shared<CButton>(Point(142, 142), AnimationPath::builtin("MUBCANC.DEF"), VLC->generaltexth->zelp[561], std::bind(&CSimpleJoinScreen::leaveScreen, this), EShortcut::GLOBAL_CANCEL);
+	buttonCancel = std::make_shared<CButton>(Point(142, 142), AnimationPath::builtin("MUBCANC.DEF"), LIBRARY->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(VLC->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
+	textTitle->setText(LIBRARY->generaltexth->translate("vcmi.mainMenu.serverConnecting"));
 	buttonOk->block(true);
 	ENGINE->input().stopTextInput();
 
@@ -695,7 +695,7 @@ void CSimpleJoinScreen::connectToServer()
 
 void CSimpleJoinScreen::leaveScreen()
 {
-	textTitle->setText(VLC->generaltexth->translate("vcmi.mainMenu.serverClosing"));
+	textTitle->setText(LIBRARY->generaltexth->translate("vcmi.mainMenu.serverClosing"));
 	GAME->server().setState(EClientState::CONNECTION_CANCELLED);
 }
 

+ 41 - 41
client/mainmenu/CStatisticScreen.cpp

@@ -32,7 +32,7 @@
 #include "../../lib/gameState/CGameState.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/TextOperations.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 #include <vstd/DateUtils.h>
 
@@ -50,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, VLC->generaltexth->translate("vcmi.statisticWindow.statistics")));
+	layout.emplace_back(std::make_shared<CLabel>(400, 20, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->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(VLC->generaltexth->translate("vcmi.statisticWindow.selectView"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonSelect->setTextOverlay(LIBRARY->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(VLC->generaltexth->translate("vcmi.statisticWindow.tsvCopy"), EFonts::FONT_SMALL, Colors::YELLOW);
+	buttonCsvSave->setTextOverlay(LIBRARY->generaltexth->translate("vcmi.statisticWindow.tsvCopy"), EFonts::FONT_SMALL, Colors::YELLOW);
 
 	mainContent = getContent(OVERVIEW, EGameResID::NONE);
 }
@@ -67,7 +67,7 @@ void CStatisticScreen::onSelectButton()
 {
 	std::vector<std::string> texts;
 	for(auto & val : contentInfo)
-		texts.emplace_back(VLC->generaltexth->translate(std::get<0>(val.second)));
+		texts.emplace_back(LIBRARY->generaltexth->translate(std::get<0>(val.second)));
 	ENGINE->windows().createAndPushWindow<StatisticSelector>(texts, [this](int selectedIndex)
 	{
 		OBJECT_CONSTRUCTION;
@@ -79,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(VLC->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()));
+				resourceText.emplace_back(LIBRARY->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()));
 			
 			ENGINE->windows().createAndPushWindow<StatisticSelector>(resourceText, [this, content, possibleRes](int index)
 			{
@@ -139,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, VLC->generaltexth->translate("vcmi.statisticWindow.icon.townCaptured") });
+			icons.push_back({ graphics->playerColors[val.player], val.day, imageTown, LIBRARY->generaltexth->translate("vcmi.statisticWindow.icon.townCaptured") });
 		if(val.eventDefeatedStrongestHero)
-			icons.push_back({ graphics->playerColors[val.player], val.day, imageBattle, VLC->generaltexth->translate("vcmi.statisticWindow.icon.strongestHeroDefeated") });
+			icons.push_back({ graphics->playerColors[val.player], val.day, imageBattle, LIBRARY->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, VLC->generaltexth->translate("vcmi.statisticWindow.icon.defeated") });
+			icons.push_back({ graphics->playerColors[val.player], val.day, imageDefeated, LIBRARY->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, VLC->generaltexth->translate("vcmi.statisticWindow.icon.grailFound") });
+			icons.push_back({ graphics->playerColors[val.player], val.day, imageGrail, LIBRARY->generaltexth->translate("vcmi.statisticWindow.icon.grailFound") });
 		}
 	}
 
@@ -165,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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), statistic);
+		return std::make_shared<OverviewPanel>(contentArea.resize(-15), LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", res.getNum()).get()), plotData, icons, 0);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->generaltexth->translate(std::get<0>(contentInfo[c])) + " - " + LIBRARY->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), VLC->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 1);
+		return std::make_shared<LineChart>(contentArea.resize(-5), LIBRARY->generaltexth->translate(std::get<0>(contentInfo[c])), plotData, icons, 1);
 	}
 
 	return nullptr;
@@ -262,12 +262,12 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 
 	dataExtract = {
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.playerName"), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.playerName"), [this](PlayerColor color){
 				return playerDataFilter(color).front().playerName;
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.daysSurvived"), [this](PlayerColor color){
+			LIBRARY->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)
@@ -276,7 +276,7 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.maxHeroLevel"), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.maxHeroLevel"), [this](PlayerColor color){
 				int maxLevel = 0;
 				for(const auto & val : playerDataFilter(color))
 					if(maxLevel < val.maxHeroLevel)
@@ -285,7 +285,7 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.battleWinRatioHero"), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.battleWinRatioHero"), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				if(!val.numBattlesPlayer)
 					return std::string("");
@@ -294,7 +294,7 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.battleWinRatioNeutral"), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.battleWinRatioNeutral"), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				if(!val.numWinBattlesNeutral)
 					return std::string("");
@@ -303,25 +303,25 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.battlesHero"), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.battlesHero"), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.numBattlesPlayer);
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.battlesNeutral"), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.battlesNeutral"), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.numBattlesNeutral);
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.obeliskVisited"), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.obeliskVisited"), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(static_cast<int>(val.obeliskVisitedRatio * 100)) + " %";
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.maxArmyStrength"), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.maxArmyStrength"), [this](PlayerColor color){
 				int maxArmyStrength = 0;
 				for(const auto & val : playerDataFilter(color))
 					if(maxArmyStrength < val.armyStrength)
@@ -330,43 +330,43 @@ OverviewPanel::OverviewPanel(Rect position, std::string title, const StatisticDa
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::GOLD).get()), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + LIBRARY->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::GOLD).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::GOLD]);
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::WOOD).get()), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + LIBRARY->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::WOOD).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::WOOD]);
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::MERCURY).get()), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + LIBRARY->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::MERCURY).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::MERCURY]);
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::ORE).get()), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + LIBRARY->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::ORE).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::ORE]);
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::SULFUR).get()), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + LIBRARY->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::SULFUR).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::SULFUR]);
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::CRYSTAL).get()), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + LIBRARY->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::CRYSTAL).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::CRYSTAL]);
 			}
 		},
 		{
-			VLC->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + VLC->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::GEMS).get()), [this](PlayerColor color){
+			LIBRARY->generaltexth->translate("vcmi.statisticWindow.param.tradeVolume") + " - " + LIBRARY->generaltexth->translate(TextIdentifier("core.restypes", EGameResID::GEMS).get()), [this](PlayerColor color){
 				auto val = playerDataFilter(color).back();
 				return std::to_string(val.tradeVolume[EGameResID::GEMS]);
 			}
@@ -532,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, VLC->generaltexth->translate("core.genrltxt.64")));
+	layout.emplace_back(std::make_shared<CLabel>(p.x, p.y, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->translate("core.genrltxt.64")));
 }
 
 void LineChart::updateStatusBar(const Point & cursorPosition)
@@ -545,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(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)));
+		statusBar->write(LIBRARY->generaltexth->translate("core.genrltxt.64") + ": " + CStatisticScreen::getDay(x) + "   " + LIBRARY->generaltexth->translate("vcmi.statisticWindow.value") + ": " + (static_cast<int>(y) > 0 ? std::to_string(static_cast<int>(y)) : std::to_string(y)));
 	}
 	setRedrawParent(true);
 	redraw();

+ 6 - 6
client/mapView/MapRenderer.cpp

@@ -140,10 +140,10 @@ int MapTileStorage::groupCount(size_t fileIndex, size_t rotationIndex, size_t im
 }
 
 MapRendererTerrain::MapRendererTerrain()
-	: storage(VLC->terrainTypeHandler->objects.size())
+	: storage(LIBRARY->terrainTypeHandler->objects.size())
 {
 	logGlobal->debug("Loading map terrains");
-	for(const auto & terrain : VLC->terrainTypeHandler->objects)
+	for(const auto & terrain : LIBRARY->terrainTypeHandler->objects)
 		storage.load(terrain->getIndex(), AnimationPath::builtin(terrain->tilesFilename.getName() + (terrain->paletteAnimation.size() ? "_Shifted": "")), EImageBlitMode::OPAQUE);
 	logGlobal->debug("Done loading map terrains");
 }
@@ -179,10 +179,10 @@ uint8_t MapRendererTerrain::checksum(IMapRendererContext & context, const int3 &
 }
 
 MapRendererRiver::MapRendererRiver()
-	: storage(VLC->riverTypeHandler->objects.size())
+	: storage(LIBRARY->riverTypeHandler->objects.size())
 {
 	logGlobal->debug("Loading map rivers");
-	for(const auto & river : VLC->riverTypeHandler->objects)
+	for(const auto & river : LIBRARY->riverTypeHandler->objects)
 		storage.load(river->getIndex(), AnimationPath::builtin(river->tilesFilename.getName() + (river->paletteAnimation.size() ? "_Shifted": "")), EImageBlitMode::COLORKEY);
 	logGlobal->debug("Done loading map rivers");
 }
@@ -214,10 +214,10 @@ uint8_t MapRendererRiver::checksum(IMapRendererContext & context, const int3 & c
 }
 
 MapRendererRoad::MapRendererRoad()
-	: storage(VLC->roadTypeHandler->objects.size())
+	: storage(LIBRARY->roadTypeHandler->objects.size())
 {
 	logGlobal->debug("Loading map roads");
-	for(const auto & road : VLC->roadTypeHandler->objects)
+	for(const auto & road : LIBRARY->roadTypeHandler->objects)
 		storage.load(road->getIndex(), road->tilesFilename, EImageBlitMode::COLORKEY);
 	logGlobal->debug("Done loading map roads");
 }

+ 3 - 3
client/mapView/mapHandler.cpp

@@ -55,7 +55,7 @@ std::string CMapHandler::getTerrainDescr(const int3 & pos, bool rightClick) cons
 	const TerrainTile & t = map->getTile(pos);
 
 	if(t.hasFavorableWinds())
-		return VLC->objtypeh->getObjectName(Obj::FAVORABLE_WINDS, 0);
+		return LIBRARY->objtypeh->getObjectName(Obj::FAVORABLE_WINDS, 0);
 
 	std::string result = t.getTerrain()->getNameTranslated();
 
@@ -72,7 +72,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 % VLC->generaltexth->allTexts[330]
+			% result % LIBRARY->generaltexth->allTexts[330]
 		); // 'digging ok'
 	}
 
@@ -242,6 +242,6 @@ IMapObjectObserver::IMapObjectObserver()
 
 IMapObjectObserver::~IMapObjectObserver()
 {
-	if (VLC && MAPHANDLER)
+	if (LIBRARY && MAPHANDLER)
 		GAME->map().removeMapObserver(this);
 }

+ 3 - 3
client/media/CMusicHandler.cpp

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

+ 2 - 2
client/media/CVideoHandler.cpp

@@ -25,7 +25,7 @@
 #include "../../lib/filesystem/Filesystem.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/Languages.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 #include <SDL_render.h>
 
@@ -524,7 +524,7 @@ int FFMpegStream::findAudioStream() const
 		}
 	}
 
-	std::string preferredLanguageName = VLC->generaltexth->getPreferredLanguage();
+	std::string preferredLanguageName = LIBRARY->generaltexth->getPreferredLanguage();
 	std::string preferredTag = Languages::getLanguageOptions(preferredLanguageName).tagISO2;
 
 	for (auto const & entry : streamToLanguage)

+ 4 - 4
client/render/AssetGenerator.cpp

@@ -24,7 +24,7 @@
 #include "../lib/IGameSettings.h"
 #include "../lib/json/JsonNode.h"
 #include "../lib/VCMIDirs.h"
-#include "../lib/VCMI_Lib.h"
+#include "../lib/GameLibrary.h"
 #include "../lib/RiverHandler.h"
 #include "../lib/RoadHandler.h"
 #include "../lib/TerrainHandler.h"
@@ -156,7 +156,7 @@ AssetGenerator::CanvasPtr AssetGenerator::createPlayerColoredBackground(const Pl
 	std::shared_ptr<IImage> texture = ENGINE->renderHandler().loadImage(locator);
 
 	// transform to make color of brown DIBOX.PCX texture match color of specified player
-	auto filterSettings = VLC->settingsHandler->getFullConfig()["interface"]["playerColoredBackground"];
+	auto filterSettings = LIBRARY->settingsHandler->getFullConfig()["interface"]["playerColoredBackground"];
 	static const std::array<ColorFilter, PlayerColor::PLAYER_LIMIT_I> filters = {
 		ColorFilter::genRangeShifter( filterSettings["red"   ].convertTo<std::vector<float>>() ),
 		ColorFilter::genRangeShifter( filterSettings["blue"  ].convertTo<std::vector<float>>() ),
@@ -280,7 +280,7 @@ AssetGenerator::CanvasPtr AssetGenerator::createChroniclesCampaignImages(int chr
 
 void AssetGenerator::createPaletteShiftedSprites()
 {
-	for(auto entity : VLC->terrainTypeHandler->objects)
+	for(auto entity : LIBRARY->terrainTypeHandler->objects)
 	{
 		if(entity->paletteAnimation.empty())
 			continue;
@@ -292,7 +292,7 @@ void AssetGenerator::createPaletteShiftedSprites()
 		generatePaletteShiftedAnimation(entity->tilesFilename, paletteShifts);
 
 	}
-	for(auto entity : VLC->riverTypeHandler->objects)
+	for(auto entity : LIBRARY->riverTypeHandler->objects)
 	{
 		if(entity->paletteAnimation.empty())
 			continue;

+ 2 - 2
client/render/Graphics.cpp

@@ -27,7 +27,7 @@
 #include "../../lib/json/JsonNode.h"
 #include "../lib/modding/CModHandler.h"
 #include "../lib/modding/ModScope.h"
-#include "../lib/VCMI_Lib.h"
+#include "../lib/GameLibrary.h"
 
 #include <SDL_surface.h>
 
@@ -89,7 +89,7 @@ void Graphics::loadPaletteAndColors()
 
 void Graphics::initializeBattleGraphics()
 {
-	auto allConfigs = VLC->modh->getActiveMods();
+	auto allConfigs = LIBRARY->modh->getActiveMods();
 	allConfigs.insert(allConfigs.begin(), ModScope::scopeBuiltin());
 	for(auto & mod : allConfigs)
 	{

+ 1 - 1
client/render/IRenderHandler.h

@@ -31,7 +31,7 @@ class IRenderHandler : public boost::noncopyable
 public:
 	virtual ~IRenderHandler() = default;
 
-	/// Must be called once VLC loading is over to initialize icons
+	/// Must be called once LIBRARY loading is over to initialize icons
 	virtual void onLibraryLoadingFinished(const Services * services) = 0;
 
 	/// Loads image using given path

+ 2 - 2
client/renderSDL/CBitmapFont.cpp

@@ -20,7 +20,7 @@
 
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/Rect.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 #include "../../lib/filesystem/Filesystem.h"
 #include "../../lib/modding/CModHandler.h"
 #include "../../lib/texts/Languages.h"
@@ -101,7 +101,7 @@ static AtlasLayout doAtlasPacking(const std::map<int, Point> & images)
 void CBitmapFont::loadFont(const ResourcePath & resource, std::unordered_map<CodePoint, EntryFNT> & loadedChars)
 {
 	auto data = CResourceHandler::get()->load(resource)->readAll();
-	std::string modEncoding = VLC->modh->findResourceEncoding(resource);
+	std::string modEncoding = LIBRARY->modh->findResourceEncoding(resource);
 
 	height = data.first[5];
 

+ 3 - 3
client/renderSDL/FontChain.cpp

@@ -18,7 +18,7 @@
 #include "../../lib/texts/TextOperations.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/texts/Languages.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 void FontChain::renderText(SDL_Surface * surface, const std::string & data, const ColorRGBA & color, const Point & pos) const
 {
@@ -59,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 = VLC->generaltexth->getPreferredLanguage();
+	std::string gameLanguage = LIBRARY->generaltexth->getPreferredLanguage();
 	std::string gameEncoding = Languages::getLanguageOptions(gameLanguage).encoding;
-	std::string fontEncoding = VLC->modh->findResourceEncoding(ResourcePath("data/" + bitmapFontName, EResType::BMP_FONT));
+	std::string fontEncoding = LIBRARY->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

+ 3 - 3
client/widgets/Buttons.cpp

@@ -30,7 +30,7 @@
 #include "../../lib/CConfigHandler.h"
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/filesystem/Filesystem.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.h"
 
 void ButtonBase::update()
 {
@@ -384,8 +384,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(
-		VLC->generaltexth->translate(key, "hover"),
-		VLC->generaltexth->translate(key, "help")
+		LIBRARY->generaltexth->translate(key, "hover"),
+		LIBRARY->generaltexth->translate(key, "help")
 	);
 }
 

+ 30 - 30
client/widgets/CComponent.cpp

@@ -36,7 +36,7 @@
 #include "../../lib/texts/CGeneralTextHandler.h"
 #include "../../lib/CArtHandler.h"
 #include "../../lib/CArtifactInstance.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.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, (*VLC->townh)[data.subType.as<BuildingTypeUniqueID>().getFaction()]->town->clientInfo.buildingsIcons);
+			return std::vector<AnimationPath>(4, (*LIBRARY->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 VLC->creatures()->getById(data.subType.as<CreatureID>())->getIconIndex();
+			return LIBRARY->creatures()->getById(data.subType.as<CreatureID>())->getIconIndex();
 		case ComponentType::ARTIFACT:
-			return VLC->artifacts()->getById(data.subType.as<ArtifactID>())->getIconIndex();
+			return LIBRARY->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 VLC->heroTypes()->getById(data.subType.as<HeroTypeID>())->getIconIndex();
+			return LIBRARY->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 VLC->generaltexth->arraytxt[2+data.subType.getNum()];
+			return LIBRARY->generaltexth->arraytxt[2+data.subType.getNum()];
 		case ComponentType::EXPERIENCE:
 		case ComponentType::LEVEL:
-			return VLC->generaltexth->allTexts[241];
+			return LIBRARY->generaltexth->allTexts[241];
 		case ComponentType::MANA:
-			return VLC->generaltexth->allTexts[149];
+			return LIBRARY->generaltexth->allTexts[149];
 		case ComponentType::SEC_SKILL:
-			return VLC->skillh->getByIndex(data.subType.getNum())->getDescriptionTranslated(data.value.value_or(0));
+			return LIBRARY->skillh->getByIndex(data.subType.getNum())->getDescriptionTranslated(data.value.value_or(0));
 		case ComponentType::RESOURCE:
 		case ComponentType::RESOURCE_PER_DAY:
-			return VLC->generaltexth->allTexts[242];
+			return LIBRARY->generaltexth->allTexts[242];
 		case ComponentType::NONE:
 		case ComponentType::CREATURE:
 			return "";
 		case ComponentType::ARTIFACT:
-			return VLC->artifacts()->getById(data.subType.as<ArtifactID>())->getDescriptionTranslated();
+			return LIBRARY->artifacts()->getById(data.subType.as<ArtifactID>())->getDescriptionTranslated();
 		case ComponentType::SPELL_SCROLL:
 		{
-			auto description = ArtifactID(ArtifactID::SPELL_SCROLL).toEntity(VLC)->getDescriptionTranslated();
+			auto description = ArtifactID(ArtifactID::SPELL_SCROLL).toEntity(LIBRARY)->getDescriptionTranslated();
 			ArtifactUtils::insertScrrollSpellName(description, data.subType.as<SpellID>());
 			return description;
 		}
 		case ComponentType::SPELL:
-			return VLC->spells()->getById(data.subType.as<SpellID>())->getDescriptionTranslated(std::max(0, data.value.value_or(0)));
+			return LIBRARY->spells()->getById(data.subType.as<SpellID>())->getDescriptionTranslated(std::max(0, data.value.value_or(0)));
 		case ComponentType::MORALE:
-			return VLC->generaltexth->heroscrn[ 4 - (data.value.value_or(0)>0) + (data.value.value_or(0)<0)];
+			return LIBRARY->generaltexth->heroscrn[ 4 - (data.value.value_or(0)>0) + (data.value.value_or(0)<0)];
 		case ComponentType::LUCK:
-			return VLC->generaltexth->heroscrn[ 7 - (data.value.value_or(0)>0) + (data.value.value_or(0)<0)];
+			return LIBRARY->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 (*VLC->townh)[index.getFaction()]->town->buildings[index.getBuilding()]->getDescriptionTranslated();
+			return (*LIBRARY->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) % VLC->generaltexth->primarySkillNames[data.subType.getNum()]);
+				return boost::str(boost::format("%+d %s") % data.value.value_or(0) % LIBRARY->generaltexth->primarySkillNames[data.subType.getNum()]);
 			else
-				return VLC->generaltexth->primarySkillNames[data.subType.getNum()];
+				return LIBRARY->generaltexth->primarySkillNames[data.subType.getNum()];
 		case ComponentType::EXPERIENCE:
 			return std::to_string(data.value.value_or(0));
 		case ComponentType::LEVEL:
 		{
-			std::string level = VLC->generaltexth->allTexts[442];
+			std::string level = LIBRARY->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) % VLC->generaltexth->allTexts[387]);
+			return boost::str(boost::format("%+d %s") % data.value.value_or(0) % LIBRARY->generaltexth->allTexts[387]);
 		case ComponentType::SEC_SKILL:
-			return VLC->generaltexth->levels[data.value.value_or(0)-1] + "\n" + VLC->skillh->getById(data.subType.as<SecondarySkill>())->getNameTranslated();
+			return LIBRARY->generaltexth->levels[data.value.value_or(0)-1] + "\n" + LIBRARY->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(VLC->generaltexth->allTexts[3]) % data.value.value_or(0));
+			return boost::str(boost::format(LIBRARY->generaltexth->allTexts[3]) % data.value.value_or(0));
 		case ComponentType::CREATURE:
 		{
-			auto creature = VLC->creh->getById(data.subType.as<CreatureID>());
+			auto creature = LIBRARY->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 VLC->artifacts()->getById(data.subType.as<ArtifactID>())->getNameTranslated();
+			return LIBRARY->artifacts()->getById(data.subType.as<ArtifactID>())->getNameTranslated();
 		case ComponentType::SPELL_SCROLL:
 		case ComponentType::SPELL:
 			if (data.value.value_or(0) < 0)
-				return "{#A9A9A9|" + VLC->spells()->getById(data.subType.as<SpellID>())->getNameTranslated() + "}";
+				return "{#A9A9A9|" + LIBRARY->spells()->getById(data.subType.as<SpellID>())->getNameTranslated() + "}";
 			else
-				return VLC->spells()->getById(data.subType.as<SpellID>())->getNameTranslated();
+				return LIBRARY->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 = (*VLC->townh)[index.getFaction()]->town->buildings[index.getBuilding()];
+				auto building = (*LIBRARY->townh)[index.getFaction()]->town->buildings[index.getBuilding()];
 				if(!building)
 				{
-					logGlobal->error("Town of faction %s has no building #%d", (*VLC->townh)[index.getFaction()]->town->faction->getNameTranslated(), index.getBuilding().getNum());
+					logGlobal->error("Town of faction %s has no building #%d", (*LIBRARY->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 VLC->generaltexth->capColors[data.subType.as<PlayerColor>().getNum()];
+			return LIBRARY->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, VLC->generaltexth->allTexts[4]));
+					orLabels.push_back(std::make_shared<CLabel>(orPos.x, orPos.y, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[4]));
 				}
 				currentX += getDistance(prevComp.get(), iter->get());
 			}

+ 7 - 7
client/widgets/CComponentHolder.cpp

@@ -168,7 +168,7 @@ void CCommanderArtPlace::returnArtToHeroCallback()
 	ArtifactPosition freeSlot = ArtifactUtils::getArtBackpackPosition(commanderOwner, getArtifactId());
 	if(freeSlot == ArtifactPosition::PRE_FIRST)
 	{
-		GAME->interface()->showInfoDialog(VLC->generaltexth->translate("core.genrltxt.152"));
+		GAME->interface()->showInfoDialog(LIBRARY->generaltexth->translate("core.genrltxt.152"));
 	}
 	else
 	{
@@ -188,7 +188,7 @@ void CCommanderArtPlace::returnArtToHeroCallback()
 void CCommanderArtPlace::clickPressed(const Point & cursorPosition)
 {
 	if(getArtifactId() != ArtifactID::NONE && text.size())
-		GAME->interface()->showYesNoDialog(VLC->generaltexth->translate("vcmi.commanderWindow.artifactMessage"), [this]() { returnArtToHeroCallback(); }, []() {});
+		GAME->interface()->showYesNoDialog(LIBRARY->generaltexth->translate("vcmi.commanderWindow.artifactMessage"), [this]() { returnArtToHeroCallback(); }, []() {});
 }
 
 void CCommanderArtPlace::showPopupWindow(const Point & cursorPosition)
@@ -203,18 +203,18 @@ void CArtPlace::lockSlot(bool on)
 	if(on)
 	{
 		image->setFrame(ArtifactID::ART_LOCK);
-		hoverText = VLC->generaltexth->allTexts[507];
+		hoverText = LIBRARY->generaltexth->allTexts[507];
 	}
 	else if(artId != ArtifactID::NONE)
 	{
 		image->setFrame(imageIndex);
-		auto hoverText = MetaString::createFromRawString(VLC->generaltexth->heroscrn[1]);
+		auto hoverText = MetaString::createFromRawString(LIBRARY->generaltexth->heroscrn[1]);
 		hoverText.replaceName(artId);
 		this->hoverText = hoverText.toString();
 	}
 	else
 	{
-		hoverText = VLC->generaltexth->allTexts[507];
+		hoverText = LIBRARY->generaltexth->allTexts[507];
 	}
 }
 
@@ -298,8 +298,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(VLC->generaltexth->heroscrn[21]);
-		hoverText.replaceRawString(VLC->generaltexth->levels[level - 1]);
+		auto hoverText = MetaString::createFromRawString(LIBRARY->generaltexth->heroscrn[21]);
+		hoverText.replaceRawString(LIBRARY->generaltexth->levels[level - 1]);
 		hoverText.replaceTextID(secSkill->getNameTextID());
 		this->hoverText = hoverText.toString();
 		component.value = level;

+ 10 - 10
client/widgets/CGarrisonInt.cpp

@@ -55,17 +55,17 @@ void CGarrisonSlot::hover (bool on)
 			{
 				if(owner->getSelection() == this)
 				{
-					temp = VLC->generaltexth->tcommands[4]; //View %s
+					temp = LIBRARY->generaltexth->tcommands[4]; //View %s
 					boost::algorithm::replace_first(temp,"%s",creature->getNameSingularTranslated());
 				}
 				else if (owner->getSelection()->creature == creature)
 				{
-					temp = VLC->generaltexth->tcommands[2]; //Combine %s armies
+					temp = LIBRARY->generaltexth->tcommands[2]; //Combine %s armies
 					boost::algorithm::replace_first(temp,"%s",creature->getNameSingularTranslated());
 				}
 				else if (owner->getSelection()->creature)
 				{
-					temp = VLC->generaltexth->tcommands[7]; //Exchange %s with %s
+					temp = LIBRARY->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 +85,15 @@ void CGarrisonSlot::hover (bool on)
 
 				if(isHeroOnMap)
 				{
-					temp = VLC->generaltexth->allTexts[481]; //Select %s
+					temp = LIBRARY->generaltexth->allTexts[481]; //Select %s
 				}
 				else if(upg == EGarrisonType::UPPER)
 				{
-					temp = VLC->generaltexth->tcommands[12]; //Select %s (in garrison)
+					temp = LIBRARY->generaltexth->tcommands[12]; //Select %s (in garrison)
 				}
 				else // Hero is visiting some object (town, mine, etc)
 				{
-					temp = VLC->generaltexth->tcommands[32]; //Select %s (visiting)
+					temp = LIBRARY->generaltexth->tcommands[32]; //Select %s (visiting)
 				}
 				boost::algorithm::replace_first(temp,"%s",creature->getNameSingularTranslated());
 			}
@@ -108,17 +108,17 @@ void CGarrisonSlot::hover (bool on)
 				  && owner->getSelection()->upg != upg	//we're moving it to the other garrison
 				  )
 				{
-					temp = VLC->generaltexth->tcommands[5]; //Cannot move last army to garrison
+					temp = LIBRARY->generaltexth->tcommands[5]; //Cannot move last army to garrison
 				}
 				else
 				{
-					temp = VLC->generaltexth->tcommands[6]; //Move %s
+					temp = LIBRARY->generaltexth->tcommands[6]; //Move %s
 					boost::algorithm::replace_first(temp,"%s",owner->getSelection()->creature->getNameSingularTranslated());
 				}
 			}
 			else
 			{
-				temp = VLC->generaltexth->tcommands[11]; //Empty
+				temp = LIBRARY->generaltexth->tcommands[11]; //Empty
 			}
 		}
 		ENGINE->statusbar()->write(temp);
@@ -514,7 +514,7 @@ bool CGarrisonSlot::handleSplittingShortcuts()
 	{
 		auto dismiss = getDismiss();
 		if(dismiss)
-			GAME->interface()->showYesNoDialog(VLC->generaltexth->allTexts[12], dismiss, nullptr);
+			GAME->interface()->showYesNoDialog(LIBRARY->generaltexth->allTexts[12], dismiss, nullptr);
 	}
 	else if(isAlt)
 	{

+ 13 - 13
client/widgets/MiscWidgets.cpp

@@ -216,9 +216,9 @@ std::string CMinorResDataBar::buildDateString()
 	std::string pattern = "%s: %d, %s: %d, %s: %d";
 
 	auto formatted = boost::format(pattern)
-		% VLC->generaltexth->translate("core.genrltxt.62") % GAME->interface()->cb->getDate(Date::MONTH)
-		% VLC->generaltexth->translate("core.genrltxt.63") % GAME->interface()->cb->getDate(Date::WEEK)
-		% VLC->generaltexth->translate("core.genrltxt.64") % GAME->interface()->cb->getDate(Date::DAY_OF_WEEK);
+		% LIBRARY->generaltexth->translate("core.genrltxt.62") % GAME->interface()->cb->getDate(Date::MONTH)
+		% LIBRARY->generaltexth->translate("core.genrltxt.63") % GAME->interface()->cb->getDate(Date::WEEK)
+		% LIBRARY->generaltexth->translate("core.genrltxt.64") % GAME->interface()->cb->getDate(Date::DAY_OF_WEEK);
 
 	return boost::str(formatted);
 }
@@ -298,7 +298,7 @@ void CArmyTooltip::init(const InfoAboutArmy &army)
 				}
 				else
 				{
-					subtitle = VLC->generaltexth->arraytxt[171 + 3*(slot.second.count)];
+					subtitle = LIBRARY->generaltexth->arraytxt[171 + 3*(slot.second.count)];
 				}
 			}
 		}
@@ -482,7 +482,7 @@ void CInteractableTownTooltip::init(const CGTownInstance * town)
 				return;
 			}
 		}
-		GAME->interface()->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
+		GAME->interface()->showInfoDialog(LIBRARY->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
 	});
 
 	assert(townInfo.tType);
@@ -576,16 +576,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 = VLC->generaltexth->heroscrn[hoverTextBase[morale] - mrlt];
+	hoverText = LIBRARY->generaltexth->heroscrn[hoverTextBase[morale] - mrlt];
 	component.type = componentType[morale];
-	text = VLC->generaltexth->arraytxt[textId[morale]];
-	boost::algorithm::replace_first(text,"%s",VLC->generaltexth->arraytxt[neutralDescr[morale]-mrlt]);
+	text = LIBRARY->generaltexth->arraytxt[textId[morale]];
+	boost::algorithm::replace_first(text,"%s",LIBRARY->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 += VLC->generaltexth->arraytxt[113]; //unaffected by morale
+		text += LIBRARY->generaltexth->arraytxt[113]; //unaffected by morale
 		component.value = 0;
 	}
 	else if(morale && node && node->getBonusBearer()->hasBonusOfType(BonusType::NO_MORALE))
@@ -614,7 +614,7 @@ void MoraleLuckBox::set(const AFactionMember * node)
 			}
 		}
 		text = addInfo.empty() 
-			? text + VLC->generaltexth->arraytxt[noneTxtId] 
+			? text + LIBRARY->generaltexth->arraytxt[noneTxtId] 
 			: text + addInfo;
 	}
 	std::string imageName;
@@ -644,7 +644,7 @@ CCreaturePic::CCreaturePic(int x, int y, const CCreature * cre, bool Big, bool A
 
 	auto faction = cre->getFactionID();
 
-	assert(VLC->townh->size() > faction);
+	assert(LIBRARY->townh->size() > faction);
 
 	if (cre->animDefName.empty())
 	{
@@ -656,9 +656,9 @@ CCreaturePic::CCreaturePic(int x, int y, const CCreature * cre, bool Big, bool A
 	}
 
 	if(Big)
-		bg = std::make_shared<CPicture>((*VLC->townh)[faction]->creatureBg130);
+		bg = std::make_shared<CPicture>((*LIBRARY->townh)[faction]->creatureBg130);
 	else
-		bg = std::make_shared<CPicture>((*VLC->townh)[faction]->creatureBg120);
+		bg = std::make_shared<CPicture>((*LIBRARY->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

@@ -19,7 +19,7 @@
 #include "../render/IImage.h"
 
 #include "../../lib/texts/CGeneralTextHandler.h"
-#include "../../lib/VCMI_Lib.h"
+#include "../../lib/GameLibrary.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, VLC->generaltexth->translate(hoverText), callback, alternativeLayout);
+	auto item = std::make_shared<RadialMenuItem>(path, LIBRARY->generaltexth->translate(hoverText), callback, alternativeLayout);
 
 	item->moveBy(offset);
 

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

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

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

@@ -33,18 +33,18 @@ CAltarCreatures::CAltarCreatures(const IMarket * market, const CGHeroInstance *
 	OBJECT_CONSTRUCTION;
 
 	deal = std::make_shared<CButton>(dealButtonPosWithSlider, AnimationPath::builtin("ALTSACR.DEF"),
-		VLC->generaltexth->zelp[584], [this]() {CAltarCreatures::makeDeal();}, EShortcut::MARKET_DEAL);
+		LIBRARY->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(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));
+		boost::str(boost::format(LIBRARY->generaltexth->allTexts[272]) % hero->getNameTranslated())));
+	labels.emplace_back(std::make_shared<CLabel>(450, 30, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->allTexts[479]));
+	texts.emplace_back(std::make_unique<CTextBox>(LIBRARY->generaltexth->allTexts[480], Rect(320, 56, 256, 40), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW));
 	offerSlider->moveTo(pos.topLeft() + Point(231, 481));
-	maxAmount->setHelp(VLC->generaltexth->zelp[578]);
+	maxAmount->setHelp(LIBRARY->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"), VLC->generaltexth->zelp[579], std::bind(&CExperienceAltar::sacrificeAll, this), EShortcut::MARKET_SACRIFICE_ALL);
+		Point(393, 520), AnimationPath::builtin("ALTARMY.DEF"), LIBRARY->generaltexth->zelp[579], std::bind(&CExperienceAltar::sacrificeAll, this), EShortcut::MARKET_SACRIFICE_ALL);
 
 	// Hero creatures panel
 	assert(bidTradePanel);
@@ -175,9 +175,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()), VLC->creatures()->getByIndex(bidTradePanel->getHighlightedItemId())->getIconIndex()};
+		bidSelected = ShowcaseParams {std::to_string(offerSlider->getValue()), LIBRARY->creatures()->getByIndex(bidTradePanel->getHighlightedItemId())->getIconIndex()};
 	if(offerTradePanel->isHighlighted() && offerSlider->getValue() > 0)
-		offerSelected = ShowcaseParams {offerTradePanel->highlightedSlot->subtitle->getText(), VLC->creatures()->getByIndex(offerTradePanel->getHighlightedItemId())->getIconIndex()};
+		offerSelected = ShowcaseParams {offerTradePanel->highlightedSlot->subtitle->getText(), LIBRARY->creatures()->getByIndex(offerTradePanel->getHighlightedItemId())->getIconIndex()};
 	return MarketShowcasesParams {bidSelected, offerSelected};
 }
 
@@ -214,7 +214,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(VLC->generaltexth->allTexts[122]) % std::to_string(hero->calculateXp(units * expPerUnit[slot->serial]))) : "");
+		boost::str(boost::format(LIBRARY->generaltexth->allTexts[122]) % std::to_string(hero->calculateXp(units * expPerUnit[slot->serial]))) : "");
 }
 
 void CAltarCreatures::onOfferSliderMoved(int newVal)

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

@@ -32,8 +32,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"),
-		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]));
+		LIBRARY->generaltexth->zelp[595], [this](){CArtifactsBuying::makeDeal();}, EShortcut::MARKET_DEAL);
+	labels.emplace_back(std::make_shared<CLabel>(445, 148, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[168]));
 
 	// Player's resources
 	assert(bidTradePanel);
@@ -75,7 +75,7 @@ void CArtifactsBuying::makeDeal()
 	}
 	else
 	{
-		GAME->interface()->showInfoDialog(VLC->generaltexth->translate("core.genrltxt.326"));
+		GAME->interface()->showInfoDialog(LIBRARY->generaltexth->translate("core.genrltxt.326"));
 	}
 }
 
@@ -85,7 +85,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), VLC->artifacts()->getByIndex(offerTradePanel->getHighlightedItemId())->getIconIndex()}
+			ShowcaseParams {std::to_string(deal->isBlocked() ? 0 : offerQty), LIBRARY->artifacts()->getByIndex(offerTradePanel->getHighlightedItemId())->getIconIndex()}
 		};
 	else
 		return MarketShowcasesParams {std::nullopt, std::nullopt};
@@ -115,6 +115,6 @@ std::string CArtifactsBuying::getTraderText()
 	}
 	else
 	{
-		return madeTransaction ? VLC->generaltexth->allTexts[162] : VLC->generaltexth->allTexts[163];
+		return madeTransaction ? LIBRARY->generaltexth->allTexts[162] : LIBRARY->generaltexth->allTexts[163];
 	}
 }

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

@@ -35,9 +35,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(VLC->generaltexth->allTexts[271]) % hero->getNameTranslated())));
+	labels.push_back(std::make_shared<CLabel>(155, 56, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, boost::str(boost::format(LIBRARY->generaltexth->allTexts[271]) % hero->getNameTranslated())));
 	deal = std::make_shared<CButton>(dealButtonPos, AnimationPath::builtin("TPMRKB.DEF"),
-		VLC->generaltexth->zelp[595], [this](){CArtifactsSelling::makeDeal();}, EShortcut::MARKET_DEAL);
+		LIBRARY->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 +59,7 @@ CArtifactsSelling::CArtifactsSelling(const IMarket * market, const CGHeroInstanc
 	heroArts->onClickNotTradableCallback = []()
 	{
 		// This item can't be traded
-		GAME->interface()->showInfoDialog(VLC->generaltexth->allTexts[21]);
+		GAME->interface()->showInfoDialog(LIBRARY->generaltexth->allTexts[21]);
 	};
 	CArtifactsSelling::updateShowcases();
 	CArtifactsSelling::deselect();
@@ -90,7 +90,7 @@ void CArtifactsSelling::updateShowcases()
 	{
 		bidSelectedSlot->image->enable();
 		bidSelectedSlot->setID(art->getTypeId().num);
-		bidSelectedSlot->image->setFrame(VLC->artifacts()->getByIndex(art->getTypeId())->getIconIndex());
+		bidSelectedSlot->image->setFrame(LIBRARY->artifacts()->getByIndex(art->getTypeId())->getIconIndex());
 		bidSelectedSlot->subtitle->setText(std::to_string(bidQty));
 	}
 	else
@@ -161,13 +161,13 @@ std::string CArtifactsSelling::getTraderText()
 	{
 		MetaString message = MetaString::createFromTextID("core.genrltxt.268");
 		message.replaceNumber(offerQty);
-		message.replaceRawString(offerQty == 1 ? VLC->generaltexth->allTexts[161] : VLC->generaltexth->allTexts[160]);
+		message.replaceRawString(offerQty == 1 ? LIBRARY->generaltexth->allTexts[161] : LIBRARY->generaltexth->allTexts[160]);
 		message.replaceName(GameResID(offerTradePanel->getHighlightedItemId()));
 		message.replaceName(art->getTypeId());
 		return message.toString();
 	}
 	else
 	{
-		return madeTransaction ? VLC->generaltexth->allTexts[162] : VLC->generaltexth->allTexts[163];
+		return madeTransaction ? LIBRARY->generaltexth->allTexts[162] : LIBRARY->generaltexth->allTexts[163];
 	}
 }

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

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

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

@@ -125,9 +125,9 @@ CExperienceAltar::CExperienceAltar()
 	OBJECT_CONSTRUCTION;
 
 	// Experience needed to reach next level
-	texts.emplace_back(std::make_shared<CTextBox>(VLC->generaltexth->allTexts[475], Rect(15, 415, 125, 50), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW));
+	texts.emplace_back(std::make_shared<CTextBox>(LIBRARY->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>(VLC->generaltexth->allTexts[476], Rect(15, 495, 125, 40), 0, FONT_SMALL, ETextAlignment::CENTER, Colors::YELLOW));
+	texts.emplace_back(std::make_shared<CTextBox>(LIBRARY->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 +139,7 @@ void CExperienceAltar::deselect()
 
 void CExperienceAltar::update()
 {
-	expToLevel->setText(std::to_string(VLC->heroh->reqExp(VLC->heroh->level(hero->exp) + 1) - hero->exp));
+	expToLevel->setText(std::to_string(LIBRARY->heroh->reqExp(LIBRARY->heroh->level(hero->exp) + 1) - hero->exp));
 }
 
 CCreaturesSelling::CCreaturesSelling()
@@ -175,7 +175,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, VLC->generaltexth->allTexts[168]));
+	labels.emplace_back(std::make_shared<CLabel>(445, 148, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[168]));
 }
 
 CResourcesSelling::CResourcesSelling(const CTradeableItem::ClickPressedFunctor & clickPressedCallback)
@@ -183,7 +183,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, VLC->generaltexth->allTexts[270]));
+	labels.emplace_back(std::make_shared<CLabel>(156, 148, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, LIBRARY->generaltexth->allTexts[270]));
 }
 
 void CResourcesSelling::updateSubtitles() const
@@ -197,7 +197,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"), VLC->generaltexth->zelp[596],
+	maxAmount = std::make_shared<CButton>(Point(228, 520), AnimationPath::builtin("IRCBTNS.DEF"), LIBRARY->generaltexth->zelp[596],
 		[this]()
 		{
 			offerSlider->scrollToMax();

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

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

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

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

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

@@ -139,9 +139,9 @@ int CTradeableItem::getIndex()
 		return id;
 	case EType::ARTIFACT_TYPE:
 	case EType::ARTIFACT:
-		return VLC->artifacts()->getByIndex(id)->getIconIndex();
+		return LIBRARY->artifacts()->getByIndex(id)->getIconIndex();
 	case EType::CREATURE:
-		return VLC->creatures()->getByIndex(id)->getIconIndex();
+		return LIBRARY->creatures()->getByIndex(id)->getIconIndex();
 	default:
 		return -1;
 	}
@@ -164,20 +164,20 @@ void CTradeableItem::hover(bool on)
 	switch(type)
 	{
 	case EType::CREATURE:
-		ENGINE->statusbar()->write(boost::str(boost::format(VLC->generaltexth->allTexts[481]) % VLC->creh->objects[id]->getNamePluralTranslated()));
+		ENGINE->statusbar()->write(boost::str(boost::format(LIBRARY->generaltexth->allTexts[481]) % LIBRARY->creh->objects[id]->getNamePluralTranslated()));
 		break;
 	case EType::ARTIFACT_TYPE:
 	case EType::ARTIFACT:
 		if(id < 0)
-			ENGINE->statusbar()->write(VLC->generaltexth->zelp[582].first);
+			ENGINE->statusbar()->write(LIBRARY->generaltexth->zelp[582].first);
 		else
-			ENGINE->statusbar()->write(VLC->artifacts()->getByIndex(id)->getNameTranslated());
+			ENGINE->statusbar()->write(LIBRARY->artifacts()->getByIndex(id)->getNameTranslated());
 		break;
 	case EType::RESOURCE:
-		ENGINE->statusbar()->write(VLC->generaltexth->restypes[id]);
+		ENGINE->statusbar()->write(LIBRARY->generaltexth->restypes[id]);
 		break;
 	case EType::PLAYER:
-		ENGINE->statusbar()->write(VLC->generaltexth->capColors[id]);
+		ENGINE->statusbar()->write(LIBRARY->generaltexth->capColors[id]);
 		break;
 	}
 }
@@ -191,7 +191,7 @@ void CTradeableItem::showPopupWindow(const Point & cursorPosition)
 	case EType::ARTIFACT_TYPE:
 	case EType::ARTIFACT:
 		if (id >= 0)
-			CRClickPopup::createAndPush(VLC->artifacts()->getByIndex(id)->getDescriptionTranslated());
+			CRClickPopup::createAndPush(LIBRARY->artifacts()->getByIndex(id)->getDescriptionTranslated());
 		break;
 	}
 }
@@ -316,7 +316,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(VLC->generaltexth->capColors[players[slotNum].num]);
+		slot->subtitle->setText(LIBRARY->generaltexth->capColors[players[slotNum].num]);
 		slotNum++;
 	}
 	showcaseSlot = std::make_shared<CTradeableItem>(Rect(selectedPos, slotDimension), EType::PLAYER, 0, 0);

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä