diff --git a/src/Dodge/Creature/Impulse/UseItem.hs b/src/Dodge/Creature/Impulse/UseItem.hs index 5b15bf1a2..cc8fe6ebe 100644 --- a/src/Dodge/Creature/Impulse/UseItem.hs +++ b/src/Dodge/Creature/Impulse/UseItem.hs @@ -55,7 +55,7 @@ itemEffect cr it w = case it ^. itUse of tryReload :: Creature -> Item -> Input -> (World -> World) -> World -> World tryReload cr it theinput f - | cid == 0 && itNeedsLoading it && _mouseButtons theinput M.!? SDL.ButtonLeft == Just 1 = + | cid == 0 && itNeedsLoading it && _mouseButtons theinput M.!? SDL.ButtonLeft == Just 0 = cWorld . lWorld . creatures . ix cid %~ crToggleReloading | otherwise = (runIdentity . pointerToItemLocation (_itLocation it) (return . (itUse . heldHammer .~ HammerDown))) diff --git a/src/Dodge/Event/Input.hs b/src/Dodge/Event/Input.hs index 331c34135..e1cc1ddd4 100644 --- a/src/Dodge/Event/Input.hs +++ b/src/Dodge/Event/Input.hs @@ -64,7 +64,7 @@ handleMouseButtonEvent :: MouseButtonEventData -> Input -> Input handleMouseButtonEvent mbev theinput = case mouseButtonEventMotion mbev of Released -> theinput & mouseButtons . at thebutton .~ Nothing Pressed -> theinput - & mouseButtons . at thebutton ?~ 1 + & mouseButtons . at thebutton ?~ 0 & clickPos . at thebutton ?~ (theinput ^. mousePos) -- note that mouse button down events are NOT repeating where diff --git a/src/Dodge/Update.hs b/src/Dodge/Update.hs index dec7a1adb..c2ce69301 100644 --- a/src/Dodge/Update.hs +++ b/src/Dodge/Update.hs @@ -91,7 +91,7 @@ updateUniverseFirst u = setClickWorldPos :: Universe -> M.Map MouseButton Point2 setClickWorldPos u = fmap (const (screenToWorldPos (u ^. uvWorld . wCam) (u ^. uvWorld . input . mousePos))) - (M.filter (== 1) $ u ^. uvWorld . input . mouseButtons) + (M.filter (== 0) $ u ^. uvWorld . input . mouseButtons) updateWorldEventFlags :: Universe -> Universe updateWorldEventFlags u = @@ -162,13 +162,13 @@ pauseTime itmloc w | justPressedButtonLeft || outofcharge = w & timeFlow .~ NormalTimeFlow | otherwise = w & pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix itmloc) . itUse . leftConsumption . wpCharge -~ 1 where - justPressedButtonLeft = w ^? input . mouseButtons . ix ButtonLeft == Just 1 + justPressedButtonLeft = w ^? input . mouseButtons . ix ButtonLeft == Just 0 outofcharge = maybe True (== 0) charge charge = w ^? pointerToItemLocation (w ^?! cWorld . lWorld . itemLocations . ix itmloc) . itUse . leftConsumption . wpCharge doItemTimeScroll :: Int -> World -> World doItemTimeScroll smoothing w = case w ^? input . mouseButtons . ix ButtonLeft of - Just 1 -> w & timeFlow .~ NormalTimeFlow + Just 0 -> w & timeFlow .~ NormalTimeFlow _ -> doTimeScroll smoothing w doTimeScroll :: Int -> World -> World diff --git a/src/Dodge/Update/Camera.hs b/src/Dodge/Update/Camera.hs index b9a89f1c2..2e12807d5 100644 --- a/src/Dodge/Update/Camera.hs +++ b/src/Dodge/Update/Camera.hs @@ -47,7 +47,7 @@ updateFloatingCamera cfig w = w translateFloatingCamera :: Input -> Camera -> Camera translateFloatingCamera theinput cam = fromMaybe cam $ do presstime <- theinput ^. mouseButtons . at ButtonLeft - guard $ presstime > 1 + guard $ presstime > 0 hpos <- theinput ^? heldPos . ix ButtonLeft let thetran = screenToWorldPos cam hpos diff --git a/src/Dodge/Update/Input/InGame.hs b/src/Dodge/Update/Input/InGame.hs index e8f0031d5..174c8313e 100644 --- a/src/Dodge/Update/Input/InGame.hs +++ b/src/Dodge/Update/Input/InGame.hs @@ -61,7 +61,7 @@ updateUseInputInGame u = case u ^. uvWorld . hud . hudElement of where w = u ^. uvWorld pkeys = u ^. uvWorld . input . pressedKeys - lbinitialpress = u ^? uvWorld . input . mouseButtons . ix ButtonLeft == Just 1 + lbinitialpress = u ^? uvWorld . input . mouseButtons . ix ButtonLeft == Just 0 updatePressedButtonsCarte :: World -> World updatePressedButtonsCarte w = updatePressedButtonsCarte' (_mouseButtons (_input w)) w @@ -152,7 +152,7 @@ doRegexInput u i sss any ((== Just InitialPress) . (`M.lookup` pkeys)) [ScancodeReturn, ScancodeSlash] - endmouse = (Just 1 == ) $ u ^? uvWorld . input . mouseButtons . ix ButtonLeft + endmouse = (Just 0 == ) $ u ^? uvWorld . input . mouseButtons . ix ButtonLeft backspacetonothing = sss ^? sssExtra . sssFilters . ix i . _Just == Just "" && ScancodeBackspace `M.lookup` pkeys == Just InitialPress diff --git a/src/Dodge/Update/Input/ScreenLayer.hs b/src/Dodge/Update/Input/ScreenLayer.hs index dfed78747..e0a562b57 100644 --- a/src/Dodge/Update/Input/ScreenLayer.hs +++ b/src/Dodge/Update/Input/ScreenLayer.hs @@ -60,12 +60,12 @@ mouseClickOptionsList :: ScreenLayer -> Universe -> Universe mouseClickOptionsList screen u = fromMaybe u $ do sl <- screen ^? scSelectionList Just $ case u ^. uvWorld . input . mouseButtons . at ButtonLeft of - Just 1 -> fromMaybe u $ do + Just 0 -> fromMaybe u $ do i <- sl ^. slSelPos f <- sl ^? slItems . ix i . siPayload . _1 return $ f u _ -> case u ^. uvWorld . input . mouseButtons . at ButtonRight of - Just 1 -> fromMaybe u $ do + Just 0 -> fromMaybe u $ do i <- sl ^. slSelPos f <- sl ^? slItems . ix i . siPayload . _2 return $ f u