Resolved #2549 - fixed New Game Screen options alignment and placing

This commit is contained in:
Yair Morgenstern 2020-05-20 20:52:13 +03:00
parent 9b93e4fb51
commit d81507ef2d

View File

@ -23,9 +23,12 @@ class NewGameOptionsTable(newGameScreen: NewGameScreen, val updatePlayerPickerTa
defaults().pad(5f) defaults().pad(5f)
add("Game Options".toLabel(fontSize = 24)).padTop(0f).padBottom(20f).colspan(2).row() add("Game Options".toLabel(fontSize = 24)).padTop(0f).padBottom(20f).colspan(2).row()
addDifficultySelectBox() add(Table().apply {
addGameSpeedSelectBox() defaults().pad(5f)
addEraSelectBox() addDifficultySelectBox()
addGameSpeedSelectBox()
addEraSelectBox()
}).colspan(2).row()
addCityStatesSelectBox() addCityStatesSelectBox()
addVictoryTypeCheckboxes() addVictoryTypeCheckboxes()
@ -82,8 +85,8 @@ class NewGameOptionsTable(newGameScreen: NewGameScreen, val updatePlayerPickerTa
} }
} }
fun addSelectBox(text: String, values: Collection<String>, initialState: String, onChange: (newValue: String) -> Unit) { fun Table.addSelectBox(text: String, values: Collection<String>, initialState: String, onChange: (newValue: String) -> Unit) {
add(text.toLabel()) add(text.toLabel()).left()
val selectBox = TranslatedSelectBox(values, initialState, CameraStageBaseScreen.skin) val selectBox = TranslatedSelectBox(values, initialState, CameraStageBaseScreen.skin)
selectBox.onChange { onChange(selectBox.selected.value) } selectBox.onChange { onChange(selectBox.selected.value) }
add(selectBox).fillX().row() add(selectBox).fillX().row()