mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-13 19:39:34 +07:00
Tutorials saved between turns
No notification for "discovering" barbarians
This commit is contained in:
parent
041f904f6c
commit
1689005fef
@ -1,11 +1,17 @@
|
||||
package com.unciv
|
||||
|
||||
import com.unciv.logic.GameSaver
|
||||
|
||||
class GameSettings {
|
||||
var showWorkedTiles: Boolean = true
|
||||
var showResourcesAndImprovements: Boolean = true
|
||||
var language: String = "English"
|
||||
var resolution: String = "1050x700"
|
||||
var tutorialsShown = ArrayList<String>()
|
||||
|
||||
fun save(){
|
||||
GameSaver().setGeneralSettings(this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -261,7 +261,7 @@ class CivilizationInfo {
|
||||
|
||||
val viewedCivs = viewablePositions
|
||||
.flatMap { it.getUnits().map { u->u.civInfo }.union(listOf(it.getOwner())) }
|
||||
.filterNotNull().filterNot { it==this }
|
||||
.filterNotNull().filterNot { it==this || it.isBarbarianCivilization() }
|
||||
|
||||
for(otherCiv in viewedCivs)
|
||||
if(!diplomacy.containsKey(otherCiv.civName)){
|
||||
|
@ -54,7 +54,7 @@ class LanguagePickerScreen: PickerScreen(){
|
||||
rightSideButton.setText("Pick language".tr())
|
||||
rightSideButton.addClickListener {
|
||||
UnCivGame.Current.settings.language = chosenLanguage
|
||||
GameSaver().setGeneralSettings(UnCivGame.Current.settings)
|
||||
UnCivGame.Current.settings.save()
|
||||
UnCivGame.Current.startNewGame()
|
||||
dispose()
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ open class CameraStageBaseScreen : Screen {
|
||||
fun displayTutorials(name: String) {
|
||||
if (UnCivGame.Current.settings.tutorialsShown.contains(name)) return
|
||||
UnCivGame.Current.settings.tutorialsShown.add(name)
|
||||
UnCivGame.Current.settings.save()
|
||||
val texts = GameBasics.Tutorials[name]!!
|
||||
tutorialTexts.addAll(texts)
|
||||
if (!isTutorialShowing) displayTutorial()
|
||||
|
@ -4,7 +4,6 @@ import com.badlogic.gdx.scenes.scene2d.Actor
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.SelectBox
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener
|
||||
import com.unciv.UnCivGame
|
||||
import com.unciv.logic.GameSaver
|
||||
import com.unciv.models.gamebasics.GameBasics
|
||||
import com.unciv.ui.utils.CameraStageBaseScreen
|
||||
import com.unciv.ui.utils.center
|
||||
@ -16,9 +15,11 @@ class WorldScreenDisplayOptionsTable() : PopupTable(){
|
||||
}
|
||||
|
||||
fun update() {
|
||||
val settings = UnCivGame.Current.settings
|
||||
settings.save()
|
||||
clear()
|
||||
val tileMapHolder = UnCivGame.Current.worldScreen.tileMapHolder
|
||||
val settings = UnCivGame.Current.settings
|
||||
|
||||
if (settings.showWorkedTiles) addButton("{Hide} {worked tiles}") { settings.showWorkedTiles = false; update() }
|
||||
else addButton("{Show} {worked tiles}") { settings.showWorkedTiles = true; update() }
|
||||
|
||||
@ -35,7 +36,7 @@ class WorldScreenDisplayOptionsTable() : PopupTable(){
|
||||
languageSelectBox.addListener(object : ChangeListener() {
|
||||
override fun changed(event: ChangeEvent?, actor: Actor?) {
|
||||
UnCivGame.Current.settings.language = languageSelectBox.selected;
|
||||
GameSaver().setGeneralSettings(UnCivGame.Current.settings)
|
||||
UnCivGame.Current.settings.save()
|
||||
UnCivGame.Current.worldScreen = WorldScreen()
|
||||
UnCivGame.Current.setWorldScreen()
|
||||
UnCivGame.Current.worldScreen.stage.addActor(WorldScreenDisplayOptionsTable())
|
||||
@ -52,7 +53,7 @@ class WorldScreenDisplayOptionsTable() : PopupTable(){
|
||||
resolutionSelectBox.addListener(object : ChangeListener() {
|
||||
override fun changed(event: ChangeEvent?, actor: Actor?) {
|
||||
UnCivGame.Current.settings.resolution = resolutionSelectBox.selected
|
||||
GameSaver().setGeneralSettings(UnCivGame.Current.settings)
|
||||
UnCivGame.Current.settings.save()
|
||||
UnCivGame.Current.worldScreen = WorldScreen()
|
||||
UnCivGame.Current.setWorldScreen()
|
||||
UnCivGame.Current.worldScreen.stage.addActor(WorldScreenDisplayOptionsTable())
|
||||
|
Loading…
Reference in New Issue
Block a user