Move selection list offset into option screen data structure

This commit is contained in:
2022-12-22 10:27:01 +00:00
parent 91d65094c9
commit a8fa1e9949
7 changed files with 14 additions and 11 deletions
+2 -2
View File
@@ -103,7 +103,7 @@ mouseClickOptionsList mos sl u = case u ^. uvWorld . input . mouseButtons . at B
ScrollSelectionItem -> do
maxlines <- sl ^? slSizeRestriction . maxSelectionLines
alllines <- sl ^? slLength
Just $ uvScreenLayers . _head . scSelectionList . slOffset %~
Just $ uvScreenLayers . _head . scOffset %~
(\x -> if x + maxlines - 2 >= alllines then 0 else x + maxlines - 2)
SpecialSelectionItem -> Just id
_ -> u
@@ -155,7 +155,7 @@ optionScreenUpdate mos mop _ sl u =
. mouseOverSelectionList sl
. menuWheelEvents
. over (uvScreenLayers . _head . scSelectionList) (setSelectionListRestriction cfig)
$ over (uvScreenLayers . _head . scSelectionList) setShownSelectionItems
$ over (uvScreenLayers . _head) setShownSelectionItems
u
where
cfig = u ^. uvConfig