mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-08 23:08:35 +07:00
Added city-state icon to diplomacy screen, so you know who's a city state and who's a major civ at a glance
This commit is contained in:
@ -48,10 +48,17 @@ class DiplomacyScreen:CameraStageBaseScreen() {
|
|||||||
val currentPlayerCiv = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization()
|
val currentPlayerCiv = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization()
|
||||||
for (civ in UnCivGame.Current.gameInfo.civilizations
|
for (civ in UnCivGame.Current.gameInfo.civilizations
|
||||||
.filterNot { it.isDefeated() || it.isPlayerCivilization() || it.isBarbarianCivilization() }) {
|
.filterNot { it.isDefeated() || it.isPlayerCivilization() || it.isBarbarianCivilization() }) {
|
||||||
if (!currentPlayerCiv.diplomacy.containsKey(civ.civName)) continue
|
if (!currentPlayerCiv.knows(civ.civName)) continue
|
||||||
|
|
||||||
val civIndicator = ImageGetter.getCircle().apply { color = civ.getNation().getSecondaryColor() }
|
val civIndicator = ImageGetter.getCircle().apply { color = civ.getNation().getSecondaryColor() }
|
||||||
.surroundWithCircle(100f).apply { circle.color = civ.getNation().getColor() }
|
.surroundWithCircle(100f).apply { circle.color = civ.getNation().getColor() }
|
||||||
|
if(civ.isCityState()){
|
||||||
|
val cityStateIcon = ImageGetter.getImage("OtherIcons/CityState.png")
|
||||||
|
cityStateIcon.setSize(70f,70f)
|
||||||
|
cityStateIcon.center(civIndicator)
|
||||||
|
civIndicator.addActor(cityStateIcon)
|
||||||
|
}
|
||||||
|
|
||||||
val relationship = ImageGetter.getCircle()
|
val relationship = ImageGetter.getCircle()
|
||||||
if(currentPlayerCiv.isAtWarWith(civ)) relationship.color = Color.RED
|
if(currentPlayerCiv.isAtWarWith(civ)) relationship.color = Color.RED
|
||||||
else relationship.color = Color.GREEN
|
else relationship.color = Color.GREEN
|
||||||
@ -94,16 +101,16 @@ class DiplomacyScreen:CameraStageBaseScreen() {
|
|||||||
diplomacyTable.defaults().pad(10f)
|
diplomacyTable.defaults().pad(10f)
|
||||||
if (otherCiv.isCityState()) {
|
if (otherCiv.isCityState()) {
|
||||||
diplomacyTable.add(otherCiv.getNation().getLeaderDisplayName().toLabel()).row()
|
diplomacyTable.add(otherCiv.getNation().getLeaderDisplayName().toLabel()).row()
|
||||||
diplomacyTable.add(("Type : " + otherCiv.getCityStateType().toString()).toLabel()).row()
|
diplomacyTable.add(("Type: " + otherCiv.getCityStateType().toString()).toLabel()).row()
|
||||||
diplomacyTable.add(("Influence : " + otherCiv.getDiplomacyManager(currentPlayerCiv).influence.toInt().toString()).toLabel()).row()
|
diplomacyTable.add(("Influence: " + otherCiv.getDiplomacyManager(currentPlayerCiv).influence.toInt()+"/60").toLabel()).row()
|
||||||
if (otherCiv.getDiplomacyManager(currentPlayerCiv).influence >= 60) {
|
if (otherCiv.getDiplomacyManager(currentPlayerCiv).influence >= 60) {
|
||||||
when(otherCiv.getCityStateType()) {
|
when(otherCiv.getCityStateType()) {
|
||||||
CityStateType.Cultured -> diplomacyTable.add(
|
CityStateType.Cultured -> diplomacyTable.add(
|
||||||
("Providing " + (5.0f * currentPlayerCiv.getEra().ordinal).toString() + " culture each turn").toLabel())
|
("Providing " + (5.0f * currentPlayerCiv.getEra().ordinal).toString() + " culture each turn").toLabel())
|
||||||
CityStateType.Maritime -> diplomacyTable.add(
|
CityStateType.Maritime -> diplomacyTable.add(
|
||||||
("Providing 3 food in capital and 1 food in other cities.").toLabel())
|
"Providing 3 food in capital and 1 food in other cities".toLabel())
|
||||||
CityStateType.Mercantile -> diplomacyTable.add(
|
CityStateType.Mercantile -> diplomacyTable.add(
|
||||||
("Providing 3 happiness.").toLabel())
|
"Providing 3 happiness".toLabel())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -111,8 +118,8 @@ class DiplomacyScreen:CameraStageBaseScreen() {
|
|||||||
}
|
}
|
||||||
diplomacyTable.addSeparator()
|
diplomacyTable.addSeparator()
|
||||||
|
|
||||||
val giftButton = TextButton("Give 100 gold".tr(), skin)
|
|
||||||
val giftAmount = 100
|
val giftAmount = 100
|
||||||
|
val giftButton = TextButton("Give [$giftAmount] gold".tr(), skin)
|
||||||
giftButton.onClick{ giveGoldGift(otherCiv,giftAmount ) }
|
giftButton.onClick{ giveGoldGift(otherCiv,giftAmount ) }
|
||||||
diplomacyTable.add(giftButton).row()
|
diplomacyTable.add(giftButton).row()
|
||||||
if (currentPlayerCiv.gold < giftAmount ) giftButton.disable()
|
if (currentPlayerCiv.gold < giftAmount ) giftButton.disable()
|
||||||
|
Reference in New Issue
Block a user