Major item refactor, still broken
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -28,7 +28,8 @@ worldSPic cfig u =
|
||||
<> foldup (shiftDraw _blPos _blDir (drawBlock . _blDraw)) (filtOn _blPos _blocks)
|
||||
<> foldup (shiftDraw _fsPos _fsDir (const _fsSPic)) (filtOn _fsPos _foregroundShapes)
|
||||
<> foldup (shiftDraw' _cpPos _cpDir _cpSPic) (filtOn _cpPos _corpses)
|
||||
<> foldup drawCreature (filtOn _crPos _creatures)
|
||||
<> foldup (drawCreature (u ^. uvWorld . cWorld . lWorld . items))
|
||||
(filtOn _crPos _creatures)
|
||||
<> foldup (Prelude.uncurry floorItemSPic) (IM.intersectionWith (,) (u^.uvWorld.cWorld.lWorld.items) (filtOn _flItPos (_floorItems)))
|
||||
<> foldup btSPic (filtOn _btPos _buttons)
|
||||
<> foldup (mcSPic (u ^. uvWorld . cWorld . lWorld)) (filtOn _mcPos _machines)
|
||||
@@ -57,12 +58,12 @@ drawPulseBall pb =
|
||||
. setLayer BloomLayer
|
||||
$ circleSolidCol green white 10
|
||||
|
||||
drawCreature :: Creature -> SPic
|
||||
drawCreature cr = translateSPz (_crZ cr) . uncurryV translateSPxy (_crPos cr) . rotateSP (_crDir cr) $
|
||||
drawCreature :: IM.IntMap Item -> Creature -> SPic
|
||||
drawCreature m cr = translateSPz (_crZ cr) . uncurryV translateSPxy (_crPos cr) . rotateSP (_crDir cr) $
|
||||
case cr ^. crType of
|
||||
BarrelCrit{} -> barrelShape
|
||||
LampCrit{_lampHeight = h} -> lampCrSPic h
|
||||
_ -> basicCrPict cr
|
||||
_ -> basicCrPict m cr
|
||||
|
||||
barrelShape :: SPic
|
||||
barrelShape = noPic $ cylinderPoly Medium Important (map (addZ 20) ps) (map (addZ 0) ps)
|
||||
|
||||
Reference in New Issue
Block a user