Make inventory cursor change when dropping items sensible
This commit is contained in:
@@ -5,6 +5,7 @@ module Dodge.DisplayInventory (
|
||||
updateCombinePositioning,
|
||||
) where
|
||||
|
||||
import Dodge.Inventory
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
@@ -79,8 +80,13 @@ updateInventoryPositioning u =
|
||||
%~ updateDisplaySections (_uvWorld u) (_uvConfig u)
|
||||
& checkInventorySelectionExists
|
||||
|
||||
-- this is possibly not completely correct
|
||||
checkInventorySelectionExists :: Universe -> Universe
|
||||
checkInventorySelectionExists u = u
|
||||
checkInventorySelectionExists u = fromMaybe u $ do
|
||||
(i,j) <- u ^? uvWorld . hud . hudElement . diSelection . _Just
|
||||
Just $ case u ^? uvWorld . hud . hudElement . diSections . ix i . ssItems . ix j of
|
||||
Nothing -> u & uvWorld %~ scrollAugNextInSection
|
||||
_ -> u
|
||||
|
||||
updateDisplaySections ::
|
||||
World ->
|
||||
|
||||
Reference in New Issue
Block a user