Continue inventory tweak

This commit is contained in:
2023-02-16 17:07:59 +00:00
parent 934dd64704
commit 4afc216b25
28 changed files with 106 additions and 94 deletions
+6 -5
View File
@@ -85,9 +85,10 @@ inventoryDisplay sss w cfig = listPicturesAtScaleOff
spos <- _sssSelPos sss
sss ^? sssSections . ix spos . ssCursor . _Just . scurColor
thecursor = fromMaybe mempty $ do
sectype <- you w ^? crManipulation . isel
sectype <- you w ^? crManipulation . manObject
let secnum = case sectype of
SelItem{} -> 0
InInventory SortInventory -> negate 1
InInventory {} -> 0
SelNothing{} -> 1
SelCloseObject{} -> 2
xint <- sss ^? sssSections . ix secnum . ssIndent
@@ -152,8 +153,8 @@ 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 ^? crManipulation . isel of
Just (SelItem i _) -> f $ yourInv w ^?! ix i
yourAugmentedItem f x g w = case you w ^? crManipulation . manObject of
Just (InInventory (SelItem i _)) -> f $ yourInv w ^?! ix i
Just (SelCloseObject i) -> g $ w ^?! hud . closeObjects . ix i
_ -> x
@@ -269,7 +270,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 ^? crManipulation . isel . ispItem
curpos <- you w ^? crManipulation . manObject . inInventory . 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)