Work on inventory management

This commit is contained in:
2023-02-16 16:12:03 +00:00
parent ff5fa6321a
commit 934dd64704
30 changed files with 129 additions and 111 deletions
+3 -3
View File
@@ -85,7 +85,7 @@ inventoryDisplay sss w cfig = listPicturesAtScaleOff
spos <- _sssSelPos sss
sss ^? sssSections . ix spos . ssCursor . _Just . scurColor
thecursor = fromMaybe mempty $ do
sectype <- you w ^? crInvSel . isel
sectype <- you w ^? crManipulation . isel
let secnum = case sectype of
SelItem{} -> 0
SelNothing{} -> 1
@@ -152,7 +152,7 @@ floorItemPickupInfo n itm
-- note the use of ^?!
-- it is probably desirable for this to crash hard for now
yourAugmentedItem :: (Item -> a) -> a -> (Either FloorItem Button -> a) -> World -> a
yourAugmentedItem f x g w = case you w ^? crInvSel . isel of
yourAugmentedItem f x g w = case you w ^? crManipulation . isel of
Just (SelItem i _) -> f $ yourInv w ^?! ix i
Just (SelCloseObject i) -> g $ w ^?! hud . closeObjects . ix i
_ -> x
@@ -269,7 +269,7 @@ displayTerminal tid cfig w = fromMaybe mempty $ do
drawRBOptions :: Configuration -> World -> RightButtonOptions -> Picture
drawRBOptions cfig w EquipOptions{_opEquip = es, _opSel = i, _opAllocateEquipment = ae}
= fromMaybe mempty $ do
curpos <- you w ^? crInvSel . isel . ispItem
curpos <- you w ^? crManipulation . isel . ispItem
let midtext str = listTextPictureAt 252 0 cfig curpos (text str)
let extratext str = listTextPictureAt 432 0 cfig curpos (text (str ++ deactivatetext))
return $ listPicturesAtOff 342 0 cfig (curpos - i) (map (text . eqPosText) es)