fix context
This commit is contained in:
parent
e0b4d000d3
commit
8b4844211b
@ -14,6 +14,7 @@ import (
|
||||
"lab.zaar.be/thefish/alchemyst-go/ui"
|
||||
"lab.zaar.be/thefish/alchemyst-go/ui/mainwindow"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util/appctx"
|
||||
blt "lab.zaar.be/thefish/bearlibterminal"
|
||||
"os"
|
||||
"runtime"
|
||||
@ -57,7 +58,7 @@ func main() {
|
||||
var logger = log.Output(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339}).Level(logLevels[config.Verbosity])
|
||||
|
||||
// set up context
|
||||
mainCtx := util.NewClientContext(config, &logger)
|
||||
mainCtx := appctx.NewClientContext(config, &logger)
|
||||
|
||||
//set up main window
|
||||
mw := mainwindow.Init(mainCtx)
|
||||
@ -230,7 +231,7 @@ func setupLayers(mainwindow *mainwindow.MainWindow) {
|
||||
mainwindow.AddLayer("menu", 3, "white")
|
||||
}
|
||||
|
||||
func decodeInput(ctx util.ClientCtx, baseLayer *mainwindow.Layer) {
|
||||
func decodeInput(ctx appctx.ClientCtx, baseLayer *mainwindow.Layer) {
|
||||
var exit = false
|
||||
var waitForWCspam = true
|
||||
for !exit {
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/gamemap"
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/types"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util/appctx"
|
||||
)
|
||||
|
||||
//fixme move to config
|
||||
@ -38,7 +39,7 @@ var fges = map[int]types.RectFill{
|
||||
},
|
||||
}
|
||||
|
||||
func DefaultGen(ctx util.ClientCtx,l *gamemap.Level) (*gamemap.Level, []gamemap.Room) {
|
||||
func DefaultGen(ctx appctx.ClientCtx,l *gamemap.Level) (*gamemap.Level, []gamemap.Room) {
|
||||
|
||||
rng := util.NewRNG()
|
||||
|
||||
|
@ -3,17 +3,17 @@ package mainwindow
|
||||
import (
|
||||
"fmt"
|
||||
"lab.zaar.be/thefish/alchemyst-go/engine/types"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util"
|
||||
"lab.zaar.be/thefish/alchemyst-go/util/appctx"
|
||||
blt "lab.zaar.be/thefish/bearlibterminal"
|
||||
)
|
||||
|
||||
type MainWindow struct {
|
||||
types.Rect
|
||||
ctx util.ClientCtx
|
||||
ctx appctx.ClientCtx
|
||||
layers map[string]types.Renderable
|
||||
}
|
||||
|
||||
func Init(ctx util.ClientCtx) *MainWindow {
|
||||
func Init(ctx appctx.ClientCtx) *MainWindow {
|
||||
ctx.Logger().Info().Msgf("Opening main window...")
|
||||
mw := MainWindow{ctx: ctx, layers: make(map[string]types.Renderable, 0)}
|
||||
mw.Open()
|
||||
|
Loading…
x
Reference in New Issue
Block a user