mirror of
https://github.com/yairm210/Unciv.git
synced 2025-10-04 01:13:48 -04:00
Fix disappearing terrain when switching between mods (#7257)
This commit is contained in:
parent
83926eac7c
commit
7de3fdf452
@ -32,7 +32,7 @@ object TileSetCache : HashMap<String, TileSetConfig>() {
|
|||||||
for (entry in allConfigs.entries.filter { it.key.mod == mod } ) { // Built-in tilesets all have empty strings as their `.mod`, so loop through all of them.
|
for (entry in allConfigs.entries.filter { it.key.mod == mod } ) { // Built-in tilesets all have empty strings as their `.mod`, so loop through all of them.
|
||||||
val tileSet = entry.key.tileSet
|
val tileSet = entry.key.tileSet
|
||||||
if (tileSet in this) this[tileSet]!!.updateConfig(entry.value)
|
if (tileSet in this) this[tileSet]!!.updateConfig(entry.value)
|
||||||
else this[tileSet] = entry.value
|
else this[tileSet] = entry.value.clone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,17 @@ class TileSetConfig {
|
|||||||
var tileScale: Float = 1f
|
var tileScale: Float = 1f
|
||||||
var ruleVariants: HashMap<String, Array<String>> = HashMap()
|
var ruleVariants: HashMap<String, Array<String>> = HashMap()
|
||||||
|
|
||||||
|
fun clone(): TileSetConfig {
|
||||||
|
val toReturn = TileSetConfig()
|
||||||
|
toReturn.useColorAsBaseTerrain = useColorAsBaseTerrain
|
||||||
|
toReturn.unexploredTileColor = unexploredTileColor
|
||||||
|
toReturn.fogOfWarColor = fogOfWarColor
|
||||||
|
toReturn.fallbackTileSet = fallbackTileSet
|
||||||
|
toReturn.tileScale = tileScale
|
||||||
|
toReturn.ruleVariants.putAll(ruleVariants.map { Pair(it.key, it.value.clone()) })
|
||||||
|
return toReturn
|
||||||
|
}
|
||||||
|
|
||||||
fun updateConfig(other: TileSetConfig) {
|
fun updateConfig(other: TileSetConfig) {
|
||||||
useColorAsBaseTerrain = other.useColorAsBaseTerrain
|
useColorAsBaseTerrain = other.useColorAsBaseTerrain
|
||||||
unexploredTileColor = other.unexploredTileColor
|
unexploredTileColor = other.unexploredTileColor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user