{-# LANGUAGE StrictData #-} {-# LANGUAGE TemplateHaskell #-} module Dodge.Data.SelectionList where import Color import Control.Lens import Data.IntMap.Strict (IntMap) import Dodge.Data.CardinalPoint import Dodge.Data.ScreenPos import Picture.Data import Linear data LDParams = LDP -- List display parameters { _ldpPos :: ScreenPos , _ldpScale :: Float , _ldpVerticalGap :: Float , _ldpSize :: Maybe (V2 Int) } data CursorDisplay = BoundCurs [CardinalPoint] | BackdropCurs data SectionCursor = SectionCursor { _scurPos :: Int , _scurSize :: Int , _scurColor :: Color } data SelSection a = SelSection { _ssItems :: IntMap (SelectionItem a) , _ssOffset :: Int , _ssShownItems :: [Picture] , _ssShownLength :: Int , _ssIndent :: Int } type IMSS a = IntMap (SelSection a) type IMSI a = IntMap (SelectionItem a) data SelectionWidth = FixedSelectionWidth Int | UseItemWidth data SelectionItem a = SelItem { _siPictures :: [String] , _siHeight :: Int , _siWidth :: Int , _siIsSelectable :: Bool , _siColor :: Color , _siOffX :: Int , _siPayload :: Maybe a , _siDisplayMod :: SIDisplayMod } data SIDisplayMod = NoSIDisplayMod | HighlightSI | DropShadowSI | InventoryHeadSI | InventoryHeadFilterSI makeLenses ''LDParams makeLenses ''SelectionItem makeLenses ''SelSection makeLenses ''SectionCursor makePrisms ''CursorDisplay