mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 22:06:05 -04:00
Global politics overview table includes current civ
This commit is contained in:
parent
3187f49e91
commit
cfc292eb0a
@ -16,10 +16,10 @@ import com.unciv.models.translations.tr
|
|||||||
class DiplomacyFunctions(val civInfo: Civilization){
|
class DiplomacyFunctions(val civInfo: Civilization){
|
||||||
|
|
||||||
/** A sorted Sequence of all other civs we know (excluding barbarians and spectators) */
|
/** A sorted Sequence of all other civs we know (excluding barbarians and spectators) */
|
||||||
fun getKnownCivsSorted(includeCityStates: Boolean = true, includeDefeated: Boolean = false) =
|
fun getKnownCivsSorted(includeSelf:Boolean, includeCityStates: Boolean = true, includeDefeated: Boolean = false) =
|
||||||
civInfo.gameInfo.civilizations.asSequence()
|
civInfo.gameInfo.civilizations.asSequence()
|
||||||
.filterNot {
|
.filterNot {
|
||||||
it == civInfo ||
|
(!includeSelf && it == civInfo) ||
|
||||||
it.isBarbarian() ||
|
it.isBarbarian() ||
|
||||||
it.isSpectator() ||
|
it.isSpectator() ||
|
||||||
!civInfo.knows(it) ||
|
!civInfo.knows(it) ||
|
||||||
|
@ -112,7 +112,7 @@ class DiplomacyScreen(
|
|||||||
|
|
||||||
var selectCivY = 0f
|
var selectCivY = 0f
|
||||||
|
|
||||||
for (civ in viewingCiv.diplomacyFunctions.getKnownCivsSorted()) {
|
for (civ in viewingCiv.diplomacyFunctions.getKnownCivsSorted(includeSelf = false)) {
|
||||||
if (civ == selectCiv) {
|
if (civ == selectCiv) {
|
||||||
selectCivY = leftSideTable.prefHeight
|
selectCivY = leftSideTable.prefHeight
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,9 @@ import com.unciv.ui.components.extensions.addBorder
|
|||||||
import com.unciv.ui.components.extensions.addSeparator
|
import com.unciv.ui.components.extensions.addSeparator
|
||||||
import com.unciv.ui.components.extensions.addSeparatorVertical
|
import com.unciv.ui.components.extensions.addSeparatorVertical
|
||||||
import com.unciv.ui.components.extensions.center
|
import com.unciv.ui.components.extensions.center
|
||||||
import com.unciv.ui.components.input.onClick
|
|
||||||
import com.unciv.ui.components.extensions.toLabel
|
import com.unciv.ui.components.extensions.toLabel
|
||||||
import com.unciv.ui.components.extensions.toTextButton
|
import com.unciv.ui.components.extensions.toTextButton
|
||||||
|
import com.unciv.ui.components.input.onClick
|
||||||
import com.unciv.ui.images.ImageGetter
|
import com.unciv.ui.images.ImageGetter
|
||||||
import com.unciv.ui.screens.basescreen.BaseScreen
|
import com.unciv.ui.screens.basescreen.BaseScreen
|
||||||
import com.unciv.ui.screens.diplomacyscreen.DiplomacyScreen
|
import com.unciv.ui.screens.diplomacyscreen.DiplomacyScreen
|
||||||
@ -94,7 +94,7 @@ class GlobalPoliticsOverviewTable (
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun createGlobalPoliticsTable() {
|
private fun createGlobalPoliticsTable() {
|
||||||
for (civ in viewingPlayer.diplomacyFunctions.getKnownCivsSorted(includeCityStates = false)) {
|
for (civ in viewingPlayer.diplomacyFunctions.getKnownCivsSorted(includeSelf = true, includeCityStates = false)) {
|
||||||
addSeparator(Color.GRAY)
|
addSeparator(Color.GRAY)
|
||||||
|
|
||||||
// civ image
|
// civ image
|
||||||
@ -249,9 +249,8 @@ class GlobalPoliticsOverviewTable (
|
|||||||
else gameInfo.civilizations.count {
|
else gameInfo.civilizations.count {
|
||||||
!it.isSpectator() && !it.isBarbarian() && (persistableData.includeCityStates || !it.isCityState())
|
!it.isSpectator() && !it.isBarbarian() && (persistableData.includeCityStates || !it.isCityState())
|
||||||
}.toString()
|
}.toString()
|
||||||
undefeatedCivs = sequenceOf(viewingPlayer) +
|
undefeatedCivs = viewingPlayer.diplomacyFunctions.getKnownCivsSorted(includeSelf = true, persistableData.includeCityStates)
|
||||||
viewingPlayer.diplomacyFunctions.getKnownCivsSorted(persistableData.includeCityStates)
|
defeatedCivs = viewingPlayer.diplomacyFunctions.getKnownCivsSorted(includeSelf = true, persistableData.includeCityStates, true)
|
||||||
defeatedCivs = viewingPlayer.diplomacyFunctions.getKnownCivsSorted(persistableData.includeCityStates, true)
|
|
||||||
.filter { it.isDefeated() }
|
.filter { it.isDefeated() }
|
||||||
|
|
||||||
clear()
|
clear()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user