Allow dropping items by dragging off inventory
This commit is contained in:
@@ -84,7 +84,8 @@ mouseCursorType u = case u ^. uvWorld . input . mouseContext of
|
||||
MouseMenuClick {} -> drawMenuClick 5
|
||||
MouseMenuCursor -> drawMenuCursor 5
|
||||
MouseInGame -> drawPlus 5
|
||||
OverInvDrag -> drawDrag 5
|
||||
OverInvDrag (Just _) -> drawDrag 5
|
||||
OverInvDrag Nothing -> drawDragDrop 5
|
||||
OverInvDragSelect {} -> drawDragSelect 5
|
||||
OverInvSelect {} -> drawSelect 5
|
||||
OverInvFilt {} -> drawCombFilter 5
|
||||
@@ -157,6 +158,12 @@ drawDragSelect x = polygonWire $ rectWH (0.5 * x) x
|
||||
drawDrag :: Float -> Picture
|
||||
drawDrag x = line [V2 0 x,V2 0 (-x)]
|
||||
|
||||
drawDragDrop :: Float -> Picture
|
||||
drawDragDrop x = line [V2 (-x) x,V2 0 x,V2 0 (-x)]
|
||||
<> line [V2 (-y) (y-x), V2 0 (-x), V2 y (y-x)]
|
||||
where
|
||||
y = 0.7 * x
|
||||
|
||||
drawSelect :: Float -> Picture
|
||||
drawSelect x = polygonWire $ rectWH x (0.5 * x)
|
||||
-- line [V2 (-x) 0, V2 0 0]
|
||||
@@ -188,7 +195,7 @@ drawGapPlus x =
|
||||
]
|
||||
|
||||
aimDelaySweep :: World -> Picture
|
||||
aimDelaySweep w = fromMaybe mempty $ do
|
||||
aimDelaySweep w = fold $ do
|
||||
cr <- w ^? cWorld . lWorld . creatures . ix 0
|
||||
aimstatus <- cr ^? crStance . posture
|
||||
guard (aimstatus == Aiming)
|
||||
|
||||
Reference in New Issue
Block a user