Major item refactor, still broken

This commit is contained in:
2025-08-24 19:34:09 +01:00
parent 22b4be440a
commit 94f6d5c630
62 changed files with 820 additions and 805 deletions
+8 -5
View File
@@ -62,7 +62,8 @@ drawInventory sss w cfig =
f = fmap (\(x, y, _) -> (x, y))
curs = invCursorParams w
itemconnections = fromMaybe mempty $ do
inv <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
inv' <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
let inv = fmap (\k -> w ^?! cWorld . lWorld . items . ix k) inv'
case w ^? hud . hudElement . diInvFilter . _Just of
Just (_ : _) -> Nothing
_ -> return . drawItemConnections sss cfig $ invAdj inv
@@ -79,7 +80,8 @@ drawRootCursor w sss msel ldp cfig = fromMaybe mempty $ do
guard $ crIsAiming cr
(i, j) <- msel
guard $ i == 0
inv <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
inv' <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
let inv = fmap (\k -> w ^?! cWorld . lWorld . items . ix k) inv'
(x, y) <- getRootItemBounds j inv
return $
drawSSMultiCursor
@@ -201,7 +203,7 @@ drawExamineInventory cfig w =
yourAugmentedItem
itemInfo
(yourInfo (you w))
(closeObjectInfo (crNumFreeSlots (you w)))
(closeObjectInfo (crNumFreeSlots (w ^. cWorld . lWorld . items) (you w)))
w
)
)
@@ -248,7 +250,7 @@ drawRBOptions cfig w = fold $ do
invid <- you w ^? crManipulation . manObject . imSelectedItem
eslist <-
fmap eqSiteToPositions $
you w ^? crInv . ix invid >>= equipType -- . itUse . uequipEffect . eeType
you w ^? crInv . ix invid >>= \k -> w ^? cWorld . lWorld . items . ix k >>= equipType -- . itUse . uequipEffect . eeType
i <- w ^? rbOptions . opSel
let ae = getEquipmentAllocation invid w
sss <- w ^? hud . hudElement . diSections
@@ -297,7 +299,8 @@ drawRBOptions cfig w = fold $ do
| a == b - 1 = listCursorChooseBorderScale 0 1 (bc South) curpos 0 white 7 1
| otherwise = mempty
otheritem j = fromMaybe "" $ do
itype <- you w ^? crInv . ix j . itType
itid <- you w ^? crInv . ix j
itype <- w ^? cWorld . lWorld . items . ix itid . itType
return $ itemBaseName itype
equipAllocString :: EquipmentAllocation -> String