From 991ef3595b6394bc20b14030f2e96ca1b78d462f Mon Sep 17 00:00:00 2001 From: vilmibm Date: Fri, 8 Jul 2022 00:56:47 -0500 Subject: [PATCH] lay out a grid for game page --- client/cmd/main.go | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/client/cmd/main.go b/client/cmd/main.go index 972b3c1..3961872 100644 --- a/client/cmd/main.go +++ b/client/cmd/main.go @@ -65,21 +65,44 @@ func _main() error { AddButtons([]string{"hey. let's go"}). SetDoneFunc(func(_ int, _ string) { pages.SwitchToPage("main") + app.ResizeToFullScreen(pages) }).SetText("h e r m e t i c u m"), - false, + true, true) mainPage := tview.NewList(). - AddItem("jack in", "connect using an existing account", '1', nil). + AddItem("jack in", "connect using an existing account", '1', func() { + pages.SwitchToPage("game") + }). AddItem("rez a toon", "create a new account", '2', nil). AddItem("open the hood", "client configuration", '3', nil). AddItem("get outta here", "quit the client", '4', func() { app.Stop() }) - mainPage.SetRect(0, 0, 100, 100) + pages.AddPage("main", mainPage, true, false) - pages.AddPage("main", mainPage, false, false) + gamePage := tview.NewGrid(). + SetRows(1, 40, 3). + SetColumns(-1, -1). + SetBorders(true). + AddItem( + tview.NewTextView().SetTextAlign(tview.AlignLeft).SetText("h e r m e t i c u m"), + 0, 0, 1, 1, 1, 1, false). + AddItem( + tview.NewTextView().SetTextAlign(tview.AlignRight).SetText("TODO server status"), + 0, 1, 1, 1, 1, 1, false). + AddItem( + tview.NewTextView().SetText("TODO game messages"), + 1, 0, 1, 1, 10, 20, false). + AddItem( + tview.NewTextView().SetText("TODO detail window"), + 1, 1, 1, 1, 10, 10, false). + AddItem( + tview.NewTextView().SetText("TODO input"), + 2, 0, 1, 2, 1, 30, false) + + pages.AddPage("game", gamePage, true, false) return app.SetRoot(pages, true).SetFocus(pages).Run() }