mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Can no longer click 'next turn' if popups are open - #1289
This commit is contained in:
parent
b2cd200856
commit
777802ab04
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
@ -75,8 +75,7 @@ class SpecificUnitAutomation{
|
|||||||
.asSequence()
|
.asSequence()
|
||||||
.sortedByDescending { nearbyTileRankings[it] }
|
.sortedByDescending { nearbyTileRankings[it] }
|
||||||
.take(5)
|
.take(5)
|
||||||
.toList()
|
var rank = top5Tiles.map { nearbyTileRankings[it]!! }.sum()
|
||||||
var rank = top5Tiles.asSequence().map { nearbyTileRankings[it]!! }.sum()
|
|
||||||
if (tileInfo.isCoastalTile()) rank += 5
|
if (tileInfo.isCoastalTile()) rank += 5
|
||||||
|
|
||||||
val luxuryResourcesInCityArea = tileInfo.getTilesAtDistance(2).filter { it.resource!=null }
|
val luxuryResourcesInCityArea = tileInfo.getTilesAtDistance(2).filter { it.resource!=null }
|
||||||
|
@ -182,10 +182,6 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||||||
techPolicyandVictoryHolder.setPosition(10f, topBar.y - techPolicyandVictoryHolder.height - 5f)
|
techPolicyandVictoryHolder.setPosition(10f, topBar.y - techPolicyandVictoryHolder.height - 5f)
|
||||||
updateDiplomacyButton(viewingCiv)
|
updateDiplomacyButton(viewingCiv)
|
||||||
|
|
||||||
updateNextTurnButton() // This must be before the notifications update, since its position is based on it
|
|
||||||
notificationsScroll.update(viewingCiv.notifications)
|
|
||||||
notificationsScroll.setPosition(stage.width - notificationsScroll.width - 5f,
|
|
||||||
nextTurnButton.y - notificationsScroll.height - 5f)
|
|
||||||
|
|
||||||
val isSomethingOpen = tutorials.isTutorialShowing || stage.actors.any { it is TradePopup }
|
val isSomethingOpen = tutorials.isTutorialShowing || stage.actors.any { it is TradePopup }
|
||||||
|| alertPopupIsOpen
|
|| alertPopupIsOpen
|
||||||
@ -198,6 +194,11 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||||||
viewingCiv.tradeRequests.isNotEmpty() -> TradePopup(this)
|
viewingCiv.tradeRequests.isNotEmpty() -> TradePopup(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateNextTurnButton(isSomethingOpen) // This must be before the notifications update, since its position is based on it
|
||||||
|
notificationsScroll.update(viewingCiv.notifications)
|
||||||
|
notificationsScroll.setPosition(stage.width - notificationsScroll.width - 5f,
|
||||||
|
nextTurnButton.y - notificationsScroll.height - 5f)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun displayTutorialsOnUpdate() {
|
private fun displayTutorialsOnUpdate() {
|
||||||
@ -388,7 +389,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateNextTurnButton() {
|
fun updateNextTurnButton(isSomethingOpen: Boolean) {
|
||||||
val text = when {
|
val text = when {
|
||||||
!isPlayersTurn -> "Waiting for other players..."
|
!isPlayersTurn -> "Waiting for other players..."
|
||||||
viewingCiv.shouldGoToDueUnit() -> "Next unit"
|
viewingCiv.shouldGoToDueUnit() -> "Next unit"
|
||||||
@ -400,7 +401,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||||||
nextTurnButton.setText(text.tr())
|
nextTurnButton.setText(text.tr())
|
||||||
nextTurnButton.color = if (text == "Next turn") Color.WHITE else Color.GRAY
|
nextTurnButton.color = if (text == "Next turn") Color.WHITE else Color.GRAY
|
||||||
nextTurnButton.pack()
|
nextTurnButton.pack()
|
||||||
if (alertPopupIsOpen || !isPlayersTurn || waitingForAutosave) nextTurnButton.disable()
|
if (isSomethingOpen || !isPlayersTurn || waitingForAutosave) nextTurnButton.disable()
|
||||||
else nextTurnButton.enable()
|
else nextTurnButton.enable()
|
||||||
nextTurnButton.setPosition(stage.width - nextTurnButton.width - 10f, topBar.y - nextTurnButton.height - 10f)
|
nextTurnButton.setPosition(stage.width - nextTurnButton.width - 10f, topBar.y - nextTurnButton.height - 10f)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user