From 6404364b8b25997b5d24115da4f882244cf01507 Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Mon, 9 Aug 2021 13:07:12 +0200 Subject: [PATCH] Fixed bug in main menu. --- cmd/tins2021/mainmenu.go | 1 + cmd/tins2021/menu.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/tins2021/mainmenu.go b/cmd/tins2021/mainmenu.go index 2f377cd..1cbc688 100644 --- a/cmd/tins2021/mainmenu.go +++ b/cmd/tins2021/mainmenu.go @@ -41,6 +41,7 @@ func newMainMenu(app *appContext, ctx ui.Context) ui.Control { menu.Add("Quit", func(ctx ui.Context) { ctx.Quit() }) menu.Activate(1) // play + ctx.Animate() return Center(&mainMenu{ StackPanel: ui.StackPanel{ diff --git a/cmd/tins2021/menu.go b/cmd/tins2021/menu.go index cc82411..dfbdafd 100644 --- a/cmd/tins2021/menu.go +++ b/cmd/tins2021/menu.go @@ -25,7 +25,7 @@ func (m *Menu) Activate(i int) { if len(m.buttons) == 0 || i < 0 { return } - m.active = i % len(m.buttons) + m.updateActiveButton(i % len(m.buttons)) } func (m *Menu) Add(text string, click func(ui.Context)) {