welcome/app/help.go

41 lines
1.3 KiB
Go
Raw Normal View History

2025-01-18 23:17:39 +00:00
package app
import (
"git.sr.ht/~rockorager/vaxis"
"git.tilde.town/nbsp/welcome/ui"
)
type Help struct{}
func (view *Help) Event(state *ui.State, event vaxis.Event) (processed bool) {
if key, ok := event.(vaxis.Key); ok && key.EventType == vaxis.EventPress {
switch key.String() {
case "Ctrl+c", "Ctrl+d", "Enter":
close(ui.Quit)
}
processed = true
}
win := state.Window()
win.Print(
vaxis.Segment{Text: ` links, help, & goodbye
good job on getting all the way through this tutorial! i knew you could do it.
while there's a lot of things you can do in town, the tools you just received
should help you traverse the land and get further help if you need it.
to join our chatroom and ask for help or just say hi, run `},
vaxis.Segment{Text: "town chat", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
vaxis.Segment{Text: `
run `},
vaxis.Segment{Text: "town bbj", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
vaxis.Segment{Text: ` to see what we're talking about on our bulletin board
oh, and you've got mail! run `},
vaxis.Segment{Text: "town mail", Style: vaxis.Style{Foreground: vaxis.IndexColor(3)}},
vaxis.Segment{Text: ` to see who it's from :)
press to quit to a shell!
`},
)
return
}