Disabled city state diplomacy buttons when it is not your turn (#4503)

This commit is contained in:
Xander Lenstra 2021-07-13 16:41:31 +02:00 committed by GitHub
parent 68b40cf860
commit 6c0237fcc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,12 +156,13 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
diplomacyTable.addSeparator()
val giveGoldButton = "Give a Gift".toTextButton()
giveGoldButton.onClick {
val giveGiftButton = "Give a Gift".toTextButton()
giveGiftButton.onClick {
rightSideTable.clear()
rightSideTable.add(ScrollPane(getGoldGiftTable(otherCiv)))
}
diplomacyTable.add(giveGoldButton).row()
diplomacyTable.add(giveGiftButton).row()
if (isNotPlayersTurn()) giveGiftButton.disable()
if (otherCivDiplomacyManager.diplomaticStatus == DiplomaticStatus.Protector){
val revokeProtectionButton = "Revoke Protection".toTextButton()
@ -173,6 +174,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
}, this).open()
}
diplomacyTable.add(revokeProtectionButton).row()
if (isNotPlayersTurn()) revokeProtectionButton.disable()
} else {
val protectionButton = "Pledge to protect".toTextButton()
protectionButton.onClick {
@ -186,6 +188,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
protectionButton.disable()
}
diplomacyTable.add(protectionButton).row()
if (isNotPlayersTurn()) protectionButton.disable()
}
val diplomacyManager = viewingCiv.getDiplomacyManager(otherCiv)