mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-19 16:57:38 +07:00
Prevent some state changing actions during next-turn (#9327)
* Prevent some state changing actions during next-turn * Direct canChangeState
This commit is contained in:
parent
a858e45ec4
commit
1df7ee46ac
@ -263,7 +263,8 @@ class UnitOverviewTab(
|
||||
// Upgrade column
|
||||
if (unit.upgrade.canUpgrade()) {
|
||||
val unitAction = UnitActionsUpgrade.getUpgradeAction(unit)
|
||||
val enable = unitAction?.action != null && viewingPlayer.isCurrentPlayer()
|
||||
val enable = unitAction?.action != null && viewingPlayer.isCurrentPlayer() &&
|
||||
GUI.isAllowedChangeState()
|
||||
val upgradeIcon = ImageGetter.getUnitIcon(unit.upgrade.getUnitToUpgradeTo().name,
|
||||
if (enable) Color.GREEN else Color.GREEN.darken(0.5f))
|
||||
if (enable) upgradeIcon.onClick {
|
||||
|
@ -206,12 +206,10 @@ class WorldMapHolder(
|
||||
}
|
||||
|
||||
private fun onTileRightClicked(unit: MapUnit, tile: Tile) {
|
||||
if (UncivGame.Current.gameInfo!!.getCurrentPlayerCivilization().isSpectator()) {
|
||||
return
|
||||
}
|
||||
removeUnitActionOverlay()
|
||||
selectedTile = tile
|
||||
unitMovementPaths.clear()
|
||||
if (!worldScreen.canChangeState) return
|
||||
|
||||
// Concurrency might open up a race condition window - if worldScreen.shouldUpdate is on too
|
||||
// early, concurrent code might possibly call worldScreen.render() and then our request will be
|
||||
|
Loading…
Reference in New Issue
Block a user