Add loading screen
This commit is contained in:
parent
29201a8bb2
commit
0197300b18
@ -37,6 +37,9 @@ func CreateAppContext(flgConfig string, flgDebug bool) (*AppContext, error) {
|
||||
}()
|
||||
}
|
||||
|
||||
// Loading screen
|
||||
views.Loading()
|
||||
|
||||
// Load config
|
||||
config, err := config.NewConfig(flgConfig)
|
||||
if err != nil {
|
||||
|
21
views/load.go
Normal file
21
views/load.go
Normal file
@ -0,0 +1,21 @@
|
||||
package views
|
||||
|
||||
import (
|
||||
termbox "github.com/nsf/termbox-go"
|
||||
)
|
||||
|
||||
func Loading() {
|
||||
const loading string = "LOADING"
|
||||
|
||||
w, h := termbox.Size()
|
||||
termbox.Clear(termbox.ColorDefault, termbox.ColorDefault)
|
||||
|
||||
offset := (w / 2) - (len(loading) / 2)
|
||||
y := h / 2
|
||||
|
||||
for x := 0; x < len(loading); x++ {
|
||||
termbox.SetCell(offset+x, y, rune(loading[x]), termbox.ColorDefault, termbox.ColorDefault)
|
||||
}
|
||||
|
||||
termbox.Flush()
|
||||
}
|
Loading…
Reference in New Issue
Block a user