Separate out input datatype

This commit is contained in:
2022-10-29 11:36:57 +01:00
parent 82e2a5a234
commit af6cdff063
19 changed files with 160 additions and 112 deletions
+3 -3
View File
@@ -73,7 +73,7 @@ targetRBCreatureUp it cr w t
& tgPos .~ Nothing
& tgActive .~ False
)
| SDL.ButtonRight `M.member` _mouseButtons w && isJust (t ^? tgID . _Just)
| SDL.ButtonRight `M.member` _mouseButtons (_input w) && isJust (t ^? tgID . _Just)
&& canSeeTarget =
(w, t & updatePos & tgActive .~ True)
| otherwise = (w, t & tgID .~ fmap _crID newtarg & updatePos & tgActive .~ False)
@@ -105,7 +105,7 @@ targetUpdateWith f it _ w t
targetCursorUpdate :: World -> Targeting -> Targeting
targetCursorUpdate w t
| SDL.ButtonRight `M.member` _mouseButtons w =
| SDL.ButtonRight `M.member` _mouseButtons (_input w) =
t
& tgPos . _Just .~ mouseWorldPos w
& tgActive .~ True
@@ -115,7 +115,7 @@ targetCursorUpdate w t
targetRBPressUpdate :: World -> Targeting -> Targeting
targetRBPressUpdate w t
| SDL.ButtonRight `M.member` _mouseButtons w =
| SDL.ButtonRight `M.member` _mouseButtons (_input w) =
t
& tgPos %~ maybe (Just $ mouseWorldPos w) Just
& tgActive .~ True