This commit is contained in:
2024-09-13 09:43:56 +01:00
parent d2e1b054d0
commit c81fd5490d
6 changed files with 80 additions and 124 deletions
+8 -13
View File
@@ -49,7 +49,7 @@ updateCombineSections w cfig sss =
where
mselpos = sss ^. sssExtra . sssSelPos
availablelines = getAvailableListLines secondColumnParams cfig
allcombs = IM.fromAscList $ zip [0 ..] $ combineList' w
allcombs = IM.fromAscList $ zip [0 ..] $ combineList w
filtcombs = fromMaybe allcombs $ do
str <- mstr
invitms <- w ^? hud . hudElement . diSections . sssSections . ix 0 . ssItems
@@ -140,7 +140,7 @@ updateDisplaySections w cfig sss =
invDimColor :: Color
invDimColor = greyN 0.7
-- it is annoying that this is necessary
-- this appears to be only for filtering
updateInventorySectionItems :: World -> World
updateInventorySectionItems w =
w
@@ -214,20 +214,15 @@ updateSection sis mcsel availablelines ss =
si <- sis ^? ix csel
let xselsize = length $ _siPictures si
return $ case sum $ fmap (length . _siPictures) . fst . IM.split csel $ sis of
pos
| pos == 0 || length allstrings <= availablelines ->
pos | pos == 0 || length allstrings <= availablelines ->
0
pos
| pos - 1 < oldoffset ->
pos | pos - 1 < oldoffset ->
pos - 1
pos
| maxcsel == csel ->
pos | maxcsel == csel ->
pos - availablelines + xselsize
pos
| pos + 1 + xselsize - availablelines > oldoffset ->
pos | pos + 1 + xselsize - availablelines > oldoffset ->
pos - availablelines + 1 + xselsize
_
| length allstrings - oldoffset < availablelines ->
_ | length allstrings - oldoffset < availablelines ->
length allstrings - availablelines
_ -> oldoffset
tweakfirst (x : xs)
@@ -263,7 +258,7 @@ enterCombineInv cfig w =
cm'
sss
where
cm' = IM.fromAscList $ zip [0 ..] $ combineList' w
cm' = IM.fromAscList $ zip [0 ..] $ combineList w
cm
| null cm' = IM.singleton 0 $ SelectionInfo ["No possible combinations"] 1 False white 0
| otherwise = cm'