mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 15:30:43 -04:00
Minimap slider has better values to accommodate screen sizes
This commit is contained in:
parent
7e827aebd3
commit
b4f588e70f
@ -49,7 +49,7 @@ class Minimap(val mapHolder: WorldMapHolder, minimapSize: Int) : Table(){
|
|||||||
if (shape != MapShape.rectangular) mapSize.radius
|
if (shape != MapShape.rectangular) mapSize.radius
|
||||||
else max (mapSize.height, mapSize.width * 3 / 4) * MapSize.Huge.radius / MapSize.Huge.height
|
else max (mapSize.height, mapSize.width * 3 / 4) * MapSize.Huge.radius / MapSize.Huge.height
|
||||||
}
|
}
|
||||||
val groupSize = (minimapSize + 1) * 100f / effectiveRadius
|
val groupSize = (minimapSize + 1) * 10f / effectiveRadius
|
||||||
|
|
||||||
for (tileInfo in mapHolder.tileMap.values) {
|
for (tileInfo in mapHolder.tileMap.values) {
|
||||||
val hex = ImageGetter.getImage("OtherIcons/Hexagon")
|
val hex = ImageGetter.getImage("OtherIcons/Hexagon")
|
||||||
|
@ -4,7 +4,6 @@ import com.badlogic.gdx.Application
|
|||||||
import com.badlogic.gdx.Gdx
|
import com.badlogic.gdx.Gdx
|
||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.*
|
import com.badlogic.gdx.scenes.scene2d.ui.*
|
||||||
import com.badlogic.gdx.utils.Array as GdxArray
|
|
||||||
import com.unciv.MainMenuScreen
|
import com.unciv.MainMenuScreen
|
||||||
import com.unciv.logic.civilization.PlayerType
|
import com.unciv.logic.civilization.PlayerType
|
||||||
import com.unciv.models.UncivSound
|
import com.unciv.models.UncivSound
|
||||||
@ -17,6 +16,7 @@ import com.unciv.ui.worldscreen.WorldScreen
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.concurrent.thread
|
import kotlin.concurrent.thread
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
import com.badlogic.gdx.utils.Array as GdxArray
|
||||||
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
import com.unciv.ui.utils.AutoScrollPane as ScrollPane
|
||||||
|
|
||||||
class Language(val language:String, val percentComplete:Int){
|
class Language(val language:String, val percentComplete:Int){
|
||||||
@ -168,14 +168,15 @@ class OptionsPopup(val previousScreen:CameraStageBaseScreen) : Popup(previousScr
|
|||||||
private fun addMinimapSizeSlider() {
|
private fun addMinimapSizeSlider() {
|
||||||
optionsTable.add("Show minimap".tr())
|
optionsTable.add("Show minimap".tr())
|
||||||
|
|
||||||
val minimapSliderLimit = resolutionArray.indexOf(settings.resolution) + 1
|
val minimapSliderLimit = (resolutionArray.indexOf(settings.resolution) + 1) *5f
|
||||||
val minimapSlider = Slider(0f, minimapSliderLimit.toFloat(), 1f, false, skin)
|
// each 1 point is effectively 10px per hexagon
|
||||||
minimapSlider.value = if(settings.showMinimap) min(settings.minimapSize, minimapSliderLimit).toFloat() else 0f
|
val minimapSlider = Slider(0f, minimapSliderLimit, 1f, false, skin)
|
||||||
|
minimapSlider.value = if(settings.showMinimap) min(settings.minimapSize.toFloat(), minimapSliderLimit)
|
||||||
|
else 0f
|
||||||
minimapSlider.onChange {
|
minimapSlider.onChange {
|
||||||
val size = minimapSlider.value.toInt()
|
val size = minimapSlider.value.toInt()
|
||||||
if (size == 0) {
|
if (size == 0) settings.showMinimap = false
|
||||||
settings.showMinimap = false
|
else {
|
||||||
} else {
|
|
||||||
settings.showMinimap = true
|
settings.showMinimap = true
|
||||||
settings.minimapSize = size
|
settings.minimapSize = size
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user