mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
Disabled city state diplomacy buttons when it is not your turn (#4503)
This commit is contained in:
parent
68b40cf860
commit
6c0237fcc3
@ -156,12 +156,13 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
|
|||||||
|
|
||||||
diplomacyTable.addSeparator()
|
diplomacyTable.addSeparator()
|
||||||
|
|
||||||
val giveGoldButton = "Give a Gift".toTextButton()
|
val giveGiftButton = "Give a Gift".toTextButton()
|
||||||
giveGoldButton.onClick {
|
giveGiftButton.onClick {
|
||||||
rightSideTable.clear()
|
rightSideTable.clear()
|
||||||
rightSideTable.add(ScrollPane(getGoldGiftTable(otherCiv)))
|
rightSideTable.add(ScrollPane(getGoldGiftTable(otherCiv)))
|
||||||
}
|
}
|
||||||
diplomacyTable.add(giveGoldButton).row()
|
diplomacyTable.add(giveGiftButton).row()
|
||||||
|
if (isNotPlayersTurn()) giveGiftButton.disable()
|
||||||
|
|
||||||
if (otherCivDiplomacyManager.diplomaticStatus == DiplomaticStatus.Protector){
|
if (otherCivDiplomacyManager.diplomaticStatus == DiplomaticStatus.Protector){
|
||||||
val revokeProtectionButton = "Revoke Protection".toTextButton()
|
val revokeProtectionButton = "Revoke Protection".toTextButton()
|
||||||
@ -173,6 +174,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
|
|||||||
}, this).open()
|
}, this).open()
|
||||||
}
|
}
|
||||||
diplomacyTable.add(revokeProtectionButton).row()
|
diplomacyTable.add(revokeProtectionButton).row()
|
||||||
|
if (isNotPlayersTurn()) revokeProtectionButton.disable()
|
||||||
} else {
|
} else {
|
||||||
val protectionButton = "Pledge to protect".toTextButton()
|
val protectionButton = "Pledge to protect".toTextButton()
|
||||||
protectionButton.onClick {
|
protectionButton.onClick {
|
||||||
@ -186,6 +188,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
|
|||||||
protectionButton.disable()
|
protectionButton.disable()
|
||||||
}
|
}
|
||||||
diplomacyTable.add(protectionButton).row()
|
diplomacyTable.add(protectionButton).row()
|
||||||
|
if (isNotPlayersTurn()) protectionButton.disable()
|
||||||
}
|
}
|
||||||
|
|
||||||
val diplomacyManager = viewingCiv.getDiplomacyManager(otherCiv)
|
val diplomacyManager = viewingCiv.getDiplomacyManager(otherCiv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user