Improve inventory display
This commit is contained in:
+12
-11
@@ -59,13 +59,15 @@ drawHP cfig =
|
||||
drawInventory :: IM.IntMap (SelectionSection ()) -> World -> Configuration -> Picture
|
||||
drawInventory sss w cfig =
|
||||
drawSelectionSections sss ldp cfig
|
||||
<> drawSSCursor sss (w ^? hud . hudElement . diSelection . _Just) ldp curs cfig
|
||||
-- <> drawSSCursor sss (w ^? hud . hudElement . diSelection . _Just) ldp curs cfig
|
||||
<> drawSSMultiCursor sss (w ^? hud . hudElement . diSelection . _Just)
|
||||
(w ^? hud . hudElement . diSelectionExtra)
|
||||
ldp curs cfig
|
||||
<> iextra
|
||||
<> translateScreenPos
|
||||
cfig
|
||||
(ldp ^. ldpPos)
|
||||
(drawDIMouseOver w)
|
||||
<> drawDISelections w cfig
|
||||
(drawDIMouseOver w <> drawDISelections w)
|
||||
<> drawDISelections' w cfig
|
||||
where
|
||||
ldp = invDisplayParams w
|
||||
@@ -82,9 +84,9 @@ drawDIMouseOver w = fromMaybe mempty $ do
|
||||
(_, i) <- w ^? hud . hudElement . subInventory . nsMouseOver . _Just
|
||||
sss <- w ^? hud . hudElement . diSections
|
||||
let idp = invDisplayParams w
|
||||
return . color (withAlpha 0.5 white) $ selSecDrawCursorAt 10 idp curs sss (0, i)
|
||||
return . color (withAlpha 0.2 white) $ selSecDrawCursorAt 15 idp curs sss (0, i)
|
||||
where
|
||||
curs = BoundaryCursor [North, South]
|
||||
curs = BackdropCursor
|
||||
|
||||
getMouseInvSel :: World -> Maybe ((Int, Int), (Int, Int))
|
||||
getMouseInvSel w = case w ^? hud . hudElement . subInventory . nsSelected of
|
||||
@@ -97,14 +99,13 @@ getMouseInvSel' w = do
|
||||
(i, j) <- w ^? hud . hudElement . diSelection . _Just
|
||||
return ((i, j), (i, j + x))
|
||||
|
||||
drawDISelections :: World -> Configuration -> Picture
|
||||
drawDISelections w cfig = fromMaybe mempty $ do
|
||||
((i, j), (a, b)) <- getMouseInvSel w
|
||||
drawDISelections :: World -> Picture
|
||||
drawDISelections w = fromMaybe mempty $ do
|
||||
((_, j), (_, b)) <- getMouseInvSel w
|
||||
sss <- w ^? hud . hudElement . diSections
|
||||
let idp = invDisplayParams w
|
||||
tp <- selNumPosCardinal NorthWest8 cfig idp sss i j
|
||||
bp <- selNumPosCardinal SouthWest8 cfig idp sss a b
|
||||
return . color red . line $ sort [tp, bp]
|
||||
let f x = selSecDrawCursorAt 15 idp BackdropCursor sss (0,x)
|
||||
return . color (withAlpha 0.2 white) . foldMap f $ [min j b..max j b]
|
||||
|
||||
drawDISelections' :: World -> Configuration -> Picture
|
||||
drawDISelections' w cfig = fromMaybe mempty $ do
|
||||
|
||||
Reference in New Issue
Block a user