Allow for left click to start and pause reloading when aiming

This commit is contained in:
2022-06-22 18:18:25 +01:00
parent 3609bdb4fd
commit 4d1b5d3ca8
6 changed files with 20 additions and 15 deletions
+1 -3
View File
@@ -68,11 +68,9 @@ handleMouseMotionEvent mmev u = Just $ u & uvWorld . mousePos .~ V2
handleMouseButtonEvent :: MouseButtonEventData -> World -> World
handleMouseButtonEvent mbev = case mouseButtonEventMotion mbev of
Released -> mouseButtons . at thebutton .~ Nothing
Pressed -> handlePressedMouseButton thebutton . (mouseButtons . at thebutton %~ f)
Pressed -> handlePressedMouseButton thebutton . (mouseButtons . at thebutton ?~ False)
where
thebutton = mouseButtonEventButton mbev
f Nothing = Just False
f _ = Just True
{- | Sets window position in config. -}
handleWindowMoveEvent :: WindowMovedEventData -> Universe -> Maybe Universe