mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 12:54:06 -04:00
Revert "perf(memory): Save unit icon location on baseunit"
This reverts commit ba37be8641459509e2f28b1209ee4d89f8472d02.
This commit is contained in:
parent
f1f37fcd74
commit
b68c4d3edc
@ -63,9 +63,6 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
||||
|
||||
@Transient
|
||||
var cachedForceEvaluation: Int = -1
|
||||
|
||||
@delegate:Transient // memory perf optimization to not create the string per unit
|
||||
val unitIconLocation by lazy { "UnitIcons/$name.png" }
|
||||
|
||||
@Transient
|
||||
val costFunctions = BaseUnitCost(this)
|
||||
|
@ -251,8 +251,8 @@ object ImageGetter {
|
||||
fun getRandomNationPortrait(size: Float): Portrait = PortraitNation(Constants.random, size)
|
||||
|
||||
fun getUnitIcon(unit: BaseUnit, color: Color = Color.BLACK): Image =
|
||||
if (imageExists(unit.unitIconLocation))
|
||||
getImage(unit.unitIconLocation).apply { this.color = color }
|
||||
if (imageExists("UnitIcons/${unit.name}"))
|
||||
getImage("UnitIcons/${unit.name}").apply { this.color = color }
|
||||
else getImage("UnitTypeIcons/${unit.type}").apply { this.color = color }
|
||||
|
||||
fun getConstructionPortrait(construction: String, size: Float): Group {
|
||||
|
Loading…
x
Reference in New Issue
Block a user