This commit is contained in:
2025-12-24 16:49:51 +00:00
parent a1c20c56ce
commit c96c18b9aa
3 changed files with 13 additions and 20 deletions
+8 -8
View File
@@ -66,7 +66,7 @@ drawInventory sss w cfig = \case
<> drawMouseOver cfig w <> drawMouseOver cfig w
_ -> _ ->
drawSelectionSections sss invDP cfig 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 <> drawRootCursor w sss (w ^. hud . diSelection) invDP cfig
<> itemconnections <> itemconnections
<> drawMouseOver cfig w <> drawMouseOver cfig w
@@ -123,7 +123,7 @@ drawMouseOver cfig w =
. translateScreenPos cfig (invDP ^. ldpPos) . translateScreenPos cfig (invDP ^. ldpPos)
. color (0.3 *^ white) . color (0.3 *^ white)
-- . color white -- . color white
$ selSecDrawCursorAt invDP curs sss (Sel j i mempty) $ selSecDrawCursor invDP curs sss (Sel j i mempty)
-- curs = BoundaryCursor [West] -- curs = BoundaryCursor [West]
curs = BackdropCursor curs = BackdropCursor
combinvsel = do combinvsel = do
@@ -135,7 +135,7 @@ drawMouseOver cfig w =
return return
. translateScreenPos cfig (idp ^. ldpPos) . translateScreenPos cfig (idp ^. ldpPos)
. color (0.3 * white) . 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 :: Config -> World -> Maybe Picture
drawDragSelected cfig w = do drawDragSelected cfig w = do
@@ -148,7 +148,7 @@ drawDragSelected cfig w = do
) )
Sel i _ _ <- w ^? hud . diSelection . _Just Sel i _ _ <- w ^? hud . diSelection . _Just
sss <- w ^? hud . diSections 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 return
. translateScreenPos cfig (invDP ^. ldpPos) . translateScreenPos cfig (invDP ^. ldpPos)
. color (0.2 *^ white) . color (0.2 *^ white)
@@ -159,7 +159,7 @@ drawDragSelecting :: Config -> World -> Maybe Picture
drawDragSelecting cfig w = do drawDragSelecting cfig w = do
OverInvDragSelect (Just (i, j)) (Just b) <- w ^? input . mouseContext OverInvDragSelect (Just (i, j)) (Just b) <- w ^? input . mouseContext
sss <- w ^? hud . diSections 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 return
. translateScreenPos cfig (invDP ^. ldpPos) . translateScreenPos cfig (invDP ^. ldpPos)
. color (0.2 *^ white) . color (0.2 *^ white)
@@ -186,7 +186,7 @@ drawMapperInventory itid w = fold $ do
drawCombineInventory :: Config -> IMSS CombItem -> World -> Picture drawCombineInventory :: Config -> IMSS CombItem -> World -> Picture
drawCombineInventory cfig sss w = drawCombineInventory cfig sss w =
drawSelectionSections sss secondColumnLDP cfig drawSelectionSections sss secondColumnLDP cfig
<> drawSSCursor sss secondColumnLDP curs cfig msel <> foldMap (drawSSCursor sss secondColumnLDP curs cfig) msel
<> combineInventoryExtra sss msel cfig w <> combineInventoryExtra sss msel cfig w
where where
curs = BoundaryCursor [North, South, West] curs = BoundaryCursor [North, South, West]
@@ -344,7 +344,7 @@ combineInventoryExtra sss msel cfig w = fold $ do
invDP invDP
(BoundaryCursor [North, South, East, West]) (BoundaryCursor [North, South, East, West])
(w ^. hud . diSections) (w ^. hud . diSections)
(Just (Sel 0 i mempty)) (Sel 0 i mempty)
drawTerminalDisplay :: World -> Config -> Int -> Picture drawTerminalDisplay :: World -> Config -> Int -> Picture
drawTerminalDisplay w cfig tid = fold $ do drawTerminalDisplay w cfig tid = fold $ do
@@ -394,7 +394,7 @@ drawTerminalCursorLink w cfig tm = fold $ do
invDP invDP
(BoundaryCursor [North, South, East, West]) (BoundaryCursor [North, South, East, West])
(w ^. hud . diSections) (w ^. hud . diSections)
(Just (Sel 5 j mempty)) (Sel 5 j mempty)
) )
<> lConnectCol (lp + V2 155 0) rp lcol white white <> lConnectCol (lp + V2 155 0) rp lcol white white
+4 -11
View File
@@ -7,24 +7,22 @@ module Dodge.Render.List (
drawSelectionListBackground, drawSelectionListBackground,
drawListYgapScaleYoff, drawListYgapScaleYoff,
drawListElement, drawListElement,
selSecDrawCursor,
dShadCol, dShadCol,
drawListYoff, drawListYoff,
stackPicturesAt, stackPicturesAt,
toTopLeft, toTopLeft,
listCursorChooseBorderScale, listCursorChooseBorderScale,
selSecDrawCursorAt, selSecDrawCursor,
drawTitleBackground, -- should be renamed, made sensible drawTitleBackground, -- should be renamed, made sensible
drawCursorAt, drawCursorAt,
drawLabelledList, drawLabelledList,
) where ) where
import Dodge.Data.HUD
import qualified Data.IntMap.Strict as IM
import Data.Maybe import Data.Maybe
import Dodge.Base.Window import Dodge.Base.Window
import Dodge.Data.CardinalPoint import Dodge.Data.CardinalPoint
import Dodge.Data.Config import Dodge.Data.Config
import Dodge.Data.HUD
import Dodge.Data.SelectionList import Dodge.Data.SelectionList
import Dodge.ListDisplayParams import Dodge.ListDisplayParams
import Dodge.ScreenPos import Dodge.ScreenPos
@@ -105,9 +103,8 @@ stackPicturesAt = stackPicturesAtOff 0
stackPicturesAtOff :: Int -> [Picture] -> Picture stackPicturesAtOff :: Int -> [Picture] -> Picture
stackPicturesAtOff i = mconcat . zipWith (drawListElement 10 1 0) [i, i - 1 ..] stackPicturesAtOff i = mconcat . zipWith (drawListElement 10 1 0) [i, i - 1 ..]
selSecDrawCursorAt :: selSecDrawCursor :: LDParams -> CursorDisplay -> IMSS a -> Selection -> Picture
LDParams -> CursorDisplay -> IM.IntMap (SelSection a) -> Selection -> Picture selSecDrawCursor ldp curs sss sel = fold $ do
selSecDrawCursorAt ldp curs sss sel = fold $ do
let i = sel ^. slSec let i = sel ^. slSec
j = sel ^. slInt j = sel ^. slInt
yint <- selSecYint i j sss yint <- selSecYint i j sss
@@ -124,10 +121,6 @@ selSecDrawCursorAt ldp curs sss sel = fold $ do
(_siWidth si) (_siWidth si)
(_siHeight 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 -- displays a cursor that should match up to list text pictures
listCursorChooseBorderScale :: listCursorChooseBorderScale ::
Float -> Float ->
+1 -1
View File
@@ -30,7 +30,7 @@ drawSelectionSections sss ldp cfig =
) )
drawSSCursor :: 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 = drawSSCursor sss ldp curs cfig =
translateScreenPos cfig (ldp ^. ldpPos) . translateScreenPos cfig (ldp ^. ldpPos) .
selSecDrawCursor ldp curs sss selSecDrawCursor ldp curs sss