mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-03 22:22:51 +07:00
Policies screen top button reworked (#8564)
* Policies screen top button reworked * Removed completed branch from count * refine
This commit is contained in:
parent
1018460730
commit
5fdbb7f188
@ -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}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user