|
@@ -5,17 +5,19 @@ import (
|
|
|
"unicode"
|
|
|
)
|
|
|
|
|
|
+/*
|
|
|
type MenuOption struct {
|
|
|
Ch rune
|
|
|
Text string
|
|
|
}
|
|
|
+*/
|
|
|
|
|
|
type Menu struct {
|
|
|
Chosen int
|
|
|
SelectedR func(string) string
|
|
|
UnselectedR func(string) string
|
|
|
Options []rune
|
|
|
- MenuOptions []MenuOption
|
|
|
+ // MenuOptions []MenuOption
|
|
|
Panel
|
|
|
}
|
|
|
|
|
@@ -74,6 +76,7 @@ func (m *Menu) AddSelection(key string, text string) {
|
|
|
// the menu in larger chunks -- but it is redundant.
|
|
|
// Once the menu is built, I really could delete the MenuOptions.
|
|
|
|
|
|
+/*
|
|
|
func (m *Menu) Build() {
|
|
|
// Take MenuOptions and build the Menu
|
|
|
|
|
@@ -88,6 +91,7 @@ func (m *Menu) Build() {
|
|
|
m.Lines = append(m.Lines, Line{Text: text, RenderF: m.UnselectedR})
|
|
|
}
|
|
|
}
|
|
|
+*/
|
|
|
|
|
|
func (m *Menu) Choose(d *Door) int {
|
|
|
var changed []int
|
|
@@ -130,8 +134,8 @@ func (m *Menu) Choose(d *Door) int {
|
|
|
changed = make([]int, 0)
|
|
|
|
|
|
use_numberpad := true
|
|
|
- for _, option := range m.MenuOptions {
|
|
|
- if option.Ch == rune('8') || option.Ch == rune('2') {
|
|
|
+ for _, option := range m.Options {
|
|
|
+ if option == rune('8') || option == rune('2') {
|
|
|
use_numberpad = false
|
|
|
}
|
|
|
}
|