Cleanup
This commit is contained in:
@@ -140,11 +140,6 @@ setPixelOffsetBounded cfig (V2 x y) ldp = ldp & ldpPos . spPixelOff .~ V2 x' y'
|
||||
$ max (1+20*(ldp^.ldpVerticalGap + ldp^?!ldpSize._Just._y.to fromIntegral)-h*b) y
|
||||
V2 a b = ldp ^. ldpPos . spScreenOff
|
||||
|
||||
--leftHeldPosShift :: World -> Point2
|
||||
--leftHeldPosShift w = fromMaybe 0 $ do
|
||||
-- p <- w ^? input . heldPos . ix SDL.ButtonLeft
|
||||
-- return $ w ^. input . mousePos - p
|
||||
|
||||
doDrag :: Config -> Int -> Int -> Maybe (Int, Int) -> World -> World
|
||||
doDrag cfig n k mmouseover w = fromMaybe w $ do
|
||||
guard (n /= 0)
|
||||
|
||||
@@ -69,17 +69,13 @@ optionScreenDefaultEffect u = fromMaybe u $ do
|
||||
-- ouch this is not good
|
||||
mouseClickOptionsList :: Universe -> Universe
|
||||
mouseClickOptionsList u = fromMaybe u $ do
|
||||
sl <- u ^? uvScreenLayers . ix 0 . scSelectionList
|
||||
case u ^. uvWorld . input . mouseButtons of
|
||||
mbs | mbs ^. at ButtonLeft == Just 0 -> do
|
||||
i <- u ^? uvWorld . input . mouseContext . mcoMenuClick
|
||||
f <- sl ^? ix i . siPayload . _Just . _1
|
||||
return $ f u & uvSoundQueue .:~ click1S
|
||||
mbs | mbs ^. at ButtonRight == Just 0 -> do
|
||||
i <- u ^? uvWorld . input . mouseContext . mcoMenuClick
|
||||
f <- sl ^? ix i . siPayload . _Just . _2
|
||||
return $ f u & uvSoundQueue .:~ click1S
|
||||
l <- case u ^. uvWorld . input . mouseButtons of
|
||||
mbs | mbs ^. at ButtonLeft == Just 0 -> Just _1
|
||||
mbs | mbs ^. at ButtonRight == Just 0 -> Just _2
|
||||
_ -> Nothing
|
||||
i <- u ^? uvWorld . input . mouseContext . mcoMenuClick . _Just
|
||||
f <- u ^? uvScreenLayers . ix 0 . scSelectionList . ix i . siPayload . _Just . l
|
||||
return $ f u & uvSoundQueue .:~ click1S
|
||||
|
||||
ldpSelection :: Config -> LDParams -> Point2 -> Maybe Int
|
||||
ldpSelection cfig ldp (V2 _ y)
|
||||
|
||||
Reference in New Issue
Block a user