Cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user