浏览代码

Fix map grid visibility on game load

Ivan Savenko 2 年之前
父节点
当前提交
a9d25b0109
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. 9 1
      client/mapView/MapViewController.cpp
  2. 1 0
      client/mapView/MapViewController.h

+ 9 - 1
client/mapView/MapViewController.cpp

@@ -185,9 +185,16 @@ void MapViewController::tick(uint32_t timeDelta)
 		fadingInContext->progress = std::min( 1.0, fadingInContext->progress);
 	}
 
+	if (adventureContext)
+		adventureContext->animationTime += timeDelta;
+
+	updateState();
+}
+
+void MapViewController::updateState()
+{
 	if(adventureContext)
 	{
-		adventureContext->animationTime += timeDelta;
 		adventureContext->settingsSessionSpectate = settings["session"]["spectate"].Bool();
 		adventureContext->settingsAdventureObjectAnimation = settings["adventure"]["objectAnimation"].Bool();
 		adventureContext->settingsAdventureTerrainAnimation = settings["adventure"]["terrainAnimation"].Bool();
@@ -511,6 +518,7 @@ void MapViewController::activateAdventureContext(uint32_t animationTime)
 	adventureContext = std::make_shared<MapRendererAdventureContext>(*state);
 	adventureContext->animationTime = animationTime;
 	context = adventureContext;
+	updateState();
 }
 
 void MapViewController::activateAdventureContext()

+ 1 - 0
client/mapView/MapViewController.h

@@ -74,6 +74,7 @@ private:
 	void onAfterHeroDisembark(const CGHeroInstance * obj, const int3 & from, const int3 & dest) override;
 
 	void resetContext();
+	void updateState();
 
 public:
 	MapViewController(std::shared_ptr<MapViewModel> model, std::shared_ptr<MapViewCache> view);