mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 11:28:03 +07:00
Option Screen choices visible on minimap toggle buttons immediately - ugly (#3881)
This commit is contained in:
parent
7c34c5f440
commit
7a8bf68885
@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.Batch
|
||||
import com.badlogic.gdx.math.MathUtils
|
||||
import com.badlogic.gdx.math.Vector2
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor
|
||||
import com.badlogic.gdx.scenes.scene2d.Group
|
||||
import com.badlogic.gdx.scenes.scene2d.Touchable
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Image
|
||||
@ -121,6 +122,10 @@ class MinimapHolder(mapHolder: WorldMapHolder): Table() {
|
||||
val minimap = Minimap(mapHolder)
|
||||
val worldScreen = mapHolder.worldScreen
|
||||
|
||||
var yieldImageButton: Actor? = null
|
||||
var populationImageButton: Actor? = null
|
||||
var resourceImageButton: Actor? = null
|
||||
|
||||
init {
|
||||
add(getToggleIcons()).align(Align.bottom)
|
||||
add(getWrappedMinimap())
|
||||
@ -225,12 +230,22 @@ class MinimapHolder(mapHolder: WorldMapHolder): Table() {
|
||||
}
|
||||
toggleIconTable.add(resourceImage)
|
||||
toggleIconTable.pack()
|
||||
|
||||
yieldImageButton = yieldImage.actor
|
||||
populationImageButton = populationImage.actor
|
||||
resourceImageButton = resourceImage.actor
|
||||
|
||||
return toggleIconTable
|
||||
}
|
||||
|
||||
fun update(civInfo: CivilizationInfo) {
|
||||
isVisible = UncivGame.Current.settings.showMinimap
|
||||
minimap.update(civInfo)
|
||||
with(UncivGame.Current.settings) {
|
||||
yieldImageButton?.color?.a = if (showTileYields) 1f else 0.5f
|
||||
populationImageButton?.color?.a = if (showWorkedTiles) 1f else 0.5f
|
||||
resourceImageButton?.color?.a = if (showResourcesAndImprovements) 1f else 0.5f
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -238,4 +253,4 @@ class MinimapHolder(mapHolder: WorldMapHolder): Table() {
|
||||
override fun draw(batch: Batch?, parentAlpha: Float) {
|
||||
super.draw(batch, parentAlpha)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user