Simplify check if inventory selection exists
This commit is contained in:
@@ -92,11 +92,12 @@ updateInventoryPositioning u =
|
||||
|
||||
-- this is possibly not completely correct
|
||||
checkInventorySelectionExists :: Universe -> Universe
|
||||
checkInventorySelectionExists u = fromMaybe u $ do
|
||||
(i, j,_) <- (u ^? uvWorld . hud . hudElement . diSelection . _Just) <|> Just (0, -1, mempty)
|
||||
Just $ case u ^? uvWorld . hud . hudElement . diSections . ix i . ssItems . ix j of
|
||||
checkInventorySelectionExists u = case u ^? uvWorld . hud . hudElement . diSections . ix i . ssItems . ix j of
|
||||
Nothing -> u & uvWorld %~ scrollAugNextInSection
|
||||
_ -> u
|
||||
where
|
||||
(i,j,_) = fromMaybe (0,-1,mempty)
|
||||
$ u ^? uvWorld . hud . hudElement . diSelection . _Just
|
||||
|
||||
checkCombineSelectionExists :: Universe -> Universe
|
||||
checkCombineSelectionExists u = fromMaybe u $ do
|
||||
|
||||
Reference in New Issue
Block a user