mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
fix puzzle map never open
This commit is contained in:
@@ -51,6 +51,7 @@ BasicMapView::BasicMapView(const Point & offset, const Point & dimensions)
|
|||||||
: model(createModel(dimensions))
|
: model(createModel(dimensions))
|
||||||
, tilesCache(new MapViewCache(model))
|
, tilesCache(new MapViewCache(model))
|
||||||
, controller(new MapViewController(model, tilesCache))
|
, controller(new MapViewController(model, tilesCache))
|
||||||
|
, needFullUpdate(false)
|
||||||
{
|
{
|
||||||
OBJECT_CONSTRUCTION;
|
OBJECT_CONSTRUCTION;
|
||||||
pos += offset;
|
pos += offset;
|
||||||
@@ -76,7 +77,7 @@ void BasicMapView::tick(uint32_t msPassed)
|
|||||||
void BasicMapView::show(Canvas & to)
|
void BasicMapView::show(Canvas & to)
|
||||||
{
|
{
|
||||||
CanvasClipRectGuard guard(to, pos);
|
CanvasClipRectGuard guard(to, pos);
|
||||||
render(to, false);
|
render(to, needFullUpdate);
|
||||||
|
|
||||||
controller->afterRender();
|
controller->afterRender();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ protected:
|
|||||||
void render(Canvas & target, bool fullUpdate);
|
void render(Canvas & target, bool fullUpdate);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool needFullUpdate;
|
||||||
|
|
||||||
BasicMapView(const Point & offset, const Point & dimensions);
|
BasicMapView(const Point & offset, const Point & dimensions);
|
||||||
~BasicMapView() override;
|
~BasicMapView() override;
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ CPuzzleWindow::CPuzzleWindow(const int3 & GrailPos, double discoveredRatio)
|
|||||||
quitb->setBorderColor(Colors::METALLIC_GOLD);
|
quitb->setBorderColor(Colors::METALLIC_GOLD);
|
||||||
|
|
||||||
mapView = std::make_shared<PuzzleMapView>(Point(8,9), Point(591, 544), grailPos);
|
mapView = std::make_shared<PuzzleMapView>(Point(8,9), Point(591, 544), grailPos);
|
||||||
|
mapView->needFullUpdate = true;
|
||||||
|
|
||||||
logo = std::make_shared<CPicture>(ImagePath::builtin("PUZZLOGO"), 607, 3);
|
logo = std::make_shared<CPicture>(ImagePath::builtin("PUZZLOGO"), 607, 3);
|
||||||
title = std::make_shared<CLabel>(700, 95, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->allTexts[463]);
|
title = std::make_shared<CLabel>(700, 95, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, LIBRARY->generaltexth->allTexts[463]);
|
||||||
@@ -93,4 +94,7 @@ void CPuzzleWindow::show(Canvas & to)
|
|||||||
currentAlpha -= animSpeed;
|
currentAlpha -= animSpeed;
|
||||||
}
|
}
|
||||||
CWindowObject::show(to);
|
CWindowObject::show(to);
|
||||||
|
|
||||||
|
if(mapView->needFullUpdate && piecesToRemove.empty())
|
||||||
|
mapView->needFullUpdate = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user