1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-06-09 06:20:43 +00:00

Updated ctx to include current sys/forum funcs

This commit is contained in:
マリウス 2023-01-04 21:42:03 -05:00
parent 351049310f
commit 587bab0859
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F

View File

@ -15,6 +15,9 @@ type Ctx struct {
Loading bool
Logger *zap.SugaredLogger
Theme *theme.Theme
currentSystem int
currentForum string
}
func New(
@ -28,6 +31,9 @@ func New(
Loading: false,
Logger: logger,
Theme: theme.New(cfg),
currentSystem: -1,
currentForum: "",
}
}
@ -39,3 +45,19 @@ func (c *Ctx) AddSystem(sys *system.System) error {
func (c *Ctx) NumSystems() int {
return len(c.Systems)
}
func (c *Ctx) SetCurrentSystem(idx int) {
c.currentSystem = idx
}
func (c *Ctx) GetCurrentSystem() int {
return c.currentSystem
}
func (c *Ctx) SetCurrentForum(id string) {
c.currentForum = id
}
func (c *Ctx) GetCurrentForum() string {
return c.currentForum
}