1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2025-01-03 14:56:41 -05:00

Extended UI Context with Config, Logger

This commit is contained in:
マリウス 2022-12-29 14:33:12 -05:00
parent fbc0cea73a
commit 96364d8735
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F

View File

@ -1,19 +1,30 @@
package ctx package ctx
import "github.com/mrusme/gobbs/system" import (
"github.com/mrusme/gobbs/config"
"github.com/mrusme/gobbs/system"
"go.uber.org/zap"
)
type Ctx struct { type Ctx struct {
Screen [2]int Screen [2]int
Content [2]int Content [2]int
Config *config.Config
Systems []*system.System Systems []*system.System
Loading bool Loading bool
Logger *zap.SugaredLogger
} }
func New() Ctx { func New(
cfg *config.Config,
logger *zap.SugaredLogger,
) Ctx {
return Ctx{ return Ctx{
Screen: [2]int{0, 0}, Screen: [2]int{0, 0},
Content: [2]int{0, 0}, Content: [2]int{0, 0},
Config: cfg,
Loading: false, Loading: false,
Logger: logger,
} }
} }