Finisher policies are now unpickable

This commit is contained in:
Yair Morgenstern 2018-03-03 22:22:00 +02:00
parent 9d019ffd10
commit f2c790aec4

View file

@ -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