Implement generalised storing of position for mouse presses
This commit is contained in:
@@ -121,11 +121,12 @@ pressedMBEffectsTopInventory pkeys w
|
||||
| isDown SDL.ButtonLeft && inTopInv = doTopInvLeftClick (you w) w
|
||||
| isDown SDL.ButtonMiddle =
|
||||
w & wCam . camRot -~ rotation
|
||||
& input . clickMousePos .~ _mousePos (_input w)
|
||||
| otherwise = w
|
||||
where
|
||||
inTopInv = case w ^. hud . hudElement of
|
||||
DisplayInventory {_subInventory = NoSubInventory} -> True
|
||||
_ -> False
|
||||
isDown but = but `M.member` pkeys
|
||||
rotation = angleBetween (_mousePos (_input w)) (_clickMousePos (_input w))
|
||||
theinput = w ^. input
|
||||
rotation = fromMaybe 0
|
||||
$ angleBetween (theinput ^. mousePos) <$> (theinput ^. heldPos . at SDL.ButtonMiddle)
|
||||
|
||||
Reference in New Issue
Block a user