Tweak inventory display

This commit is contained in:
2025-01-05 15:55:34 +00:00
parent 2f30163c2f
commit ba5c6178c6
2 changed files with 4 additions and 6 deletions
+2 -4
View File
@@ -296,10 +296,8 @@ updateSection indent mcsel sis availablelines oldoffset =
SelectionSection SelectionSection
{ _ssItems = sis { _ssItems = sis
, _ssOffset = offset , _ssOffset = offset
, _ssShownItems = , _ssShownItems = shownitems
tweakfirst . tweaklast . map (^. _2) $ , _ssShownLength = min aslength availablelines
take availablelines shownstrings
, _ssShownLength = length shownitems
, _ssIndent = indent , _ssIndent = indent
} }
where where
+2 -2
View File
@@ -196,12 +196,12 @@ selSecYint i j sss = do
. fst . fst
$ IM.split j (ss ^. ssItems) $ IM.split j (ss ^. ssItems)
where where
secpos = sum . fmap (length . _ssShownItems) . fst $ IM.split i sss secpos = sum . fmap _ssShownLength . fst $ IM.split i sss
inverseSelSecYint :: Int -> IM.IntMap (SelectionSection a) -> Maybe (Int, Int) inverseSelSecYint :: Int -> IM.IntMap (SelectionSection a) -> Maybe (Int, Int)
inverseSelSecYint yint sss = do inverseSelSecYint yint sss = do
((i, ss), othersss) <- IM.minViewWithKey sss ((i, ss), othersss) <- IM.minViewWithKey sss
let l = length $ _ssShownItems ss let l = _ssShownLength ss
if l <= yint if l <= yint
then inverseSelSecYint (yint - l) othersss then inverseSelSecYint (yint - l) othersss
else do else do