Reorganise/cleanup

This commit is contained in:
2023-02-21 01:24:22 +00:00
parent dee7472d31
commit 4904c57972
13 changed files with 119 additions and 140 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ import Data.IntMap.Strict (IntMap)
data HUDElement
= DisplayInventory
{ _subInventory :: SubInventory
, _diSections :: FilterableSections ()
, _diSections :: SelectionSections ()
}
| DisplayCarte
@@ -25,7 +25,7 @@ data SubInventory
| ExamineInventory {_subInvMSel :: Maybe Int}
-- | CombineInventory {_subInvMap :: SelectionIntMap CombinableItem}
| CombineInventory {_ciCombinations :: IntMap (SelectionItem CombinableItem)
, _ciSections :: FilterableSections CombinableItem
, _ciSections :: SelectionSections CombinableItem
}
| LockedInventory
| DisplayTerminal {_termID :: Int}
+9 -13
View File
@@ -30,23 +30,19 @@ data SelectionList a = SelectionList
}
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
-- this is projected to be VERY arbitrary: the fssFilters point to the lower of
-- a pair of ints (i,i+1) such that the lower is the regex section, the higher
-- is the items section.
data FilterableSections a = FilterableSections
{ _fssFilters :: IntMap (Maybe String)
, _fssSections :: SelectionSections a
}
data SelectionSections a = SelectionSections
{ _sssSections :: IntMap (SelectionSection a)
, _sssSelPos :: Maybe (Int,Int)
, _sssExtra :: SSSExtra
}
--data SSSExtra :: SSSExtra
-- { _sssSelPos :: Maybe (Int,Int)
-- , _sssFilters :: IntMap (Maybe String
-- }
-- note that filters are arbitrary: the sssFilters point to the lower of
-- a pair of ints (i,i+1) such that the lower is the regex section, the higher
-- is the items section.
data SSSExtra = SSSExtra
{ _sssSelPos :: Maybe (Int,Int)
, _sssFilters :: IntMap (Maybe String)
}
data SectionCursor = SectionCursor
{ _scurPos :: Int
@@ -100,7 +96,7 @@ makeLenses ''SelectionList
makeLenses ''SelectionItem
makeLenses ''SelectionSection
makeLenses ''SelectionSections
makeLenses ''FilterableSections
makeLenses ''SSSExtra
makeLenses ''SectionCursor
--deriveJSON defaultOptions ''SelectionItem
--deriveJSON defaultOptions ''SelectionList