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
_ ->
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
+4 -11
View File
@@ -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 ->
+1 -1
View File
@@ -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