Update city-state related icons and popups.

This commit is contained in:
Duan Tao
2019-05-08 17:16:44 +08:00
committed by Yair Morgenstern
parent 9ab02c8d22
commit 1434ca3f30
5 changed files with 357 additions and 324 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 991 KiB

After

Width:  |  Height:  |  Size: 986 KiB

View File

@ -10,6 +10,9 @@ import com.unciv.logic.civilization.CityStateType
import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.logic.civilization.diplomacy.DiplomaticModifiers
import com.unciv.logic.civilization.diplomacy.RelationshipLevel
import com.unciv.logic.trade.TradeLogic
import com.unciv.logic.trade.TradeOffer
import com.unciv.logic.trade.TradeType
import com.unciv.models.gamebasics.tr
import com.unciv.models.stats.Stat
import com.unciv.ui.utils.*
@ -113,7 +116,24 @@ class DiplomacyScreen:CameraStageBaseScreen() {
val diplomacyManager = currentPlayerCiv.getDiplomacyManager(otherCiv)
if (!currentPlayerCiv.isAtWarWith(otherCiv)) {
if (currentPlayerCiv.isAtWarWith(otherCiv)) {
if (otherCiv.isCityState()) {
val PeaceButton = TextButton("Negociate Peace".tr(), skin)
PeaceButton.onClick {
YesNoPopupTable("Peace with [${otherCiv.civName}]?".tr(), {
diplomacyManager.makePeace()
updateLeftSideTable()
}, this)
val tradeLogic = TradeLogic(currentPlayerCiv, otherCiv)
tradeLogic.currentTrade.ourOffers.add(TradeOffer("Peace Treaty", TradeType.Treaty, 20))
tradeLogic.currentTrade.theirOffers.add(TradeOffer("Peace Treaty", TradeType.Treaty, 20))
tradeLogic.acceptTrade()
}
diplomacyTable.add(PeaceButton).row()
}
} else {
val declareWarButton = TextButton("Declare war".tr(), skin)
declareWarButton.color = Color.RED
val turnsToPeaceTreaty = diplomacyManager.turnsToPeaceTreaty()

View File

@ -49,10 +49,16 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu
add(getCloseButton("Farewell."))
}
AlertType.FirstContact -> {
val translatedNation = worldScreen.gameInfo.getCivilization(popupAlert.value).getTranslatedNation()
addLeaderName(translatedNation)
addGoodSizedLabel(translatedNation.introduction).row()
add(getCloseButton("A pleasure to meet you."))
val civ = worldScreen.gameInfo.getCivilization(popupAlert.value)
val translatedNation = civ.getTranslatedNation()
if (civ.isCityState()) {
addGoodSizedLabel("Type : " + civ.getCityStateType()).row()
add(getCloseButton("A pleasure to meet you."))
} else {
addLeaderName(translatedNation)
addGoodSizedLabel(translatedNation.introduction).row()
add(getCloseButton("A pleasure to meet you."))
}
}
AlertType.CityConquered -> {
addGoodSizedLabel("What would you like to do with the city?").row()