more gracefully hand keyboard shortcuts from Movie to options menu

This commit is contained in:
2023-07-11 14:20:13 -06:00
parent 91869a5db5
commit 7a77e67c81
2 changed files with 23 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
# @install: lix --silent download "gh://github.com/kiss-lang/kiss-flixel#97953584e13a74785cffb534bc9e705ae1ef16bc" into kiss-flixel/0.0.0/github/97953584e13a74785cffb534bc9e705ae1ef16bc # @install: lix --silent download "gh://github.com/kiss-lang/kiss-flixel#1a1715a3895db9db6f5d49387f18a790cb513267" into kiss-flixel/0.0.0/github/1a1715a3895db9db6f5d49387f18a790cb513267
-lib flixel -lib flixel
-lib flixel-addons -lib flixel-addons
-lib flixel-ui -lib flixel-ui
@@ -6,5 +6,5 @@
-lib kiss-tools -lib kiss-tools
-lib lime -lib lime
-lib openfl -lib openfl
-cp ${HAXE_LIBCACHE}/kiss-flixel/0.0.0/github/97953584e13a74785cffb534bc9e705ae1ef16bc/src/ -cp ${HAXE_LIBCACHE}/kiss-flixel/0.0.0/github/1a1715a3895db9db6f5d49387f18a790cb513267/src/
-D kiss-flixel=0.0.0 -D kiss-flixel=0.0.0

View File

@@ -85,18 +85,26 @@
(sh.registerItem "{escape} pause" ->cc (showPauseMenu cc) true) (sh.registerItem "{escape} pause" ->cc (showPauseMenu cc) true)
(resume) (resume)
} true) } true)
(chooseString "PAUSED" ["" "Resume" "Options" "Main Menu" "Quit to Desktop"] (let [choices ["" "Resume" "Options" "Main Menu" "Quit to Desktop"]
->choice optsIdx (choices.indexOf "Options")]
(case choice // chooseString automatically sets pauseMenu
("Resume" (chooseString "PAUSED" choices
(sh.registerItem "{escape} pause" ->cc (showPauseMenu cc) true) ->choice
(resume)) (case choice
("Options" ("Resume"
(sh.registerItem "{escape} nil" ->cc {} true) (sh.registerItem "{escape} pause" ->cc (showPauseMenu cc) true)
(MenuState.optionsMenu ->(showPauseMenu resume))) (resume))
("Main Menu" (FlxG.switchState (new MenuState))) ("Options"
("Quit to Desktop" (Sys.exit 0)) (sh.cancel)
(never otherwise)))) (MenuState.optionsMenu
->{
(sh.start)
(showPauseMenu resume)
(set pauseMenu.selectedIndex optsIdx)
}))
("Main Menu" (FlxG.switchState (new MenuState)))
("Quit to Desktop" (Sys.exit 0))
(never otherwise)))))
(method :Void showDialogHistory [:Array<HistoryElement<ActorFlxSprite>> history :Continuation resume] (method :Void showDialogHistory [:Array<HistoryElement<ActorFlxSprite>> history :Continuation resume]
// register tab and escape to resume (and register escape to pause and tab to history when resuming lol) // register tab and escape to resume (and register escape to pause and tab to history when resuming lol)
@@ -214,7 +222,7 @@
"up" "up"
"down" "down"
"enter")) "enter"))
(pauseMenu.enableGamepadInput true)) (pauseMenu.enableGamepadInput true [=>START ""]))
(method :Void enterString [:String prompt :String->Void submit] (method :Void enterString [:String prompt :String->Void submit]
(set pauseMenu (set pauseMenu