mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04:00
Hides 'automate' unit action and unhides 'stop exploring' unit action (#4810)
This commit is contained in:
parent
b6ee4c0b1c
commit
b649427415
@ -268,8 +268,6 @@ class MapUnit {
|
|||||||
|
|
||||||
fun isMoving() = action?.startsWith("moveTo") == true
|
fun isMoving() = action?.startsWith("moveTo") == true
|
||||||
|
|
||||||
fun isAutomaticallyBuildingImprovements() = action != null && action == Constants.unitActionAutomation
|
|
||||||
|
|
||||||
fun isCivilian() = baseUnit.isCivilian()
|
fun isCivilian() = baseUnit.isCivilian()
|
||||||
|
|
||||||
fun getFortificationTurns(): Int {
|
fun getFortificationTurns(): Int {
|
||||||
|
@ -35,7 +35,9 @@ object UnitActions {
|
|||||||
val actionList = ArrayList<UnitAction>()
|
val actionList = ArrayList<UnitAction>()
|
||||||
|
|
||||||
if (unit.isMoving()) actionList += UnitAction(UnitActionType.StopMovement) { unit.action = null }
|
if (unit.isMoving()) actionList += UnitAction(UnitActionType.StopMovement) { unit.action = null }
|
||||||
if (unit.isAutomaticallyBuildingImprovements())
|
if (unit.action == Constants.unitActionExplore)
|
||||||
|
actionList += UnitAction(UnitActionType.StopExploration) { unit.action = null }
|
||||||
|
if (unit.action == Constants.unitActionAutomation)
|
||||||
actionList += UnitAction(UnitActionType.StopAutomation) { unit.action = null }
|
actionList += UnitAction(UnitActionType.StopAutomation) { unit.action = null }
|
||||||
|
|
||||||
addSleepActions(actionList, unit, false)
|
addSleepActions(actionList, unit, false)
|
||||||
@ -48,7 +50,6 @@ object UnitActions {
|
|||||||
addSetupAction(unit, actionList)
|
addSetupAction(unit, actionList)
|
||||||
addFoundCityAction(unit, actionList, tile)
|
addFoundCityAction(unit, actionList, tile)
|
||||||
addBuildingImprovementsAction(unit, actionList, tile, worldScreen, unitTable)
|
addBuildingImprovementsAction(unit, actionList, tile, worldScreen, unitTable)
|
||||||
addAutomateBuildingImprovementsAction(unit, actionList)
|
|
||||||
addCreateWaterImprovements(unit, actionList)
|
addCreateWaterImprovements(unit, actionList)
|
||||||
addGreatPersonActions(unit, actionList, tile)
|
addGreatPersonActions(unit, actionList, tile)
|
||||||
addFoundReligionAction(unit, actionList, tile)
|
addFoundReligionAction(unit, actionList, tile)
|
||||||
@ -56,6 +57,7 @@ object UnitActions {
|
|||||||
addSpreadReligionActions(unit, actionList, tile)
|
addSpreadReligionActions(unit, actionList, tile)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
addToggleActionsAction(unit, actionList, unitTable)
|
addToggleActionsAction(unit, actionList, unitTable)
|
||||||
|
|
||||||
return actionList
|
return actionList
|
||||||
@ -71,6 +73,7 @@ object UnitActions {
|
|||||||
|
|
||||||
addSwapAction(unit, actionList, worldScreen)
|
addSwapAction(unit, actionList, worldScreen)
|
||||||
addExplorationActions(unit, actionList)
|
addExplorationActions(unit, actionList)
|
||||||
|
addAutomateBuildingImprovementsAction(unit, actionList)
|
||||||
addDisbandAction(actionList, unit, worldScreen)
|
addDisbandAction(actionList, unit, worldScreen)
|
||||||
addGiftAction(unit, actionList, tile)
|
addGiftAction(unit, actionList, tile)
|
||||||
|
|
||||||
@ -290,7 +293,7 @@ object UnitActions {
|
|||||||
unit.action = Constants.unitActionExplore
|
unit.action = Constants.unitActionExplore
|
||||||
if (unit.currentMovement > 0) UnitAutomation.automatedExplore(unit)
|
if (unit.currentMovement > 0) UnitAutomation.automatedExplore(unit)
|
||||||
}
|
}
|
||||||
} else actionList += UnitAction(UnitActionType.StopExploration) { unit.action = null }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addUnitUpgradeAction(unit: MapUnit, actionList: ArrayList<UnitAction>) {
|
private fun addUnitUpgradeAction(unit: MapUnit, actionList: ArrayList<UnitAction>) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user