aboutsummaryrefslogtreecommitdiff
path: root/go/client
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-02-17 00:29:26 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:50 +0100
commit65aa5f53d54b4590b98a559fccfb1cc7c7644187 (patch)
tree8b258625df3211a93efba1db889bd371e2f1d0ae /go/client
parent1c4651a7bba1e2b23a182152dc96902e9fb6868a (diff)
downloadmuhqs-game-65aa5f53d54b4590b98a559fccfb1cc7c7644187.tar.gz
muhqs-game-65aa5f53d54b4590b98a559fccfb1cc7c7644187.zip
implement unit and artifact switch action
Simplify the Choice Widget and make it a TextBox variant. Drive-by fixes: * ui.Collection: prioritize newer widgets during active widget selection * game.FullAction: fix incorrect cost function. Full actions cost all available actions. Also fix the cost check
Diffstat (limited to 'go/client')
-rw-r--r--go/client/game.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/go/client/game.go b/go/client/game.go
index 8447e452..32fb5f2f 100644
--- a/go/client/game.go
+++ b/go/client/game.go
@@ -409,18 +409,12 @@ func (g *Game) highlightTargets() {
func (g *Game) Update() error {
g.handlePlayerNotifications()
-
- if err := g.Collection.Update(); err != nil {
- return nil
- }
-
- x, y := ebiten.CursorPosition()
-
- obj := g.findObjectAt(x, y)
-
g.highlightTargets()
if inpututil.IsMouseButtonJustPressed(ebiten.MouseButtonLeft) {
+ x, y := ebiten.CursorPosition()
+ obj := g.findObjectAt(x, y)
+
if g.prompt != nil {
if err := g.prompt.Add(obj); err == nil {
g.AddHighlight(obj)
@@ -445,7 +439,8 @@ func (g *Game) Update() error {
g.prompt.ClearSelections()
}
}
- return nil
+
+ return g.Collection.Update()
}
func (g *Game) Draw(screen *ebiten.Image) {