Improve jump to hotkey

This commit is contained in:
2025-06-01 09:44:03 +01:00
parent 39753755af
commit 59e1207b46
3 changed files with 20 additions and 7 deletions
+15 -3
View File
@@ -4,7 +4,8 @@ module Dodge.Inventory (
destroyInvItem,
updateCloseObjects,
changeSwapSel,
augInvDirectSelect,
invSetSelection,
invSetSelectionPos,
scrollAugInvSel,
crNumFreeSlots,
setInvPosFromSS,
@@ -176,14 +177,25 @@ changeSwapWith f w = case w ^? hud . hudElement . diSelection . _Just of
Just (5, i, _) -> w & changeSwapOther ispCloseButton 5 f i
_ -> w
augInvDirectSelect :: (Int, Int, IS.IntSet) -> World -> World
augInvDirectSelect sel w =
invSetSelection :: (Int, Int, IS.IntSet) -> World -> World
invSetSelection sel w =
w
& hud . hudElement . diSelection ?~ sel
& worldEventFlags . at InventoryChange ?~ ()
& setInvPosFromSS
& cWorld . lWorld %~ crUpdateItemLocations 0
invSetSelectionPos :: Int -> Int -> World -> World
invSetSelectionPos i j w =
w
& hud . hudElement . diSelection %~ f
& worldEventFlags . at InventoryChange ?~ ()
& setInvPosFromSS
& cWorld . lWorld %~ crUpdateItemLocations 0
where
f Nothing = Just (i,j,mempty)
f (Just (_,_,s)) = Just (i,j,s)
scrollAugInvSel :: Int -> World -> World
scrollAugInvSel yi w
| yi == 0 = w