1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-03 23:19:22 +02:00

Support for changing resolution without game restart

This commit is contained in:
Ivan Savenko
2023-05-04 22:33:25 +03:00
parent 97426a3f7c
commit fd3933e589
10 changed files with 53 additions and 7 deletions

View File

@@ -799,3 +799,19 @@ void CAdventureMapInterface::hotkeySwitchMapLevel()
{
widget->getMapView()->onMapLevelSwitched();
}
void CAdventureMapInterface::onScreenResize()
{
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
widget.reset();
pos.x = pos.y = 0;
pos.w = GH.screenDimensions().x;
pos.h = GH.screenDimensions().y;
widget = std::make_shared<CAdventureMapWidget>(shortcuts);
widget->setState(EGameState::MAKING_TURN);
widget->getMapView()->onViewMapActivated();
if (isActive())
widget->activate();
}