diff --git a/core/src/com/unciv/logic/civilization/managers/PolicyManager.kt b/core/src/com/unciv/logic/civilization/managers/PolicyManager.kt index caee82dcb5..c813934228 100644 --- a/core/src/com/unciv/logic/civilization/managers/PolicyManager.kt +++ b/core/src/com/unciv/logic/civilization/managers/PolicyManager.kt @@ -30,8 +30,11 @@ class PolicyManager : IsPartOfGameInfoSerialization { var storedCulture = 0 internal val adoptedPolicies = HashSet() var numberOfAdoptedPolicies = 0 + + /** Indicates whether we shoudl *check* if policy is adoptible, and if so open */ var shouldOpenPolicyPicker = false - get() = field && canAdoptPolicy() + + fun shouldOpenPolicyPicker() = shouldOpenPolicyPicker && canAdoptPolicy() /** A [Map] pairing each [PolicyBranch] to its priority ([Int]). */ val priorityMap: Map diff --git a/core/src/com/unciv/ui/screens/worldscreen/status/NextTurnAction.kt b/core/src/com/unciv/ui/screens/worldscreen/status/NextTurnAction.kt index a3683671ef..93283b54d0 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/status/NextTurnAction.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/status/NextTurnAction.kt @@ -54,8 +54,9 @@ enum class NextTurnAction(protected val text: String, val color: Color) { }, PickPolicy("Pick a policy", Color.VIOLET) { override fun isChoice(worldScreen: WorldScreen) = - worldScreen.viewingCiv.policies.shouldOpenPolicyPicker || - worldScreen.viewingCiv.policies.freePolicies > 0 && worldScreen.viewingCiv.policies.canAdoptPolicy() + (worldScreen.viewingCiv.policies.shouldOpenPolicyPicker || + worldScreen.viewingCiv.policies.freePolicies > 0) + && worldScreen.viewingCiv.policies.canAdoptPolicy() override fun action(worldScreen: WorldScreen) { worldScreen.game.pushScreen(PolicyPickerScreen(worldScreen.selectedCiv, worldScreen.canChangeState)) worldScreen.viewingCiv.policies.shouldOpenPolicyPicker = false