From a059fa9bb1ace39cf5fdcfd489a90f5d778c9344 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 20 Aug 2025 14:44:06 +0200 Subject: add game and settings menus --- go/client/challenges.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'go/client/challenges.go') 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) }) -- cgit v1.2.3