mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Merge branch 'master' into 'develop'
This commit is contained in:
@ -73,7 +73,7 @@ void MapViewController::setViewCenter(const Point & position, int level)
|
||||
adventureInt->onMapViewMoved(model->getTilesTotalRect(), model->getLevel());
|
||||
}
|
||||
|
||||
void MapViewController::setTileSize(const Point & tileSize)
|
||||
void MapViewController::setTileSize(const Point & tileSize, bool setTarget)
|
||||
{
|
||||
Point oldSize = model->getSingleTileSize();
|
||||
model->setTileSize(tileSize);
|
||||
@ -88,6 +88,9 @@ void MapViewController::setTileSize(const Point & tileSize)
|
||||
|
||||
// force update of view center since changing tile size may invalidated it
|
||||
setViewCenter(newViewCenter, model->getLevel());
|
||||
|
||||
if(setTarget)
|
||||
targetTileSize = tileSize;
|
||||
}
|
||||
|
||||
void MapViewController::modifyTileSize(int stepsChange, bool useDeadZone)
|
||||
@ -126,7 +129,7 @@ void MapViewController::modifyTileSize(int stepsChange, bool useDeadZone)
|
||||
if(actualZoom.y >= defaultTileSize - zoomTileDeadArea && actualZoom.y <= defaultTileSize + zoomTileDeadArea)
|
||||
actualZoom.y = defaultTileSize;
|
||||
}
|
||||
|
||||
|
||||
bool isInDeadZone = targetTileSize != actualZoom || actualZoom == Point(defaultTileSize, defaultTileSize);
|
||||
|
||||
if(!wasInDeadZone && isInDeadZone)
|
||||
@ -134,7 +137,13 @@ void MapViewController::modifyTileSize(int stepsChange, bool useDeadZone)
|
||||
|
||||
wasInDeadZone = isInDeadZone;
|
||||
|
||||
setTileSize(actualZoom);
|
||||
setTileSize(actualZoom, false);
|
||||
|
||||
if (adventureContext)
|
||||
{
|
||||
Settings tileZoom = settings.write["adventure"]["tileZoom"];
|
||||
tileZoom->Integer() = actualZoom.x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,7 +234,7 @@ void MapViewController::updateState()
|
||||
adventureContext->settingShowVisitable = settings["session"]["showVisitable"].Bool();
|
||||
adventureContext->settingShowBlocked = settings["session"]["showBlocked"].Bool();
|
||||
adventureContext->settingSpellRange = settings["session"]["showSpellRange"].Bool();
|
||||
adventureContext->settingTextOverlay = ENGINE->isKeyboardAltDown() || ENGINE->input().getNumTouchFingers() == 2;
|
||||
adventureContext->settingTextOverlay = (ENGINE->isKeyboardAltDown() || ENGINE->input().getNumTouchFingers() == 2) && settings["general"]["enableOverlay"].Bool();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user