Can pick up items by dragging

This commit is contained in:
2024-11-25 14:03:42 +00:00
parent 691ed23eb4
commit 951d1191cc
4 changed files with 30 additions and 23 deletions
+5 -7
View File
@@ -183,8 +183,7 @@ filterSectionsPair ::
String ->
Maybe String ->
(IM.IntMap (SelectionItem a), IM.IntMap (SelectionItem a))
filterSectionsPair infocus filtfn itms filtdescription mfilt =
(filtsis, itms')
filterSectionsPair infocus filtfn itms filtdescription mfilt = (filtsis, itms')
where
filtcurs = if infocus then cFilledRect else cWireRect
filtsis = fold $ do
@@ -345,21 +344,19 @@ enterCombineInv :: Configuration -> World -> World
enterCombineInv cfig w =
w & hud . hudElement . subInventory
.~ CombineInventory
{ _ciSections = sss
{ _ciSections = IM.fromDistinctAscList [(-1, filtsection), (0, combsection)]
, _ciSelection = selpos
, _ciFilter = Nothing
}
& hud . hudElement . diInvFilter .~ Nothing
where
cm' = IM.fromDistinctAscList . zip [0 ..] $ combineList w
cm
| null cm' = IM.singleton 0 $ SelectionInfo ["No possible combinations"] 1 False white 0
cm | null cm' = IM.singleton 0
$ SelectionInfo ["No possible combinations"] 1 False white 0
| otherwise = cm'
sss = IM.fromDistinctAscList [(-1, filtsection), (0, combsection)]
selpos
| null cm' = Nothing
| otherwise = Just (0, 0)
availablelines = getAvailableListLines secondColumnParams cfig
filtsection =
SelectionSection
{ _ssItems = mempty
@@ -374,6 +371,7 @@ enterCombineInv cfig w =
cm
availablelines
0
availablelines = getAvailableListLines secondColumnParams cfig
regexList :: String -> [String] -> Bool
regexList x = any (List.isInfixOf x)