diff options
Diffstat (limited to 'go/ui')
| -rw-r--r-- | go/ui/hoverable.go | 5 | ||||
| -rw-r--r-- | go/ui/mapView.go | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/go/ui/hoverable.go b/go/ui/hoverable.go index 08fd9240..ea80b51e 100644 --- a/go/ui/hoverable.go +++ b/go/ui/hoverable.go @@ -2,6 +2,7 @@ package ui import ( "image/color" + "muhq.space/muhqs-game/go/game" ) @@ -111,7 +112,9 @@ func (h *hoverPermInfo) init(mv *MapView, c *Collection) { } h.reset = func() { - mv.ClearTileHighlights() + for _, t := range movable { + mv.ClearTileHighlight(t) + } } } diff --git a/go/ui/mapView.go b/go/ui/mapView.go index 035f0f35..169aaaf3 100644 --- a/go/ui/mapView.go +++ b/go/ui/mapView.go @@ -473,6 +473,13 @@ func (vw *MapView) AddHighlightTile(t *game.Tile, color color.Color) { vw.AddHighlightPosition(t.Position, color) } +// ClearTileHighlight removes a tile from the highlighted ones. +func (vw *MapView) ClearTileHighlight(t *game.Tile) { + delete(vw.tileHighlights, t.Position) + vw.ForceRedraw() +} + +// ClearTileHighlights removes all tile highlights. func (vw *MapView) ClearTileHighlights() { vw.HighlightTiles([]*game.Tile{}, nil) } |
