Rethink unselectable items in lists

This commit is contained in:
2022-12-25 11:39:47 +00:00
parent a3162e8f9c
commit 3de16cbd1a
4 changed files with 14 additions and 34 deletions
+4 -1
View File
@@ -109,13 +109,16 @@ menuOptionToSelectionItem :: Universe -> Int -> MenuOption -> SelectionItem (Uni
menuOptionToSelectionItem w padAmount mo = SelectionItem
{ _siPictures = [color thecol $ text optionText]
, _siHeight = 1
, _siIsSelectable = True
, _siIsSelectable = isselectable
, _siWidth = length optionText
, _siColor = white
, _siOffX = 0
, _siPayload = f
}
where
isselectable = case _moString mo w of
MODBlockedString{} -> False
_ -> True
f = fromMaybe id $ mo ^? moEff
thecol = case _moString mo w of
MODBlockedString{} -> greyN 0.5