From c3fb94c7b516d3b3e5b6efca758b356dd059bdae Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 20 Feb 2023 12:40:36 +0000 Subject: [PATCH] Commit before trying to generalise filterable sections --- src/Dodge/Data/SelectionList.hs | 9 +++++++++ src/Dodge/Default/World.hs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Dodge/Data/SelectionList.hs b/src/Dodge/Data/SelectionList.hs index 21acdad4b..9446a070d 100644 --- a/src/Dodge/Data/SelectionList.hs +++ b/src/Dodge/Data/SelectionList.hs @@ -30,6 +30,14 @@ 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) @@ -88,6 +96,7 @@ makeLenses ''SelectionList makeLenses ''SelectionItem makeLenses ''SelectionSection makeLenses ''SelectionSections +makeLenses ''FilterableSections makeLenses ''SectionCursor --deriveJSON defaultOptions ''SelectionItem --deriveJSON defaultOptions ''SelectionList diff --git a/src/Dodge/Default/World.hs b/src/Dodge/Default/World.hs index f4bf3edff..732b25ebb 100644 --- a/src/Dodge/Default/World.hs +++ b/src/Dodge/Default/World.hs @@ -161,7 +161,7 @@ defaultHUD = defaultDisplayInventory :: HUDElement defaultDisplayInventory = DisplayInventory - {_subInventory =NoSubInventory + {_subInventory = NoSubInventory , _diSections = defaultInvSections , _invRegex = Nothing , _closeRegex = Nothing