mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-23 06:08:46 +07:00
Revert "We now auto-detect resolution from the screen! Been a long time coming!"
This reverts commit 7d458207b5
.
This commit is contained in:
@ -8,6 +8,7 @@ class GameSettings {
|
||||
var checkForDueUnits: Boolean = true
|
||||
var singleTapMove: Boolean = false
|
||||
var language: String = "English"
|
||||
var resolution: String = "1050x700"
|
||||
var tutorialsShown = ArrayList<String>()
|
||||
var hasCrashedRecently = false
|
||||
var soundEffectsVolume = 0.5f
|
||||
|
@ -22,7 +22,8 @@ open class CameraStageBaseScreen : Screen {
|
||||
var hasPopupOpen = false
|
||||
|
||||
init {
|
||||
stage = Stage(ExtendViewport(Gdx.graphics.width.toFloat(), Gdx.graphics.height.toFloat()), batch)// FitViewport(1000,600)
|
||||
val resolutions: List<Float> = game.settings.resolution.split("x").map { it.toInt().toFloat() }
|
||||
stage = Stage(ExtendViewport(resolutions[0], resolutions[1]), batch)// FitViewport(1000,600)
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,6 +112,8 @@ class WorldScreenOptionsTable(val worldScreen:WorldScreen) : PopupTable(worldScr
|
||||
|
||||
addLanguageSelectBox(innerTable)
|
||||
|
||||
addResolutionSelectBox(innerTable)
|
||||
|
||||
addAutosaveTurnsSelectBox(innerTable)
|
||||
|
||||
addTileSetSelectBox(innerTable)
|
||||
@ -194,6 +196,26 @@ class WorldScreenOptionsTable(val worldScreen:WorldScreen) : PopupTable(worldScr
|
||||
}
|
||||
}
|
||||
|
||||
private fun addResolutionSelectBox(innerTable: PopupTable) {
|
||||
innerTable.add("Resolution".toLabel())
|
||||
|
||||
val resolutionSelectBox = SelectBox<String>(skin)
|
||||
val resolutionArray = Array<String>()
|
||||
resolutionArray.addAll("750x500","900x600", "1050x700", "1200x800", "1500x1000")
|
||||
resolutionSelectBox.items = resolutionArray
|
||||
resolutionSelectBox.selected = UncivGame.Current.settings.resolution
|
||||
innerTable.add(resolutionSelectBox).pad(10f).row()
|
||||
|
||||
resolutionSelectBox.addListener(object : ChangeListener() {
|
||||
override fun changed(event: ChangeEvent?, actor: Actor?) {
|
||||
UncivGame.Current.settings.resolution = resolutionSelectBox.selected
|
||||
UncivGame.Current.settings.save()
|
||||
UncivGame.Current.worldScreen = WorldScreen(worldScreen.viewingCiv)
|
||||
UncivGame.Current.setWorldScreen()
|
||||
WorldScreenOptionsTable(UncivGame.Current.worldScreen)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun addTileSetSelectBox(innerTable: PopupTable) {
|
||||
innerTable.add("Tileset".toLabel())
|
||||
|
Reference in New Issue
Block a user