This commit is contained in:
2024-11-29 10:06:59 +00:00
parent 8d6b44e9f4
commit a9edab0e31
3 changed files with 5 additions and 14 deletions
+3 -1
View File
@@ -139,4 +139,6 @@ shoulderSH = translateSHz 20
drawEquipment :: Creature -> SPic drawEquipment :: Creature -> SPic
{-# INLINE drawEquipment #-} {-# INLINE drawEquipment #-}
drawEquipment cr = foldMap (itemEquipPict cr . fmap (\(a, b, _) -> CItem a b)) (invLDT $ _crInv cr) drawEquipment cr = foldMap
(itemEquipPict cr . fmap (\(a, b, _) -> CItem a b))
(invLDT $ _crInv cr)
-12
View File
@@ -308,7 +308,6 @@ updateSection indent mcsel sis availablelines oldoffset =
SelectionSection SelectionSection
{ _ssItems = sis { _ssItems = sis
, _ssOffset = offset , _ssOffset = offset
-- , _ssShownItems = tweakfirst shownitems
, _ssShownItems = tweakfirst . tweaklast . map snd , _ssShownItems = tweakfirst . tweaklast . map snd
$ take availablelines shownstrings $ take availablelines shownstrings
, _ssIndent = indent , _ssIndent = indent
@@ -334,22 +333,11 @@ updateSection indent mcsel sis availablelines oldoffset =
tweakfirst tweakfirst
| offset > 0 = ix 0 .~ color moreupcolor (text (replicate 15 (toEnum 30))) | offset > 0 = ix 0 .~ color moreupcolor (text (replicate 15 (toEnum 30)))
| otherwise = id | otherwise = id
-- tweakfirst (x : xs)
-- | offset > 0 =
-- color moreupcolor (text (replicate 15 (toEnum 30))) :
-- xs
-- | otherwise = x : xs
-- tweakfirst [] = []
moreupcolor = fromMaybe white $ allstrings ^? ix offset . _1 moreupcolor = fromMaybe white $ allstrings ^? ix offset . _1
tweaklast tweaklast
| length shownstrings > availablelines = ix (availablelines - 1) | length shownstrings > availablelines = ix (availablelines - 1)
.~ color moredowncolor (text . replicate 15 $ toEnum 31) .~ color moredowncolor (text . replicate 15 $ toEnum 31)
| otherwise = id | otherwise = id
-- shownitems
-- | length shownstrings > availablelines =
-- map snd (take (availablelines - 1) shownstrings)
-- ++ [color moredowncolor . text $ replicate 15 (toEnum 31)]
-- | otherwise = map snd shownstrings
moredowncolor = fromMaybe white $ allstrings ^? ix (offset + availablelines - 1) . _1 moredowncolor = fromMaybe white $ allstrings ^? ix (offset + availablelines - 1) . _1
allstrings = listSelectionColorPicture sis allstrings = listSelectionColorPicture sis
shownstrings = drop offset allstrings shownstrings = drop offset allstrings
+2 -1
View File
@@ -62,7 +62,8 @@ showAttachItem :: AttachType -> Item -> String
showAttachItem t itm = case t of showAttachItem t itm = case t of
ZOOMSCOPE -> "ZOOMSCOPE" ZOOMSCOPE -> "ZOOMSCOPE"
BULLETSYNTH -> "BSYNTH" BULLETSYNTH -> "BSYNTH"
REMOTESCREEN -> "REMOTE SCREEN " ++ show (itm ^? itUse . uaParams . apLinkedProjectile . _Just) REMOTESCREEN -> "REMOTE SCREEN " ++ maybe mempty show
(itm ^? itUse . uaParams . apLinkedProjectile . _Just)
HOMINGMODULE -> "HOMING MOD" HOMINGMODULE -> "HOMING MOD"
AUGMENTEDHUD -> "AUGMENTED HUD" AUGMENTEDHUD -> "AUGMENTED HUD"