1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

CPlayerInterface: if autoskip enabled dont center view on town / hero

This commit is contained in:
ArseniyShestakov
2015-12-11 11:21:35 +03:00
parent ab92123da3
commit 8792c23372

View File

@@ -2242,8 +2242,10 @@ CGPath * CPlayerInterface::getAndVerifyPath(const CGHeroInstance * h)
void CPlayerInterface::acceptTurn() void CPlayerInterface::acceptTurn()
{ {
bool centerView = true;
if(settings["session"]["autoSkip"].Bool()) if(settings["session"]["autoSkip"].Bool())
{ {
centerView = false;
while(CInfoWindow *iw = dynamic_cast<CInfoWindow *>(GH.topInt())) while(CInfoWindow *iw = dynamic_cast<CInfoWindow *>(GH.topInt()))
iw->close(); iw->close();
} }
@@ -2270,10 +2272,10 @@ void CPlayerInterface::acceptTurn()
//select first hero if available. //select first hero if available.
if(heroToSelect != nullptr) if(heroToSelect != nullptr)
{ {
adventureInt->select(heroToSelect); adventureInt->select(heroToSelect, centerView);
} }
else else
adventureInt->select(towns.front()); adventureInt->select(towns.front(), centerView);
//show new day animation and sound on infobar //show new day animation and sound on infobar
adventureInt->infoBar.showDate(); adventureInt->infoBar.showDate();