Allow scrolling within a larger selection to not remove larger selection
This commit is contained in:
@@ -59,7 +59,8 @@ tryPutItemInInv cid flit w = case maybeInvSlot of
|
||||
& cWorld . lWorld %~ crUpdateItemLocations cid
|
||||
)
|
||||
where
|
||||
updateselectionextra | cid == 0 = hud . hudElement . diSelectionExtra .~ mempty
|
||||
updateselectionextra | cid == 0
|
||||
= hud . hudElement . diSelection . _Just . _3 %~ const mempty
|
||||
| otherwise = id
|
||||
it = _flIt flit
|
||||
maybeInvSlot = checkInvSlotsYou it w
|
||||
|
||||
@@ -83,7 +83,7 @@ setInvPosFromSS w =
|
||||
& cWorld . lWorld . creatures . ix 0 . crManipulation . manObject .~ thesel
|
||||
where
|
||||
thesel = fromMaybe SelNothing $ do
|
||||
(i, j) <- w ^? hud . hudElement . diSelection . _Just
|
||||
(i, j, _) <- w ^? hud . hudElement . diSelection . _Just
|
||||
case i of
|
||||
(-1) -> Just SortInventory
|
||||
0 -> do
|
||||
|
||||
@@ -27,8 +27,8 @@ swapInvItems f i w = fromMaybe w $ do
|
||||
ss <- w ^? hud . hudElement . diSections . ix 0 . ssItems
|
||||
k <- f i ss
|
||||
let updateselection = case w ^? hud . hudElement . diSelection . _Just of
|
||||
Just (0, j) | j == k -> hud . hudElement . diSelection . _Just . _2 .~ i
|
||||
Just (0, j) | j == i -> hud . hudElement . diSelection . _Just . _2 .~ k
|
||||
Just (0, j,_) | j == k -> hud . hudElement . diSelection . _Just . _2 .~ i
|
||||
Just (0, j,_) | j == i -> hud . hudElement . diSelection . _Just . _2 .~ k
|
||||
_ -> id
|
||||
return $
|
||||
w
|
||||
@@ -71,11 +71,11 @@ swapInvItems f i w = fromMaybe w $ do
|
||||
|
||||
swapAnyExtraSelection :: Int -> Int -> World -> World
|
||||
swapAnyExtraSelection i k w = fromMaybe w $ do
|
||||
is <- w ^? hud . hudElement . diSelectionExtra
|
||||
is <- w ^? hud . hudElement . diSelection . _Just . _3
|
||||
let f = if i `IS.member` is then IS.insert k else id
|
||||
g = if k `IS.member` is then IS.insert i else id
|
||||
return $
|
||||
w & hud . hudElement . diSelectionExtra
|
||||
w & hud . hudElement . diSelection . _Just . _3
|
||||
%~ (f . g . IS.delete i . IS.delete k)
|
||||
|
||||
checkConnection :: SoundOrigin -> SoundID -> Int -> Int -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user