mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
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:
parent
d1135f3d20
commit
e0fe788e28
@ -249,6 +249,7 @@ Uniques =
|
|||||||
Promotions =
|
Promotions =
|
||||||
Load copied data =
|
Load copied data =
|
||||||
Could not load game from clipboard! =
|
Could not load game from clipboard! =
|
||||||
|
Reset to defaults =
|
||||||
Start game! =
|
Start game! =
|
||||||
Map Options =
|
Map Options =
|
||||||
Game Options =
|
Game Options =
|
||||||
|
@ -44,6 +44,15 @@ class NewGameScreen(
|
|||||||
|
|
||||||
updateRuleset()
|
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.enable()
|
||||||
rightSideButton.setText("Start game!".tr())
|
rightSideButton.setText("Start game!".tr())
|
||||||
rightSideButton.onClick {
|
rightSideButton.onClick {
|
||||||
|
@ -10,7 +10,7 @@ open class PickerScreen(disableScroll: Boolean = false) : CameraStageBaseScreen(
|
|||||||
|
|
||||||
internal var closeButton: TextButton = Constants.close.toTextButton()
|
internal var closeButton: TextButton = Constants.close.toTextButton()
|
||||||
protected var descriptionLabel: Label
|
protected var descriptionLabel: Label
|
||||||
private var rightSideGroup = VerticalGroup()
|
protected var rightSideGroup = VerticalGroup()
|
||||||
protected var rightSideButton: TextButton
|
protected var rightSideButton: TextButton
|
||||||
private val screenSplit = 0.85f
|
private val screenSplit = 0.85f
|
||||||
private val maxBottomTableHeight = 150f // about 7 lines of normal text
|
private val maxBottomTableHeight = 150f // about 7 lines of normal text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user