Tweak camera movement

This commit is contained in:
2024-12-31 09:54:57 +00:00
parent e12e4777b2
commit ede08ff1db
6 changed files with 79 additions and 79 deletions
+13 -7
View File
@@ -180,9 +180,13 @@ updateDisplaySections w cfig =
IM.fromDistinctAscList . zip [0 ..] $
mapMaybe (closeItemToSelectionItem w) (w ^. hud . closeItems)
invitems =
IM.mapWithKey
(\k (indent, x) -> invSelectionItem indent (w ^. cWorld . lWorld)
k (x ^. locLDT . ldtValue))
IM.map
( \(indent, x) ->
invSelectionItem
indent
(w ^. cWorld . lWorld)
(x ^. locLDT . ldtValue)
)
(fmap (first removeindentiffiltering) . allInvLocs $ _crInv cr)
removeindentiffiltering =
if maybe False (not . null) (w ^? hud . hudElement . diInvFilter . _Just)
@@ -309,8 +313,9 @@ updateSection indent mcsel sis availablelines oldoffset =
SelectionSection
{ _ssItems = sis
, _ssOffset = offset
, _ssShownItems = tweakfirst . tweaklast . map snd
$ take availablelines shownstrings
, _ssShownItems =
tweakfirst . tweaklast . map snd $
take availablelines shownstrings
, _ssIndent = indent
}
where
@@ -331,12 +336,13 @@ updateSection indent mcsel sis availablelines oldoffset =
| length allstrings - oldoffset < availablelines ->
length allstrings - availablelines
_ -> oldoffsetbounded
tweakfirst
tweakfirst
| offset > 0 = ix 0 .~ color moreupcolor (text (replicate 15 (toEnum 30)))
| otherwise = id
moreupcolor = fromMaybe white $ allstrings ^? ix offset . _1
tweaklast
| length shownstrings > availablelines = ix (availablelines - 1)
| length shownstrings > availablelines =
ix (availablelines - 1)
.~ color moredowncolor (text . replicate 15 $ toEnum 31)
| otherwise = id
moredowncolor = fromMaybe white $ allstrings ^? ix (offset + availablelines - 1) . _1