World screen centers on capital instead of zero position

This commit is contained in:
Yair Morgenstern 2018-07-18 18:41:15 +03:00
parent e6a95452b4
commit 606a375467
2 changed files with 8 additions and 2 deletions

View file

@ -140,4 +140,4 @@ class TileMapHolder(internal val worldScreen: WorldScreen, internal val tileMap:
}
}
}

View file

@ -70,7 +70,13 @@ class WorldScreen : CameraStageBaseScreen() {
update()
tileMapHolder.setCenterPosition(Vector2.Zero)
val tileToCenterOn: Vector2 =
when {
civInfo.cities.isNotEmpty() -> civInfo.getCapital().location
civInfo.getCivUnits().isNotEmpty() -> civInfo.getCivUnits().first().getTile().position
else -> Vector2.Zero
}
tileMapHolder.setCenterPosition(tileToCenterOn)
createNextTurnButton() // needs civ table to be positioned
displayTutorials("NewGame")
}