mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 05:41:11 +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 hit(x: Float, y: Float, touchable: Boolean): Actor? = null
|
||||||
override fun draw(batch: Batch?, parentAlpha: Float) = super.draw(batch, parentAlpha)
|
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 tileImageIdentifiers = listOf<String>()
|
||||||
private var bottomRightRiverImage: Image? = null
|
private var bottomRightRiverImage: Image? = null
|
||||||
private var bottomRiverImage: Image? = null
|
private var bottomRiverImage: Image? = null
|
||||||
@ -155,6 +155,7 @@ class TileLayerTerrain(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup,
|
|||||||
val finalLocation = existingImages.random(
|
val finalLocation = existingImages.random(
|
||||||
Random(tileGroup.tile.position.hashCode() + locationToCheck.hashCode()))
|
Random(tileGroup.tile.position.hashCode() + locationToCheck.hashCode()))
|
||||||
val image = ImageGetter.getImage(finalLocation)
|
val image = ImageGetter.getImage(finalLocation)
|
||||||
|
image.name = finalLocation // for debug mode reveal
|
||||||
|
|
||||||
tileBaseImages.add(image)
|
tileBaseImages.add(image)
|
||||||
addActor(image)
|
addActor(image)
|
||||||
|
@ -58,6 +58,9 @@ fun debugTab(
|
|||||||
add("Show coordinates on tiles".toCheckBox(DebugUtils.SHOW_TILE_COORDS) {
|
add("Show coordinates on tiles".toCheckBox(DebugUtils.SHOW_TILE_COORDS) {
|
||||||
DebugUtils.SHOW_TILE_COORDS = it
|
DebugUtils.SHOW_TILE_COORDS = it
|
||||||
}).colspan(2).row()
|
}).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
|
val curGameInfo = game.gameInfo
|
||||||
if (curGameInfo != null) {
|
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) {
|
add(MarkupRenderer.render(TileDescription.toMarkup(tile, selectedCiv), padding = 0f, iconDisplay = IconDisplay.None) {
|
||||||
worldScreen.openCivilopedia(it)
|
worldScreen.openCivilopedia(it)
|
||||||
} ).pad(5f).row()
|
} ).pad(5f).row()
|
||||||
if (DebugUtils.VISIBLE_MAP)
|
if (DebugUtils.VISIBLE_MAP) add(tile.position.toPrettyString().toLabel()).colspan(2).pad(5f)
|
||||||
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()
|
pack()
|
||||||
|
@ -12,6 +12,8 @@ object DebugUtils {
|
|||||||
/** This flag paints the tile coordinates directly onto the map tiles. */
|
/** This flag paints the tile coordinates directly onto the map tiles. */
|
||||||
var SHOW_TILE_COORDS: Boolean = false
|
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 */
|
/** For when you need to test something in an advanced game and don't have time to faff around */
|
||||||
var SUPERCHARGED: Boolean = false
|
var SUPERCHARGED: Boolean = false
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user