mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 04:43:05 -04:00
Add checkbox to Settings AdvancedTab to enable or disable easter eggs. (#8248)
This commit is contained in:
parent
f45d23d8d5
commit
37250cc65d
@ -739,6 +739,7 @@ Font family =
|
||||
Font size multiplier =
|
||||
Default Font =
|
||||
You need to restart the game for this change to take effect. =
|
||||
Enable Easter Eggs =
|
||||
|
||||
# Notifications
|
||||
|
||||
|
@ -117,7 +117,7 @@ class MainMenuScreen: BaseScreen(), RecreateOnResize {
|
||||
easterEggRuleset = EasterEggRulesets.getTodayEasterEggRuleset()?.let {
|
||||
RulesetCache.getComplexRuleset(baseRuleset, listOf(it))
|
||||
}
|
||||
val mapRuleset = easterEggRuleset ?: baseRuleset
|
||||
val mapRuleset = if (game.settings.enableEasterEggs) easterEggRuleset ?: baseRuleset else baseRuleset
|
||||
|
||||
val newMap = MapGenerator(mapRuleset)
|
||||
.generateMap(MapParameters().apply {
|
||||
|
@ -88,6 +88,8 @@ class GameSettings {
|
||||
var fontFamily: String = Fonts.DEFAULT_FONT_FAMILY
|
||||
var fontSizeMultiplier: Float = 1f
|
||||
|
||||
var enableEasterEggs: Boolean = true
|
||||
|
||||
/** Maximum zoom-out of the map - performance heavy */
|
||||
var maxWorldZoomOut = 2f
|
||||
|
||||
|
@ -30,6 +30,7 @@ import com.unciv.ui.utils.extensions.onActivation
|
||||
import com.unciv.ui.utils.extensions.onChange
|
||||
import com.unciv.ui.utils.extensions.onClick
|
||||
import com.unciv.ui.utils.extensions.setFontColor
|
||||
import com.unciv.ui.utils.extensions.toCheckBox
|
||||
import com.unciv.ui.utils.extensions.toLabel
|
||||
import com.unciv.ui.utils.extensions.toTextButton
|
||||
import com.unciv.ui.utils.extensions.withoutItem
|
||||
@ -73,6 +74,8 @@ fun advancedTab(
|
||||
addTranslationGeneration(this, optionsPopup)
|
||||
|
||||
addSetUserId(this, settings)
|
||||
|
||||
addEasterEggsCheckBox(this, settings)
|
||||
}
|
||||
|
||||
private fun addAutosaveTurnsSelectBox(table: Table, settings: GameSettings) {
|
||||
@ -285,3 +288,8 @@ private fun addSetUserId(table: Table, settings: GameSettings) {
|
||||
table.add(takeUserIdFromClipboardButton).pad(5f).colspan(2).row()
|
||||
table.add(idSetLabel).colspan(2).row()
|
||||
}
|
||||
|
||||
private fun addEasterEggsCheckBox(table: Table, settings: GameSettings) {
|
||||
val checkbox = "Enable Easter Eggs".toCheckBox(settings.enableEasterEggs) { settings.enableEasterEggs = it }
|
||||
table.add(checkbox).colspan(2).row()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user