mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Fix map grid visibility on game load
This commit is contained in:
@@ -185,9 +185,16 @@ void MapViewController::tick(uint32_t timeDelta)
|
|||||||
fadingInContext->progress = std::min( 1.0, fadingInContext->progress);
|
fadingInContext->progress = std::min( 1.0, fadingInContext->progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (adventureContext)
|
||||||
|
adventureContext->animationTime += timeDelta;
|
||||||
|
|
||||||
|
updateState();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapViewController::updateState()
|
||||||
|
{
|
||||||
if(adventureContext)
|
if(adventureContext)
|
||||||
{
|
{
|
||||||
adventureContext->animationTime += timeDelta;
|
|
||||||
adventureContext->settingsSessionSpectate = settings["session"]["spectate"].Bool();
|
adventureContext->settingsSessionSpectate = settings["session"]["spectate"].Bool();
|
||||||
adventureContext->settingsAdventureObjectAnimation = settings["adventure"]["objectAnimation"].Bool();
|
adventureContext->settingsAdventureObjectAnimation = settings["adventure"]["objectAnimation"].Bool();
|
||||||
adventureContext->settingsAdventureTerrainAnimation = settings["adventure"]["terrainAnimation"].Bool();
|
adventureContext->settingsAdventureTerrainAnimation = settings["adventure"]["terrainAnimation"].Bool();
|
||||||
@@ -511,6 +518,7 @@ void MapViewController::activateAdventureContext(uint32_t animationTime)
|
|||||||
adventureContext = std::make_shared<MapRendererAdventureContext>(*state);
|
adventureContext = std::make_shared<MapRendererAdventureContext>(*state);
|
||||||
adventureContext->animationTime = animationTime;
|
adventureContext->animationTime = animationTime;
|
||||||
context = adventureContext;
|
context = adventureContext;
|
||||||
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapViewController::activateAdventureContext()
|
void MapViewController::activateAdventureContext()
|
||||||
|
@@ -74,6 +74,7 @@ private:
|
|||||||
void onAfterHeroDisembark(const CGHeroInstance * obj, const int3 & from, const int3 & dest) override;
|
void onAfterHeroDisembark(const CGHeroInstance * obj, const int3 & from, const int3 & dest) override;
|
||||||
|
|
||||||
void resetContext();
|
void resetContext();
|
||||||
|
void updateState();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MapViewController(std::shared_ptr<MapViewModel> model, std::shared_ptr<MapViewCache> view);
|
MapViewController(std::shared_ptr<MapViewModel> model, std::shared_ptr<MapViewCache> view);
|
||||||
|
Reference in New Issue
Block a user