diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 14:44:06 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:42 +0200 |
| commit | a059fa9bb1ace39cf5fdcfd489a90f5d778c9344 (patch) | |
| tree | 8907fbb2246c829d85d995694c35b229761ad5b8 /go/client/game.go | |
| parent | a702781e58fc6db55aca6b61b1eb556bfca481b2 (diff) | |
| download | muhqs-game-a059fa9bb1ace39cf5fdcfd489a90f5d778c9344.tar.gz muhqs-game-a059fa9bb1ace39cf5fdcfd489a90f5d778c9344.zip | |
add game and settings menus
Diffstat (limited to 'go/client/game.go')
| -rw-r--r-- | go/client/game.go | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/go/client/game.go b/go/client/game.go index eae065c6..f4262f67 100644 --- a/go/client/game.go +++ b/go/client/game.go @@ -34,17 +34,17 @@ const ( STATE_BAR_WIDTH = 300 POC_BUTTON_WIDTH = 150 - - AUTO_PROGRESS_PROMPT = true ) type Game struct { - app *app + app *app + settings *settings keyBindings keyBindings selectedObject any + menuButton *ui.ImageButton handLayer *ui.HandView discardBtn *ui.ImageButton stateBar *ui.StateBar @@ -77,6 +77,7 @@ type Game struct { func newGame(app *app, gameState game.State) *Game { g := &Game{ app: app, + settings: newSettings(), gameState: gameState, keyBindings: make(keyBindings), Collection: ui.Collection{ @@ -92,6 +93,16 @@ func newGame(app *app, gameState game.State) *Game { g.keyBindings[ebiten.KeyEscape] = reset g.keyBindings[ebiten.KeyQ] = func(ui.InputEvent, *Game) (bool, error) { return false, ebiten.Termination } + menuImg := ebiten.NewImageFromImage(assets.GetIcon("menu.png")) + g.menuButton = ui.NewImageButton( + g.Width-menuImg.Bounds().Dx()-10, + 10, + menuImg, + func(*ui.ImageButton) { + activities.PushActivity(newGameMenu(g)) + }) + g.AddWidget(g.menuButton) + g.passButton = ui.NewSimpleButton(g.Width-PASS_BUTTON_WIDTH, g.Height-DEFAULT_BUTTON_HEIGHT, PASS_BUTTON_WIDTH, @@ -504,7 +515,7 @@ func (g *Game) updateButtons() { passButtonLabel = "confirm" } - if AUTO_PROGRESS_PROMPT && !targets.Cur().AllowSelection() { + if g.settings.gameplay["autoProgressPrompt"].(bool) && !targets.Cur().AllowSelection() { g.progressPrompt() return } |
