Move towards moving menu selection list position to mouse context

This commit is contained in:
2024-11-17 12:18:34 +00:00
parent e7ea5d7fa9
commit 53d8ca2861
6 changed files with 228 additions and 195 deletions
+24 -6
View File
@@ -80,7 +80,8 @@ mouseCursorType :: Universe -> Picture
mouseCursorType u = case u ^. uvWorld . input . mouseContext of
NoMouseContext -> drawEmptySet 5
MouseAiming -> rotate a (drawPlus 5)
MouseMenuClick -> drawMenuClick 5
MouseMenuClick {} -> drawMenuClick 5
MouseMenuCursor -> drawMenuCursor 5
MouseInGame -> drawPlus 5
OverInvSelect {} -> drawSelect 5
OverInvFilt {} -> drawCombFilter 5
@@ -119,13 +120,30 @@ drawPlus :: Float -> Picture
drawPlus x = fold [line [V2 (- x) 0, V2 x 0], line [V2 0 (- x), V2 0 x]]
drawMenuClick :: Float -> Picture
drawMenuClick x = line
[ V2 0 0
, V2 x (-x)
, V2 0 (-x)
, V2 0 0
drawMenuClick z = fold
[ line [V2 y 0, V2 x 0]
, line [V2 ny 0, V2 nx 0]
, line [V2 0 ny , V2 0 nx]
, line [V2 0 y , V2 0 x]
]
where
x = 0.5 * z
y = x + z
ny = - y
nx = - x
drawMenuCursor :: Float -> Picture
drawMenuCursor z = fold
[ line [V2 y 0, V2 x 0]
, line [V2 ny 0, V2 nx 0]
, line [V2 0 ny , V2 0 nx]
, line [V2 0 y , V2 0 x]
]
where
x = z
y = x + z
ny = - y
nx = - x
drawCombFilterJump :: Float -> Picture
drawCombFilterJump x = rotate (0.25*pi)
$ fold [line [V2 0 0, V2 x 0], line [V2 0 0, V2 0 x]]