mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 15:59:33 +07:00
Resolved #12506 - debug option to show tile image locations
Some checks failed
Conflict marking / main (push) Failing after 19s
Detekt / detekt (ubuntu-latest) (push) Failing after 1m0s
Generate mkdocs from docs folder / deploy (push) Failing after 24s
Build and test / Check code and run unit tests (push) Failing after 35m3s
Close stale issues and PRs / stale (push) Successful in 14s
Docker / build (push) Failing after 1m8s
Some checks failed
Conflict marking / main (push) Failing after 19s
Detekt / detekt (ubuntu-latest) (push) Failing after 1m0s
Generate mkdocs from docs folder / deploy (push) Failing after 24s
Build and test / Check code and run unit tests (push) Failing after 35m3s
Close stale issues and PRs / stale (push) Successful in 14s
Docker / build (push) Failing after 1m8s
This commit is contained in:
@ -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<Image> = ArrayList()
|
||||
val tileBaseImages: ArrayList<Image> = ArrayList()
|
||||
private var tileImageIdentifiers = listOf<String>()
|
||||
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)
|
||||
|
@ -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) {
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user