Policies screen top button reworked (#8564)

* Policies screen top button reworked

* Removed completed branch from count

* refine
This commit is contained in:
Gualdimar 2023-02-04 22:50:38 +02:00 committed by GitHub
parent 1018460730
commit 5fdbb7f188
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -581,7 +581,13 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: Civilization = w
lockIcon.isVisible = false
if (viewingCiv.policies.isAdopted(branch.name)) {
policy = branch.policies.last()
text = "Completed"
val amountToDo = branch.policies.count()-1
val amountDone =
if(viewingCiv.policies.isAdopted(policy.name))
amountToDo
else
branch.policies.count { viewingCiv.policies.isAdopted(it.name) }
text = "{Completed} ($amountDone/$amountToDo)"
} else if (viewingCiv.gameInfo.ruleset.eras[branch.era]!!.eraNumber > viewingCiv.getEraNumber()) {
policy = branch
text = branch.era
@ -600,7 +606,8 @@ class PolicyPickerScreen(val worldScreen: WorldScreen, civInfo: Civilization = w
PolicyColors.branchCompleted
}
else -> {
lockIcon.isVisible = true
if(!viewingCiv.policies.isAdopted(branch.name))
lockIcon.isVisible = true
label.color.a = 0.5f
PolicyColors.policyNotPickable}
}