This commit is contained in:
2026-05-18 09:32:37 +01:00
parent 42fd6f783f
commit e8d09f773c
3 changed files with 9 additions and 10 deletions
+6 -6
View File
@@ -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
+3 -3
View File
@@ -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
-1
View File
@@ -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)