Click on combine filter jumps to combination

This commit is contained in:
2024-11-26 12:05:19 +00:00
parent a4d95c5bd5
commit e33fed2239
2 changed files with 62 additions and 49 deletions
+12
View File
@@ -191,6 +191,7 @@ updateMouseClickInGame cfig w = case w ^. input . mouseContext of
OverCombFilter ->
w & hud . hudElement . subInventory . ciFilter .~ Nothing
& worldEventFlags . at CombineInventoryChange ?~ ()
& hud . hudElement . subInventory . ciSelection %~ endCombineRegex w
OverCombCombine x ->
w
& tryCombine x
@@ -232,6 +233,17 @@ endRegex i w = fromMaybe id $ do
return k
return $ ssSetCursor (ssLookupDown i j) sss
endCombineRegex ::World
-> Maybe (Int,Int,IS.IntSet)
-> Maybe (Int,Int,IS.IntSet)
endCombineRegex w = fromMaybe id $ do
sss <- w ^? hud . hudElement . subInventory . ciSections
let j = fromMaybe 0 $ do
itms <- sss ^? ix 0 . ssItems
(k,_) <- IM.lookupMin itms
return (k-1)
return $ ssSetCursor (ssLookupDown 0 j) sss
startDrag :: (Int, Int) -> Configuration -> World -> World
startDrag (a, b) cfig w = setcontext
. fromMaybe (augInvDirectSelect (a, b, IS.singleton b) w) $ do