mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
Resolved #2278 - various exploration-related improvements
This commit is contained in:
parent
dd8acda4c0
commit
b441d537a5
@ -385,5 +385,6 @@ object UnitAutomation {
|
||||
if (unit.health < 80 && tryHealUnit(unit)) return
|
||||
if (tryExplore(unit)) return
|
||||
unit.civInfo.addNotification("[${unit.name}] finished exploring.", unit.currentTile.position, Color.GRAY)
|
||||
unit.action = null
|
||||
}
|
||||
}
|
@ -200,8 +200,8 @@ object UnitActions {
|
||||
actionList += UnitAction(
|
||||
type = UnitActionType.Explore,
|
||||
action = {
|
||||
UnitAutomation.automatedExplore(unit)
|
||||
unit.action = Constants.unitActionExplore
|
||||
if(unit.currentMovement>0) UnitAutomation.automatedExplore(unit)
|
||||
})
|
||||
} else {
|
||||
actionList += UnitAction(
|
||||
|
@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Button
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup
|
||||
import com.unciv.Constants
|
||||
import com.unciv.logic.map.MapUnit
|
||||
import com.unciv.logic.map.TileInfo
|
||||
import com.unciv.logic.map.action.BuildLongRoadAction
|
||||
@ -75,6 +76,7 @@ class UnitContextMenu(val tileMapHolder: WorldMapHolder, val selectedUnit: MapUn
|
||||
// I can't think of any way to avoid this,
|
||||
// but it's so rare and edge-case-y that ignoring its failure is actually acceptable, hence the empty catch
|
||||
selectedUnit.movement.moveToTile(tileToMoveTo)
|
||||
if(selectedUnit.action == Constants.unitActionExplore) selectedUnit.action = null // remove explore on manual move
|
||||
Sounds.play(UncivSound.Whoosh)
|
||||
if (selectedUnit.currentTile != targetTile)
|
||||
selectedUnit.action = "moveTo " + targetTile.position.x.toInt() + "," + targetTile.position.y.toInt()
|
||||
@ -82,7 +84,6 @@ class UnitContextMenu(val tileMapHolder: WorldMapHolder, val selectedUnit: MapUn
|
||||
tileMapHolder.worldScreen.bottomUnitTable.selectedUnit = selectedUnit
|
||||
}
|
||||
|
||||
// we don't update it directly because we're on a different thread; instead, we tell it to update itself
|
||||
tileMapHolder.worldScreen.shouldUpdate = true
|
||||
tileMapHolder.unitActionOverlay?.remove()
|
||||
} catch (e: Exception) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user