diff --git a/src/Dodge/Data/SelectionList.hs b/src/Dodge/Data/SelectionList.hs index f00ece570..2a3452ce5 100644 --- a/src/Dodge/Data/SelectionList.hs +++ b/src/Dodge/Data/SelectionList.hs @@ -38,7 +38,6 @@ type IMSS a = IntMap (SelectionSection a) data SelectionWidth = FixedSelectionWidth Int --- | UseMaxSelectionItemWidth | UseItemWidth data SelectionItem a diff --git a/src/Dodge/DisplayInventory.hs b/src/Dodge/DisplayInventory.hs index bd238e80e..d8c19c6d7 100644 --- a/src/Dodge/DisplayInventory.hs +++ b/src/Dodge/DisplayInventory.hs @@ -51,7 +51,7 @@ updateCombineSections w cfig = (const 0) (w ^? hud . hudElement . subInventory . ciSelection . _Just) (getAvailableListLines secondColumnParams cfig) - (IM.fromDistinctAscList [(0, sclose), (-1, sfclose)]) + (IM.fromDistinctAscList [(-1, sfclose),(0, sclose')]) where filtcurs = w ^? hud . hudElement . subInventory . ciSelection . _Just . _1 == Just (-1) (sfclose, sclose) = @@ -62,6 +62,11 @@ updateCombineSections w cfig = "COMBINATIONS" $ w ^? hud . hudElement . subInventory . ciFilter . _Just invitms = fold $ w ^? cWorld . lWorld . creatures . ix 0 . crInv + sclose' + | null sclose = + IM.singleton 0 $ + SelectionInfo ["No possible combinations"] 1 25 False white 0 + | otherwise = sclose regexCombs :: IM.IntMap Item -> SelectionItem CombinableItem -> String -> Bool regexCombs inv ci = \case @@ -318,10 +323,15 @@ enterCombineInv :: Configuration -> World -> World enterCombineInv cfig w = w & hud . hudElement . subInventory .~ CombineInventory - { _ciSections = IM.fromDistinctAscList [(-1, filtsection), (0, combsection)] + { _ciSections = updateCombineSections w cfig mempty , _ciSelection = selpos , _ciFilter = Nothing } +-- .~ CombineInventory +-- { _ciSections = IM.fromDistinctAscList [(-1, filtsection), (0, combsection)] +-- , _ciSelection = selpos +-- , _ciFilter = Nothing +-- } & hud . hudElement . diInvFilter .~ Nothing where