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:
parent
fbc0cea73a
commit
96364d8735
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user