|
@@ -12,6 +12,12 @@ func pctUpdate(pct *int64) func() int64 {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+func press_a_key(d *door.Door) {
|
|
|
+ d.Write(door.Reset + door.CRNL + "Press a key to continue...")
|
|
|
+ d.Key()
|
|
|
+ d.Write(door.CRNL)
|
|
|
+}
|
|
|
+
|
|
|
func main() {
|
|
|
fmt.Println("Starting testdoor.go")
|
|
|
d := door.Door{}
|
|
@@ -91,9 +97,7 @@ func main() {
|
|
|
|
|
|
}
|
|
|
|
|
|
- d.Write(door.Reset + door.CRNL + "Press a key to continue...")
|
|
|
- d.Key()
|
|
|
- d.Write(door.CRNL)
|
|
|
+ press_a_key(&d)
|
|
|
|
|
|
m := door.Menu{Panel: door.Panel{Width: 25,
|
|
|
X: 5,
|
|
@@ -110,11 +114,17 @@ func main() {
|
|
|
door.ColorText("BOLD WHI ON BLUE"),
|
|
|
door.ColorText("BOLD YEL ON BLUE"),
|
|
|
door.ColorText("BOLD CYAN ON BLUE"))
|
|
|
- m.MenuOptions = []door.MenuOption{{rune('1'), "Play A Game"},
|
|
|
- {rune('A'), "Ask BUGZ for Help"},
|
|
|
- {rune('D'), "Drop to DOS"},
|
|
|
- {rune('Q'), "Quit"}}
|
|
|
- m.Build()
|
|
|
+ m.AddSelection("1", "Play A Game")
|
|
|
+ m.AddSelection("A", "Ask BUGZ for Help")
|
|
|
+ m.AddSelection("D", "Drop to DOS")
|
|
|
+ m.AddSelection("Q", "Quit")
|
|
|
+ /*
|
|
|
+ m.MenuOptions = []door.MenuOption{{rune('1'), "Play A Game"},
|
|
|
+ {rune('A'), "Ask BUGZ for Help"},
|
|
|
+ {rune('D'), "Drop to DOS"},
|
|
|
+ {rune('Q'), "Quit"}}
|
|
|
+ m.Build()
|
|
|
+ */
|
|
|
|
|
|
// Yes, the render functions are working
|
|
|
/*
|
|
@@ -155,8 +165,7 @@ func main() {
|
|
|
d.Write(door.Reset + door.CRNL + door.CRNL)
|
|
|
d.Write(fmt.Sprintf("You chose %d from the menu."+door.CRNL, item))
|
|
|
|
|
|
- d.Write(door.Reset + door.CRNL + "Press a key to continue...")
|
|
|
- d.Key()
|
|
|
+ press_a_key(&d)
|
|
|
|
|
|
message = fmt.Sprintf("Returning %s to the BBS..."+door.CRNL, name)
|
|
|
d.Write(message)
|
|
@@ -167,6 +176,8 @@ func main() {
|
|
|
|
|
|
message = fmt.Sprintf("You had %0.2f minutes / %0.2f seconds remaining!"+door.CRNL, left.Minutes(), left.Seconds())
|
|
|
d.Write(message)
|
|
|
+ left = d.TimeUsed()
|
|
|
+ d.Write(fmt.Sprintf("You used %0.2f seconds, or %0.2f minutes."+door.CRNL, left.Seconds(), left.Minutes()))
|
|
|
|
|
|
fmt.Println("Ending testdoor.go")
|
|
|
}
|