Continue shuffle

This commit is contained in:
2023-02-19 12:08:34 +00:00
parent 9109841658
commit df11cfbdc5
+15 -12
View File
@@ -1,9 +1,4 @@
module Dodge.Update.Input (
updateKeyInGame,
updateKeysInTerminal,
doInputScreenInput,
doSubInvRegexInput,
doRegexInput,
updateUseInput,
) where
@@ -37,14 +32,22 @@ import SDL
updateUseInput :: Universe -> Universe
updateUseInput u = case u ^? uvScreenLayers . _head of
Just (InputScreen thetext _) -> doInputScreenInput thetext u
Just screen@OptionScreen{_scPositionedMenuOption = mop, _scOptionFlag = flag, _scSelectionList = sellist, _scListDisplayParams = ldps} ->
optionScreenUpdate screen mop flag ldps sellist u
_ -> case u ^? uvWorld . hud . hudElement . subInventory of
Just (DisplayTerminal tmid) | inTermFocus (_uvWorld u) -> updateKeysInTerminal tmid u
Just (CombineInventory _ _ _)
Just sl -> updateUseInputOnScreen sl u
Nothing -> updateUseInputInGame (u ^. uvWorld . hud . hudElement) u
updateUseInputOnScreen :: ScreenLayer -> Universe -> Universe
updateUseInputOnScreen sl = case sl of
InputScreen thetext _-> doInputScreenInput thetext
screen@OptionScreen{_scPositionedMenuOption = mop, _scOptionFlag = flag, _scSelectionList = sellist, _scListDisplayParams = ldps} ->
optionScreenUpdate screen mop flag ldps sellist
updateUseInputInGame :: HUDElement -> Universe -> Universe
updateUseInputInGame h u = case h of
DisplayCarte -> u
DisplayInventory si _ -> case si of
DisplayTerminal tmid | inTermFocus (_uvWorld u) -> updateKeysInTerminal tmid u
CombineInventory _ _ _
| inSubInvRegex (u ^. uvWorld) -> doSubInvRegexInput u
-- _ | inInvRegex (u ^. uvWorld) -> doInvRegexInput u
_ | inInvRegex (u ^. uvWorld) -> doRegexInput (-1) invRegex invRegex u
_ | inCloseRegex (u ^. uvWorld) -> doRegexInput 2 closeRegex closeRegex u
_ -> M.foldlWithKey' updateKeyInGame u pkeys