mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 09:17:47 +07:00
Patch ModManager exit to allow deactivating a selected tileset (#4029)
This commit is contained in:
parent
876bdf8f30
commit
084adc3396
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user