Incomplete work on mouse interaction with filtered inventory
This commit is contained in:
@@ -86,6 +86,8 @@ mouseCursorType u = case u ^. uvWorld . input . mouseContext of
|
||||
MouseInGame -> drawPlus 5
|
||||
OverInvDrag (Just _) -> drawDrag 5
|
||||
OverInvDrag Nothing -> drawDragDrop 5
|
||||
OverInvFiltDrag -> drawFiltDrag 5
|
||||
OverInvFiltDragDrop -> drawFiltDragDrop 5
|
||||
OverInvDragSelect {} -> drawDragSelect 5
|
||||
OverInvSelect {} -> drawSelect 5
|
||||
OverInvFilt {} -> drawCombFilter 5
|
||||
@@ -156,16 +158,48 @@ drawDragSelect :: Float -> Picture
|
||||
drawDragSelect x = polygonWire $ rectWH (0.5 * x) x
|
||||
|
||||
drawDrag :: Float -> Picture
|
||||
drawDrag x = line [V2 0 x,V2 0 (-x)]
|
||||
drawDrag x = line [V2 0 y,V2 0 z]
|
||||
<> line [V2 0 (-y),V2 0 (-z)]
|
||||
<> line [V2 (-w) (z-w), V2 0 z, V2 w (z-w)]
|
||||
<> line [V2 (-w) (w-z), V2 0 (-z), V2 w (w-z)]
|
||||
<> drawSelect 5
|
||||
where
|
||||
z = 1.5 * x
|
||||
y = 0.5 * x
|
||||
w = 0.3 * 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)]
|
||||
drawDragDrop x =
|
||||
line (fmap (+V2 z (-x)) [V2 (-x) x,V2 0 x,V2 0 (-x)])
|
||||
<> line (fmap (+V2 z (-x)) [V2 (-y) (y-x), V2 0 (-x), V2 y (y-x)])
|
||||
<> drawSelect 5
|
||||
where
|
||||
z = 1.5 * x
|
||||
y = 0.7 * x
|
||||
|
||||
drawFiltDrag :: Float -> Picture
|
||||
drawFiltDrag x = polygonWire
|
||||
[ V2 0 y
|
||||
, V2 x y
|
||||
, V2 0 (-y)
|
||||
, V2 (-x) (-y)
|
||||
]
|
||||
where
|
||||
y = 0.5 * x
|
||||
|
||||
drawFiltDragDrop :: Float -> Picture
|
||||
drawFiltDragDrop x = polygonWire
|
||||
[ V2 0 y
|
||||
, V2 x y
|
||||
, V2 0 (-y)
|
||||
, V2 (-x) (-y)
|
||||
] <> 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.5 * x
|
||||
|
||||
drawSelect :: Float -> Picture
|
||||
drawSelect x = polygonWire $ rectWH x (0.5 * x)
|
||||
drawSelect x = polygonWire $ rectWH (0.5 * x) (0.5 * x)
|
||||
-- line [V2 (-x) 0, V2 0 0]
|
||||
--drawSelect x = line
|
||||
-- [ V2 x x
|
||||
|
||||
Reference in New Issue
Block a user