World screen centers on capital instead of zero position
This commit is contained in:
parent
e6a95452b4
commit
606a375467
2 changed files with 8 additions and 2 deletions
|
@ -140,4 +140,4 @@ class TileMapHolder(internal val worldScreen: WorldScreen, internal val tileMap:
|
|||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue