48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
|
package app
|
||
|
|
||
|
import (
|
||
|
"git.sr.ht/~rockorager/vaxis"
|
||
|
"git.tilde.town/nbsp/neofeels/ui"
|
||
|
)
|
||
|
|
||
|
type Credits struct {
|
||
|
title string
|
||
|
credits string
|
||
|
help string
|
||
|
}
|
||
|
|
||
|
func NewCredits() *Credits {
|
||
|
return &Credits{
|
||
|
` ___ __
|
||
|
/ _/__ ___ / /__
|
||
|
/ _/ -_) -_) (_-<
|
||
|
/_/ \__/\__/_/___/
|
||
|
neofeels 0.1.0`,
|
||
|
`ttbp written for tilde.town by ~endorphant in python
|
||
|
neofeels written by ~nbsp in go
|
||
|
|
||
|
tips for development of ttbp are accepted at https://liberapay.com/modgethanc/
|
||
|
tips for development of neofeels are accepted at https://liberapay.com/nbsp/
|
||
|
|
||
|
kind words are also extremely appreciated :)`,
|
||
|
"q exit",
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (credits *Credits) 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":
|
||
|
close(ui.Quit)
|
||
|
case "Enter", "q":
|
||
|
ui.ViewChange <- NewMainMenu()
|
||
|
}
|
||
|
processed = true
|
||
|
}
|
||
|
win := state.Window()
|
||
|
win.New(win.Width/2-10, win.Height/2-8, 20, 5).Print(vaxis.Segment{Text: credits.title})
|
||
|
win.New(win.Width/2-40, win.Height/2-2, 80, 7).Print(vaxis.Segment{Text: credits.credits})
|
||
|
win.New(win.Width/2-3, win.Height/2+6, 6, 1).Print(vaxis.Segment{Text: credits.help})
|
||
|
return
|
||
|
}
|