Escape will go back to main menu in the level selection menu.

This commit is contained in:
Sander Schobers 2019-12-31 11:43:42 +01:00
parent 449873f6b8
commit c61f074465

View File

@ -3,6 +3,8 @@ package main
import (
"fmt"
"opslag.de/schobers/allg5"
"opslag.de/schobers/krampus19/alui"
)
@ -35,4 +37,14 @@ func (s *levelSelect) Enter(ctx *Context) error {
return nil
}
func (s *levelSelect) Handle(e allg5.Event) {
switch e := e.(type) {
case *allg5.KeyDownEvent:
switch e.KeyCode {
case allg5.KeyEscape:
s.ctx.Navigation.ShowMainMenu()
}
}
}
func (s *levelSelect) Leave() {}