diff options
| -rw-r--r-- | go/client/game.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/go/client/game.go b/go/client/game.go index c328ddf7..9f440ceb 100644 --- a/go/client/game.go +++ b/go/client/game.go @@ -111,12 +111,6 @@ func (g *Game) addActivePlayer(name string, deckList string) *Game { return g.initPlayerUi(p) } -func (g *Game) addPrompt(action game.Action, prompt string) { - g.prompt = ui.NewPrompt(g.Height/2, g.Width, action, prompt) - g.AddWidget(g.prompt) - g.updateHighlight() -} - func (g *Game) getPlayer(name string) *game.Player { for _, p := range g.gameState.Players { if p.Name == name { @@ -282,6 +276,9 @@ func (g *Game) addActionChoice(perm game.Permanent, x, y int) { } func (g *Game) addChoice(choice *ui.Choice) { + if g.choice != nil { + g.removeChoice() + } g.choice = choice g.AddWidget(choice) } @@ -291,6 +288,15 @@ func (g *Game) removeChoice() { g.choice = nil } +func (g *Game) addPrompt(action game.Action, prompt string) { + if g.prompt != nil { + g.removePrompt() + } + g.prompt = ui.NewPrompt(g.Height/2, g.Width, action, prompt) + g.AddWidget(g.prompt) + g.updateHighlight() +} + func (g *Game) progressPrompt() { a := g.prompt.Action() targets := a.Targets() |
