Start adding filters to selection lists

This commit is contained in:
2023-01-15 11:55:32 +00:00
parent 6f1162f7b9
commit 64b1c2761e
16 changed files with 128 additions and 66 deletions
+3 -1
View File
@@ -10,6 +10,7 @@ import Dodge.Data.Button
import Dodge.Data.FloorItem
import Control.Lens
import Geometry.Data
import qualified Data.Text as T
data HUDElement
= DisplayInventory
@@ -21,7 +22,8 @@ data HUDElement
data SubInventory
= NoSubInventory
| ExamineInventory {_subInvSel :: Maybe Int}
| CombineInventory {_subInvSel :: Maybe Int}
| CombineInventory {_subInvSel :: Maybe Int, _subInvRegex :: T.Text
, _subInvRegexInput :: Bool}
| LockedInventory
| DisplayTerminal {_termID :: Int}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
+6 -2
View File
@@ -4,7 +4,6 @@
{-# LANGUAGE StrictData #-}
module Dodge.Data.SelectionList where
import Color
import Picture.Data
import Control.Lens
import Dodge.Data.CardinalPoint
--import Data.Aeson
@@ -24,6 +23,8 @@ data SelectionList a = SelectionList
{ _slItems :: [SelectionItem a]
, _slSelPos :: Maybe Int
, _slLength :: Int
, _slRegex :: String
, _slRegexInput :: Bool
}
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
@@ -35,7 +36,7 @@ data CursorType = NoCursor
| BorderCursor [CardinalPoint]
data SelectionItem a = SelectionItem
{ _siPictures :: [Picture]
{ _siPictures :: [String]
, _siHeight :: Int
, _siIsSelectable :: Bool
, _siWidth :: Int
@@ -43,6 +44,9 @@ data SelectionItem a = SelectionItem
, _siOffX :: Int
, _siPayload :: a
}
| SelectionFilter
{ _siPictures :: [String]
}
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''ListDisplayParams