mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 09:17:47 +07:00
Added fogOfWarColor and unexploredTileColor (#3833)
* Added fogOfWarColor and unexploredTileColor * update updateConfig function
This commit is contained in:
parent
86fafd59db
commit
29dfa338ba
@ -1,11 +1,17 @@
|
||||
package com.unciv.models.tilesets
|
||||
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
|
||||
class TileSetConfig {
|
||||
var useColorAsBaseTerrain = true
|
||||
var unexploredTileColor: Color = Color.DARK_GRAY
|
||||
var fogOfWarColor: Color = Color.BLACK
|
||||
var ruleVariants: HashMap<String, Array<String>> = HashMap()
|
||||
|
||||
fun updateConfig(other: TileSetConfig){
|
||||
useColorAsBaseTerrain = other.useColorAsBaseTerrain
|
||||
unexploredTileColor = other.unexploredTileColor
|
||||
fogOfWarColor = other.fogOfWarColor
|
||||
for ((tileSetString, renderOrder) in other.ruleVariants){
|
||||
ruleVariants[tileSetString] = renderOrder
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings,
|
||||
hideCircle()
|
||||
if (viewingCiv != null && !isExplored(viewingCiv)) {
|
||||
clearUnexploredTiles()
|
||||
for(image in tileBaseImages) image.color = Color.DARK_GRAY
|
||||
for(image in tileBaseImages) image.color = tileSetStrings.tileSetConfig.unexploredTileColor
|
||||
return
|
||||
}
|
||||
|
||||
@ -661,11 +661,11 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings,
|
||||
|
||||
private fun updateTileColor(isViewable: Boolean) {
|
||||
var color =
|
||||
if (ImageGetter.imageExists(tileSetStrings.getTile(tileInfo.baseTerrain)))
|
||||
Color.WHITE // no need to color it, it's already colored
|
||||
else tileInfo.getBaseTerrain().getColor()
|
||||
if (tileSetStrings.tileSetConfig.useColorAsBaseTerrain)
|
||||
tileInfo.getBaseTerrain().getColor()
|
||||
else Color.WHITE // no need to color it, it's already colored
|
||||
|
||||
if (!isViewable) color =color.cpy().lerp(Color.BLACK, 0.6f)
|
||||
if (!isViewable) color = color.cpy().lerp(tileSetStrings.tileSetConfig.fogOfWarColor, 0.6f)
|
||||
for(image in tileBaseImages) image.color = color
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user