Cleanup
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user