Count mouse button press time up from 0
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user