diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index c594a28699..797a44eceb 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -449,17 +449,18 @@ open class TileInfo { /** Shows important properties of this tile for debugging _only_, it helps to see what you're doing */ override fun toString(): String { - val lineList = arrayListOf("TileInfo @($position)") + val lineList = arrayListOf("TileInfo @$position") + if (!this::baseTerrain.isInitialized) return lineList[0] + ", uninitialized" if (isCityCenter()) lineList += getCity()!!.name lineList += baseTerrain for (terrainFeature in terrainFeatures) lineList += terrainFeature - if (resource != null ) lineList += resource!! + if (resource != null) lineList += resource!! if (naturalWonder != null) lineList += naturalWonder!! if (roadStatus !== RoadStatus.None && !isCityCenter()) lineList += roadStatus.name if (improvement != null) lineList += improvement!! if (civilianUnit != null) lineList += civilianUnit!!.name + " - " + civilianUnit!!.civInfo.civName if (militaryUnit != null) lineList += militaryUnit!!.name + " - " + militaryUnit!!.civInfo.civName - if (isImpassible()) lineList += Constants.impassable + if (this::baseTerrainObject.isInitialized && isImpassible()) lineList += Constants.impassable return lineList.joinToString() } diff --git a/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt b/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt index 843dc85ef3..9eb31a5719 100644 --- a/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/ModManagementScreen.kt @@ -104,7 +104,18 @@ class ModManagementScreen: PickerScreen(disableScroll = true) { init { - setDefaultCloseAction(MainMenuScreen()) + //setDefaultCloseAction(screen) // this would initialize the new MainMenuScreen immediately + val closeAction = { + val tileSets = ImageGetter.getAvailableTilesets() + if (game.settings.tileSet !in tileSets) { + game.settings.tileSet = tileSets.first() + } + game.setScreen(MainMenuScreen()) + dispose() + } + closeButton.onClick(closeAction) + onBackButtonClicked(closeAction) + refreshInstalledModTable() // Header row