aboutsummaryrefslogtreecommitdiff
path: root/go/client
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/client
parent121016509135952eb1144abdaa8aeabe5bebe682 (diff)
downloadmuhqs-game-778487d25a79721539cea1e47331e3c2f985c8cc.tar.gz
muhqs-game-778487d25a79721539cea1e47331e3c2f985c8cc.zip
rework hover detection
Diffstat (limited to 'go/client')
-rw-r--r--go/client/game.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/go/client/game.go b/go/client/game.go
index d525a49c..f726c95d 100644
--- a/go/client/game.go
+++ b/go/client/game.go
@@ -122,7 +122,7 @@ func (g *Game) loadMap(mapName string) *Game {
}
func (g *Game) initMapUi() {
- g.mapView = ui.NewMapView(g.gameState)
+ g.mapView = ui.NewMapView(g.gameState, &g.Collection)
g.AddWidget(g.mapView)
storeTiles := g.gameState.Map().FilterTiles(func(t *game.Tile) bool { return t.Type == game.TileTypes.Store })
@@ -179,7 +179,7 @@ func (g *Game) initPlayerUi(player *game.Player) *Game {
x = g.discardPileButton.X + g.discardPileButton.Width/2
y = g.Height - DEFAULT_BUTTON_HEIGHT
- g.discardPileView = ui.NewPocList(x, y, g.activePlayer().DiscardPile)
+ g.discardPileView = ui.NewPocList(x, y, g.activePlayer().DiscardPile, &g.Collection)
if !g.storesOnMap {
x = g.stateBar.Width + g.discardPileButton.Width
@@ -199,7 +199,7 @@ func (g *Game) initPlayerUi(player *game.Player) *Game {
x = g.storeButton.X + g.storeButton.Width/2
y = g.Height - DEFAULT_BUTTON_HEIGHT
- g.storeView = ui.NewPocList(x, y, g.activePlayer().Store)
+ g.storeView = ui.NewPocList(x, y, g.activePlayer().Store, &g.Collection)
}
return g
@@ -461,6 +461,10 @@ func (g *Game) updateButtons() {
g.passButton.UpdateLabel(passButtonLabel)
}
+func (g *Game) ResetHover() {
+ ui.AppendInput(ui.InputEvent{ui.HoverEnd, -1, -1, nil})
+}
+
func (g *Game) reset() {
g.removeChoice()
g.selectedObject = nil
@@ -582,7 +586,7 @@ func (g *Game) handleSelection(obj any, x, y int) {
g.hideStore()
}
- g.storeView = ui.NewPocList(x, y, g.gameState.Map().StoreOn(obj.Position))
+ g.storeView = ui.NewPocList(x, y, g.gameState.Map().StoreOn(obj.Position), &g.Collection)
g.showStore()
}