Cleanup
This commit is contained in:
@@ -89,49 +89,19 @@ targetRBPress = TargetingOnHeld
|
||||
, _tgDraw = targetRBPressDraw
|
||||
}
|
||||
targetRBPressDraw :: Int -> Item -> Creature -> World -> Picture
|
||||
targetRBPressDraw _ it _ w' = fromMaybe mempty $ do
|
||||
mwp <- it ^? itTargeting' . tgPos . _Just
|
||||
targetRBPressDraw _ it _ w = fromMaybe mempty $ do
|
||||
mwp <- it ^? itTargeting . tgPos . _Just
|
||||
return $ setLayer 1 $ color red $ onLayer InvLayer $ uncurryV translate mwp
|
||||
$ rotate (_cameraRot w')
|
||||
$ rotate (_cameraRot w)
|
||||
$ pictures
|
||||
[line [V2 x x, V2 (-x) (-x)]
|
||||
,line [V2 (-x) x, V2 x (-x)]
|
||||
]
|
||||
where
|
||||
x = 5 / _cameraZoom w'
|
||||
x = 5 / _cameraZoom w
|
||||
|
||||
targetRBPressUpdate :: Item -> Creature -> World -> Targeting -> Targeting
|
||||
targetRBPressUpdate _ _ w t
|
||||
| SDL.ButtonRight `S.member` _mouseButtons w = t
|
||||
& tgPos %~ maybe (Just $ mouseWorldPos w) Just
|
||||
| otherwise = t & tgPos %~ const Nothing
|
||||
|
||||
--rbSetTarget :: ItEffect
|
||||
--rbSetTarget = ItInvEffect
|
||||
-- {_itInvEffect = setTarg
|
||||
-- ,_itEffectCounter = 0
|
||||
-- }
|
||||
-- where
|
||||
-- setTarg :: ItEffect -> Creature -> Int -> World -> World
|
||||
-- setTarg _ cr invid w
|
||||
-- | _crInvSel cr /= invid = w
|
||||
-- | SDL.ButtonRight `S.member` _mouseButtons w = w
|
||||
-- & creatures . ix (_crID cr) . crInv . ix invid . itTargeting
|
||||
-- %~ maybe (Just $ targetRBMousePos w) Just
|
||||
-- | otherwise = w & creatures . ix (_crID cr) . crInv . ix invid . itTargeting .~ Nothing
|
||||
|
||||
targetRBMousePos
|
||||
:: World
|
||||
-> (World -> Maybe Point2, Int -> Item -> Creature -> World -> Picture)
|
||||
targetRBMousePos w = (f, \_ _ _ w' -> cursorPic w')
|
||||
where
|
||||
f _ = Just mwp
|
||||
mwp = mouseWorldPos w
|
||||
cursorPic w' = setLayer 1 $ color red $ onLayer InvLayer $ uncurryV translate mwp
|
||||
$ rotate (_cameraRot w')
|
||||
$ pictures
|
||||
[line [V2 x x, V2 (-x) (-x)]
|
||||
,line [V2 (-x) x, V2 x (-x)]
|
||||
]
|
||||
where
|
||||
x = 5 / _cameraZoom w'
|
||||
|
||||
Reference in New Issue
Block a user