Added title on main menu.

Changed "Apply" button into "OK" (settings menu).
This commit is contained in:
Sander Schobers 2019-12-31 11:27:55 +01:00
parent 4b393610e2
commit 449873f6b8
2 changed files with 3 additions and 1 deletions

View File

@ -281,7 +281,7 @@ func (s *changeSettings) Enter(ctx *Context) error {
buttons := &alui.StackPanel{Orientation: alui.OrientationHorizontal}
buttons.AddChild(
newWideButton("Cancel", func() { s.ctx.Navigation.ShowMainMenu() }),
newWideButton("Apply", func() {
newWideButton("OK", func() {
var controls = controls{MoveLeft: keyLeft.Key, MoveUp: keyUp.Key, MoveRight: keyRight.Key, MoveDown: keyDown.Key}
var video = video{Windowed: windowed.Selected, DisplayMode: displayMode.Mode()}
s.ctx.Settings = settings{Controls: controls, Video: video}

View File

@ -1,6 +1,7 @@
package main
import (
"opslag.de/schobers/allg5"
"opslag.de/schobers/krampus19/alui"
)
@ -13,6 +14,7 @@ type mainMenu struct {
func (m *mainMenu) Enter(ctx *Context) error {
m.ctx = ctx
m.Init()
m.AddChild(alui.NewMargins(&alui.Label{ControlBase: alui.ControlBase{Font: "header"}, Text: "Sokodragon", TextAlign: allg5.AlignCenter}, 3*margin))
m.Add("Play", func() { m.ctx.Navigation.SelectLevel("1") })
m.Add("Settings", func() { m.ctx.Navigation.ChangeSettings() })
m.Add("Quit", func() { m.ctx.Navigation.Quit() })