Finisher policies are now unpickable
This commit is contained in:
parent
9d019ffd10
commit
f2c790aec4
1 changed files with 6 additions and 6 deletions
|
@ -88,6 +88,7 @@ class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen(
|
|||
|
||||
private fun pickPolicy(policy: Policy) {
|
||||
if (civInfo.policies.isAdopted(policy.name)
|
||||
|| policy.name.endsWith("Complete")
|
||||
|| !civInfo.policies.getAdoptedPolicies().containsAll(policy.requires!!)
|
||||
|| !civInfo.policies.canAdoptPolicy()) {
|
||||
rightSideButton.touchable = Touchable.disabled
|
||||
|
@ -111,13 +112,12 @@ class PolicyPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen(
|
|||
} else
|
||||
toReturn = TextButton(policy.name, CameraStageBaseScreen.skin)
|
||||
|
||||
if (civInfo.policies.isAdopted(policy.name)) { // existing
|
||||
toReturn.color = Color.GREEN
|
||||
} else if (!civInfo.policies.getAdoptedPolicies().containsAll(policy.requires!!))
|
||||
// non-available
|
||||
{
|
||||
toReturn.color = Color.GRAY
|
||||
when {
|
||||
civInfo.policies.isAdopted(policy.name) -> toReturn.color = Color.GREEN
|
||||
policy.name.endsWith("Complete") || !civInfo.policies.getAdoptedPolicies().containsAll(policy.requires!!)
|
||||
-> toReturn.color = Color.GRAY
|
||||
}
|
||||
|
||||
toReturn.addClickListener { pickPolicy(policy) }
|
||||
toReturn.pack()
|
||||
return toReturn
|
||||
|
|
Loading…
Reference in a new issue