diff --git a/core/src/com/unciv/ui/components/tilegroups/layers/TileLayerTerrain.kt b/core/src/com/unciv/ui/components/tilegroups/layers/TileLayerTerrain.kt index df76003b98..cd27ec9f05 100644 --- a/core/src/com/unciv/ui/components/tilegroups/layers/TileLayerTerrain.kt +++ b/core/src/com/unciv/ui/components/tilegroups/layers/TileLayerTerrain.kt @@ -20,7 +20,7 @@ class TileLayerTerrain(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup, override fun hit(x: Float, y: Float, touchable: Boolean): Actor? = null override fun draw(batch: Batch?, parentAlpha: Float) = super.draw(batch, parentAlpha) - private val tileBaseImages: ArrayList = ArrayList() + val tileBaseImages: ArrayList = ArrayList() private var tileImageIdentifiers = listOf() private var bottomRightRiverImage: Image? = null private var bottomRiverImage: Image? = null @@ -155,6 +155,7 @@ class TileLayerTerrain(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup, val finalLocation = existingImages.random( Random(tileGroup.tile.position.hashCode() + locationToCheck.hashCode())) val image = ImageGetter.getImage(finalLocation) + image.name = finalLocation // for debug mode reveal tileBaseImages.add(image) addActor(image) diff --git a/core/src/com/unciv/ui/popups/options/DebugTab.kt b/core/src/com/unciv/ui/popups/options/DebugTab.kt index 4346d9bbb0..c27e1c89f7 100644 --- a/core/src/com/unciv/ui/popups/options/DebugTab.kt +++ b/core/src/com/unciv/ui/popups/options/DebugTab.kt @@ -58,6 +58,9 @@ fun debugTab( add("Show coordinates on tiles".toCheckBox(DebugUtils.SHOW_TILE_COORDS) { DebugUtils.SHOW_TILE_COORDS = it }).colspan(2).row() + add("Show tile image locations".toCheckBox(DebugUtils.SHOW_TILE_IMAGE_LOCATIONS) { + DebugUtils.SHOW_TILE_IMAGE_LOCATIONS = it + }).colspan(2).row() val curGameInfo = game.gameInfo if (curGameInfo != null) { diff --git a/core/src/com/unciv/ui/screens/worldscreen/bottombar/TileInfoTable.kt b/core/src/com/unciv/ui/screens/worldscreen/bottombar/TileInfoTable.kt index 8cb0cc17d2..9452c9f502 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/bottombar/TileInfoTable.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/bottombar/TileInfoTable.kt @@ -38,8 +38,12 @@ class TileInfoTable(private val worldScreen: WorldScreen) : Table(BaseScreen.ski add(MarkupRenderer.render(TileDescription.toMarkup(tile, selectedCiv), padding = 0f, iconDisplay = IconDisplay.None) { worldScreen.openCivilopedia(it) } ).pad(5f).row() - if (DebugUtils.VISIBLE_MAP) - add(tile.position.toPrettyString().toLabel()).colspan(2).pad(5f) + if (DebugUtils.VISIBLE_MAP) add(tile.position.toPrettyString().toLabel()).colspan(2).pad(5f) + if (DebugUtils.SHOW_TILE_IMAGE_LOCATIONS){ + val imagesString = "Images: " + worldScreen.mapHolder.tileGroups[tile]!!.layerTerrain.tileBaseImages.joinToString{"\n"+it.name} + add(imagesString.toLabel()) + } + } pack() diff --git a/core/src/com/unciv/utils/DebugUtils.kt b/core/src/com/unciv/utils/DebugUtils.kt index a86a8c4b12..5309726632 100644 --- a/core/src/com/unciv/utils/DebugUtils.kt +++ b/core/src/com/unciv/utils/DebugUtils.kt @@ -11,6 +11,8 @@ object DebugUtils { /** This flag paints the tile coordinates directly onto the map tiles. */ var SHOW_TILE_COORDS: Boolean = false + + var SHOW_TILE_IMAGE_LOCATIONS: Boolean = false /** For when you need to test something in an advanced game and don't have time to faff around */ var SUPERCHARGED: Boolean = false