mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
The base resolution is auto but it can be manually set. That oughtta keep everyone happy.
This commit is contained in:
parent
66e940dd2b
commit
df27cb3bdd
@ -8,7 +8,7 @@ class GameSettings {
|
||||
var checkForDueUnits: Boolean = true
|
||||
var singleTapMove: Boolean = false
|
||||
var language: String = "English"
|
||||
var resolution: String = "1050x700"
|
||||
var resolution: String = "Auto"
|
||||
var tutorialsShown = ArrayList<String>()
|
||||
var hasCrashedRecently = false
|
||||
var soundEffectsVolume = 0.5f
|
||||
|
@ -22,8 +22,26 @@ open class CameraStageBaseScreen : Screen {
|
||||
var hasPopupOpen = false
|
||||
|
||||
init {
|
||||
val resolutions: List<Float> = game.settings.resolution.split("x").map { it.toInt().toFloat() }
|
||||
stage = Stage(ExtendViewport(resolutions[0], resolutions[1]), batch)// FitViewport(1000,600)
|
||||
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]
|
||||
}
|
||||
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("750x500","900x600", "1050x700", "1200x800", "1500x1000")
|
||||
resolutionArray.addAll("Auto","750x500","900x600", "1050x700", "1200x800", "1500x1000")
|
||||
resolutionSelectBox.items = resolutionArray
|
||||
resolutionSelectBox.selected = UncivGame.Current.settings.resolution
|
||||
innerTable.add(resolutionSelectBox).pad(10f).row()
|
||||
|
Loading…
x
Reference in New Issue
Block a user