This commit is contained in:
2024-11-26 21:27:09 +00:00
parent 199cd73fa9
commit 9e0ef2ed1d
2 changed files with 10 additions and 42 deletions
+8 -8
View File
@@ -56,17 +56,17 @@ drawInventory sss w cfig =
drawSelectionSections sss ldp cfig
<> drawSSCursor sss (f $ w ^? hud . hudElement . diSelection . _Just) ldp curs cfig
<> drawRootCursor w sss (f $ w ^? hud . hudElement . diSelection . _Just) ldp cfig
<> iextra
<> itemconnections
<> drawMouseOver cfig w
where
f = fmap (\(x, y, _) -> (x, y))
ldp = invDisplayParams w
curs = invCursorParams w
iextra = fromMaybe mempty $ do
itemconnections = fromMaybe mempty $ do
inv <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
case w ^? hud . hudElement . diInvFilter . _Just of
Just (_ : _) -> Nothing
_ -> return . inventoryExtra sss cfig w $ invAdj inv
_ -> return . drawItemConnections sss cfig w $ invAdj inv
drawRootCursor ::
World ->
@@ -304,25 +304,25 @@ equipAllocString = \case
ReplaceEquipment{} -> " PUT ON"
RemoveEquipment{} -> "TAKE OFF"
inventoryExtra ::
drawItemConnections ::
IM.IntMap (SelectionSection ()) ->
Configuration ->
World ->
IM.IntMap (Maybe (Int, Int), [Int], [Int]) ->
Picture
inventoryExtra sss cfig w =
drawItemConnections sss cfig w =
translate (negate 5) 0
. IM.foldMapWithKey (inventoryExtraH sss cfig w)
. IM.foldMapWithKey (drawItemChildrenConnect sss cfig w)
. fmap (\(_, a, b) -> a <> b)
inventoryExtraH ::
drawItemChildrenConnect ::
IM.IntMap (SelectionSection ()) ->
Configuration ->
World ->
Int ->
[Int] ->
Picture
inventoryExtraH sss cfig w i is = fromMaybe mempty $ do
drawItemChildrenConnect sss cfig w i is = fromMaybe mempty $ do
p <- snum i
let ps = mapMaybe snum is
return $ color white $ lConnectMulti ps p