From 6becda01d553d3180f0ed9dbd814d8740efb4b79 Mon Sep 17 00:00:00 2001 From: justin Date: Tue, 23 Dec 2025 22:54:56 +0000 Subject: [PATCH] Add connector between terminal button and temrinal display --- src/Dodge/Render/Connectors.hs | 5 +++++ src/Dodge/Render/HUD.hs | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Dodge/Render/Connectors.hs b/src/Dodge/Render/Connectors.hs index 27b4d22af..118237ef1 100644 --- a/src/Dodge/Render/Connectors.hs +++ b/src/Dodge/Render/Connectors.hs @@ -5,6 +5,7 @@ module Dodge.Render.Connectors ( zConnectCol, zConnectColMidX, lConnect, + lConnectCol, lConnectMulti, ) where @@ -42,6 +43,10 @@ zConnectColMidX (V2 x y) (V2 a b) midx c1 c2 c3 c4 = lConnect :: Point2 -> Point2 -> Picture lConnect sp@(V2 _ y) ep@(V2 x _) = line [sp, V2 x y, ep] +lConnectCol :: Point2 -> Point2 -> Color -> Color -> Color -> Picture +lConnectCol sp@(V2 _ y) ep@(V2 x _) c1 c2 c3 = lineCol + $ zip [sp, V2 x y, ep] [c1,c2,c3] + -- this function is the reason for the incomplete-uni-patterns warning suppression lConnectMulti :: [Point2] -> Point2 -> Picture lConnectMulti sps (V2 x y) = diff --git a/src/Dodge/Render/HUD.hs b/src/Dodge/Render/HUD.hs index 78339dfb8..0ad0291bf 100644 --- a/src/Dodge/Render/HUD.hs +++ b/src/Dodge/Render/HUD.hs @@ -389,17 +389,21 @@ drawTerminalDisplay w cfig tid = fold $ do drawTerminalCursorLink :: World -> Config -> Terminal -> Picture drawTerminalCursorLink w cfig tm = fold $ do j <- elemIndex (tm ^. tmButtonID) $ w ^. hud . closeButtons - return . translateScreenPos cfig (invDP ^. ldpPos) - $ selSecDrawCursor invDP + lp <- selNumPos cfig invDP (w^. hud . diSections) 5 j + let rp = screenPosAbs cfig (secondColumnLDP ^. ldpPos) - V2 5 10 + lcol <- selSecSelCol 5 j (w ^. hud . diSections) + return $ translateScreenPos cfig (invDP ^. ldpPos) + (selSecDrawCursor invDP (BoundaryCursor [North,South,East,West]) (w ^. hud . diSections) - (Just (5,j)) + (Just (5,j))) + <> lConnectCol (lp + V2 155 0) rp lcol white white lnkMidPosInvSelsCol :: Config -> World -> Int -> Color -> [Int] -> Picture lnkMidPosInvSelsCol cfig w i col = fromMaybe mempty . foldMap f where f j = do - sss <- w ^? hud . diSections + let sss = w ^. hud . diSections combinesss <- w ^? hud . subInventory . ciSections lp <- selNumPos cfig invDP sss 0 j rp <- selNumPos cfig secondColumnLDP combinesss 0 i