Allow for inventory item bolding

This commit is contained in:
2025-12-09 22:46:57 +00:00
parent bf8c538491
commit 851b26262a
18 changed files with 274 additions and 225 deletions
+10 -7
View File
@@ -65,7 +65,7 @@ updateCombineSections w cfig =
sclose'
| null sclose =
IM.singleton 0 $
SelItem ["NONE"] 1 25 False white 2 Nothing
SelItem ["NONE"] 1 25 False white 2 Nothing NoSIDisplayMod
| otherwise = sclose
regexCombs :: IM.IntMap Item -> SelectionItem CombItem -> String -> Bool
@@ -124,7 +124,7 @@ updateDisplaySections w cfig =
[ sfinv
, sinv
, IM.singleton 0 $
SelItem [displayFreeSlots (crNumFreeSlots (w ^. cWorld . lWorld . items) cr)] 1 15 True invDimColor 2 Nothing
SelItem [displayFreeSlots (crNumFreeSlots (w ^. cWorld . lWorld . items) cr)] 1 15 True invDimColor 2 Nothing NoSIDisplayMod
, sfclose
, sclose
, interfaceshead
@@ -144,7 +144,7 @@ updateDisplaySections w cfig =
btitems =
IM.fromDistinctAscList . zip [0 ..] $
mapMaybe (closeButtonToSelectionItem w) (w ^. hud . closeButtons)
makehead str = IM.singleton 0 $ SelItem [str] 1 15 False white 0 Nothing
makehead str = IM.singleton 0 $ SelItem [str] 1 15 False white 0 Nothing NoSIDisplayMod
cr = you w
closeitms =
IM.fromDistinctAscList . zip [0 ..] $
@@ -165,7 +165,7 @@ filterSectionsPair infocus filtfn itms s mfilt = (x, itms')
where
filtcurs = if infocus then cFilledRect else cWireRect
x = IM.singleton 0 $
fromMaybe (SelItem [s] 1 (length s) False white 0 Nothing) $ do
fromMaybe (SelItem [s] 1 (length s) False white 0 Nothing NoSIDisplayMod) $ do
str <- mfilt
return $
SelItem
@@ -176,6 +176,7 @@ filterSectionsPair infocus filtfn itms s mfilt = (x, itms')
white
0
Nothing
NoSIDisplayMod
f y = y
-- | null y =
-- IM.singleton 0 $ SelItem ["(NONE)"] 1 (length s) True (greyN 0.5) 0 Nothing
@@ -293,8 +294,7 @@ updateSection indent mcsel sis availablelines oldoffset =
| otherwise = id
tweaklast
| aslength - offset > availablelines =
ix (availablelines - 1)
.~ color white (text . replicate 15 $ toEnum 31)
ix (availablelines - 1) .~ color white (text . replicate 15 $ toEnum 31)
| otherwise = id
(allstrings, Sum aslength) = foldMap listSelectionColorPicture sis
shownstrings = drop offset allstrings
@@ -302,7 +302,10 @@ updateSection indent mcsel sis availablelines oldoffset =
listSelectionColorPicture :: SelectionItem a -> ([Picture], Sum Int)
listSelectionColorPicture si = (g <$> _siPictures si, Sum $ _siHeight si)
where
g = translate lindent 0 . color (_siColor si) . text
textf = case si ^. siDisplayMod of
NoSIDisplayMod -> text
HighlightSI -> hackBoldText
g = translate lindent 0 . color (_siColor si) . textf
lindent = 100 * fromIntegral (_siOffX si)
regexList :: String -> [String] -> Bool