2020-09-25 01:40:19 +03:00

62 lines
1.5 KiB
Go

package screens
import (
"lab.zaar.be/thefish/alchemyst-go/engine/types"
"lab.zaar.be/thefish/alchemyst-go/ui/mainwindow"
blt "lab.zaar.be/thefish/bearlibterminal"
)
type TitleScreen struct {
mw *mainwindow.MainWindow
scm *types.ScreenManager
}
func NewTitleScreen(mw *mainwindow.MainWindow, scm *types.ScreenManager) *TitleScreen {
return &TitleScreen{mw: mw, scm: scm}
}
func (ts *TitleScreen) UseEcs() bool { return false }
func (ts *TitleScreen) Enter() {
blt.Clear()
}
//fixme key names to action constants!
func (ts *TitleScreen) HandleInput(input string) {
switch input {
case "n":
ts.scm.SetScreenByName("game")
}
}
func (ts *TitleScreen) Exit() {
blt.Clear()
}
func (ts *TitleScreen) Render() {
blt.PrintExt(0, 2, ts.mw.W, ts.mw.H, blt.TK_ALIGN_CENTER, logo)
blt.PrintExt(0, 19, ts.mw.W, ts.mw.H, blt.TK_ALIGN_CENTER, menu)
blt.PrintExt(0, 35, ts.mw.W, ts.mw.H, 3, credits)
}
var logo = `
Precomputed shade test
`
var menu = `
(c) 2019 thefish <thefish@zaar.be>
[color=green]N[/color]ew dungeon run
[color=green]L[/color]oad saved game
Read [color=green]h[/color]elp file
Highest [color=green]S[/color]cores
`
var credits = `
Roguebasin Libtcod Tutorial (c) 2010-2011, Jotaf Henriques
Brogue 1.3 (c) 2010 Brian Walker
Madness (c) 2010 hmp <humpolec@gmail.com>
BearLibTerminal (c) Cfyz 2009-2019 <http://foo.wyrd.name/en:bearlibterminal>
Gogue (c) 2019 jcerise
`