Work on mouse selection in options menu
This commit is contained in:
@@ -12,6 +12,7 @@ module Dodge.Render.List (
|
||||
toTopLeft,
|
||||
) where
|
||||
|
||||
import Dodge.ScreenPos
|
||||
import Data.Maybe
|
||||
import Dodge.Base.Window
|
||||
import Dodge.Data.CardinalPoint
|
||||
@@ -26,16 +27,15 @@ import Picture
|
||||
|
||||
drawSelectionList :: ListDisplayParams -> Configuration -> SelectionList a -> Picture
|
||||
drawSelectionList ldps cfig sl =
|
||||
toTopLeft
|
||||
translateScreenPos
|
||||
cfig
|
||||
( translate (ldps ^. ldpPosX) (negate $ ldps ^. ldpPosY) $
|
||||
(ldps ^. ldpPos) $
|
||||
listPicturesYgapScaleYoff
|
||||
(_ldpVerticalGap ldps)
|
||||
(_ldpScale ldps)
|
||||
0
|
||||
(makeSelectionListPictures sl)
|
||||
<> drawSelectionCursor sl ldps
|
||||
)
|
||||
|
||||
makeSelectionListPictures :: SelectionList a -> [Picture]
|
||||
makeSelectionListPictures = concatMap f . getShownItems
|
||||
@@ -76,9 +76,7 @@ drawListYoff :: Int -> [Picture] -> Picture
|
||||
drawListYoff = listPicturesYgapScaleYoff 0 1
|
||||
|
||||
listPicturesYgapScaleYoff :: Float -> Float -> Int -> [Picture] -> Picture
|
||||
listPicturesYgapScaleYoff ygap s i =
|
||||
mconcat
|
||||
. zipWith (drawListElement ygap s) [i ..]
|
||||
listPicturesYgapScaleYoff ygap s i = mconcat . zipWith (drawListElement ygap s) [i ..]
|
||||
|
||||
stackPicturesAt :: [Picture] -> Picture
|
||||
stackPicturesAt = stackPicturesAtOff 0
|
||||
@@ -103,12 +101,10 @@ listCursorDisplayParams ::
|
||||
Int ->
|
||||
Picture
|
||||
listCursorDisplayParams ldp borders a b c d =
|
||||
translate xoff (- yoff) . listCursorChooseBorderScale ygap s borders a b c d
|
||||
listCursorChooseBorderScale ygap s borders a b c d
|
||||
where
|
||||
ygap = _ldpVerticalGap ldp
|
||||
s = _ldpScale ldp
|
||||
xoff = _ldpPosX ldp
|
||||
yoff = _ldpPosY ldp
|
||||
|
||||
-- displays a cursor that should match up to list text pictures
|
||||
-- the width of a character appears to be 9(?!)
|
||||
|
||||
Reference in New Issue
Block a user