Rethink unselectable items in lists
This commit is contained in:
+4
-1
@@ -100,15 +100,18 @@ mouseClickOptionsList screen u = fromMaybe u $ do
|
||||
Just False -> fromMaybe u $ do
|
||||
i <- sl ^. slSelPos
|
||||
f <- sl ^? slItems . ix i . siPayload
|
||||
--f <- sl ^? slItems . ix i . siPayload
|
||||
return $ f u
|
||||
_ -> u
|
||||
|
||||
mouseOverSelectionList :: ListDisplayParams -> SelectionList (Universe -> Universe) -> Universe -> Universe
|
||||
mouseOverSelectionList ldps sl u
|
||||
| x > xl && x < xr && ylower == yupper && mmoving
|
||||
&& ylower >= 0 && ylower < ymax = u & uvScreenLayers . _head . scSelectionList . slSelPos ?~ yupper
|
||||
&& ylower >= 0 && ylower < ymax && isselectable = u & uvScreenLayers . _head . scSelectionList . slSelPos ?~ yupper
|
||||
| otherwise = u
|
||||
where
|
||||
isselectable = fromMaybe False
|
||||
$ u ^? uvScreenLayers . _head . scSelectionList . slItems . ix yupper . siIsSelectable
|
||||
ymax = maybe 0 length $ sl ^? slItems
|
||||
mmoving = u ^. uvWorld . input . mouseMoving
|
||||
ylower = ceiling $ (hh - (75 + y + _ldpPosY ldps)) / 50
|
||||
|
||||
Reference in New Issue
Block a user