This commit is contained in:
2025-01-04 15:09:20 +00:00
parent 89eed0d059
commit 649fc35e32
4 changed files with 821954 additions and 175897 deletions
+7 -9
View File
@@ -37,7 +37,7 @@ updateCombinePositioning u =
u
& uvWorld . hud . hudElement . subInventory . ciSections
%~ updateCombineSections (_uvWorld u) (_uvConfig u)
& checkCombineSelectionExists
& uvWorld . hud . hudElement . subInventory %~ checkCombineSelectionExists
updateCombineSections ::
World ->
@@ -96,16 +96,14 @@ checkInventorySelectionExists u =
fromMaybe (1, -1, mempty) $
u ^? uvWorld . hud . hudElement . diSelection . _Just
checkCombineSelectionExists :: Universe -> Universe
checkCombineSelectionExists :: SubInventory -> SubInventory
checkCombineSelectionExists u = fromMaybe u $ do
sss <- u ^? uvWorld . hud . hudElement . subInventory . ciSections
(i, j, _) <-
u ^? uvWorld . hud . hudElement . subInventory . ciSelection . _Just
<|> Just (0, 0, mempty)
Just $ case u ^? uvWorld . hud . hudElement . subInventory . ciSections . ix i . ssItems . ix j of
sss <- u ^? ciSections
(i, j, _) <- u ^? ciSelection . _Just <|> Just (0, 0, mempty)
Just $ case u ^? ciSections . ix i . ssItems . ix j of
Nothing ->
u & uvWorld . hud . hudElement . subInventory . ciSelection ?~ (0, -1, mempty)
& uvWorld . hud . hudElement . subInventory . ciSelection
u & ciSelection ?~ (0, -1, mempty)
& ciSelection
%~ scrollSelectionSections (-1) sss
_ -> u