Moved paused rendering to screen

master
Michael Dvorkin 11 years ago
parent e048f15df6
commit 38d5129ff2
  1. 6
      cmd/mop.go
  2. 8
      screen.go

@ -68,11 +68,7 @@ loop:
}
} else if event.Ch == 'p' || event.Ch == 'P' {
paused = !paused
if paused {
screen.Draw("\n<right><r> Paused </r></right>")
} else {
screen.Draw("\n<right> </right>")
}
screen.Draw(paused)
} else if event.Ch == '?' || event.Ch == 'h' || event.Ch == 'H' {
showingHelp = true
screen.Clear().Draw(help)

@ -82,6 +82,14 @@ func (screen *Screen) Draw(objects ...interface{}) *Screen {
case time.Time:
timestamp := ptr.(time.Time).Format(`3:04:05pm PST`)
screen.DrawLine(0, 0, `<right>` + timestamp + `</right>`)
case bool:
timestamp := time.Now().Format(`3:04:05pm PST`)
if ptr.(bool) {
timestamp = `<r>Paused ` + timestamp + `</r>`
} else {
timestamp = ` ` + timestamp
}
screen.DrawLine(0, 0, `<right>` + timestamp + `</right>`)
default:
screen.draw(ptr.(string))
}

Loading…
Cancel
Save