Continue tweaking inventory display
This commit is contained in:
+9
-22
@@ -8,7 +8,6 @@ module Dodge.Render.HUD (
|
||||
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Data.List (sort)
|
||||
import qualified Data.Map.Strict as M
|
||||
import Data.Maybe
|
||||
import qualified Data.Vector as V
|
||||
@@ -59,16 +58,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
|
||||
<> drawSSMultiCursor sss (w ^? hud . hudElement . diSelection . _Just)
|
||||
(w ^? hud . hudElement . diSelectionExtra)
|
||||
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)
|
||||
<> drawDISelections' w cfig
|
||||
where
|
||||
ldp = invDisplayParams w
|
||||
curs = invCursorParams w
|
||||
@@ -91,13 +89,11 @@ drawDIMouseOver w = fromMaybe mempty $ do
|
||||
getMouseInvSel :: World -> Maybe ((Int, Int), (Int, Int))
|
||||
getMouseInvSel w = case w ^? hud . hudElement . subInventory . nsSelected of
|
||||
Just (MouseInvSelect s (Just e)) -> Just (s, e)
|
||||
_ -> Nothing
|
||||
|
||||
getMouseInvSel' :: World -> Maybe ((Int, Int), (Int, Int))
|
||||
getMouseInvSel' w = do
|
||||
x <- w ^? hud . hudElement . diSelectionExtra
|
||||
(i, j) <- w ^? hud . hudElement . diSelection . _Just
|
||||
return ((i, j), (i, j + x))
|
||||
_ -> case w ^? hud . hudElement . diSelectionExtra of
|
||||
Just x | x > 0 -> do
|
||||
(i,j) <- w ^? hud . hudElement . diSelection . _Just
|
||||
return ((i,j),(i,j+x))
|
||||
_ -> Nothing
|
||||
|
||||
drawDISelections :: World -> Picture
|
||||
drawDISelections w = fromMaybe mempty $ do
|
||||
@@ -107,15 +103,6 @@ drawDISelections w = fromMaybe mempty $ do
|
||||
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
|
||||
((i, j), (a, b)) <- getMouseInvSel' w
|
||||
sss <- w ^? hud . hudElement . diSections
|
||||
let idp = invDisplayParams w
|
||||
tp <- selNumPosCardinal NorthEast8 cfig idp sss i j
|
||||
bp <- selNumPosCardinal SouthEast8 cfig idp sss a b
|
||||
return . color green . line $ sort [tp, bp]
|
||||
|
||||
drawSubInventory :: SubInventory -> Configuration -> World -> Picture
|
||||
drawSubInventory subinv cfig w = case subinv of
|
||||
LockedInventory -> mempty -- topInvCursor col cursPos cfig w
|
||||
|
||||
Reference in New Issue
Block a user