Separate out input datatype
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user