Cleanup
This commit is contained in:
@@ -156,19 +156,19 @@ drawDragSelected cfig w = do
|
|||||||
drawDragSelecting :: Universe -> Maybe Picture
|
drawDragSelecting :: Universe -> Maybe Picture
|
||||||
drawDragSelecting u = do
|
drawDragSelecting u = do
|
||||||
x <- w ^? input . mouseContext . mcoSecSelStart
|
x <- w ^? input . mouseContext . mcoSecSelStart
|
||||||
sss <- w ^? hud . diSections
|
|
||||||
-- y <- inverseSelNumPos cfig invDP (w^.input.mousePos) sss
|
|
||||||
y <- mouseInvPosFixWidth u
|
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
|
return
|
||||||
. translateScreenPos cfig (invDP ^. ldpPos)
|
. translateScreenPos cfig (invDP ^. ldpPos)
|
||||||
. color (0.2 *^ white)
|
. color (0.2 *^ white)
|
||||||
. IM.foldMapWithKey f
|
. IM.foldMapWithKey f
|
||||||
$ sssSelectionSlice sss x y
|
$ sssSelectionSlice sss x y
|
||||||
where
|
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
|
w = u ^. uvWorld
|
||||||
cfig = u ^. uvConfig
|
cfig = u ^. uvConfig
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ module Dodge.Render.List (
|
|||||||
toTopLeft,
|
toTopLeft,
|
||||||
listCursor,
|
listCursor,
|
||||||
selSecDrawCursor,
|
selSecDrawCursor,
|
||||||
selSecDrawCursor',
|
selSecDrawCursorFixWidth,
|
||||||
drawTitleBackground, -- should be renamed, made sensible
|
drawTitleBackground, -- should be renamed, made sensible
|
||||||
drawCursorAt,
|
drawCursorAt,
|
||||||
drawLabelledList,
|
drawLabelledList,
|
||||||
@@ -117,8 +117,8 @@ selSecDrawCursor ldp curs sss sel = fold $ do
|
|||||||
(_siWidth si)
|
(_siWidth si)
|
||||||
(_siHeight si)
|
(_siHeight si)
|
||||||
|
|
||||||
selSecDrawCursor' :: LDParams -> CursorDisplay -> IMSS a -> Selection -> Picture
|
selSecDrawCursorFixWidth :: LDParams -> CursorDisplay -> IMSS a -> Selection -> Picture
|
||||||
selSecDrawCursor' ldp curs sss sel = fold $ do
|
selSecDrawCursorFixWidth 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
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import Data.Maybe
|
|||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import qualified SDL
|
import qualified SDL
|
||||||
|
|
||||||
-- assumes that, for picking up, you are selecting the item
|
|
||||||
interactWithCloseObj :: Either (NewInt ItmInt) Button -> World -> World
|
interactWithCloseObj :: Either (NewInt ItmInt) Button -> World -> World
|
||||||
interactWithCloseObj e w = worldEventFlags . at InventoryChange ?~ () $ case e of
|
interactWithCloseObj e w = worldEventFlags . at InventoryChange ?~ () $ case e of
|
||||||
(Left flit)
|
(Left flit)
|
||||||
|
|||||||
Reference in New Issue
Block a user