mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
Hiding resources and improvements in the world screen no loger affects the city screens
This commit is contained in:
parent
42e6ab1c65
commit
2b2f8affd8
@ -20,7 +20,7 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo) : TileGroup(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun update() {
|
fun update() {
|
||||||
super.update(true)
|
super.update(true,true)
|
||||||
|
|
||||||
updatePopulationImage()
|
updatePopulationImage()
|
||||||
if (improvementImage != null) improvementImage!!.setColor(1f, 1f, 1f, 0.5f)
|
if (improvementImage != null) improvementImage!!.setColor(1f, 1f, 1f, 0.5f)
|
||||||
|
@ -107,7 +107,7 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun update(isViewable: Boolean) {
|
open fun update(isViewable: Boolean, showResourcesAndImprovements:Boolean) {
|
||||||
hideCircle()
|
hideCircle()
|
||||||
if (!tileInfo.tileMap.gameInfo.getPlayerCivilization().exploredTiles.contains(tileInfo.position)
|
if (!tileInfo.tileMap.gameInfo.getPlayerCivilization().exploredTiles.contains(tileInfo.position)
|
||||||
&& !UnCivGame.Current.viewEntireMapForDebug) {
|
&& !UnCivGame.Current.viewEntireMapForDebug) {
|
||||||
@ -119,8 +119,8 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||||||
updateCityImage()
|
updateCityImage()
|
||||||
updateTileColor(isViewable)
|
updateTileColor(isViewable)
|
||||||
|
|
||||||
updateResourceImage(isViewable)
|
updateResourceImage(isViewable,showResourcesAndImprovements)
|
||||||
updateImprovementImage(isViewable)
|
updateImprovementImage(isViewable,showResourcesAndImprovements)
|
||||||
|
|
||||||
|
|
||||||
civilianUnitImage = newUnitImage(tileInfo.civilianUnit, civilianUnitImage, isViewable, -20f)
|
civilianUnitImage = newUnitImage(tileInfo.civilianUnit, civilianUnitImage, isViewable, -20f)
|
||||||
@ -272,13 +272,13 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateImprovementImage(viewable: Boolean) {
|
private fun updateImprovementImage(viewable: Boolean, showResourcesAndImprovements: Boolean) {
|
||||||
if (improvementImage != null) {
|
if (improvementImage != null) {
|
||||||
improvementImage!!.remove()
|
improvementImage!!.remove()
|
||||||
improvementImage = null
|
improvementImage = null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tileInfo.improvement != null && UnCivGame.Current.settings.showResourcesAndImprovements) {
|
if (tileInfo.improvement != null && showResourcesAndImprovements) {
|
||||||
improvementImage = ImageGetter.getImprovementIcon(tileInfo.improvement!!)
|
improvementImage = ImageGetter.getImprovementIcon(tileInfo.improvement!!)
|
||||||
addActor(improvementImage)
|
addActor(improvementImage)
|
||||||
improvementImage!!.run {
|
improvementImage!!.run {
|
||||||
@ -293,8 +293,8 @@ open class TileGroup(var tileInfo: TileInfo) : Group() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateResourceImage(viewable: Boolean) {
|
private fun updateResourceImage(viewable: Boolean, showResourcesAndImprovements: Boolean) {
|
||||||
val shouldDisplayResource = UnCivGame.Current.settings.showResourcesAndImprovements
|
val shouldDisplayResource = showResourcesAndImprovements
|
||||||
&& tileInfo.hasViewableResource(tileInfo.tileMap.gameInfo.getPlayerCivilization())
|
&& tileInfo.hasViewableResource(tileInfo.tileMap.gameInfo.getPlayerCivilization())
|
||||||
|
|
||||||
if (resourceImage != null && !shouldDisplayResource) {
|
if (resourceImage != null && !shouldDisplayResource) {
|
||||||
|
@ -39,7 +39,7 @@ class WorldTileGroup(tileInfo: TileInfo) : TileGroup(tileInfo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun update(isViewable: Boolean) {
|
fun update(isViewable: Boolean) {
|
||||||
val city = tileInfo.getCity()
|
val city = tileInfo.getCity()
|
||||||
|
|
||||||
removePopulationIcon()
|
removePopulationIcon()
|
||||||
@ -51,7 +51,8 @@ class WorldTileGroup(tileInfo: TileInfo) : TileGroup(tileInfo) {
|
|||||||
|| UnCivGame.Current.viewEntireMapForDebug)
|
|| UnCivGame.Current.viewEntireMapForDebug)
|
||||||
updateCityButton(city, isViewable || UnCivGame.Current.viewEntireMapForDebug) // needs to be before the update so the units will be above the city button
|
updateCityButton(city, isViewable || UnCivGame.Current.viewEntireMapForDebug) // needs to be before the update so the units will be above the city button
|
||||||
|
|
||||||
super.update(isViewable || UnCivGame.Current.viewEntireMapForDebug)
|
super.update(isViewable || UnCivGame.Current.viewEntireMapForDebug,
|
||||||
|
UnCivGame.Current.settings.showResourcesAndImprovements)
|
||||||
|
|
||||||
yieldGroup.isVisible = !UnCivGame.Current.settings.showResourcesAndImprovements
|
yieldGroup.isVisible = !UnCivGame.Current.settings.showResourcesAndImprovements
|
||||||
if(yieldGroup.isVisible)
|
if(yieldGroup.isVisible)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user