Work on menus
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.SelectionList where
|
||||
import Color
|
||||
import Picture.Data
|
||||
@@ -13,14 +14,36 @@ data SelectionList = SelectionList
|
||||
, _slScale :: Float
|
||||
, _slVerticalGap :: Float
|
||||
, _slItems :: [SelectionItem]
|
||||
, _slShownItems :: [(SelectionItem,SelectionItemIndex)]
|
||||
, _slSelPos :: Maybe Int
|
||||
, _slCursorType :: CursorType
|
||||
, _slWidth :: SelectionWidth
|
||||
, _slLength :: Int
|
||||
, _slSizeRestriction :: SelectionSizeRestriction
|
||||
, _slSpecialItem :: SpecialSelectionItem
|
||||
}
|
||||
|
||||
data SelectionItemIndex = ListedSelectionItem Int
|
||||
| ScrollUpSelectionItem
|
||||
| ScrollDownSelectionItem
|
||||
| SpecialSelectionItem
|
||||
|
||||
data SpecialSelectionItem = NoSpecialSelectionItem
|
||||
| BottomSelectionItem {_bottomSelectionItem :: SelectionItem}
|
||||
|
||||
data SelectionSizeRestriction = NoSelectionSizeRestriction
|
||||
| SelectionSizeRestriction
|
||||
{ _maxSelectionLines :: Int
|
||||
, _overflowItemTop :: SelectionItem
|
||||
, _overflowItemBottom :: SelectionItem
|
||||
, _ssrType :: SSRType
|
||||
}
|
||||
|
||||
newtype SSRType = SSRFromScreenBottom {_ssrFromScreenBottom :: Float}
|
||||
|
||||
data SelectionWidth = FixedSelectionWidth Int
|
||||
| VariableSelectionWidth [Int]
|
||||
| VariableSelectionWidth (Int -> Int)
|
||||
| UseMaxSelectionItemWidth
|
||||
|
||||
data CursorType = NoCursor
|
||||
| BorderCursor (Set CardinalPoint)
|
||||
@@ -36,3 +59,6 @@ data SelectionItem = SelectionItem
|
||||
|
||||
makeLenses ''SelectionList
|
||||
makeLenses ''SelectionItem
|
||||
makeLenses ''SpecialSelectionItem
|
||||
makeLenses ''SelectionSizeRestriction
|
||||
makeLenses ''SSRType
|
||||
|
||||
@@ -12,6 +12,7 @@ module Dodge.Data.Universe (
|
||||
module Loop.Data,
|
||||
) where
|
||||
|
||||
import Dodge.Data.SelectionList
|
||||
import Control.Lens
|
||||
--import qualified Data.Map.Strict as M
|
||||
import Data.Preload
|
||||
@@ -21,7 +22,7 @@ import Dodge.Data.Config
|
||||
import Dodge.Data.World
|
||||
import Loop.Data
|
||||
import Picture.Data
|
||||
import SDL (Scancode)
|
||||
--import SDL (Scancode)
|
||||
|
||||
data Universe = Universe
|
||||
{ _uvWorld :: World
|
||||
@@ -48,15 +49,14 @@ data OptionScreenFlag = NormalOptions | GameOverOptions | SplashOptions
|
||||
|
||||
data ScreenLayer
|
||||
= OptionScreen
|
||||
{ _scTitle :: Universe -> String
|
||||
{ _scTitle :: String
|
||||
, _scOptions :: [MenuOption]
|
||||
, _scDefaultEff :: Universe -> Universe
|
||||
, _scMaybeOption :: Maybe MenuOption
|
||||
, _scOptionFlag :: OptionScreenFlag
|
||||
, _scOptionsOffset :: Int
|
||||
, _scSelPos :: Maybe Int
|
||||
, _scSelectionList :: SelectionList
|
||||
}
|
||||
| ColumnsScreen
|
||||
{ _scTitle :: Universe -> String
|
||||
{ _scTitle :: String
|
||||
, _scColumns :: [(String, String)]
|
||||
}
|
||||
| InputScreen
|
||||
@@ -94,3 +94,4 @@ makeLenses ''Universe
|
||||
makeLenses ''ScreenLayer
|
||||
makeLenses ''SideEffect
|
||||
makeLenses ''MenuOptionDisplay
|
||||
makeLenses ''MenuOption
|
||||
|
||||
Reference in New Issue
Block a user