diff --git a/android/assets/Construction.atlas b/android/assets/Construction.atlas index 60695472f9..33ff7af0cd 100644 --- a/android/assets/Construction.atlas +++ b/android/assets/Construction.atlas @@ -1292,6 +1292,13 @@ UnitActionIcons/StopMove orig: 100, 100 offset: 0, 0 index: -1 +UnitActionIcons/ShowUnitDestination + rotate: false + xy: 980, 0 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 UnitActionIcons/Swap rotate: false xy: 1702, 646 diff --git a/android/assets/Construction.png b/android/assets/Construction.png index ffefaf461d..70b0c1259c 100644 Binary files a/android/assets/Construction.png and b/android/assets/Construction.png differ diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index a169b78fd8..1a273efbfb 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -1067,6 +1067,7 @@ Range = XP = Move unit = Stop movement = +Show unit destination = Swap units = Construct improvement = Automate = diff --git a/core/src/com/unciv/models/UnitAction.kt b/core/src/com/unciv/models/UnitAction.kt index 3bb8f44386..277959a33e 100644 --- a/core/src/com/unciv/models/UnitAction.kt +++ b/core/src/com/unciv/models/UnitAction.kt @@ -18,7 +18,7 @@ open class UnitAction( val title: String = type.value, val isCurrentAction: Boolean = false, val uncivSound: UncivSound = type.uncivSound, - /** Action is Null is this unit *can* execute the action but *not right now* - it's embarked, out of moves, etc */ + /** Action is Null if this unit *can* execute the action but *not right now* - it's embarked, out of moves, etc */ val action: (() -> Unit)? = null ) { fun getIcon(): Actor { @@ -103,6 +103,8 @@ enum class UnitActionType( { ImageGetter.getUnitActionPortrait("Stop") }, false), StopMovement("Stop movement", { ImageGetter.getUnitActionPortrait("StopMove") }, false), + ShowUnitDestination("Show unit destination", + { ImageGetter.getUnitActionPortrait("ShowUnitDestination")}, false), Sleep("Sleep", { ImageGetter.getUnitActionPortrait("Sleep") }), SleepUntilHealed("Sleep until healed", diff --git a/core/src/com/unciv/ui/components/input/KeyboardBinding.kt b/core/src/com/unciv/ui/components/input/KeyboardBinding.kt index 2d43939fc5..5f22fd1bbe 100644 --- a/core/src/com/unciv/ui/components/input/KeyboardBinding.kt +++ b/core/src/com/unciv/ui/components/input/KeyboardBinding.kt @@ -90,6 +90,7 @@ enum class KeyboardBinding( Automate(Category.UnitActions, 'm'), StopAutomation(Category.UnitActions,"Stop automation", 'm'), StopMovement(Category.UnitActions,"Stop movement", '.'), + ShowUnitDestination(Category.UnitActions, "Show unit destination", 'j'), Sleep(Category.UnitActions, 'f'), SleepUntilHealed(Category.UnitActions,"Sleep until healed", 'h'), Fortify(Category.UnitActions, 'f'), diff --git a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt index a5605a84f6..af23e10910 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt @@ -60,8 +60,9 @@ object UnitActions { addTriggerUniqueActions(unit, actionList) addAddInCapitalAction(unit, actionList, tile) - if (unit.isMoving()) + if (unit.isMoving()) { actionList += UnitAction(UnitActionType.StopMovement) { unit.action = null } + } if (unit.isExploring()) actionList += UnitAction(UnitActionType.StopExploration) { unit.action = null } if (unit.isAutomated()) @@ -87,6 +88,11 @@ object UnitActions { val tile = unit.getTile() val actionList = ArrayList() + if (unit.isMoving()) { + actionList += UnitAction(UnitActionType.ShowUnitDestination) { + GUI.getMap().setCenterPosition(unit.getMovementDestination().position,true) + } + } addSleepActions(actionList, unit, true) addFortifyActions(actionList, unit, true) addAutomateAction(unit, actionList, false) diff --git a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt index c174357f4a..5d2d60f2b8 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActionsTable.kt @@ -65,12 +65,12 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table() { // overlay, since the user definitely wants to interact with the new unit. worldScreen.mapHolder.removeUnitActionOverlay() if (UncivGame.Current.settings.autoUnitCycle - && (unit.isDestroyed || unitAction.type.isSkippingToNextUnit || unit.currentMovement == 0f)) { + && (unit.isDestroyed || (unit.isMoving() && unit.currentMovement == 0f && unitAction.type.isSkippingToNextUnit) || (!unit.isMoving() && unitAction.type.isSkippingToNextUnit))) { worldScreen.switchToNextUnit() } } } - return actionButton + return actionButton } } diff --git a/docs/Credits.md b/docs/Credits.md index eec0931bff..36a1be3a88 100644 --- a/docs/Credits.md +++ b/docs/Credits.md @@ -730,6 +730,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https: - [Keyboard](https://thenounproject.com/icon/keyboard-2685534/) by Twenty Foo Studio for Options Keys - [charts](https://thenounproject.com/icon/charts-2312023/) by Srinivas Agra (gimped to appear bolder) for the Charts page - [framed image](https://thenounproject.com/icon/framed-image-2332187/) by Jose Dean for Victory Illustrations page +- [down](https://thenounproject.com/icon/down-39378/) by Cengiz SARI for Show unit destination ### Main menu