Remove cursor type from ListDisplayParams

This commit is contained in:
2024-10-25 17:41:37 +01:00
parent bd505b072a
commit 6424899afd
7 changed files with 252 additions and 208 deletions
+12 -6
View File
@@ -1,5 +1,6 @@
module Dodge.ListDisplayParams
( invDisplayParams
, invCursorParams
, secondColumnParams
, subInvX
, defaultListDisplayParams
@@ -22,18 +23,23 @@ defaultListDisplayParams =
, _ldpScale = 1
, _ldpPos = ScreenPos {_spScreenOff = V2 (-0.5) 0.5 -- top left
, _spPixelOff = 0}
, _ldpCursorSides = mempty
, _ldpWidth = FixedSelectionWidth 15
}
invDisplayParams :: World -> ListDisplayParams
invDisplayParams w =
defaultListDisplayParams
& ldpCursorSides .~ selcursortype
-- & ldpCursorSides .~ selcursortype
& ldpWidth .~ FixedSelectionWidth (determineInvSelCursorWidth w)
& ldpPos . spPixelOff .~ V2 6 (-1)
where
selcursortype = case w ^? hud . hudElement . subInventory of
-- where
-- selcursortype = case w ^? hud . hudElement . subInventory of
-- _ | ButtonRight `M.member` _mouseButtons (_input w) -> [North, South, East, West]
-- Just ExamineInventory{} -> [North, South, East, West]
-- Just CombineInventory{} -> []
-- _ -> [North, South, West]
invCursorParams :: World -> CursorDisplay
invCursorParams w = CursorDisplay $ case w ^? hud . hudElement . subInventory of
_ | ButtonRight `M.member` _mouseButtons (_input w) -> [North, South, East, West]
Just ExamineInventory{} -> [North, South, East, West]
Just CombineInventory{} -> []
@@ -43,7 +49,7 @@ secondColumnParams :: ListDisplayParams
secondColumnParams =
defaultListDisplayParams
& ldpPos . spPixelOff .~ V2 subInvX (-81)
& ldpCursorSides .~ [North, South, West]
-- & ldpCursorSides .~ [North, South, West]
subInvX :: Float
subInvX = 10 * fromIntegral topInvW + 70
@@ -71,4 +77,4 @@ optionListDisplayParams =
& ldpScale .~ 2
& ldpVerticalGap .~ 0
& ldpWidth .~ FixedSelectionWidth 50
& ldpCursorSides .~ [North, South, West]
-- & ldpCursorSides .~ [North, South, West]