Add cursor at end of input filters

This commit is contained in:
2024-11-02 21:56:28 +00:00
parent a25b62d77f
commit 7bafb1e9e6
6 changed files with 18 additions and 6 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+1 -1
View File
@@ -1 +1 @@
All good (594 modules, at 02:32:29)
All good (594 modules, at 21:55:11)
+15 -4
View File
@@ -47,8 +47,12 @@ updateCombineSections w cfig =
(getAvailableListLines secondColumnParams cfig)
[(0, sclose), (-1, sfclose)]
where
filtcurs = case w ^? hud . hudElement . subInventory . ciSelection . _Just . _1 of
Just (-1) -> [toEnum 219] -- filled rect
_ -> [toEnum 128] -- wire rect
(sfclose, sclose) =
filterSectionsPair
filtcurs
(flip . andOrRegex $ regexCombs invitms)
(IM.fromDistinctAscList . zip [0 ..] $ combineList w)
"COMBINATIONS"
@@ -106,12 +110,18 @@ updateDisplaySections w cfig =
Just (2, _) -> reverse [filtinv, filtclose, closex, invx, youx]
Just (3, _) -> reverse [filtinv, filtclose, closex, invx, youx]
_ -> reverse [filtinv, filtclose, invx, closex, youx]
invfiltcurs = case mselpos ^? _Just . _1 of
Just (-1) -> [toEnum 219] -- filled rect
_ -> [toEnum 128] -- wire rect
(sfinv, sinv) =
filterSectionsPair plainRegex invitems "INVENTORY" $
filterSectionsPair invfiltcurs plainRegex invitems "INVENTORY" $
w ^? hud . hudElement . diInvFilter . _Just
(filtinv, invx) = ((-1, sfinv), (0, sinv))
closefiltcurs = case mselpos ^? _Just . _1 of
Just (2) -> [toEnum 219] -- filled rect
_ -> [toEnum 128] -- wire rect
(sfclose, sclose) =
filterSectionsPair plainRegex closeitms "NEARBY" $
filterSectionsPair closefiltcurs plainRegex closeitms "NEARBY" $
w ^? hud . hudElement . diCloseFilter . _Just
(filtclose, closex) = ((2, sfclose), (3, sclose))
youx = (1, youitems)
@@ -143,12 +153,13 @@ updateDisplaySections w cfig =
-- numfiltitems = " " ++ show (length itms - length itms') ++ " FILTERED"
filterSectionsPair ::
String -> -- string at the end of the input
(String -> SelectionItem a -> Bool) ->
IM.IntMap (SelectionItem a) ->
String ->
Maybe String ->
(IM.IntMap (SelectionItem a), IM.IntMap (SelectionItem a))
filterSectionsPair filtfn itms filtdescription mfilt =
filterSectionsPair endstr filtfn itms filtdescription mfilt =
( filtsis
, itms'
)
@@ -159,7 +170,7 @@ filterSectionsPair filtfn itms filtdescription mfilt =
IM.singleton
0
$ SelectionInfo
[filtdescription ++ " FILTER: " ++ str, numfiltitems]
[filtdescription ++ " FILTER:" ++ str ++ endstr, numfiltitems]
2
True
white
+1
View File
@@ -24,6 +24,7 @@ testStringInit :: Universe -> [String]
testStringInit u = [show $ u ^? uvWorld . hud . hudElement . diSelection . _Just
, show $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crManipulation . manObject
]
-- <> [[toEnum (i+j * 32) | i <- [0..31]] | j <- [0..7]]
-- <> map show (IM.elems (L.postscan (L.premap _siHeight L.sum)
-- $ fromMaybe mempty $ u ^? uvWorld . hud . hudElement . diSections . sssSections . ix 0 . ssItems)
-- )
+1 -1
View File
@@ -95,7 +95,7 @@ preloadRender = do
-- initTexture2DArray 50 "data/texture/charMapVertBig.png" 2 32 64 95 GL_NEAREST_MIPMAP_LINEAR GL_LINEAR
--initTexture2DArray 50 "data/texture/charMapVert16Block.png" 2 16 32 95 GL_NEAREST GL_NEAREST
--initTexture2DArray 50 "data/charMaps/charMapVert16Tall.png" 2 16 32 95 GL_NEAREST GL_NEAREST
initTexture2DArray 50 "data/charMaps/cMap16x32.CodePage437.png" 2 16 32 255 GL_NEAREST GL_NEAREST
initTexture2DArray 50 "data/charMaps/cMap16x32.Custom.png" 2 16 32 256 GL_NEAREST GL_NEAREST
--initTexture2DArray 50 "data/texture/charMapVert8Block.png" 2 8 16 95 GL_NEAREST GL_NEAREST
--initTexture2DArray 50 "data/texture/charMapVertBig.png" 2 32 64 95 GL_LINEAR_MIPMAP_LINEAR GL_LINEAR
--initTexture2DArray 50 "data/texture/charMapVertBig.png" 2 32 64 95 GL_LINEAR_MIPMAP_NEAREST GL_LINEAR