From 8fe6b9752ee32cb91f71e871ff5e21472fe63000 Mon Sep 17 00:00:00 2001 From: bdnugget Date: Sun, 16 Mar 2025 22:55:45 +0100 Subject: [PATCH] Fix restart button (keypresses got buffered) --- main.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/main.go b/main.go index e88a5be..edbde8b 100644 --- a/main.go +++ b/main.go @@ -157,8 +157,6 @@ func (gs *gameState) layout(g *gocui.Gui) error { if _, err := g.SetCurrentView("game"); err != nil { return err } - v.Editor = gocui.EditorFunc(gs.gameEditor) - v.Editable = true } // Restart button - positioned below the game view @@ -252,17 +250,6 @@ func (gs *gameState) handleMouseClick(g *gocui.Gui, v *gocui.View) error { return nil } -// Handle keyboard input for the game -func (gs *gameState) gameEditor(v *gocui.View, key gocui.Key, ch rune, mod gocui.Modifier) { - // Handle keyboard input for the game - if key == gocui.KeyArrowUp { - // Move cursor up - } else if key == gocui.KeyArrowDown { - // Move cursor down - } - // etc. -} - func (gs *gameState) openCell(x, y int) { if x < 0 || y < 0 || x >= gs.rows || y >= gs.cols || gs.field[x][y].isOpen { return // Bounds check and already opened check