Refactor shell movement, modularised in a tweakable way
This commit is contained in:
@@ -111,13 +111,13 @@ rbSetTarget = ItInvEffect
|
||||
| _crInvSel cr /= invid = w
|
||||
| SDL.ButtonRight `S.member` _mouseButtons w = w
|
||||
& creatures . ix (_crID cr) . crInv . ix invid . itTargeting
|
||||
%~ maybe (Just $ targetCurrentMousePos w) Just
|
||||
%~ maybe (Just $ targetRBMousePos w) Just
|
||||
| otherwise = w & creatures . ix (_crID cr) . crInv . ix invid . itTargeting .~ Nothing
|
||||
|
||||
targetCurrentMousePos
|
||||
targetRBMousePos
|
||||
:: World
|
||||
-> (World -> Maybe Point2, Int -> Item -> Creature -> World -> Picture)
|
||||
targetCurrentMousePos w = (f, \_ _ _ w' -> cursorPic w')
|
||||
targetRBMousePos w = (f, \_ _ _ w' -> cursorPic w')
|
||||
where
|
||||
f _ = Just mwp
|
||||
mwp = mouseWorldPos w
|
||||
|
||||
Reference in New Issue
Block a user