Continue tweaking inventory display
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
All good (594 modules, at 10:51:47)
|
All good (594 modules, at 14:50:27)
|
||||||
|
|||||||
+7
-20
@@ -8,7 +8,6 @@ module Dodge.Render.HUD (
|
|||||||
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import Data.List (sort)
|
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import qualified Data.Vector as V
|
import qualified Data.Vector as V
|
||||||
@@ -59,16 +58,15 @@ drawHP cfig =
|
|||||||
drawInventory :: IM.IntMap (SelectionSection ()) -> World -> Configuration -> Picture
|
drawInventory :: IM.IntMap (SelectionSection ()) -> World -> Configuration -> Picture
|
||||||
drawInventory sss w cfig =
|
drawInventory sss w cfig =
|
||||||
drawSelectionSections sss ldp 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)
|
-- <> drawSSMultiCursor sss (w ^? hud . hudElement . diSelection . _Just)
|
||||||
(w ^? hud . hudElement . diSelectionExtra)
|
-- (w ^? hud . hudElement . diSelectionExtra)
|
||||||
ldp curs cfig
|
-- ldp curs cfig
|
||||||
<> iextra
|
<> iextra
|
||||||
<> translateScreenPos
|
<> translateScreenPos
|
||||||
cfig
|
cfig
|
||||||
(ldp ^. ldpPos)
|
(ldp ^. ldpPos)
|
||||||
(drawDIMouseOver w <> drawDISelections w)
|
(drawDIMouseOver w <> drawDISelections w)
|
||||||
<> drawDISelections' w cfig
|
|
||||||
where
|
where
|
||||||
ldp = invDisplayParams w
|
ldp = invDisplayParams w
|
||||||
curs = invCursorParams w
|
curs = invCursorParams w
|
||||||
@@ -91,13 +89,11 @@ drawDIMouseOver w = fromMaybe mempty $ do
|
|||||||
getMouseInvSel :: World -> Maybe ((Int, Int), (Int, Int))
|
getMouseInvSel :: World -> Maybe ((Int, Int), (Int, Int))
|
||||||
getMouseInvSel w = case w ^? hud . hudElement . subInventory . nsSelected of
|
getMouseInvSel w = case w ^? hud . hudElement . subInventory . nsSelected of
|
||||||
Just (MouseInvSelect s (Just e)) -> Just (s, e)
|
Just (MouseInvSelect s (Just e)) -> Just (s, e)
|
||||||
_ -> Nothing
|
_ -> case w ^? hud . hudElement . diSelectionExtra of
|
||||||
|
Just x | x > 0 -> do
|
||||||
getMouseInvSel' :: World -> Maybe ((Int, Int), (Int, Int))
|
|
||||||
getMouseInvSel' w = do
|
|
||||||
x <- w ^? hud . hudElement . diSelectionExtra
|
|
||||||
(i,j) <- w ^? hud . hudElement . diSelection . _Just
|
(i,j) <- w ^? hud . hudElement . diSelection . _Just
|
||||||
return ((i,j),(i,j+x))
|
return ((i,j),(i,j+x))
|
||||||
|
_ -> Nothing
|
||||||
|
|
||||||
drawDISelections :: World -> Picture
|
drawDISelections :: World -> Picture
|
||||||
drawDISelections w = fromMaybe mempty $ do
|
drawDISelections w = fromMaybe mempty $ do
|
||||||
@@ -107,15 +103,6 @@ drawDISelections w = fromMaybe mempty $ do
|
|||||||
let f x = selSecDrawCursorAt 15 idp BackdropCursor sss (0,x)
|
let f x = selSecDrawCursorAt 15 idp BackdropCursor sss (0,x)
|
||||||
return . color (withAlpha 0.2 white) . foldMap f $ [min j b..max j b]
|
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 :: SubInventory -> Configuration -> World -> Picture
|
||||||
drawSubInventory subinv cfig w = case subinv of
|
drawSubInventory subinv cfig w = case subinv of
|
||||||
LockedInventory -> mempty -- topInvCursor col cursPos cfig w
|
LockedInventory -> mempty -- topInvCursor col cursPos cfig w
|
||||||
|
|||||||
Reference in New Issue
Block a user