aboutsummaryrefslogtreecommitdiff
path: root/go
diff options
context:
space:
mode:
Diffstat (limited to 'go')
-rw-r--r--go/client/game.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/go/client/game.go b/go/client/game.go
index 4dc61a1a..4402d1ea 100644
--- a/go/client/game.go
+++ b/go/client/game.go
@@ -46,6 +46,7 @@ type Game struct {
resetButton *ui.SimpleButton
discardPileView *ui.PocList
discardPileButton *ui.SimpleButton
+ storeVisible bool
storeView *ui.PocList
storeButton *ui.SimpleButton
stackBuffer *ui.Buffer
@@ -181,7 +182,7 @@ func (g *Game) initPlayerUi(player *game.Player) *Game {
DEFAULT_BUTTON_HEIGHT,
"Store",
func(*ui.SimpleButton) {
- if idx := g.FindWidget(g.storeView); idx == -1 {
+ if !g.storeVisible {
g.showStore()
} else {
g.hideStore()
@@ -198,11 +199,16 @@ func (g *Game) initPlayerUi(player *game.Player) *Game {
}
func (g *Game) showStore() {
+ if g.storeVisible {
+ return
+ }
+ g.storeVisible = true
g.storeView.ForceRedraw()
g.AddWidget(g.storeView)
}
func (g *Game) hideStore() {
+ g.storeVisible = false
g.RemoveWidget(g.storeView)
}
@@ -380,6 +386,9 @@ func (g *Game) clearHighlights() {
}
func (g *Game) declareAction(a game.Action) {
+ if _, ok := a.(*game.BuyAction); ok {
+ g.hideStore()
+ }
g.playerCtrl.SendAction(a)
g.clearHighlights()
g.hasPriority = false