Add a "Reset to defaults" button to the Newgame screen (#5141)

* Add a reset to defaults button to the new game screen

* Add a reset to defaults button to the new game screen - template
This commit is contained in:
SomeTroglodyte 2021-09-08 19:46:18 +02:00 committed by GitHub
parent d1135f3d20
commit e0fe788e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -249,6 +249,7 @@ Uniques =
Promotions =
Load copied data =
Could not load game from clipboard! =
Reset to defaults =
Start game! =
Map Options =
Game Options =

View File

@ -44,6 +44,15 @@ class NewGameScreen(
updateRuleset()
if (UncivGame.Current.settings.lastGameSetup != null) {
val resetToDefaultsButton = "Reset to defaults".toTextButton()
resetToDefaultsButton.padBottom(5f)
rightSideGroup.addActorAt(0, resetToDefaultsButton)
resetToDefaultsButton.onClick {
game.setScreen(NewGameScreen(previousScreen, GameSetupInfo()))
}
}
rightSideButton.enable()
rightSideButton.setText("Start game!".tr())
rightSideButton.onClick {

View File

@ -10,7 +10,7 @@ open class PickerScreen(disableScroll: Boolean = false) : CameraStageBaseScreen(
internal var closeButton: TextButton = Constants.close.toTextButton()
protected var descriptionLabel: Label
private var rightSideGroup = VerticalGroup()
protected var rightSideGroup = VerticalGroup()
protected var rightSideButton: TextButton
private val screenSplit = 0.85f
private val maxBottomTableHeight = 150f // about 7 lines of normal text