diff --git a/ghcidOutput b/ghcidOutput index 1158ceb02..97c804e05 100644 --- a/ghcidOutput +++ b/ghcidOutput @@ -1 +1 @@ -All good (594 modules, at 18:51:13) +All good (594 modules, at 19:44:22) diff --git a/src/Dodge/Data/Input.hs b/src/Dodge/Data/Input.hs index ca42d6c35..50d24eb0f 100644 --- a/src/Dodge/Data/Input.hs +++ b/src/Dodge/Data/Input.hs @@ -27,7 +27,7 @@ data MouseContext , _mcoAboveSelect :: Maybe (Int,Int) , _mcoBelowSelect :: Maybe (Int,Int) } - | OverInvDragSelect { _mcoSelStart :: (Int,Int), _mcoSelEnd :: Maybe (Int,Int) } + | OverInvDragSelect { _mcoSecSelStart :: (Int,Int), _mcoSelEnd :: Maybe Int } | OverInvSelect { _mcoInvSelect :: (Int,Int)} | OverInvFilt { _mcoInvFilt :: (Int,Int)} | OverCombSelect { _mcoCombSelect :: (Int,Int)} diff --git a/src/Dodge/Render/HUD.hs b/src/Dodge/Render/HUD.hs index edbde5579..b829e4a22 100644 --- a/src/Dodge/Render/HUD.hs +++ b/src/Dodge/Render/HUD.hs @@ -144,8 +144,7 @@ drawDragSelected cfig w = do drawDragSelecting :: Configuration -> World -> Maybe Picture drawDragSelecting cfig w = do OverInvDragSelect (i, j) mselend <- w ^? input . mouseContext - (a, b) <- mselend - guard $ i == a + b <- mselend sss <- w ^? hud . hudElement . diSections let idp = invDisplayParams w let f x = selSecDrawCursorAt 15 idp BackdropCursor sss (i, x) diff --git a/src/Dodge/Update/Input/InGame.hs b/src/Dodge/Update/Input/InGame.hs index 420157547..89f0c1e65 100644 --- a/src/Dodge/Update/Input/InGame.hs +++ b/src/Dodge/Update/Input/InGame.hs @@ -93,7 +93,7 @@ updateMouseHeldInGame cfig w = case w ^. input . mouseContext of sss <- w ^? hud . hudElement . diSections let msel = inverseSelNumPos cfig ldp sss (w ^. input . mousePos) guard $ Just (fst sstart) == fmap fst msel || isNothing msel - return $ w & input . mouseContext . mcoSelEnd .~ msel + return $ w & input . mouseContext . mcoSelEnd .~ fmap snd msel OverInvDrag k mmouseover ab bn -> fromMaybe w $ do ss <- w ^? hud . hudElement . diSections . ix k . ssItems x <- mmouseover @@ -144,16 +144,13 @@ updateMouseReleaseInGame w = case w ^. input . mouseContext of & hud . hudElement . diSelection . _Just . _3 %~ getuniques (maybe mempty (h ssel) (guard (ssel ^? _1 == w ^? hud . hudElement . diSelection . _Just . _1) - >> mesel ^? _Just . _2)) - -- note this assumes that mesel isn't outside the first - -- selection, this should perhaps just be made impossible by - -- removing the first part of the tuple + >> mesel ^? _Just)) OverInvDragSelect _ Nothing -> w & input . mouseContext .~ MouseInGame & hud . hudElement . diSelection . _Just . _3 %~ const mempty OverInvDragSelect ssel (Just esel) -> w & input . mouseContext .~ MouseInGame - & augInvDirectSelect (f (min ssel esel) (h ssel (snd esel))) + & augInvDirectSelect (f (min ssel (fst ssel,esel)) (h ssel esel)) _ -> w where getuniques x y = IS.union x y IS.\\ IS.intersection x y @@ -173,7 +170,7 @@ updateMouseClickInGame cfig w = case w ^. input . mouseContext of w & input . mouseContext .~ OverInvDragSelect ysel Nothing OverInvSelect x | ScancodeLShift `M.member` (w ^. input . pressedKeys ) - -> w & input . mouseContext .~ OverInvDragSelect x (Just x) + -> w & input . mouseContext .~ OverInvDragSelect x (Just $ snd x) OverInvSelect x -> startDrag x cfig w OverTerminalReturn tmid -> terminalReturnEffect tmid w OverTerminalEscape ->