diff --git a/core/src/com/unciv/ui/pickerscreens/PromotionPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/PromotionPickerScreen.kt index a87509d545..1e2d91198b 100644 --- a/core/src/com/unciv/ui/pickerscreens/PromotionPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/PromotionPickerScreen.kt @@ -34,14 +34,13 @@ class PromotionPickerScreen(val unit: MapUnit) : PickerScreen() { rightSideButton.setText("Pick promotion".tr()) rightSideButton.onClick(UncivSound.Promote) { - acceptPromotion(selectedPromotion) + acceptPromotion(selectedPromotion) } val canBePromoted = unit.promotions.canBePromoted() val canChangeState = game.worldScreen.canChangeState val canPromoteNow = canBePromoted && canChangeState && unit.currentMovement > 0 && unit.attacksThisTurn == 0 - if (!canPromoteNow) - rightSideButton.isEnabled = false + rightSideButton.isEnabled = canPromoteNow val availablePromotionsGroup = Table() availablePromotionsGroup.defaults().pad(5f) @@ -89,7 +88,7 @@ class PromotionPickerScreen(val unit: MapUnit) : PickerScreen() { availablePromotionsGroup.add(selectPromotionButton) - if (canBePromoted && isPromotionAvailable && canChangeState) { + if (canPromoteNow && isPromotionAvailable) { val pickNow = "Pick now!".toLabel() pickNow.setAlignment(Align.center) pickNow.onClick { @@ -108,7 +107,7 @@ class PromotionPickerScreen(val unit: MapUnit) : PickerScreen() { displayTutorial(Tutorial.Experience) } - fun setScrollY(scrollY: Float): PromotionPickerScreen { + private fun setScrollY(scrollY: Float): PromotionPickerScreen { splitPane.pack() // otherwise scrollPane.maxY == 0 scrollPane.scrollY = scrollY scrollPane.updateVisualScroll() diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt index 92fa3383fb..b86120f103 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt @@ -226,7 +226,7 @@ object UnitActions { private fun addPromoteAction(unit: MapUnit, actionList: ArrayList) { if (unit.isCivilian() || !unit.promotions.canBePromoted()) return - // promotion does not consume movement points, so we can do it always + // promotion does not consume movement points, but is not allowed if a unit has exhausted its movement or has attacked actionList += UnitAction(UnitActionType.Promote, action = { UncivGame.Current.setScreen(PromotionPickerScreen(unit))