Преглед на файлове

Turn off Wopr when you select something.

bugz преди 1 година
родител
ревизия
5eb0f0488d
променени са 1 файла, в които са добавени 14 реда и са изтрити 16 реда
  1. 14 16
      testdoor/testdoor.go

+ 14 - 16
testdoor/testdoor.go

@@ -18,19 +18,8 @@ func pctUpdate(pct *int64) func() int64 {
 	}
 }
 
-// Can I add a function to Door?
-// NO:  cannot define new methods on non-local type door.Door
-
-/*
-func (d *door.Door) PressAKey() {
-	d.Write(door.Reset + door.CRNL + "Press a key to continue...")
-	d.Key()
-	d.Write(door.CRNL)
-}
-*/
-
 func press_keys(d *door.Door) {
-	d.Write(door.Reset + door.CRNL + "Press some keys...")
+	d.Write(door.Reset + door.CRNL + "Press some keys... <ENTER> to exit.")
 	var r rune
 	var ex door.Extended
 	var err error
@@ -683,14 +672,20 @@ func main() {
 	// d.Write("\x1b[?9h") // enable mouse X10 support
 	// d.Write("\x1b[?1000h") // enable any-event mouse
 	// d.Write("\x1b[?1002h")
-    // d.Write("\x1b[?1006h") // SGR style mouse. -- not supported in term
-    d.EnableMouse(door.AnyEvent)
+	// d.Write("\x1b[?1006h") // SGR style mouse. -- not supported in term
+	d.EnableMouse(door.AnyEvent)
 	// 1006 does not work in xterm or syncterm.
 	press_keys(&d)
 	// press_a_key(&d)
 	d.Write(door.CRNL)
 
-	var b []string = door.AlertBox("Warning: golang is in use!", 1)
+	var b []string
+	if door.CP437 {
+		b = door.AlertBox("Warning: golang \xfb is in use!", 1)
+	} else {
+		b = door.AlertBox("Warning: golang \u2219 is in use!", 1)
+	}
+
 	d.Write(door.ColorText("BRI WHI ON GREEN"))
 	for _, line := range b {
 		d.Write(line + door.CRNL)
@@ -718,6 +713,8 @@ func main() {
 		}
 		option := mainmenu.GetOption(choice)
 
+		wopr.Stop()
+
 		// fmt.Printf("Choice: %d, Option: %c\n", choice, option)
 
 		switch option {
@@ -759,11 +756,12 @@ func main() {
 			_ = z
 		}
 
+		wopr.Animate(&d)
 	}
 
 	// d.Write("\x1b[?1000l") // disable mouse
 	// d.Write("\x1b[?1002l")
-    d.DisableMouse()
+	d.DisableMouse()
 	d.Write(door.Reset + door.CRNL)
 
 	message = fmt.Sprintf("Returning to the %s BBS..."+door.CRNL, d.Config.BBSID)