Allow to change menu options with rclick, move towards shader experiment

This commit is contained in:
2023-02-24 15:03:06 +00:00
parent 774316372f
commit ed9a46a18d
9 changed files with 71 additions and 42 deletions
+11 -4
View File
@@ -38,7 +38,7 @@ optionScreenUpdate ::
ScreenLayer ->
PositionedMenuOption ->
ListDisplayParams ->
SelectionList (Universe -> Universe) ->
SelectionList (Universe -> Universe,Universe -> Universe) ->
Universe ->
Universe
optionScreenUpdate screen mop ldps sl u =
@@ -55,17 +55,24 @@ optionScreenDefaultEffect f u = case u ^. uvWorld . input . pressedKeys . at Sca
Just InitialPress -> fromMaybe id (f ^? pmoMenuOption . moEff) u
_ -> u
-- ouch this is not good
mouseClickOptionsList :: ScreenLayer -> Universe -> Universe
mouseClickOptionsList screen u = fromMaybe u $ do
sl <- screen ^? scSelectionList
Just $ case u ^. uvWorld . input . mouseButtons . at ButtonLeft of
Just False -> fromMaybe u $ do
i <- sl ^. slSelPos
f <- sl ^? slItems . ix i . siPayload
f <- sl ^? slItems . ix i . siPayload . _1
return $ f u
_ -> u
_ -> case u ^. uvWorld . input . mouseButtons . at ButtonRight of
Just False -> fromMaybe u $ do
i <- sl ^. slSelPos
f <- sl ^? slItems . ix i . siPayload . _2
return $ f u
_ -> u
mouseOverSelectionList :: ListDisplayParams -> SelectionList (Universe -> Universe) -> Universe -> Universe
mouseOverSelectionList :: ListDisplayParams
-> SelectionList a -> Universe -> Universe
mouseOverSelectionList ldps sl u
| x > xl && x < xr
&& ylower == yupper