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-08-20 15:50:11 +0200
commit28defc1cad1a96a2954780efa01396db8bb2fe31 (patch)
treeb6bf6e43d48a7bc7f0ccce7d6f4253e1e15e6492 /go/client
parent8f81177d191b3e6d80212e1fa370d37db2fe38ce (diff)
downloadmuhqs-game-28defc1cad1a96a2954780efa01396db8bb2fe31.tar.gz
muhqs-game-28defc1cad1a96a2954780efa01396db8bb2fe31.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) {