Improve jump to hotkey
This commit is contained in:
+15
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user