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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user