mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-25 10:26:05 +07:00
chore: renames
This commit is contained in:
parent
a11d489bd6
commit
7c1e0c0d25
@ -18,12 +18,12 @@ class TileLayerUnitArt(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup,
|
||||
override fun act(delta: Float) {}
|
||||
override fun hit(x: Float, y: Float, touchable: Boolean): Actor? = null
|
||||
|
||||
private var slot1: UnitArtSlot = UnitArtSlot()
|
||||
private var slot2: UnitArtSlot = UnitArtSlot()
|
||||
private var civilianSlot: UnitArtSlot = UnitArtSlot()
|
||||
private var militarySlot: UnitArtSlot = UnitArtSlot()
|
||||
|
||||
init {
|
||||
addActor(slot1)
|
||||
addActor(slot2)
|
||||
addActor(civilianSlot)
|
||||
addActor(militarySlot)
|
||||
}
|
||||
|
||||
private fun showMilitaryUnit(viewingCiv: Civilization) = tileGroup.isForceVisible
|
||||
@ -66,29 +66,26 @@ class TileLayerUnitArt(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup,
|
||||
|
||||
override fun doUpdate(viewingCiv: Civilization?, localUniqueCache: LocalUniqueCache) {
|
||||
|
||||
val slot1Unit = tileGroup.tile.civilianUnit
|
||||
val slot2Unit = tileGroup.tile.militaryUnit
|
||||
|
||||
val isPixelUnitsEnabled = UncivGame.Current.settings.showPixelUnits
|
||||
val isViewable = viewingCiv == null || isViewable(viewingCiv)
|
||||
val isVisibleMilitary = viewingCiv == null || showMilitaryUnit(viewingCiv)
|
||||
|
||||
val isSlot1Shown = isPixelUnitsEnabled && isViewable
|
||||
val isSlot2Shown = isPixelUnitsEnabled && isViewable && isVisibleMilitary
|
||||
val isCivilianSlotShown = isPixelUnitsEnabled && isViewable
|
||||
val isMilitarySlotShown = isPixelUnitsEnabled && isViewable && isVisibleMilitary
|
||||
|
||||
updateSlot(slot1, slot1Unit, isShown = isSlot1Shown)
|
||||
updateSlot(slot2, slot2Unit, isShown = isSlot2Shown)
|
||||
updateSlot(civilianSlot, tileGroup.tile.civilianUnit, isShown = isCivilianSlotShown)
|
||||
updateSlot(militarySlot, tileGroup.tile.militaryUnit, isShown = isMilitarySlotShown)
|
||||
}
|
||||
|
||||
override fun determineVisibility() {
|
||||
isVisible = slot1.hasChildren() || slot2.hasChildren()
|
||||
isVisible = civilianSlot.hasChildren() || militarySlot.hasChildren()
|
||||
}
|
||||
|
||||
fun reset() {
|
||||
slot1.clear()
|
||||
slot2.clear()
|
||||
civilianSlot.clear()
|
||||
militarySlot.clear()
|
||||
|
||||
slot1.imageLocation = ""
|
||||
slot2.imageLocation = ""
|
||||
civilianSlot.imageLocation = ""
|
||||
militarySlot.imageLocation = ""
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user