aboutsummaryrefslogtreecommitdiff
path: root/go/ui/mapView.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-08-06 18:02:44 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:35 +0200
commit778487d25a79721539cea1e47331e3c2f985c8cc (patch)
tree1762762f69895465e7d1a0c9844ed9dbb28b2a71 /go/ui/mapView.go
parent121016509135952eb1144abdaa8aeabe5bebe682 (diff)
downloadmuhqs-game-778487d25a79721539cea1e47331e3c2f985c8cc.tar.gz
muhqs-game-778487d25a79721539cea1e47331e3c2f985c8cc.zip
rework hover detection
Diffstat (limited to 'go/ui/mapView.go')
-rw-r--r--go/ui/mapView.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/go/ui/mapView.go b/go/ui/mapView.go
index d73f3573..36455d8c 100644
--- a/go/ui/mapView.go
+++ b/go/ui/mapView.go
@@ -48,7 +48,7 @@ type MapView struct {
permanentsHighlights map[game.Permanent][]color.Color
}
-func NewMapView(g game.State) *MapView {
+func NewMapView(g game.State, c *Collection) *MapView {
vw := &MapView{
EventHandlersMap: NewEventHandlersMap(),
gameState: g,
@@ -56,7 +56,8 @@ func NewMapView(g game.State) *MapView {
tileHighlights: make(map[game.Position][]color.Color),
permanentsHighlights: make(map[game.Permanent][]color.Color),
}
- vw.hoverPermInfo.init(vw)
+ vw.hoverPermInfo.init(vw, c)
+ vw.RegisterHandler("hover", vw.hoverPermInfo.Hover)
return vw
}