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-addons
-lib flixel-ui
@@ -6,5 +6,5 @@
-lib kiss-tools
-lib lime
-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

View File

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