From e8d09f773cdcb7bff1357bc89cf6f70a25c66b9b Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 18 May 2026 09:32:37 +0100 Subject: [PATCH] Cleanup --- src/Dodge/Render/HUD.hs | 12 ++++++------ src/Dodge/Render/List.hs | 6 +++--- src/Dodge/SelectedClose.hs | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Dodge/Render/HUD.hs b/src/Dodge/Render/HUD.hs index 0ca540d0b..c89a7e523 100644 --- a/src/Dodge/Render/HUD.hs +++ b/src/Dodge/Render/HUD.hs @@ -156,19 +156,19 @@ drawDragSelected cfig w = do drawDragSelecting :: Universe -> Maybe Picture drawDragSelecting u = do x <- w ^? input . mouseContext . mcoSecSelStart - sss <- w ^? hud . diSections --- y <- inverseSelNumPos cfig invDP (w^.input.mousePos) sss y <- mouseInvPosFixWidth u - let f i ss - | i ==0 || i == 3 = IM.foldMapWithKey (\j _ -> selSecDrawCursor' invDP BackdropCurs sss (Sel i j)) - (ss ^. ssItems) - | otherwise = mempty return . translateScreenPos cfig (invDP ^. ldpPos) . color (0.2 *^ white) . IM.foldMapWithKey f $ sssSelectionSlice sss x y where + f i ss + | i ==0 || i == 3 = IM.foldMapWithKey + (\j _ -> selSecDrawCursorFixWidth invDP BackdropCurs sss (Sel i j)) + (ss ^. ssItems) + | otherwise = mempty + sss = w ^. hud . diSections w = u ^. uvWorld cfig = u ^. uvConfig diff --git a/src/Dodge/Render/List.hs b/src/Dodge/Render/List.hs index e75b9cfed..c2f32378e 100644 --- a/src/Dodge/Render/List.hs +++ b/src/Dodge/Render/List.hs @@ -12,7 +12,7 @@ module Dodge.Render.List ( toTopLeft, listCursor, selSecDrawCursor, - selSecDrawCursor', + selSecDrawCursorFixWidth, drawTitleBackground, -- should be renamed, made sensible drawCursorAt, drawLabelledList, @@ -117,8 +117,8 @@ selSecDrawCursor ldp curs sss sel = fold $ do (_siWidth si) (_siHeight si) -selSecDrawCursor' :: LDParams -> CursorDisplay -> IMSS a -> Selection -> Picture -selSecDrawCursor' ldp curs sss sel = fold $ do +selSecDrawCursorFixWidth :: LDParams -> CursorDisplay -> IMSS a -> Selection -> Picture +selSecDrawCursorFixWidth ldp curs sss sel = fold $ do let i = sel ^. slSec j = sel ^. slInt yint <- selSecYint i j sss diff --git a/src/Dodge/SelectedClose.hs b/src/Dodge/SelectedClose.hs index deb0a1e82..114d304ee 100644 --- a/src/Dodge/SelectedClose.hs +++ b/src/Dodge/SelectedClose.hs @@ -10,7 +10,6 @@ import Data.Maybe import qualified Data.Map.Strict as M import qualified SDL --- assumes that, for picking up, you are selecting the item interactWithCloseObj :: Either (NewInt ItmInt) Button -> World -> World interactWithCloseObj e w = worldEventFlags . at InventoryChange ?~ () $ case e of (Left flit)