Remove intmap over filters

This commit is contained in:
2024-10-25 22:42:23 +01:00
parent d93c548d3c
commit 46ee29f646
7 changed files with 65 additions and 39 deletions
+4 -7
View File
@@ -16,9 +16,10 @@ import Geometry.Data
data HUDElement
= DisplayInventory
{ _subInventory :: SubInventory
, _diSections :: IntMap (SelectionSection ())
, _diSections :: IMSS ()
, _diSelection :: Maybe (Int, Int)
, _diFilters :: IntMap (Maybe String)
, _diInvFilter :: Maybe String
, _diCloseFilter :: Maybe String
, _diSelectionExtra :: Int
}
| DisplayCarte
@@ -38,13 +39,11 @@ data SubInventory
| CombineInventory
{ _ciSections :: IntMap (SelectionSection CombinableItem)
, _ciSelection :: Maybe (Int, Int)
, _ciFilters :: IntMap (Maybe String)
, _ciFilter :: Maybe String
}
| LockedInventory
| DisplayTerminal {_termID :: Int}
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
data HUD = HUD
{ _hudElement :: HUDElement
, _carteCenter :: Point2
@@ -53,8 +52,6 @@ data HUD = HUD
, _closeObjects :: [Either FloorItem Button]
}
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''HUD
makeLenses ''HUDElement
makeLenses ''SubInventory
+2
View File
@@ -53,6 +53,8 @@ data SelectionSection a = SelectionSection
, _ssDescriptor :: String
}
type IMSS a = IntMap (SelectionSection a)
data SelectionWidth
= FixedSelectionWidth Int
| VariableSelectionWidth (Int -> Int)