Fallback image for modded techs - see #8158

This commit is contained in:
Yair Morgenstern
2022-12-18 22:05:17 +02:00
parent 8481680622
commit 81f3ecd998
5 changed files with 65 additions and 54 deletions

View File

@ -370,9 +370,11 @@ object ImageGetter {
}
fun getTechIconGroup(techName: String, circleSize: Float): IconCircleGroup {
val techIconColor = ruleset.eras[ruleset.technologies[techName]?.era()]?.getColor()?.darken(0.6f)
?: Color.BLACK
return getImage("TechIcons/$techName").apply { color = techIconColor }
val techIconColor = ruleset.eras[ruleset.technologies[techName]?.era()]?.getColor()?.darken(0.6f) ?: Color.BLACK
val image =
if (imageExists("TechIcons/$techName")) getImage("TechIcons/$techName")
else getImage("TechIcons/Fallback")
return image.apply { color = techIconColor }
.surroundWithCircle(circleSize)
.surroundWithThinCircle(techIconColor)
}