From a05511f6d813dd42e114b18e2d1833610df6f3fc Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 20 Nov 2024 16:52:03 +0000 Subject: [PATCH] Use IntSet for extra selection items --- ghcidOutput | 2 +- src/Dodge/TestString.hs | 6 ++++-- src/Dodge/Update/Input/InGame.hs | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ghcidOutput b/ghcidOutput index cc0e7d04f..b0ffe0a97 100644 --- a/ghcidOutput +++ b/ghcidOutput @@ -1 +1 @@ -All good (594 modules, at 16:13:14) +All good (594 modules, at 16:52:02) diff --git a/src/Dodge/TestString.hs b/src/Dodge/TestString.hs index 2601159b6..b0c32c433 100644 --- a/src/Dodge/TestString.hs +++ b/src/Dodge/TestString.hs @@ -21,8 +21,10 @@ import Dodge.Data.Universe import qualified IntMapHelp as IM testStringInit :: Universe -> [String] -testStringInit u = [show $ - u ^? uvWorld . input . mouseContext . mcoSelEnd +testStringInit u = + [ show $ u ^? uvWorld . input . mouseContext . mcoSelEnd + , show $ u ^? uvWorld . hud . hudElement . diSelection + , show $ u ^? uvWorld . hud . hudElement . diSelectionExtra ] -- fmap show $ u ^.. uvWorld . cWorld . lWorld . creatures . ix 0 . crInv . each . itLocation . ilIsRoot -- , show . fmap (fmap _siPictures) $ u ^? uvWorld . hud . hudElement . diSections . ix (-1) . ssItems diff --git a/src/Dodge/Update/Input/InGame.hs b/src/Dodge/Update/Input/InGame.hs index c287f41f8..ef7781bb4 100644 --- a/src/Dodge/Update/Input/InGame.hs +++ b/src/Dodge/Update/Input/InGame.hs @@ -123,6 +123,9 @@ updateMouseReleaseInGame w = case w ^. input . mouseContext of OverInvDrag mpos -> fromMaybe (dropSelected w & input . mouseContext .~ MouseInGame) $ do j <- mpos return $ w & input . mouseContext .~ OverInvSelect (0,j) + OverInvDragSelect _ Nothing -> + w & input . mouseContext .~ MouseInGame + & hud . hudElement . diSelectionExtra .~ mempty OverInvDragSelect ssel (Just esel) -> w & input . mouseContext .~ MouseInGame & hud . hudElement . diSelectionExtra