Cleanup
This commit is contained in:
@@ -83,14 +83,9 @@ targetRBCreatureUp it cr w t
|
||||
& tgPos .~ Nothing
|
||||
& tgActive .~ False
|
||||
)
|
||||
| SDL.ButtonRight `M.member` _mouseButtons (_cWorld w) && isJust (t ^? tgID . _Just)
|
||||
&& canSeeTarget = (w, t & updatePos
|
||||
& tgActive .~ True
|
||||
)
|
||||
| otherwise = (w, t & tgID .~ fmap _crID newtarg
|
||||
& updatePos
|
||||
& tgActive .~ False
|
||||
)
|
||||
| SDL.ButtonRight `M.member` _mouseButtons w && isJust (t ^? tgID . _Just)
|
||||
&& canSeeTarget = (w, t & updatePos & tgActive .~ True)
|
||||
| otherwise = (w, t & tgID .~ fmap _crID newtarg & updatePos & tgActive .~ False )
|
||||
where
|
||||
newtarg = safeMinimumOn (dist mwp . _crPos)
|
||||
. filter (canseepos . _crPos)
|
||||
@@ -113,7 +108,7 @@ targetUpdateWith f it _ w t
|
||||
|
||||
targetCursorUpdate :: World -> Targeting -> Targeting
|
||||
targetCursorUpdate w t
|
||||
| SDL.ButtonRight `M.member` _mouseButtons (_cWorld w) = t
|
||||
| SDL.ButtonRight `M.member` _mouseButtons w = t
|
||||
& tgPos . _Just .~ mouseWorldPos w
|
||||
& tgActive .~ True
|
||||
| otherwise = t & tgPos %~ const Nothing
|
||||
@@ -121,7 +116,7 @@ targetCursorUpdate w t
|
||||
|
||||
targetRBPressUpdate :: World -> Targeting -> Targeting
|
||||
targetRBPressUpdate w t
|
||||
| SDL.ButtonRight `M.member` _mouseButtons (_cWorld w) = t
|
||||
| SDL.ButtonRight `M.member` _mouseButtons w = t
|
||||
& tgPos %~ maybe (Just $ mouseWorldPos w) Just
|
||||
& tgActive .~ True
|
||||
| otherwise = t & tgPos %~ const Nothing
|
||||
|
||||
Reference in New Issue
Block a user