Added keyboard shortcuts for load/new/save game.
This commit is contained in:
parent
cb58ebdf77
commit
ddef723f80
@ -229,6 +229,16 @@ func (c *GameControls) Handle(ctx ui.Context, event ui.Event) bool {
|
|||||||
c.game.Debug = !c.game.Debug
|
c.game.Debug = !c.game.Debug
|
||||||
ctx.Overlays().Toggle(fpsOverlayName)
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user