mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 01:39:40 +07:00
Auto detecting resolution was a terrible idea and I regret it entirely
This commit is contained in:
@ -8,7 +8,7 @@ class GameSettings {
|
||||
var checkForDueUnits: Boolean = true
|
||||
var singleTapMove: Boolean = false
|
||||
var language: String = "English"
|
||||
var resolution: String = "Auto"
|
||||
var resolution: String = "900x600"
|
||||
var tutorialsShown = ArrayList<String>()
|
||||
var hasCrashedRecently = false
|
||||
var soundEffectsVolume = 0.5f
|
||||
|
@ -24,21 +24,14 @@ open class CameraStageBaseScreen : Screen {
|
||||
init {
|
||||
val width:Float
|
||||
val height:Float
|
||||
if(game.settings.resolution=="Auto") {
|
||||
// lower than 750x500 just doesn't manage to fit all the components into the screen
|
||||
if (Gdx.graphics.width >= 750 && Gdx.graphics.height.toFloat() >= 500) {
|
||||
width = Gdx.graphics.width.toFloat()
|
||||
height = Gdx.graphics.height.toFloat()
|
||||
} else {
|
||||
width = 750f
|
||||
height = 500f
|
||||
}
|
||||
}
|
||||
else {
|
||||
val resolutions: List<Float> = game.settings.resolution.split("x").map { it.toInt().toFloat() }
|
||||
width = resolutions[0]
|
||||
height = resolutions[1]
|
||||
if(game.settings.resolution=="Auto") { // Aut-detecting resolution was a BAD IDEA since it needs to be based on DPI AND resolution.
|
||||
game.settings.resolution = "900x600"
|
||||
game.settings.save()
|
||||
}
|
||||
val resolutions: List<Float> = game.settings.resolution.split("x").map { it.toInt().toFloat() }
|
||||
width = resolutions[0]
|
||||
height = resolutions[1]
|
||||
|
||||
stage = Stage(ExtendViewport(width, height), batch)
|
||||
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ class WorldScreenOptionsTable(val worldScreen:WorldScreen) : PopupTable(worldScr
|
||||
|
||||
val resolutionSelectBox = SelectBox<String>(skin)
|
||||
val resolutionArray = Array<String>()
|
||||
resolutionArray.addAll("Auto","750x500","900x600", "1050x700", "1200x800", "1500x1000")
|
||||
resolutionArray.addAll("750x500","900x600", "1050x700", "1200x800", "1500x1000")
|
||||
resolutionSelectBox.items = resolutionArray
|
||||
resolutionSelectBox.selected = UncivGame.Current.settings.resolution
|
||||
innerTable.add(resolutionSelectBox).pad(10f).row()
|
||||
|
Reference in New Issue
Block a user