restart on escape

This commit is contained in:
nek0 2018-09-21 22:25:23 +02:00
parent 086302be5e
commit e0a272fb4e

View file

@ -68,7 +68,15 @@ pre = do
quitGame :: KeyboardMessage -> Affection UserData ()
quitGame (MsgKeyboardEvent _ _ SDL.Pressed False sym)
| SDL.keysymKeycode sym == SDL.KeycodeEscape = quit
| SDL.keysymKeycode sym == SDL.KeycodeEscape = do
ad <- A.get
ud <- getAffection
SDL.glMakeCurrent (drawWindow ad) (glContext ad)
(ws, _) <- yieldSystemT (0, defStorage) (return ())
putAffection ud
{ worldState = ws
}
smLoad Load
| otherwise = return ()
quitGame _ = return ()