Added keyboard shortcuts for load/new/save game.

This commit is contained in:
Sander Schobers 2020-05-24 19:57:20 +02:00
parent cb58ebdf77
commit ddef723f80

View File

@ -229,6 +229,16 @@ func (c *GameControls) Handle(ctx ui.Context, event ui.Event) bool {
c.game.Debug = !c.game.Debug
ctx.Overlays().Toggle(fpsOverlayName)
}
if e.Modifiers == ui.KeyModifierControl {
switch e.Key {
case ui.KeyL:
c.askUserBeforeLoad(ctx)
case ui.KeyN:
c.askUserBeforeNew(ctx)
case ui.KeyS:
c.askUserBeforeSave(ctx)
}
}
}
return false
}