Start adding filters to selection lists

This commit is contained in:
2023-01-15 11:55:32 +00:00
parent 6f1162f7b9
commit 64b1c2761e
16 changed files with 128 additions and 66 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ loadingScreen str = OptionScreen
, _scOffset = 0
, _scPositionedMenuOption = NoPositionedMenuOption
, _scOptionFlag = LoadingScreen
, _scSelectionList = SelectionList [] Nothing 0
, _scSelectionList = SelectionList [] Nothing 0 "" False
, _scAvailableLines = 0
, _scListDisplayParams = optionListDisplayParams
}
+5 -3
View File
@@ -66,6 +66,8 @@ makeOptionsSelectionList maxlines mselpos u mos pmo =
{ _slItems = optionsToSelections maxlines u mos pmo
, _slSelPos = mselpos
, _slLength = length $ optionsToSelections maxlines u mos pmo
, _slRegex = ""
, _slRegexInput = False
}
optionsToSelections :: Int -> Universe -> [MenuOption] -> PositionedMenuOption -> [SelectionItem (Universe -> Universe)]
@@ -101,7 +103,7 @@ cycleOptions u = fromMaybe u $ do
colStrToSelItem :: (Color, String) -> SelectionItem (Universe -> Universe)
colStrToSelItem (col, str) =
SelectionItem
{ _siPictures = [color col $ text str]
{ _siPictures = [str]
, _siHeight = 1
, _siIsSelectable = True
, _siWidth = length str
@@ -118,11 +120,11 @@ optionValueOffset u mo = case _moString mo u of
menuOptionToSelectionItem :: Universe -> Int -> MenuOption -> SelectionItem (Universe -> Universe)
menuOptionToSelectionItem w padAmount mo =
SelectionItem
{ _siPictures = [color thecol $ text optionText]
{ _siPictures = [optionText]
, _siHeight = 1
, _siIsSelectable = isselectable
, _siWidth = length optionText
, _siColor = white
, _siColor = thecol
, _siOffX = 0
, _siPayload = f
}