diff --git a/src/Dodge/Render/HUD.hs b/src/Dodge/Render/HUD.hs index a0a8b5d58..a6dea3c13 100644 --- a/src/Dodge/Render/HUD.hs +++ b/src/Dodge/Render/HUD.hs @@ -66,7 +66,7 @@ drawInventory sss w cfig = \case <> drawMouseOver cfig w _ -> drawSelectionSections sss invDP cfig - <> drawSSCursor sss invDP curs cfig (w ^. hud . diSelection) + <> foldMap (drawSSCursor sss invDP curs cfig) (w ^. hud . diSelection) <> drawRootCursor w sss (w ^. hud . diSelection) invDP cfig <> itemconnections <> drawMouseOver cfig w @@ -123,7 +123,7 @@ drawMouseOver cfig w = . translateScreenPos cfig (invDP ^. ldpPos) . color (0.3 *^ white) -- . color white - $ selSecDrawCursorAt invDP curs sss (Sel j i mempty) + $ selSecDrawCursor invDP curs sss (Sel j i mempty) -- curs = BoundaryCursor [West] curs = BackdropCursor combinvsel = do @@ -135,7 +135,7 @@ drawMouseOver cfig w = return . translateScreenPos cfig (idp ^. ldpPos) . color (0.3 * white) - $ selSecDrawCursorAt idp curs sss (Sel j i mempty) + $ selSecDrawCursor idp curs sss (Sel j i mempty) drawDragSelected :: Config -> World -> Maybe Picture drawDragSelected cfig w = do @@ -148,7 +148,7 @@ drawDragSelected cfig w = do ) Sel i _ _ <- w ^? hud . diSelection . _Just sss <- w ^? hud . diSections - let f x = (selSecDrawCursorAt invDP BackdropCursor sss (Sel i x mempty) <>) + let f x = (selSecDrawCursor invDP BackdropCursor sss (Sel i x mempty) <>) return . translateScreenPos cfig (invDP ^. ldpPos) . color (0.2 *^ white) @@ -159,7 +159,7 @@ drawDragSelecting :: Config -> World -> Maybe Picture drawDragSelecting cfig w = do OverInvDragSelect (Just (i, j)) (Just b) <- w ^? input . mouseContext sss <- w ^? hud . diSections - let f x = selSecDrawCursorAt invDP BackdropCursor sss (Sel i x mempty) + let f x = selSecDrawCursor invDP BackdropCursor sss (Sel i x mempty) return . translateScreenPos cfig (invDP ^. ldpPos) . color (0.2 *^ white) @@ -186,7 +186,7 @@ drawMapperInventory itid w = fold $ do drawCombineInventory :: Config -> IMSS CombItem -> World -> Picture drawCombineInventory cfig sss w = drawSelectionSections sss secondColumnLDP cfig - <> drawSSCursor sss secondColumnLDP curs cfig msel + <> foldMap (drawSSCursor sss secondColumnLDP curs cfig) msel <> combineInventoryExtra sss msel cfig w where curs = BoundaryCursor [North, South, West] @@ -344,7 +344,7 @@ combineInventoryExtra sss msel cfig w = fold $ do invDP (BoundaryCursor [North, South, East, West]) (w ^. hud . diSections) - (Just (Sel 0 i mempty)) + (Sel 0 i mempty) drawTerminalDisplay :: World -> Config -> Int -> Picture drawTerminalDisplay w cfig tid = fold $ do @@ -394,7 +394,7 @@ drawTerminalCursorLink w cfig tm = fold $ do invDP (BoundaryCursor [North, South, East, West]) (w ^. hud . diSections) - (Just (Sel 5 j mempty)) + (Sel 5 j mempty) ) <> lConnectCol (lp + V2 155 0) rp lcol white white diff --git a/src/Dodge/Render/List.hs b/src/Dodge/Render/List.hs index 8a41a6f75..34d1b4d6b 100644 --- a/src/Dodge/Render/List.hs +++ b/src/Dodge/Render/List.hs @@ -7,24 +7,22 @@ module Dodge.Render.List ( drawSelectionListBackground, drawListYgapScaleYoff, drawListElement, - selSecDrawCursor, dShadCol, drawListYoff, stackPicturesAt, toTopLeft, listCursorChooseBorderScale, - selSecDrawCursorAt, + selSecDrawCursor, drawTitleBackground, -- should be renamed, made sensible drawCursorAt, drawLabelledList, ) where -import Dodge.Data.HUD -import qualified Data.IntMap.Strict as IM import Data.Maybe import Dodge.Base.Window import Dodge.Data.CardinalPoint import Dodge.Data.Config +import Dodge.Data.HUD import Dodge.Data.SelectionList import Dodge.ListDisplayParams import Dodge.ScreenPos @@ -105,9 +103,8 @@ stackPicturesAt = stackPicturesAtOff 0 stackPicturesAtOff :: Int -> [Picture] -> Picture stackPicturesAtOff i = mconcat . zipWith (drawListElement 10 1 0) [i, i - 1 ..] -selSecDrawCursorAt :: - LDParams -> CursorDisplay -> IM.IntMap (SelSection a) -> Selection -> Picture -selSecDrawCursorAt ldp curs sss sel = fold $ do +selSecDrawCursor :: LDParams -> CursorDisplay -> IMSS a -> Selection -> Picture +selSecDrawCursor ldp curs sss sel = fold $ do let i = sel ^. slSec j = sel ^. slInt yint <- selSecYint i j sss @@ -124,10 +121,6 @@ selSecDrawCursorAt ldp curs sss sel = fold $ do (_siWidth si) (_siHeight si) -selSecDrawCursor :: - LDParams -> CursorDisplay -> IM.IntMap (SelSection a) -> Maybe Selection -> Picture -selSecDrawCursor ldp cd = maybe mempty . selSecDrawCursorAt ldp cd - -- displays a cursor that should match up to list text pictures listCursorChooseBorderScale :: Float -> diff --git a/src/Dodge/SelectionSections/Draw.hs b/src/Dodge/SelectionSections/Draw.hs index 757fc01b5..73ba11d18 100644 --- a/src/Dodge/SelectionSections/Draw.hs +++ b/src/Dodge/SelectionSections/Draw.hs @@ -30,7 +30,7 @@ drawSelectionSections sss ldp cfig = ) drawSSCursor :: - IM.IntMap (SelSection a) -> LDParams -> CursorDisplay -> Config -> Maybe Selection -> Picture + IM.IntMap (SelSection a) -> LDParams -> CursorDisplay -> Config -> Selection -> Picture drawSSCursor sss ldp curs cfig = translateScreenPos cfig (ldp ^. ldpPos) . selSecDrawCursor ldp curs sss