diff --git a/core/src/com/unciv/models/metadata/GameSettings.kt b/core/src/com/unciv/models/metadata/GameSettings.kt index 666aa7add7..0f68f4d447 100644 --- a/core/src/com/unciv/models/metadata/GameSettings.kt +++ b/core/src/com/unciv/models/metadata/GameSettings.kt @@ -34,6 +34,8 @@ class GameSettings { var orderTradeOffersByAmount = true var windowState = WindowState() var isFreshlyCreated = false + var minimapSize = 20 + var minimapSquare = false init { // 26 = Android Oreo. Versions below may display permanent icon in notification bar. diff --git a/core/src/com/unciv/ui/worldscreen/Minimap.kt b/core/src/com/unciv/ui/worldscreen/Minimap.kt index fd427555e6..ae17fbe7d5 100644 --- a/core/src/com/unciv/ui/worldscreen/Minimap.kt +++ b/core/src/com/unciv/ui/worldscreen/Minimap.kt @@ -17,6 +17,7 @@ import com.unciv.ui.utils.onClick import com.unciv.ui.utils.surroundWithCircle import kotlin.math.max import kotlin.math.min +import kotlin.math.sqrt class Minimap(val mapHolder: WorldMapHolder) : ScrollPane(null){ val allTiles = Group() @@ -109,7 +110,15 @@ class MinimapHolder(mapHolder: WorldMapHolder): Table(){ fun getWrappedMinimap(): Table { val internalMinimapWrapper = Table() - internalMinimapWrapper.add(minimap).size(worldScreen.stage.width/5,worldScreen.stage.height/5) + + val sizePercent = worldScreen.game.settings.minimapSize + val sizeWinX = worldScreen.stage.width * sizePercent / 100 + val sizeWinY = worldScreen.stage.height * sizePercent / 100 + val isSquare = worldScreen.game.settings.minimapSquare + val sizeX = if (isSquare) sqrt(sizeWinX * sizeWinY) else sizeWinX + val sizeY = if (isSquare) sizeX else sizeWinY + internalMinimapWrapper.add(minimap).size(sizeX,sizeY) + internalMinimapWrapper.background=ImageGetter.getBackground(Color.GRAY) internalMinimapWrapper.pack()