Allow to change menu options with rclick, move towards shader experiment
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user