Cleanup
This commit is contained in:
@@ -1,55 +1,51 @@
|
||||
module Dodge.ListDisplayParams
|
||||
( invDisplayParams
|
||||
, invCursorParams
|
||||
, secondColumnParams
|
||||
, subInvX
|
||||
, defaultListDisplayParams
|
||||
, optionListDisplayParams
|
||||
) where
|
||||
module Dodge.ListDisplayParams (
|
||||
invDisplayParams,
|
||||
invCursorParams,
|
||||
secondColumnParams,
|
||||
subInvX,
|
||||
defaultListDisplayParams,
|
||||
optionListDisplayParams,
|
||||
) where
|
||||
|
||||
import Dodge.Data.ScreenPos
|
||||
import Control.Lens
|
||||
import qualified Data.Map.Strict as M
|
||||
import Dodge.Data.CardinalPoint
|
||||
import SDL (MouseButton (..))
|
||||
import Dodge.Data.ScreenPos
|
||||
import Dodge.Data.SelectionList
|
||||
import Dodge.Data.World
|
||||
import qualified Data.Map.Strict as M
|
||||
import Control.Lens
|
||||
import Linear
|
||||
import SDL (MouseButton (..))
|
||||
|
||||
defaultListDisplayParams :: ListDisplayParams
|
||||
defaultListDisplayParams =
|
||||
ListDisplayParams
|
||||
{ _ldpVerticalGap = 0
|
||||
, _ldpScale = 1
|
||||
, _ldpPos = ScreenPos {_spScreenOff = V2 (-0.5) 0.5 -- top left
|
||||
, _spPixelOff = 0}
|
||||
, _ldpPos =
|
||||
ScreenPos
|
||||
{ _spScreenOff = V2 (-0.5) 0.5 -- top left
|
||||
, _spPixelOff = 0
|
||||
}
|
||||
, _ldpWidth = FixedSelectionWidth 15
|
||||
}
|
||||
|
||||
invDisplayParams :: World -> ListDisplayParams
|
||||
invDisplayParams w =
|
||||
defaultListDisplayParams
|
||||
-- & ldpCursorSides .~ selcursortype
|
||||
& ldpWidth .~ FixedSelectionWidth (determineInvSelCursorWidth w)
|
||||
& ldpPos . spPixelOff .~ V2 6 (-1)
|
||||
-- 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{} -> []
|
||||
_ -> [North, South, West]
|
||||
invCursorParams w = BoundaryCursor $ 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]
|
||||
|
||||
secondColumnParams :: ListDisplayParams
|
||||
secondColumnParams =
|
||||
defaultListDisplayParams
|
||||
& ldpPos . spPixelOff .~ V2 subInvX (-81)
|
||||
-- & ldpCursorSides .~ [North, South, West]
|
||||
|
||||
subInvX :: Float
|
||||
subInvX = 10 * fromIntegral topInvW + 70
|
||||
@@ -77,4 +73,3 @@ optionListDisplayParams =
|
||||
& ldpScale .~ 2
|
||||
& ldpVerticalGap .~ 0
|
||||
& ldpWidth .~ FixedSelectionWidth 50
|
||||
-- & ldpCursorSides .~ [North, South, West]
|
||||
|
||||
Reference in New Issue
Block a user