diff --git a/android/Images/OtherIcons/ArrowLeft.png b/android/Images/OtherIcons/ArrowLeft.png deleted file mode 100644 index ce9045fdb4..0000000000 Binary files a/android/Images/OtherIcons/ArrowLeft.png and /dev/null differ diff --git a/android/Images/OtherIcons/Down.png b/android/Images/OtherIcons/Down.png deleted file mode 100644 index 6cd06058c5..0000000000 Binary files a/android/Images/OtherIcons/Down.png and /dev/null differ diff --git a/android/Images/OtherIcons/Up.png b/android/Images/OtherIcons/Up.png deleted file mode 100644 index e813450d1e..0000000000 Binary files a/android/Images/OtherIcons/Up.png and /dev/null differ diff --git a/core/src/com/unciv/models/UnitAction.kt b/core/src/com/unciv/models/UnitAction.kt index c85ebc2e36..32dabb03eb 100644 --- a/core/src/com/unciv/models/UnitAction.kt +++ b/core/src/com/unciv/models/UnitAction.kt @@ -3,6 +3,7 @@ package com.unciv.models import com.badlogic.gdx.Input import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Actor +import com.badlogic.gdx.utils.Align import com.unciv.ui.utils.KeyCharAndCode import com.unciv.ui.utils.ImageGetter import com.unciv.Constants @@ -149,7 +150,7 @@ enum class UnitActionType( // readability factories private fun imageGetStopMove() = ImageGetter.getStatIcon("Movement").apply { color = Color.RED } private fun imageGetPromote() = ImageGetter.getImage("OtherIcons/Star").apply { color = Color.GOLD } - private fun imageGetShowMore() = ImageGetter.getImage("OtherIcons/ArrowRight").apply { color = Color.BLACK } - private fun imageGetHideMore() = ImageGetter.getImage("OtherIcons/ArrowLeft").apply { color = Color.BLACK } + private fun imageGetShowMore() = ImageGetter.getArrowImage(Align.right).apply { color = Color.BLACK } + private fun imageGetHideMore() = ImageGetter.getArrowImage(Align.left).apply { color = Color.BLACK } } } diff --git a/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt b/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt index 6cf27207e8..8fd89b58ad 100644 --- a/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt +++ b/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt @@ -17,7 +17,6 @@ import com.unciv.models.stats.Stat import com.unciv.models.translations.tr import com.unciv.ui.utils.* import com.unciv.ui.utils.UncivTooltip.Companion.addTooltip -import kotlin.concurrent.thread import kotlin.math.max import kotlin.math.min import com.unciv.ui.utils.AutoScrollPane as ScrollPane @@ -531,7 +530,7 @@ class CityConstructionsTable(private val cityScreen: CityScreen) { private fun getRaisePriorityButton(constructionQueueIndex: Int, name: String, city: CityInfo): Table { val tab = Table() - tab.add(ImageGetter.getImage("OtherIcons/Up").surroundWithCircle(40f)) + tab.add(ImageGetter.getArrowImage(Align.top).apply { color = Color.BLACK }.surroundWithCircle(40f)) if (cityScreen.canChangeState && !city.isPuppet) { tab.touchable = Touchable.enabled tab.onClick { @@ -548,7 +547,7 @@ class CityConstructionsTable(private val cityScreen: CityScreen) { private fun getLowerPriorityButton(constructionQueueIndex: Int, name: String, city: CityInfo): Table { val tab = Table() - tab.add(ImageGetter.getImage("OtherIcons/Down").surroundWithCircle(40f)) + tab.add(ImageGetter.getArrowImage(Align.bottom).apply { color = Color.BLACK }.surroundWithCircle(40f)) if (cityScreen.canChangeState && !city.isPuppet) { tab.touchable = Touchable.enabled tab.onClick { diff --git a/core/src/com/unciv/ui/tilegroups/TileGroup.kt b/core/src/com/unciv/ui/tilegroups/TileGroup.kt index fa6b7bbd4e..5a50b75954 100644 --- a/core/src/com/unciv/ui/tilegroups/TileGroup.kt +++ b/core/src/com/unciv/ui/tilegroups/TileGroup.kt @@ -209,17 +209,17 @@ open class TileGroup(var tileInfo: TileInfo, val tileSetStrings:TileSetStrings, if (tileInfo.naturalWonder != null) return listOf(tileSetStrings.orFallback { getTile(tileInfo.naturalWonder!!) }) val shownImprovement = tileInfo.getShownImprovement(viewingCiv) - val shouldShowImprovement = (shownImprovement != null && UncivGame.Current.settings.showPixelImprovements) + val shouldShowImprovement = shownImprovement != null && UncivGame.Current.settings.showPixelImprovements val shouldShowResource = UncivGame.Current.settings.showPixelImprovements && tileInfo.resource != null && (showEntireMap || viewingCiv == null || tileInfo.hasViewableResource(viewingCiv)) val resourceAndImprovementSequence = sequence { - if (shouldShowResource) yield(tileInfo.resource) - if (shouldShowImprovement) yield(shownImprovement) - }.filterNotNull() + if (shouldShowResource) yield(tileInfo.resource!!) + if (shouldShowImprovement) yield(shownImprovement!!) + } - val terrainImages = (sequenceOf(tileInfo.baseTerrain) + tileInfo.terrainFeatures.asSequence()).filterNotNull() + val terrainImages = sequenceOf(tileInfo.baseTerrain) + tileInfo.terrainFeatures.asSequence() val allTogether = (terrainImages + resourceAndImprovementSequence).joinToString("+") val allTogetherLocation = tileSetStrings.getTile(allTogether) diff --git a/core/src/com/unciv/ui/utils/IconCircleGroup.kt b/core/src/com/unciv/ui/utils/IconCircleGroup.kt index 295212c1ad..fd7d486c3b 100644 --- a/core/src/com/unciv/ui/utils/IconCircleGroup.kt +++ b/core/src/com/unciv/ui/utils/IconCircleGroup.kt @@ -3,6 +3,7 @@ package com.unciv.ui.utils import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Actor import com.badlogic.gdx.scenes.scene2d.Group +import com.badlogic.gdx.utils.Align class IconCircleGroup(size: Float, val actor: Actor, resizeActor: Boolean = true, color: Color = Color.WHITE): Group(){ val circle = ImageGetter.getCircle().apply { @@ -16,6 +17,7 @@ class IconCircleGroup(size: Float, val actor: Actor, resizeActor: Boolean = true addActor(circle) if (resizeActor) actor.setSize(size * 0.75f, size * 0.75f) actor.center(this) + actor.setOrigin(Align.center) addActor(actor) } } diff --git a/core/src/com/unciv/ui/utils/ImageGetter.kt b/core/src/com/unciv/ui/utils/ImageGetter.kt index cadc5b90b9..fca4e788a5 100644 --- a/core/src/com/unciv/ui/utils/ImageGetter.kt +++ b/core/src/com/unciv/ui/utils/ImageGetter.kt @@ -333,6 +333,15 @@ object ImageGetter { return redCross } + fun getArrowImage(align:Int = Align.right): Image { + val image = getImage("OtherIcons/ArrowRight") + image.setOrigin(Align.center) + if (align == Align.left) image.rotation = 180f + if (align == Align.bottom) image.rotation = -90f + if (align == Align.top) image.rotation = 90f + return image + } + fun getResourceImage(resourceName: String, size: Float): IconCircleGroup { val iconGroup = getImage("ResourceIcons/$resourceName").surroundWithCircle(size) val resource = ruleset.tileResources[resourceName]