summaryrefslogtreecommitdiff
path: root/starling/kernel.scm
diff options
context:
space:
mode:
Diffstat (limited to 'starling/kernel.scm')
-rw-r--r--starling/kernel.scm24
1 files changed, 20 insertions, 4 deletions
diff --git a/starling/kernel.scm b/starling/kernel.scm
index 25b6917..042e1ac 100644
--- a/starling/kernel.scm
+++ b/starling/kernel.scm
@@ -40,6 +40,7 @@
#:use-module (starling config)
#:use-module (starling node)
#:use-module (starling repl)
+ #:use-module (starling minibuffer)
#:use-module (starling scene)
#:use-module (starling system)
#:use-module ((sdl2 video) #:prefix sdl2:)
@@ -118,10 +119,15 @@
(define-method (on-key-press (kernel <kernel>) key scancode modifiers repeat?)
;; Hot keys when in dev mode
(when developer-mode?
- (match key
- ('f5 (reboot-current-scene))
- ('escape (abort-game))
- (_ #t)))
+ (unless (& kernel minibuffer)
+ (match key
+ ('x
+ (when (or (memq 'left-alt modifiers)
+ (memq 'right-alt modifiers))
+ (unless (& kernel minibuffer)
+ (open-minibuffer kernel))))
+ ('escape (abort-game))
+ (_ #t))))
(next-method))
(define-method (update-tree (kernel <kernel>) dt)
@@ -304,6 +310,16 @@ kernel. A convenient procedure for developers."
(display "rebooting\n")
(reboot (current-scene (current-kernel))))
+(define (pause-current-scene)
+ (pause (current-scene (current-kernel))))
+
+(define (resume-current-scene)
+ (resume (current-scene (current-kernel))))
+
+(add-minibuffer-command "reboot" reboot-current-scene)
+(add-minibuffer-command "pause" pause-current-scene)
+(add-minibuffer-command "resume" resume-current-scene)
+
(define-meta-command ((debug-game lisparuga) repl)
"debug-game
Enter a debugger for the current game loop error."