26 lines
423 B
Go
26 lines
423 B
Go
package gui
|
|
|
|
import tea "github.com/charmbracelet/bubbletea"
|
|
|
|
func (m *model) updateDraw(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|
switch msg := msg.(type) {
|
|
|
|
// Is it a key press?
|
|
case tea.KeyMsg:
|
|
switch msg.String() {
|
|
case "ctrl+c", "q":
|
|
return m, tea.Quit
|
|
case "s":
|
|
m.switchMode(Select)
|
|
}
|
|
}
|
|
return m, nil
|
|
}
|
|
func (m *model) viewDraw() string {
|
|
s := "Draw Mode:\n\n"
|
|
|
|
s += m.cardListToString()
|
|
|
|
return s
|
|
}
|