Allow terminals to block input

This commit is contained in:
2022-06-07 22:56:20 +01:00
parent e85bd36fe4
commit c31f398fab
8 changed files with 48 additions and 27 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ import SDL
handleEvent :: Event -> Universe -> IO (Maybe Universe)
handleEvent e = case eventPayload e of
TextInputEvent tev -> handleTextInput (textInputEventText tev)
TextInputEvent tev -> return . Just . handleTextInput (textInputEventText tev)
KeyboardEvent kev -> handleKeyboardEvent kev
MouseMotionEvent mmev -> return . handleMouseMotionEvent mmev
MouseButtonEvent mbev -> return . Just . over uvWorld (handleMouseButtonEvent mbev)
@@ -144,7 +144,7 @@ wheelEvent y w = case _hudElement $ _hud w of
DisplayInventory (CombineInventory _) -> w
& hud . hudElement . subInventory . combineInvSel . _Just %~ ((`mod` numcombs) . subtract yi)
DisplayInventory (DisplayTerminal tmid)
| rbDown && inTermFocus w -> w
| rbDown && inTermFocus w -> guardDisconnectedID tmid w $ w
& terminals . ix tmid %~ updatetermsubsel
| inTermFocus w -> w
& terminals . ix tmid %~ updatetermsel