From d81507ef2d7d86703498cf1c4398e762ebf9d2df Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 20 May 2020 20:52:13 +0300 Subject: [PATCH] Resolved #2549 - fixed New Game Screen options alignment and placing --- .../unciv/ui/newgamescreen/NewGameOptionsTable.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/com/unciv/ui/newgamescreen/NewGameOptionsTable.kt b/core/src/com/unciv/ui/newgamescreen/NewGameOptionsTable.kt index cd909115be..6ac5dd0674 100644 --- a/core/src/com/unciv/ui/newgamescreen/NewGameOptionsTable.kt +++ b/core/src/com/unciv/ui/newgamescreen/NewGameOptionsTable.kt @@ -23,9 +23,12 @@ class NewGameOptionsTable(newGameScreen: NewGameScreen, val updatePlayerPickerTa defaults().pad(5f) add("Game Options".toLabel(fontSize = 24)).padTop(0f).padBottom(20f).colspan(2).row() - addDifficultySelectBox() - addGameSpeedSelectBox() - addEraSelectBox() + add(Table().apply { + defaults().pad(5f) + addDifficultySelectBox() + addGameSpeedSelectBox() + addEraSelectBox() + }).colspan(2).row() addCityStatesSelectBox() addVictoryTypeCheckboxes() @@ -82,8 +85,8 @@ class NewGameOptionsTable(newGameScreen: NewGameScreen, val updatePlayerPickerTa } } - fun addSelectBox(text: String, values: Collection, initialState: String, onChange: (newValue: String) -> Unit) { - add(text.toLabel()) + fun Table.addSelectBox(text: String, values: Collection, initialState: String, onChange: (newValue: String) -> Unit) { + add(text.toLabel()).left() val selectBox = TranslatedSelectBox(values, initialState, CameraStageBaseScreen.skin) selectBox.onChange { onChange(selectBox.selected.value) } add(selectBox).fillX().row()