Allow use of esc and function keys when in terminal/other subinventories
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
All good (594 modules, at 19:45:49)
|
||||
All good (594 modules, at 19:52:21)
|
||||
|
||||
@@ -32,7 +32,7 @@ import LensHelp
|
||||
import SDL
|
||||
|
||||
updateUseInputInGame :: Universe -> Universe
|
||||
updateUseInputInGame u = case u ^. uvWorld . hud . hudElement of
|
||||
updateUseInputInGame u = updateFunctionKeys $ case u ^. uvWorld . hud . hudElement of
|
||||
DisplayCarte -> over uvWorld updatePressedButtonsCarte u
|
||||
DisplayInventory{_subInventory = si} -> case si of
|
||||
DisplayTerminal tmid
|
||||
@@ -88,6 +88,20 @@ updateUseInputInGame u = case u ^. uvWorld . hud . hudElement of
|
||||
& ciSelection .~ msel'
|
||||
& ciFilter .~ filts'
|
||||
|
||||
updateFunctionKeys :: Universe -> Universe
|
||||
updateFunctionKeys u = M.foldlWithKey' updateFunctionKey u
|
||||
(u ^. uvWorld . input . pressedKeys)
|
||||
|
||||
updateFunctionKey :: Universe -> Scancode -> PressType -> Universe
|
||||
updateFunctionKey uv sc InitialPress = case sc of
|
||||
ScancodeF1 -> useNormalCamera uv
|
||||
ScancodeF2 -> pauseAndFloatCam uv
|
||||
ScancodeF5 -> doQuicksave uv
|
||||
ScancodeF9 -> doQuickload uv
|
||||
ScancodeEscape -> pauseGame uv
|
||||
_ -> uv
|
||||
updateFunctionKey uv _ _ = uv
|
||||
|
||||
updateCombineInvClick ::
|
||||
Maybe (Int, Int) ->
|
||||
IM.IntMap (SelectionSection CombinableItem) ->
|
||||
@@ -161,11 +175,6 @@ updateKeyInGame uv sc pt = case pt of
|
||||
|
||||
updateInitialPressInGame :: Universe -> Scancode -> Universe
|
||||
updateInitialPressInGame uv sc = case sc of
|
||||
ScancodeF1 -> useNormalCamera uv
|
||||
ScancodeF2 -> pauseAndFloatCam uv
|
||||
ScancodeF5 -> doQuicksave uv
|
||||
ScancodeF9 -> doQuickload uv
|
||||
ScancodeEscape -> pauseGame uv
|
||||
ScancodeSpace -> over uvWorld spaceAction uv
|
||||
ScancodeP -> pauseGame uv
|
||||
ScancodeF -> over uvWorld youDropItem uv
|
||||
|
||||
Reference in New Issue
Block a user