Move towards inputs in terminal

This commit is contained in:
2022-06-01 14:34:16 +01:00
parent b54864bbda
commit 2cedc1b968
13 changed files with 90 additions and 64 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ import SDL
handleEvent :: Event -> Universe -> IO (Maybe Universe)
handleEvent e = case eventPayload e of
TextInputEvent tev -> handleTextInputEvent tev
TextInputEvent tev -> handleTextInput (textInputEventText tev)
KeyboardEvent kev -> handleKeyboardEvent kev
MouseMotionEvent mmev -> return . handleMouseMotionEvent mmev
MouseButtonEvent mbev -> return . handleMouseButtonEvent mbev
@@ -98,7 +98,7 @@ handlePressedMouseButton but w = case (_hudElement (_hud $ _uvWorld w), but) of
i <- _termSel tp
f <- _termOptions tp !? i
return $ w & uvWorld %~ snd f
& uvWorld . hud . hudElement .~ DisplayInventory NoSubInventory
-- & uvWorld . hud . hudElement .~ DisplayInventory NoSubInventory
( DisplayInventory (CombineInventory mi) , ButtonLeft)
-> Just $ fromMaybe (w & uvWorld . hud . hudElement .~ DisplayInventory NoSubInventory)
$ do -- ugly