Prevent bug on shift selecting from outside selection lists

This commit is contained in:
2024-11-25 18:53:27 +00:00
parent 79bc3b2ddf
commit 51caf936f4
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
All good (594 modules, at 18:28:59)
All good (594 modules, at 18:51:13)
+3 -1
View File
@@ -142,7 +142,9 @@ updateMouseReleaseInGame w = case w ^. input . mouseContext of
OverInvDragSelect ssel mesel | ScancodeLShift `M.member` (w ^. input . pressedKeys)
-> w & input . mouseContext .~ MouseInGame
& hud . hudElement . diSelection . _Just . _3 %~ getuniques
(maybe mempty (h ssel) (mesel ^? _Just . _2))
(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