package main

import (
	"opslag.de/schobers/allg5"
	"opslag.de/schobers/krampus19/alui"
)

type mainMenu struct {
	alui.Menu

	ctx *Context
}

func newHeader(label string) alui.Control {
	return alui.NewMargins(&alui.Label{ControlBase: alui.ControlBase{Font: "header"}, Text: label, TextAlign: allg5.AlignCenter}, 3*margin)
}

func (m *mainMenu) Enter(ctx *Context) error {
	m.ctx = ctx
	m.Init()
	m.AddChild(newHeader("Sokodragon"))
	m.Add("Play", func() { m.ctx.Navigation.SelectPack() })
	m.Add("Settings", func() { m.ctx.Navigation.ChangeSettings() })
	m.Add("Quit", func() { m.ctx.Navigation.Quit() })
	return nil
}

func (m *mainMenu) Leave() {}
