Continue inventory refactor
This commit is contained in:
+10
-1
@@ -4,6 +4,7 @@ module Dodge.Render.HUD (
|
||||
drawHUD,
|
||||
) where
|
||||
|
||||
import NewInt
|
||||
import Control.Applicative
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
@@ -217,7 +218,15 @@ floorItemPickupInfo n itm
|
||||
yourAugmentedItem :: (Item -> a) -> a -> (Either FloorItem Button -> a) -> World -> a
|
||||
yourAugmentedItem f x g w = case you w ^? crManipulation . manObject of
|
||||
Just (SelectedItem i _ _) -> f $ yourInv w ^?! ix i
|
||||
Just (SelCloseObject i) -> g . Left $ w ^?! hud . closeItems . ix i
|
||||
Just (SelCloseItem i) -> fromMaybe x $ do
|
||||
j <- w ^? hud . closeItems . ix i . unNInt
|
||||
flit <- w ^? cWorld . lWorld . floorItems . unNIntMap . ix j
|
||||
return . g $ Left flit
|
||||
-- g . Left $ w ^?! hud . closeItems . ix i
|
||||
Just (SelCloseButton i) -> fromMaybe x $ do
|
||||
j <- w ^? hud . closeInterfaces . ix i
|
||||
flit <- w ^? cWorld . lWorld . buttons . ix j
|
||||
return . g $ Right flit
|
||||
_ -> x
|
||||
|
||||
drawRBOptions :: Configuration -> World -> Picture
|
||||
|
||||
Reference in New Issue
Block a user