diff options
author | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-26 17:27:14 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-26 17:53:40 +0200 |
commit | 0495351b44cc7fc171c98cbcce57e966092ce6a1 (patch) | |
tree | 062866db03bec6f1fd85f76413283294943bde18 /window.go | |
parent | Update tcell and support italics (diff) |
Move ui.Home and ui.homeMessages up
Diffstat (limited to 'window.go')
-rw-r--r-- | window.go | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -1,11 +1,32 @@ package senpai import ( + "math/rand" "time" "git.sr.ht/~taiite/senpai/ui" ) +var Home = "home" + +var homeMessages = []string{ + "\x1dYou open an IRC client.", + "Welcome to the Internet Relay Network!", + "DMs & cie go here.", + "May the IRC be with you.", + "Hey! I'm senpai, you everyday IRC student!", + "Student? No, I'm an IRC \x02client\x02!", +} + +func (app *App) initWindow() { + hmIdx := rand.Intn(len(homeMessages)) + app.win.AddBuffer(Home) + app.addLineNow("", ui.Line{ + Head: "--", + Body: homeMessages[hmIdx], + }) +} + func (app *App) addLineNow(buffer string, line ui.Line) { if line.At.IsZero() { line.At = time.Now() |