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/challenges.go | |
| parent | a702781e58fc6db55aca6b61b1eb556bfca481b2 (diff) | |
| download | muhqs-game-a059fa9bb1ace39cf5fdcfd489a90f5d778c9344.tar.gz muhqs-game-a059fa9bb1ace39cf5fdcfd489a90f5d778c9344.zip | |
add game and settings menus
Diffstat (limited to 'go/client/challenges.go')
| -rw-r--r-- | go/client/challenges.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/go/client/challenges.go b/go/client/challenges.go index ca6e3563..6956282b 100644 --- a/go/client/challenges.go +++ b/go/client/challenges.go @@ -4,6 +4,7 @@ import ( "github.com/hajimehoshi/ebiten/v2" "muhq.space/muhqs-game/go/activities" "muhq.space/muhqs-game/go/game" + "muhq.space/muhqs-game/go/ui" ) var availChallenges = map[string]func(string) *game.LocalState{ @@ -21,11 +22,11 @@ type challenges struct { func newChallengesMenu(app *app, playerName string) *challenges { var m *challenges - labels := []string{} - handlers := []func(){} + labels := make([]string, 0, len(availChallenges)) + handlers := make([]func(*ui.SimpleButton), 0, len(availChallenges)) for k, start := range availChallenges { labels = append(labels, k) - handlers = append(handlers, func() { + handlers = append(handlers, func(*ui.SimpleButton) { s := start(m.playerName) m.startChallenge(s) }) |
