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)
add("Game Options".toLabel(fontSize = 24)).padTop(0f).padBottom(20f).colspan(2).row()
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<String>, initialState: String, onChange: (newValue: String) -> Unit) {
add(text.toLabel())
fun Table.addSelectBox(text: String, values: Collection<String>, 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()