Tweak shift selection

This commit is contained in:
2026-05-18 10:11:25 +01:00
parent b353263b0e
commit 6251e43db8
3 changed files with 8 additions and 8 deletions
-1
View File
@@ -203,7 +203,6 @@ multiSelScroll yi w
multiSelScroll' :: (Int -> IM.IntMap (SelectionItem ()) -> Maybe Int) -> World -> World
multiSelScroll' f w = fromMaybe w $ do
--Sel j i is <- w ^. hud . diSelection
Sel j i <- w ^. hud . diSelection
is <- w ^? hud . diSections . ix j . ssSet
ss <- w ^? hud . diSections . ix j . ssItems
+5 -4
View File
@@ -220,6 +220,7 @@ updateMouseClickInGame u = case w ^. input . mouseContext of
OverInvSelect x
| ScancodeLShift `M.member` (w ^. input . pressedKeys) ->
u & uvWorld . input . mouseContext .~ OverInvDragSelect (NonInf x)
& maybeselectselected x
OverInvSelect (-1, _)
| selsec == Just (-1) ->
u
@@ -276,6 +277,10 @@ updateMouseClickInGame u = case w ^. input . mouseContext of
w = u ^. uvWorld
f (x, y) = Sel x y
selsec = w ^? hud . diSelection . _Just . slSec
maybeselectselected (i,_) = fromMaybe id $ do
Sel i' j <- w ^. hud . diSelection
guard $ i' == i && w ^? hud . diSections . ix i . ssSet == Just (IS.empty)
return $ uvWorld . hud . diSections . ix i . ssSet .~ IS.singleton j
endRegex :: Int -> World -> Maybe Selection -> Maybe Selection
endRegex i w = ssSetCursor (ssLookupDown i j) sss
@@ -536,10 +541,6 @@ pauseGame u = u & uvScreenLayers .~ [pauseMenu u] & pauseSound
spaceAction :: World -> World
spaceAction w = case w ^. hud . subInventory of
NoSubInventory
| ScancodeCapsLock `M.member` (w ^. input . pressedKeys)
, Just (Sel 0 j) <- w ^. hud . diSelection
-> maybe id interactWithCloseObj (getCloseObj w) w
NoSubInventory -> maybe id interactWithCloseObj (getCloseObj w) w
_ -> w & hud . subInventory .~ NoSubInventory
+3 -3
View File
@@ -2878,7 +2878,7 @@ centroid src/Geometry/Polygon.hs 192;" f
centroidNum src/Geometry/Polygon.hs 195;" f
chainPairs src/Geometry.hs 360;" f
changeSwapOther src/Dodge/Inventory.hs 220;" f
changeSwapSel src/Dodge/Inventory.hs 189;" f
changeSwapSel src/Dodge/Inventory.hs 190;" f
changeSwapSelSet src/Dodge/Inventory.hs 125;" f
changeSwapWith src/Dodge/Inventory.hs 251;" f
charToTuple src/Picture/Base.hs 312;" f
@@ -4405,8 +4405,8 @@ multGunCrit src/Dodge/Creature.hs 68;" f
multiArrow src/Picture/Composite.hs 11;" f
multiLookupTrie src/SimpleTrie.hs 57;" f
multiLookupTrieI src/SimpleTrie.hs 66;" f
multiSelScroll src/Dodge/Inventory.hs 196;" f
multiSelScroll' src/Dodge/Inventory.hs 203;" f
multiSelScroll src/Dodge/Inventory.hs 197;" f
multiSelScroll' src/Dodge/Inventory.hs 204;" f
muout src/Dodge/RoomLink.hs 144;" f
muzFlareAt src/Dodge/HeldUse.hs 702;" f
muzzlePos src/Dodge/HeldUse.hs 787;" f