This commit is contained in:
2025-08-26 18:51:14 +01:00
parent b87c3380b8
commit 1ebdbdd8ae
34 changed files with 210 additions and 246 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ winConfig x y winpos =
theCleanup :: Universe -> IO () theCleanup :: Universe -> IO ()
theCleanup uv = SDL.cursorVisible $= True >> cleanUpPreload (_preloadData uv) theCleanup uv = SDL.cursorVisible $= True >> cleanUpPreload (_preloadData uv)
firstWorldLoad :: Configuration -> IO Universe firstWorldLoad :: Config -> IO Universe
firstWorldLoad theConfig = do firstWorldLoad theConfig = do
SDL.cursorVisible $= False SDL.cursorVisible $= False
pdata <- doPreload >>= applyWorldConfig theConfig pdata <- doPreload >>= applyWorldConfig theConfig
+1 -1
View File
@@ -12,7 +12,7 @@ import Dodge.Data.Input
import Geometry import Geometry
---- | Transform coordinates from world position to screen coordinates. ---- | Transform coordinates from world position to screen coordinates.
--worldPosToScreenNorm :: Configuration -> World -> Point2 -> Point2 --worldPosToScreenNorm :: Config -> World -> Point2 -> Point2
--worldPosToScreenNorm cfig w = doWindowScale cfig . doRotate . doZoom . doTranslate --worldPosToScreenNorm cfig w = doWindowScale cfig . doRotate . doZoom . doTranslate
-- where -- where
-- doTranslate p = p -.- (w ^. cWorld . lWorld . wCam . cwcCenter) -- doTranslate p = p -.- (w ^. cWorld . lWorld . wCam . cwcCenter)
+5 -5
View File
@@ -14,7 +14,7 @@ import Dodge.Data.Config
import Geometry import Geometry
-- | A box covering the screen in world coordinates -- | A box covering the screen in world coordinates
screenPolygon :: Configuration -> Camera -> [Point2] screenPolygon :: Config -> Camera -> [Point2]
screenPolygon cfig w = map (scTran . scRot . scZoom) $ screenBox cfig screenPolygon cfig w = map (scTran . scRot . scZoom) $ screenBox cfig
where where
scRot = rotateV (w ^. camRot) scRot = rotateV (w ^. camRot)
@@ -29,7 +29,7 @@ screenPolygonBord ::
Float -> Float ->
-- | Y border -- | Y border
Float -> Float ->
Configuration -> Config ->
Camera -> Camera ->
[Point2] [Point2]
screenPolygonBord xbord ybord cfig w = [tr, tl, bl, br] screenPolygonBord xbord ybord cfig w = [tr, tl, bl, br]
@@ -45,16 +45,16 @@ screenPolygonBord xbord ybord cfig w = [tr, tl, bl, br]
br = theTransform (V2 hw (- hh)) br = theTransform (V2 hw (- hh))
bl = theTransform (V2 (- hw) (- hh)) bl = theTransform (V2 (- hw) (- hh))
halfWidth, halfHeight :: Configuration -> Float halfWidth, halfHeight :: Config -> Float
halfWidth = (0.5 *) . windowXFloat halfWidth = (0.5 *) . windowXFloat
halfHeight = (0.5 *) . windowYFloat halfHeight = (0.5 *) . windowYFloat
-- | A box of the size of the screen in screen centered coordinates -- | A box of the size of the screen in screen centered coordinates
screenBox :: Configuration -> [Point2] screenBox :: Config -> [Point2]
screenBox w = rectNSWE hh (- hh) (- hw) hw screenBox w = rectNSWE hh (- hh) (- hw) hw
where where
hw = halfWidth w hw = halfWidth w
hh = halfHeight w hh = halfHeight w
pointIsOnScreen :: Configuration -> Camera -> Point2 -> Bool pointIsOnScreen :: Config -> Camera -> Point2 -> Bool
pointIsOnScreen cfig w p = pointInPolygon p $ screenPolygon cfig w pointIsOnScreen cfig w p = pointInPolygon p $ screenPolygon cfig w
+1 -1
View File
@@ -6,7 +6,7 @@ import Data.Aeson
import Dodge.Data.Config import Dodge.Data.Config
import System.Directory import System.Directory
loadDodgeConfig :: IO Configuration loadDodgeConfig :: IO Config
loadDodgeConfig = do loadDodgeConfig = do
fExists <- doesFileExist "data/dodge.config.json" fExists <- doesFileExist "data/dodge.config.json"
if fExists if fExists
+3 -3
View File
@@ -17,7 +17,7 @@ import Sound
{- | {- |
Write the current world configuration to disk as a json file. Write the current world configuration to disk as a json file.
-} -}
saveConfig :: Configuration -> (a -> IO a) -> a -> IO a saveConfig :: Config -> (a -> IO a) -> a -> IO a
saveConfig cfig f x = do saveConfig cfig f x = do
-- putStrLn "Saving config to data/dodge.config.json" -- putStrLn "Saving config to data/dodge.config.json"
BS.writeFile "data/dodge.config.json" $ BS.writeFile "data/dodge.config.json" $
@@ -27,7 +27,7 @@ saveConfig cfig f x = do
{- | {- |
Apply the volume settings from the world configuration to the running game. Apply the volume settings from the world configuration to the running game.
-} -}
setVol :: Configuration -> IO () setVol :: Config -> IO ()
setVol cfig = do setVol cfig = do
setSoundVolume (_volume_master cfig * _volume_sound cfig) setSoundVolume (_volume_master cfig * _volume_sound cfig)
setMusicVolume (_volume_master cfig * _volume_music cfig) setMusicVolume (_volume_master cfig * _volume_music cfig)
@@ -36,7 +36,7 @@ setVol cfig = do
Apply /all/ of the values in the world configuration to the running game. Apply /all/ of the values in the world configuration to the running game.
-} -}
applyWorldConfig :: applyWorldConfig ::
Configuration -> Config ->
PreloadData -> PreloadData ->
IO PreloadData IO PreloadData
applyWorldConfig cfig pdata = do applyWorldConfig cfig pdata = do
+8 -8
View File
@@ -35,7 +35,7 @@ data NumShadowCasters
| NumShadowCasters20 | NumShadowCasters20
deriving (Show,Eq,Bounded,Ord,Enum) deriving (Show,Eq,Bounded,Ord,Enum)
data Configuration = Configuration data Config = Config
{ _volume_master :: Float { _volume_master :: Float
, _volume_sound :: Float , _volume_sound :: Float
, _volume_music :: Float , _volume_music :: Float
@@ -58,9 +58,9 @@ data Configuration = Configuration
} }
deriving (Show) deriving (Show)
windowXFloat :: Configuration -> Float windowXFloat :: Config -> Float
windowXFloat = fromIntegral . _windowX windowXFloat = fromIntegral . _windowX
windowYFloat :: Configuration -> Float windowYFloat :: Config -> Float
windowYFloat = fromIntegral . _windowY windowYFloat = fromIntegral . _windowY
data DebugBool data DebugBool
@@ -124,9 +124,9 @@ applyResFactor rf = case rf of
-- EighthRes -> 8 -- EighthRes -> 8
-- SixteenthRes -> 16 -- SixteenthRes -> 16
defaultConfig :: Configuration defaultConfig :: Config
defaultConfig = defaultConfig =
Configuration Config
{ _volume_master = 1 { _volume_master = 1
, _volume_sound = 1 , _volume_sound = 1
, _volume_music = 0 , _volume_music = 0
@@ -148,13 +148,13 @@ defaultConfig =
, _debug_view_clip_bounds = NoRoomClipBoundaries , _debug_view_clip_bounds = NoRoomClipBoundaries
} }
debugOn :: DebugBool -> Configuration -> Bool debugOn :: DebugBool -> Config -> Bool
debugOn db = S.member db . _debug_booleans debugOn db = S.member db . _debug_booleans
makeLenses ''Configuration makeLenses ''Config
deriveJSON defaultOptions ''NumShadowCasters deriveJSON defaultOptions ''NumShadowCasters
deriveJSON defaultOptions ''ResFactor deriveJSON defaultOptions ''ResFactor
deriveJSON defaultOptions ''ShadowRendering deriveJSON defaultOptions ''ShadowRendering
deriveJSON defaultOptions ''RoomClipping deriveJSON defaultOptions ''RoomClipping
deriveJSON defaultOptions ''DebugBool deriveJSON defaultOptions ''DebugBool
deriveJSON defaultOptions ''Configuration deriveJSON defaultOptions ''Config
+1 -1
View File
@@ -34,7 +34,7 @@ data Universe = Universe
, _uvScreenLayers :: [ScreenLayer] , _uvScreenLayers :: [ScreenLayer]
, _uvIOEffects :: Universe -> IO Universe , _uvIOEffects :: Universe -> IO Universe
, _uvSideEffects :: Seq SideEffect , _uvSideEffects :: Seq SideEffect
, _uvConfig :: Configuration , _uvConfig :: Config
, _uvTestString :: Universe -> [String] , _uvTestString :: Universe -> [String]
, _uvCanContinue :: Bool , _uvCanContinue :: Bool
, _uvMSeed :: Maybe Int , _uvMSeed :: Maybe Int
+12 -12
View File
@@ -41,7 +41,7 @@ printRotPoint r p =
. uncurryV translate p . uncurryV translate p
$ fold [circle 3, rotate (negate r) $ scale 0.1 0.1 $ text (show p)] $ fold [circle 3, rotate (negate r) $ scale 0.1 0.1 $ text (show p)]
outsideScreenPolygon :: Configuration -> Camera -> [Point2] outsideScreenPolygon :: Config -> Camera -> [Point2]
outsideScreenPolygon cfig w = [tr, tl, bl, br] outsideScreenPolygon cfig w = [tr, tl, bl, br]
where where
scRot = rotateV (w ^. camRot) scRot = rotateV (w ^. camRot)
@@ -57,7 +57,7 @@ outsideScreenPolygon cfig w = [tr, tl, bl, br]
-- cannot only test if walls are on screen, but also if they are on the cone -- cannot only test if walls are on screen, but also if they are on the cone
-- towards the center of sight -- towards the center of sight
lineOnScreenCone :: Configuration -> World -> Point2 -> Point2 -> Bool lineOnScreenCone :: Config -> World -> Point2 -> Point2 -> Bool
lineOnScreenCone cfig w p1 p2 = lineOnScreenCone cfig w p1 p2 =
pointInPolygon p1 sp pointInPolygon p1 sp
|| pointInPolygon p2 sp || pointInPolygon p2 sp
@@ -70,7 +70,7 @@ lineOnScreenCone cfig w p1 p2 =
| otherwise = orderPolygon ((w ^. wCam . camViewFrom) : sp') | otherwise = orderPolygon ((w ^. wCam . camViewFrom) : sp')
sps = zip sp (tail sp ++ [head sp]) sps = zip sp (tail sp ++ [head sp])
drawWallFace :: Configuration -> World -> Wall -> Picture drawWallFace :: Config -> World -> Wall -> Picture
drawWallFace cfig w wall drawWallFace cfig w wall
| isRHS sightFrom x y || not (wlIsOpaque wall) = blank | isRHS sightFrom x y || not (wlIsOpaque wall) = blank
| otherwise = setDepth (-1) . color (withAlpha 0 black) . polygon $ points | otherwise = setDepth (-1) . color (withAlpha 0 black) . polygon $ points
@@ -79,7 +79,7 @@ drawWallFace cfig w wall
points = extendConeToScreenEdge cfig w sightFrom (x, y) points = extendConeToScreenEdge cfig w sightFrom (x, y)
sightFrom = w ^. wCam . camViewFrom sightFrom = w ^. wCam . camViewFrom
extendConeToScreenEdge :: Configuration -> World -> Point2 -> (Point2, Point2) -> [Point2] extendConeToScreenEdge :: Config -> World -> Point2 -> (Point2, Point2) -> [Point2]
extendConeToScreenEdge cfig w c (x, y) = orderPolygon $ wallScreenIntersect ++ [x, y] ++ borderPs ++ cornerPs extendConeToScreenEdge cfig w c (x, y) = orderPolygon $ wallScreenIntersect ++ [x, y] ++ borderPs ++ cornerPs
where where
borderPs = mapMaybe (intersectLinefromScreen cfig w c) [x, y] borderPs = mapMaybe (intersectLinefromScreen cfig w c) [x, y]
@@ -93,7 +93,7 @@ extendConeToScreenEdge cfig w c (x, y) = orderPolygon $ wallScreenIntersect ++ [
-- the following assumes that the point a is inside the screen -- the following assumes that the point a is inside the screen
-- it still works otherwise, but it might intersect two points: -- it still works otherwise, but it might intersect two points:
-- it is not obvious which will be returned -- it is not obvious which will be returned
intersectLinefromScreen :: Configuration -> World -> Point2 -> Point2 -> Maybe Point2 intersectLinefromScreen :: Config -> World -> Point2 -> Point2 -> Maybe Point2
intersectLinefromScreen cfig w a b = intersectLinefromScreen cfig w a b =
listToMaybe listToMaybe
. mapMaybe (\(x, y) -> intersectSegLineFrom x y b (b +.+ b -.- a)) . mapMaybe (\(x, y) -> intersectSegLineFrom x y b (b +.+ b -.- a))
@@ -151,7 +151,7 @@ drawZoneCol col s (V2 x y) = setLayer DebugLayer . color col $ thickLine 2 (p :
zipWith (+.+) (square 1) $ zipWith (+.+) (square 1) $
map ((s *.*) . (each %~ fromIntegral)) [V2 x y, V2 (x + 1) y, V2 (x + 1) (y + 1), V2 x (y + 1)] map ((s *.*) . (each %~ fromIntegral)) [V2 x y, V2 (x + 1) y, V2 (x + 1) (y + 1), V2 x (y + 1)]
debugDraw :: Configuration -> World -> Picture debugDraw :: Config -> World -> Picture
{-# INLINE debugDraw #-} {-# INLINE debugDraw #-}
debugDraw cfig w debugDraw cfig w
| Enable_debug `S.member` _debug_booleans cfig = | Enable_debug `S.member` _debug_booleans cfig =
@@ -162,7 +162,7 @@ debugDraw cfig w
pic = foldMap (debugDraw' cfig w) (_debug_booleans cfig) pic = foldMap (debugDraw' cfig w) (_debug_booleans cfig)
ts = map show (S.toList $ _debug_booleans cfig) ts = map show (S.toList $ _debug_booleans cfig)
debugDraw' :: Configuration -> World -> DebugBool -> Picture debugDraw' :: Config -> World -> DebugBool -> Picture
{-# INLINE debugDraw' #-} {-# INLINE debugDraw' #-}
debugDraw' cfig w bl = case bl of debugDraw' cfig w bl = case bl of
Enable_debug -> mempty Enable_debug -> mempty
@@ -315,7 +315,7 @@ viewBoundaries w =
p = w ^. wCam . camViewFrom p = w ^. wCam . camViewFrom
grs = filter (pointInOrOnPolygon p . _grBound) (_cwgGameRooms $ _cwGen $ _cWorld w) grs = filter (pointInOrOnPolygon p . _grBound) (_cwgGameRooms $ _cwGen $ _cWorld w)
viewClipBounds :: Configuration -> World -> Picture viewClipBounds :: Config -> World -> Picture
viewClipBounds cfig w viewClipBounds cfig w
| _debug_view_clip_bounds cfig == AllRoomClipBoundaries = | _debug_view_clip_bounds cfig == AllRoomClipBoundaries =
setLayer DebugLayer $ color green $ foldMap (polygonWire . _cpPoints) (_cwgRoomClipping $ _cwGen (_cWorld w)) setLayer DebugLayer $ color green $ foldMap (polygonWire . _cpPoints) (_cwgRoomClipping $ _cwGen (_cWorld w))
@@ -338,7 +338,7 @@ drawBoundingBox w = setLayer DebugLayer $ color green $ line $ (x : xs) ++ [x]
where where
(x : xs) = w ^. wCam . camBoundBox (x : xs) = w ^. wCam . camBoundBox
soundPic :: Configuration -> World -> Sound -> Picture soundPic :: Config -> World -> Sound -> Picture
soundPic cfig w s = fixedSizePicClampArrow 50 50 thePic p cfig w soundPic cfig w s = fixedSizePicClampArrow 50 50 thePic p cfig w
where where
p = _soundPos s p = _soundPos s
@@ -382,14 +382,14 @@ drawWlIDs w = setLayer FixedCoordLayer $ foldMap f (w ^. cWorld . lWorld . walls
where where
p = worldPosToScreen (w ^. wCam) $ 0.5 *.* uncurry (+.+) (_wlLine wl) p = worldPosToScreen (w ^. wCam) $ 0.5 *.* uncurry (+.+) (_wlLine wl)
drawCrInfo :: Configuration -> World -> Picture drawCrInfo :: Config -> World -> Picture
drawCrInfo cfig w = drawCrInfo cfig w =
setLayer FixedCoordLayer $ setLayer FixedCoordLayer $
renderInfoListsAt (2 * hw - 400) 0 cfig cam $ renderInfoListsAt (2 * hw - 400) 0 cfig cam $
mapMaybe crDisplayInfo $ IM.elems $ w ^. cWorld . lWorld . creatures mapMaybe crDisplayInfo $ IM.elems $ w ^. cWorld . lWorld . creatures
where where
cam = w ^. wCam cam = w ^. wCam
-- drawPathing :: Configuration -> World -> Picture -- drawPathing :: Config -> World -> Picture
-- drawPathing cfig w = -- drawPathing cfig w =
-- setLayer DebugLayer $ -- setLayer DebugLayer $
-- foldMap (edgeToPic (screenPolygon cfig (w ^. wCam)) . (^?! _3)) (FGL.labEdges gr) -- foldMap (edgeToPic (screenPolygon cfig (w ^. wCam)) . (^?! _3)) (FGL.labEdges gr)
@@ -424,7 +424,7 @@ drawCrInfo cfig w =
fpreShow str = fmap (((rightPad 7 '.' str ++ "...") ++) . show) fpreShow str = fmap (((rightPad 7 '.' str ++ "...") ++) . show)
hw = halfWidth cfig hw = halfWidth cfig
drawPathing :: Configuration -> World -> Picture drawPathing :: Config -> World -> Picture
drawPathing cfig w = drawPathing cfig w =
setLayer DebugLayer $ setLayer DebugLayer $
foldMap (edgeToPic (screenPolygon cfig (w ^. wCam)) . (^?! _3)) (FGL.labEdges gr) foldMap (edgeToPic (screenPolygon cfig (w ^. wCam)) . (^?! _3)) (FGL.labEdges gr)
+3 -3
View File
@@ -45,7 +45,7 @@ updateCombinePositioning u =
updateCombineSections :: updateCombineSections ::
World -> World ->
Configuration -> Config ->
IM.IntMap (SelectionSection CombinableItem) -> IM.IntMap (SelectionSection CombinableItem) ->
IM.IntMap (SelectionSection CombinableItem) IM.IntMap (SelectionSection CombinableItem)
updateCombineSections w cfig = updateCombineSections w cfig =
@@ -115,7 +115,7 @@ displayIndents 3 = 2
displayIndents 5 = 2 displayIndents 5 = 2
displayIndents _ = 0 displayIndents _ = 0
updateDisplaySections :: World -> Configuration -> IMSS () -> IMSS () updateDisplaySections :: World -> Config -> IMSS () -> IMSS ()
updateDisplaySections w cfig = updateDisplaySections w cfig =
updateSectionsPositioning updateSectionsPositioning
displayIndents displayIndents
@@ -319,7 +319,7 @@ toggleCombineInv uv =
Just CombineInventory{} -> uvWorld . hud . subInventory .~ NoSubInventory Just CombineInventory{} -> uvWorld . hud . subInventory .~ NoSubInventory
_ -> uvWorld %~ enterCombineInv (uv ^. uvConfig) _ -> uvWorld %~ enterCombineInv (uv ^. uvConfig)
enterCombineInv :: Configuration -> World -> World enterCombineInv :: Config -> World -> World
enterCombineInv cfig w = enterCombineInv cfig w =
w & hud . subInventory w & hud . subInventory
.~ CombineInventory .~ CombineInventory
+1 -1
View File
@@ -44,7 +44,7 @@ scToTS = \case
ScancodeDown -> Just TSdown ScancodeDown -> Just TSdown
_ -> Nothing _ -> Nothing
handleMouseMotionEvent :: MouseMotionEventData -> Configuration -> Input -> Input handleMouseMotionEvent :: MouseMotionEventData -> Config -> Input -> Input
handleMouseMotionEvent mmev cfig = set mousePos themousepos . set mouseMoving True handleMouseMotionEvent mmev cfig = set mousePos themousepos . set mouseMoving True
where where
P (V2 x y) = mouseMotionEventPos mmev P (V2 x y) = mouseMotionEventPos mmev
+2 -2
View File
@@ -34,7 +34,7 @@ import Picture
-- Int -> -- Int ->
-- Picture -> -- Picture ->
-- Point2 -> -- Point2 ->
-- Configuration -> -- Config ->
-- Camera -> -- Camera ->
-- Picture -- Picture
--fixedSizePicClamp xbord ybord pic p cfig w = --fixedSizePicClamp xbord ybord pic p cfig w =
@@ -61,7 +61,7 @@ fixedSizePicClampArrow ::
Float -> Float ->
Picture -> Picture ->
Point2 -> Point2 ->
Configuration -> Config ->
World -> World ->
Picture Picture
fixedSizePicClampArrow xbord ybord pic p cfig w = fixedSizePicClampArrow xbord ybord pic p cfig w =
+2 -2
View File
@@ -432,10 +432,10 @@ doDrawing' win pdata u = do
renderLayer FixedCoordLayer shadV pokeCounts renderLayer FixedCoordLayer shadV pokeCounts
SDL.glSwapWindow win SDL.glSwapWindow win
getDistortions :: Configuration -> World -> [Distortion] getDistortions :: Config -> World -> [Distortion]
getDistortions cfig w getDistortions cfig w
| cfig ^. graphics_distortions = w ^. cWorld . lWorld . distortions | cfig ^. graphics_distortions = w ^. cWorld . lWorld . distortions
| otherwise = [] | otherwise = []
setViewport :: (Configuration -> ResFactor) -> Configuration -> IO () setViewport :: (Config -> ResFactor) -> Config -> IO ()
setViewport f = uncurry (glViewport 0 0) . getWindowSize f setViewport f = uncurry (glViewport 0 0) . getWindowSize f
+21 -21
View File
@@ -45,14 +45,14 @@ import NewInt
import Picture import Picture
import SDL (MouseButton (..)) import SDL (MouseButton (..))
drawHUD :: Configuration -> World -> Picture drawHUD :: Config -> World -> Picture
drawHUD cfig w = case w ^. hud of drawHUD cfig w = case w ^. hud of
-- DisplayCarte -> drawCarte cfig w -- DisplayCarte -> drawCarte cfig w
HUD {_diSections = sections, _subInventory = subinv} -> HUD {_diSections = sections, _subInventory = subinv} ->
drawInventory sections w cfig drawInventory sections w cfig
<> drawSubInventory subinv cfig w <> drawSubInventory subinv cfig w
drawInventory :: IM.IntMap (SelectionSection ()) -> World -> Configuration -> Picture drawInventory :: IM.IntMap (SelectionSection ()) -> World -> Config -> Picture
drawInventory sss w cfig = drawInventory sss w cfig =
drawSelectionSections sss invDP cfig drawSelectionSections sss invDP cfig
<> drawSSCursor sss invDP curs cfig (f $ w ^? hud . diSelection . _Just) <> drawSSCursor sss invDP curs cfig (f $ w ^? hud . diSelection . _Just)
@@ -74,7 +74,7 @@ drawRootCursor ::
IM.IntMap (SelectionSection ()) -> IM.IntMap (SelectionSection ()) ->
Maybe (Int, Int) -> Maybe (Int, Int) ->
ListDisplayParams -> ListDisplayParams ->
Configuration -> Config ->
Picture Picture
drawRootCursor w sss msel ldp cfig = fromMaybe mempty $ do drawRootCursor w sss msel ldp cfig = fromMaybe mempty $ do
cr <- w ^? cWorld . lWorld . creatures . ix 0 cr <- w ^? cWorld . lWorld . creatures . ix 0
@@ -102,7 +102,7 @@ getRootItemBounds i inv = do
y <- locDTLeftmost root ^? locDT . dtValue . _1 . itLocation . ilInvID . unNInt y <- locDTLeftmost root ^? locDT . dtValue . _1 . itLocation . ilInvID . unNInt
return (x, y) return (x, y)
drawMouseOver :: Configuration -> World -> Picture drawMouseOver :: Config -> World -> Picture
drawMouseOver cfig w = drawMouseOver cfig w =
concat concat
(invsel <|> combinvsel <|> drawDragSelecting cfig w) (invsel <|> combinvsel <|> drawDragSelecting cfig w)
@@ -129,7 +129,7 @@ drawMouseOver cfig w =
. color (withAlpha 0.2 white) . color (withAlpha 0.2 white)
$ selSecDrawCursorAt idp curs sss (j, i) $ selSecDrawCursorAt idp curs sss (j, i)
drawDragSelected :: Configuration -> World -> Maybe Picture drawDragSelected :: Config -> World -> Maybe Picture
drawDragSelected cfig w = do drawDragSelected cfig w = do
ys <- w ^? hud . diSelection . _Just . slSet ys <- w ^? hud . diSelection . _Just . slSet
guard $ guard $
@@ -146,7 +146,7 @@ drawDragSelected cfig w = do
. IS.foldr f mempty . IS.foldr f mempty
$ ys $ ys
drawDragSelecting :: Configuration -> World -> Maybe Picture drawDragSelecting :: Config -> World -> Maybe Picture
drawDragSelecting cfig w = do drawDragSelecting cfig w = do
OverInvDragSelect (Just (i, j)) (Just b) <- w ^? input . mouseContext OverInvDragSelect (Just (i, j)) (Just b) <- w ^? input . mouseContext
sss <- w ^? hud . diSections sss <- w ^? hud . diSections
@@ -156,7 +156,7 @@ drawDragSelecting cfig w = do
. foldMap f . foldMap f
$ [min j b .. max j b] $ [min j b .. max j b]
drawSubInventory :: SubInventory -> Configuration -> World -> Picture drawSubInventory :: SubInventory -> Config -> World -> Picture
drawSubInventory subinv cfig w = case subinv of drawSubInventory subinv cfig w = case subinv of
-- LockedInventory -> mempty -- topInvCursor col cursPos cfig w -- LockedInventory -> mempty -- topInvCursor col cursPos cfig w
NoSubInventory{} -> drawRBOptions cfig w NoSubInventory{} -> drawRBOptions cfig w
@@ -176,7 +176,7 @@ drawMapperInventory itid w = fold $ do
f = worldPosToScreen (w ^. wCam) f = worldPosToScreen (w ^. wCam)
drawCombineInventory :: drawCombineInventory ::
Configuration -> Config ->
IM.IntMap (SelectionSection CombinableItem) -> IM.IntMap (SelectionSection CombinableItem) ->
World -> World ->
Picture Picture
@@ -191,7 +191,7 @@ drawCombineInventory cfig sss w =
fmap (\(Sel x y _) -> (x, y)) $ fmap (\(Sel x y _) -> (x, y)) $
w ^? hud . subInventory . ciSelection . _Just w ^? hud . subInventory . ciSelection . _Just
drawExamineInventory :: Configuration -> World -> Picture drawExamineInventory :: Config -> World -> Picture
drawExamineInventory cfig w = drawExamineInventory cfig w =
invHead cfig "EXAMINE" invHead cfig "EXAMINE"
<> drawSelectionList <> drawSelectionList
@@ -244,7 +244,7 @@ yourAugmentedItem f x g w = case you w ^? crManipulation . manObject of
return . g $ Right but return . g $ Right but
_ -> x _ -> x
drawRBOptions :: Configuration -> World -> Picture drawRBOptions :: Config -> World -> Picture
drawRBOptions cfig w = fold $ do drawRBOptions cfig w = fold $ do
guard $ ButtonRight `M.member` _mouseButtons (_input w) guard $ ButtonRight `M.member` _mouseButtons (_input w)
invid <- you w ^? crManipulation . manObject . imSelectedItem invid <- you w ^? crManipulation . manObject . imSelectedItem
@@ -314,7 +314,7 @@ equipAllocString = \case
drawItemConnections :: drawItemConnections ::
IM.IntMap (SelectionSection ()) -> IM.IntMap (SelectionSection ()) ->
Configuration -> Config ->
IM.IntMap (Maybe (Int, Int), [Int], [Int]) -> IM.IntMap (Maybe (Int, Int), [Int], [Int]) ->
Picture Picture
drawItemConnections sss cfig = drawItemConnections sss cfig =
@@ -324,7 +324,7 @@ drawItemConnections sss cfig =
drawItemChildrenConnect :: drawItemChildrenConnect ::
IM.IntMap (SelectionSection ()) -> IM.IntMap (SelectionSection ()) ->
Configuration -> Config ->
Int -> Int ->
[Int] -> [Int] ->
Picture Picture
@@ -338,7 +338,7 @@ drawItemChildrenConnect sss cfig i is = fromMaybe mempty $ do
combineInventoryExtra :: combineInventoryExtra ::
IM.IntMap (SelectionSection CombinableItem) -> IM.IntMap (SelectionSection CombinableItem) ->
Maybe (Int, Int) -> Maybe (Int, Int) ->
Configuration -> Config ->
World -> World ->
Picture Picture
combineInventoryExtra sss msel cfig w = fold $ do combineInventoryExtra sss msel cfig w = fold $ do
@@ -358,7 +358,7 @@ combineInventoryExtra sss msel cfig w = fold $ do
sss' sss'
(Just (0, i)) (Just (0, i))
drawTerminalDisplay :: Configuration -> Terminal -> Picture drawTerminalDisplay :: Config -> Terminal -> Picture
drawTerminalDisplay cfig tm = drawTerminalDisplay cfig tm =
invHead cfig ("T-" ++ show tid) invHead cfig ("T-" ++ show tid)
<> drawSelectionList secondColumnParams cfig f <> drawSelectionList secondColumnParams cfig f
@@ -387,7 +387,7 @@ drawTerminalDisplay cfig tm =
-- | hasfoc = clockCycle 10 (V.fromList [[cFilledRect] , "."]) w -- | hasfoc = clockCycle 10 (V.fromList [[cFilledRect] , "."]) w
lnkMidPosInvSelsCol :: Configuration -> World -> Int -> Color -> [Int] -> Picture lnkMidPosInvSelsCol :: Config -> World -> Int -> Color -> [Int] -> Picture
lnkMidPosInvSelsCol cfig w i col = fromMaybe mempty . foldMap f lnkMidPosInvSelsCol cfig w i col = fromMaybe mempty . foldMap f
where where
f j = do f j = do
@@ -398,7 +398,7 @@ lnkMidPosInvSelsCol cfig w i col = fromMaybe mempty . foldMap f
invcol <- selSecSelCol 0 j sss invcol <- selSecSelCol 0 j sss
return $ zConnectColMidX (rp - V2 5 0) (lp + V2 155 0) (rp ^. _1 - 20) col col col invcol return $ zConnectColMidX (rp - V2 5 0) (lp + V2 155 0) (rp ^. _1 - 20) col col col invcol
invHead :: Configuration -> String -> Picture invHead :: Config -> String -> Picture
invHead cfig = invHead cfig =
translateScreenPos cfig (fromTopLeft (V2 subInvX 80)) translateScreenPos cfig (fromTopLeft (V2 subInvX 80))
. dShadCol white . dShadCol white
@@ -408,7 +408,7 @@ invHead cfig =
--locPoss = map (cartePosToScreen cfig (w ^. hud) . ($ w) . doWorldPos . fst) . IM.elems . _seenLocations . _lWorld $ _cWorld w --locPoss = map (cartePosToScreen cfig (w ^. hud) . ($ w) . doWorldPos . fst) . IM.elems . _seenLocations . _lWorld $ _cWorld w
--locTexts = map fst locs --locTexts = map fst locs
--displayListEndCoords :: Configuration -> [String] -> [Point2] --displayListEndCoords :: Config -> [String] -> [Point2]
--displayListEndCoords cfig ss = map (doWindowScale cfig) $ zipWith h ss $ map f [1 ..] --displayListEndCoords cfig ss = map (doWindowScale cfig) $ zipWith h ss $ map f [1 ..]
-- where -- where
-- f :: Int -> Point2 -- f :: Int -> Point2
@@ -416,7 +416,7 @@ invHead cfig =
-- h :: String -> Point2 -> Point2 -- h :: String -> Point2 -> Point2
-- h s (V2 x y) = V2 (x + 9 * fromIntegral (length s)) y -- h s (V2 x y) = V2 (x + 9 * fromIntegral (length s)) y
--closeObjectTexts :: Configuration -> World -> Picture --closeObjectTexts :: Config -> World -> Picture
--closeObjectTexts cfig w = pictures $ --closeObjectTexts cfig w = pictures $
-- renderListAt pushout (negate 20 * fromIntegral invPos) cfig (map colAndText $ _closeObjects w) -- renderListAt pushout (negate 20 * fromIntegral invPos) cfig (map colAndText $ _closeObjects w)
-- : maybeToList maybeLine -- : maybeToList maybeLine
@@ -448,9 +448,9 @@ invHead cfig =
-- would be nice to add parameter to orient this with NSEW, cf cursor -- would be nice to add parameter to orient this with NSEW, cf cursor
selNumPos :: selNumPos ::
Configuration -> Config ->
ListDisplayParams -> ListDisplayParams ->
IM.IntMap (SelectionSection a) -> IMSS a ->
Int -> Int ->
Int -> Int ->
Maybe Point2 Maybe Point2
@@ -472,7 +472,7 @@ selNumPos = selNumPosCardinal West8
-- need to be able to determine a selection item's width for this -- need to be able to determine a selection item's width for this
selNumPosCardinal :: selNumPosCardinal ::
CardinalEightPoint -> CardinalEightPoint ->
Configuration -> Config ->
ListDisplayParams -> ListDisplayParams ->
IM.IntMap (SelectionSection a) -> IM.IntMap (SelectionSection a) ->
Int -> Int ->
+4 -4
View File
@@ -11,7 +11,7 @@ module Dodge.Render.HUD.Carte (
--import qualified IntMapHelp as IM --import qualified IntMapHelp as IM
--import Picture --import Picture
-- --
----drawCarte :: Configuration -> World -> Picture ----drawCarte :: Config -> World -> Picture
----drawCarte cfig w = ----drawCarte cfig w =
---- fold $ ---- fold $
---- toTopLeft cfig (renderListAt 0 0 locs) : ---- toTopLeft cfig (renderListAt 0 0 locs) :
@@ -38,7 +38,7 @@ module Dodge.Render.HUD.Carte (
-- (x, y) = _wlLine wl -- (x, y) = _wlLine wl
-- c = _wlColor wl -- c = _wlColor wl
-- --
----mapWall :: Configuration -> HUD -> Wall -> Maybe Picture ----mapWall :: Config -> HUD -> Wall -> Maybe Picture
----mapWall cfig thehud wl ----mapWall cfig thehud wl
---- | _wlSeen wl = Just . color c . polygon $ map (cartePosToScreen cfig thehud) [x, x +.+ n2, y +.+ n2, y] ---- | _wlSeen wl = Just . color c . polygon $ map (cartePosToScreen cfig thehud) [x, x +.+ n2, y +.+ n2, y]
---- | otherwise = Nothing ---- | otherwise = Nothing
@@ -48,7 +48,7 @@ module Dodge.Render.HUD.Carte (
---- (x, y) = _wlLine wl ---- (x, y) = _wlLine wl
---- c = _wlColor wl ---- c = _wlColor wl
-- --
--mainListCursor :: Color -> Int -> Configuration -> Picture --mainListCursor :: Color -> Int -> Config -> Picture
--mainListCursor c = openCursorAt 120 c 5 0 --mainListCursor c = openCursorAt 120 c 5 0
-- --
--openCursorAt :: --openCursorAt ::
@@ -61,7 +61,7 @@ module Dodge.Render.HUD.Carte (
-- Float -> -- Float ->
-- -- | y offset (discrete) -- -- | y offset (discrete)
-- Int -> -- Int ->
-- Configuration -> -- Config ->
-- Picture -- Picture
--openCursorAt wth col xoff yoff yint w = --openCursorAt wth col xoff yoff yint w =
-- translate (xoff - halfWidth w) (halfHeight w - (20 * fromIntegral yint + yoff) - 20) $ -- translate (xoff - halfWidth w) (halfHeight w - (20 * fromIntegral yint + yoff) - 20) $
+2 -2
View File
@@ -17,7 +17,7 @@ import Picture
renderInfoListAt :: renderInfoListAt ::
Float -> Float ->
Float -> Float ->
Configuration -> Config ->
Camera -> Camera ->
(Point2, [String]) -> (Point2, [String]) ->
Picture Picture
@@ -41,7 +41,7 @@ renderInfoListAt x y cfig cam (p, ss) =
hw = halfWidth cfig hw = halfWidth cfig
hh = halfHeight cfig hh = halfHeight cfig
renderInfoListsAt :: Float -> Float -> Configuration -> Camera -> [(Point2, [String])] -> Picture renderInfoListsAt :: Float -> Float -> Config -> Camera -> [(Point2, [String])] -> Picture
renderInfoListsAt x y cfig w = renderInfoListsAt x y cfig w =
fst . foldr f (mempty, 0) fst . foldr f (mempty, 0)
where where
+1 -1
View File
@@ -11,7 +11,7 @@ import Geometry
import qualified IntMapHelp as IM import qualified IntMapHelp as IM
import Control.Lens import Control.Lens
lightsToRender :: Configuration -> Camera -> LWorld -> [(Point3, Float, Point3)] lightsToRender :: Config -> Camera -> LWorld -> [(Point3, Float, Point3)]
{-# INLINE lightsToRender #-} {-# INLINE lightsToRender #-}
lightsToRender cfig campos w = take (fromEnum $ cfig ^. graphics_num_shadow_casters) $ lightsToRender cfig campos w = take (fromEnum $ cfig ^. graphics_num_shadow_casters) $
sortOn (\(_,x,_) -> negate x) $ sortOn (\(_,x,_) -> negate x) $
+6 -6
View File
@@ -32,7 +32,7 @@ import LensHelp
import ListHelp import ListHelp
import Picture import Picture
drawSelectionList :: ListDisplayParams -> Configuration -> [SelectionItem a] -> Picture drawSelectionList :: ListDisplayParams -> Config -> [SelectionItem a] -> Picture
drawSelectionList ldps cfig sl = drawSelectionList ldps cfig sl =
translateScreenPos cfig (ldps ^. ldpPos) $ translateScreenPos cfig (ldps ^. ldpPos) $
drawListYgapScaleYoff drawListYgapScaleYoff
@@ -41,7 +41,7 @@ drawSelectionList ldps cfig sl =
0 0
(makeSelectionListPictures sl) (makeSelectionListPictures sl)
drawTitleBackground :: Configuration -> Picture drawTitleBackground :: Config -> Picture
drawTitleBackground cfig = drawTitleBackground cfig =
translateScreenPos cfig (fromTopLeft (V2 (subInvX - 5) 75)) translateScreenPos cfig (fromTopLeft (V2 (subInvX - 5) 75))
. polygon . polygon
@@ -50,7 +50,7 @@ drawTitleBackground cfig =
drawSelectionListBackground :: drawSelectionListBackground ::
ListDisplayParams -> ListDisplayParams ->
Configuration -> Config ->
Int -> -- list length Int -> -- list length
Picture Picture
drawSelectionListBackground ldp cfig l = drawSelectionListBackground ldp cfig l =
@@ -164,7 +164,7 @@ chooseCursorBorders w h = \case
toLine South = [V2 w h', V2 0 h'] toLine South = [V2 w h', V2 0 h']
toLine West = [V2 0 h', V2 0 0] toLine West = [V2 0 h', V2 0 0]
--fillScreenText :: Configuration -> String -> Picture --fillScreenText :: Config -> String -> Picture
--fillScreenText cfig str = --fillScreenText cfig str =
-- scale wscale hscale -- scale wscale hscale
-- . centerText -- . centerText
@@ -175,7 +175,7 @@ chooseCursorBorders w h = \case
-- hw = halfWidth cfig -- hw = halfWidth cfig
-- hh = halfHeight cfig -- hh = halfHeight cfig
--fillWidthText :: Configuration -> String -> Picture --fillWidthText :: Config -> String -> Picture
--fillWidthText cfig str = --fillWidthText cfig str =
-- scale thescale thescale -- scale thescale thescale
-- . centerText -- . centerText
@@ -216,5 +216,5 @@ dShadCol :: Color -> Picture -> Picture
{-# INLINE dShadCol #-} {-# INLINE dShadCol #-}
dShadCol c p = color black (translate 1.2 (-1.2) p) <> color c p dShadCol c p = color black (translate 1.2 (-1.2) p) <> color c p
toTopLeft :: Configuration -> Picture -> Picture toTopLeft :: Config -> Picture -> Picture
toTopLeft cfig = translate (- halfWidth cfig) (halfHeight cfig) toTopLeft cfig = translate (- halfWidth cfig) (halfHeight cfig)
+6 -6
View File
@@ -13,14 +13,14 @@ import Dodge.Render.List
import Dodge.ScreenPos import Dodge.ScreenPos
import Picture import Picture
drawMenuScreen :: Configuration -> Maybe Int -> ScreenLayer -> Picture drawMenuScreen :: Config -> Maybe Int -> ScreenLayer -> Picture
drawMenuScreen cfig spos screen = case screen of drawMenuScreen cfig spos screen = case screen of
OptionScreen{_scTitle = titf, _scSelectionList = slist} -> OptionScreen{_scTitle = titf, _scSelectionList = slist} ->
drawOptions cfig titf spos slist drawOptions cfig titf spos slist
InputScreen inputstr help -> drawInputMenu cfig ('>' : inputstr) help InputScreen inputstr help -> drawInputMenu cfig ('>' : inputstr) help
drawInputMenu :: drawInputMenu ::
Configuration -> Config ->
-- | Title -- | Title
String -> String ->
-- | Help Text -- | Help Text
@@ -33,7 +33,7 @@ drawInputMenu cfig title footer =
, drawFooterText cfig red footer , drawFooterText cfig red footer
] ]
drawOptions :: Configuration -> String -> Maybe Int -> [SelectionItem a] -> Picture drawOptions :: Config -> String -> Maybe Int -> [SelectionItem a] -> Picture
drawOptions cfig title msel sl = drawOptions cfig title msel sl =
darkenBackground cfig darkenBackground cfig
<> drawTitle cfig title <> drawTitle cfig title
@@ -49,10 +49,10 @@ drawOptions cfig title msel sl =
(BoundaryCursor [North, South]) (BoundaryCursor [North, South])
) )
darkenBackground :: Configuration -> Picture darkenBackground :: Config -> Picture
darkenBackground = color (withAlpha 0.5 black) . polygon . reverse . screenBox darkenBackground = color (withAlpha 0.5 black) . polygon . reverse . screenBox
drawTitle :: Configuration -> String -> Picture drawTitle :: Config -> String -> Picture
drawTitle cfig = translate (- hw) (hh -80) . scale 0.4 0.4 . text drawTitle cfig = translate (- hw) (hh -80) . scale 0.4 0.4 . text
where where
hh = halfHeight cfig hh = halfHeight cfig
@@ -69,7 +69,7 @@ placeString ::
Picture Picture
placeString x y sc = color white . translate x y . scale sc sc . text placeString x y sc = color white . translate x y . scale sc sc . text
drawFooterText :: Configuration -> Color -> String -> Picture drawFooterText :: Config -> Color -> String -> Picture
drawFooterText cfig col = color col . placeString (- hw + 30) (- hh + 10) 0.1 drawFooterText cfig col = color col . placeString (- hw + 30) (- hh + 10) 0.1
where where
hh = halfHeight cfig hh = halfHeight cfig
+1 -1
View File
@@ -61,7 +61,7 @@ fpsText x = color col . text $ "ms/frame " ++ show x
| x < 50 = orange | x < 50 = orange
| otherwise = red | otherwise = red
drawMenuOrHUD :: Configuration -> Universe -> Picture drawMenuOrHUD :: Config -> Universe -> Picture
drawMenuOrHUD cfig u = case u ^. uvScreenLayers of drawMenuOrHUD cfig u = case u ^. uvScreenLayers of
[] -> drawHUD (u ^. uvConfig) (u ^. uvWorld) [] -> drawHUD (u ^. uvConfig) (u ^. uvWorld)
(x : _) -> drawMenuScreen cfig (u ^? uvWorld . input . mouseContext . mcoMenuClick) x (x : _) -> drawMenuScreen cfig (u ^? uvWorld . input . mouseContext . mcoMenuClick) x
+3 -3
View File
@@ -18,7 +18,7 @@ import Shape
import ShapePicture import ShapePicture
import Linear.V3 import Linear.V3
worldSPic :: Configuration -> Universe -> SPic worldSPic :: Config -> Universe -> SPic
worldSPic cfig u = worldSPic cfig u =
(mempty :!: extraPics cfig u) (mempty :!: extraPics cfig u)
<> foldup propSPic (filtOn _prPos _props) <> foldup propSPic (filtOn _prPos _props)
@@ -87,12 +87,12 @@ shiftDraw' fpos fdir fdraw x =
. rotateSP (fdir x) . rotateSP (fdir x)
$ fdraw x $ fdraw x
cullPoint :: Configuration -> World -> Point2 -> Bool cullPoint :: Config -> World -> Point2 -> Bool
cullPoint cfig w p cullPoint cfig w p
| debugOn Close_shape_culling cfig = pointInPolygon p (w ^. wCam . camBoundBox) | debugOn Close_shape_culling cfig = pointInPolygon p (w ^. wCam . camBoundBox)
| otherwise = dist (w ^. wCam . camCenter) p < (w ^. wCam . camViewDistance) | otherwise = dist (w ^. wCam . camCenter) p < (w ^. wCam . camViewDistance)
extraPics :: Configuration -> Universe -> Picture extraPics :: Config -> Universe -> Picture
extraPics cfig u = extraPics cfig u =
setLayer FixedCoordLayer (fixedCoordPictures u) setLayer FixedCoordLayer (fixedCoordPictures u)
<> foldMap drawTractorBeam (_tractorBeams lw) <> foldMap drawTractorBeam (_tractorBeams lw)
+2 -2
View File
@@ -9,10 +9,10 @@ import Picture.Base
fromTopLeft :: Point2 -> ScreenPos fromTopLeft :: Point2 -> ScreenPos
fromTopLeft (V2 x y) = ScreenPos (V2 (-0.5) 0.5) (V2 x (- y)) fromTopLeft (V2 x y) = ScreenPos (V2 (-0.5) 0.5) (V2 x (- y))
translateScreenPos :: Configuration -> ScreenPos -> Picture -> Picture translateScreenPos :: Config -> ScreenPos -> Picture -> Picture
translateScreenPos cfig = uncurryV translate . screenPosAbs cfig translateScreenPos cfig = uncurryV translate . screenPosAbs cfig
screenPosAbs :: Configuration -> ScreenPos -> Point2 screenPosAbs :: Config -> ScreenPos -> Point2
screenPosAbs cfig sp = sp ^. spScreenOff * V2 w h + sp ^. spPixelOff screenPosAbs cfig sp = sp ^. spScreenOff * V2 w h + sp ^. spPixelOff
where where
w = fromIntegral $ cfig ^. windowX w = fromIntegral $ cfig ^. windowX
+1 -1
View File
@@ -7,7 +7,7 @@ import Dodge.Data.Universe
import LensHelp import LensHelp
import Linear import Linear
getAvailableListLines :: ListDisplayParams -> Configuration -> Int getAvailableListLines :: ListDisplayParams -> Config -> Int
getAvailableListLines ldps cfig = floor ((dToBot - vgap) / itmHeight) getAvailableListLines ldps cfig = floor ((dToBot - vgap) / itmHeight)
where where
vgap = ldps ^. ldpVerticalGap vgap = ldps ^. ldpVerticalGap
+24 -59
View File
@@ -39,10 +39,7 @@ ssScrollUsing ::
IMSS a -> IMSS a ->
Maybe Selection -> Maybe Selection ->
Maybe Selection Maybe Selection
ssScrollUsing g = ssScrollUsing g = ssScrollMinOnFail g . fmap (ssItems %~ IM.filter _siIsSelectable)
ssScrollMinOnFail
g
. fmap (ssItems %~ IM.filter _siIsSelectable)
ssScrollMinOnFail :: ssScrollMinOnFail ::
(Int -> Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)) -> (Int -> Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)) ->
@@ -60,8 +57,8 @@ ssScrollMinOnFail f sss msel = fmap (\(i, j, _) -> Sel i j (q i j)) $ l <|> ssLo
f i j sss f i j sss
ssSetCursor :: ssSetCursor ::
(IM.IntMap (SelectionSection a) -> Maybe (Int, Int, SelectionItem a)) -> (IMSS a -> Maybe (Int, Int, SelectionItem a)) ->
IM.IntMap (SelectionSection a) -> IMSS a ->
Maybe Selection -> Maybe Selection ->
Maybe Selection Maybe Selection
ssSetCursor f sss msel = fromMaybe msel $ do ssSetCursor f sss msel = fromMaybe msel $ do
@@ -72,111 +69,87 @@ ssSetCursor f sss msel = fromMaybe msel $ do
return xs return xs
return $ Just (Sel i j newxs) return $ Just (Sel i j newxs)
ssLookupMax :: IM.IntMap (SelectionSection a) -> Maybe (Int, Int, SelectionItem a) ssLookupMax :: IMSS a -> Maybe (Int, Int, SelectionItem a)
ssLookupMax sss = do ssLookupMax sss = do
(i, _) <- IM.lookupMax sss (i, _) <- IM.lookupMax sss
ssLookupLE' i sss ssLookupLE' i sss
ssLookupUp :: ssLookupUp :: Int -> Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)
Int ->
Int ->
IM.IntMap (SelectionSection a) ->
Maybe (Int, Int, SelectionItem a)
ssLookupUp i j sss = case ssLookupLT i j sss of ssLookupUp i j sss = case ssLookupLT i j sss of
Nothing -> ssLookupMax sss Nothing -> ssLookupMax sss
x -> x x -> x
ssLookupDown :: ssLookupDown :: Int -> Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)
Int ->
Int ->
IM.IntMap (SelectionSection a) ->
Maybe (Int, Int, SelectionItem a)
ssLookupDown i j sss = case ssLookupGT i j sss of ssLookupDown i j sss = case ssLookupGT i j sss of
Nothing -> ssLookupMin sss Nothing -> ssLookupMin sss
x -> x x -> x
ssLookupNextMax :: ssLookupNextMax :: Int -> Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)
Int ->
Int ->
IM.IntMap (SelectionSection a) ->
Maybe (Int, Int, SelectionItem a)
ssLookupNextMax i j sss = case ssLookupGT i j sss of ssLookupNextMax i j sss = case ssLookupGT i j sss of
Just x@(i',j',_) | i' == i && j' > j -> Just x Just x@(i',j',_) | i' == i && j' > j -> Just x
_ -> ssLookupMaxInSection i sss <|> ssLookupDown i j sss _ -> ssLookupMaxInSection i sss <|> ssLookupDown i j sss
ssLookupMaxInSection :: Int -> IM.IntMap (SelectionSection a) -> ssLookupMaxInSection :: Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)
Maybe (Int, Int, SelectionItem a)
ssLookupMaxInSection i sss = do ssLookupMaxInSection i sss = do
ss <- sss ^? ix i . ssItems ss <- sss ^? ix i . ssItems
(j,s) <- IM.lookupMax ss (j,s) <- IM.lookupMax ss
return (i,j,s) return (i,j,s)
ssLookupLT :: ssLookupLT :: Int -> Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)
Int ->
Int ->
IM.IntMap (SelectionSection a) ->
Maybe (Int, Int, SelectionItem a)
ssLookupLT i j sss = fromMaybe (ssLookupLT' i sss) $ do ssLookupLT i j sss = fromMaybe (ssLookupLT' i sss) $ do
ss <- sss ^? ix i ss <- sss ^? ix i
(j', si) <- IM.lookupLT j (ss ^. ssItems) (j', si) <- IM.lookupLT j (ss ^. ssItems)
return $ Just (i, j', si) return $ Just (i, j', si)
ssLookupLT' :: ssLookupLT' :: Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)
Int ->
IM.IntMap (SelectionSection a) ->
Maybe (Int, Int, SelectionItem a)
ssLookupLT' i sss = do ssLookupLT' i sss = do
(i', ss) <- IM.lookupLT i sss (i', ss) <- IM.lookupLT i sss
case IM.lookupMax (ss ^. ssItems) of case IM.lookupMax (ss ^. ssItems) of
Just (j', si) -> return (i', j', si) Just (j', si) -> return (i', j', si)
Nothing -> ssLookupLT' i' sss Nothing -> ssLookupLT' i' sss
ssLookupLE' :: Int -> IM.IntMap (SelectionSection a) -> Maybe (Int, Int, SelectionItem a) ssLookupLE' :: Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)
ssLookupLE' i sss = do ssLookupLE' i sss = do
(i', ss) <- IM.lookupLE i sss (i', ss) <- IM.lookupLE i sss
case IM.lookupMax (ss ^. ssItems) of case IM.lookupMax (ss ^. ssItems) of
Just (j', si) -> return (i', j', si) Just (j', si) -> return (i', j', si)
Nothing -> ssLookupLT' i' sss Nothing -> ssLookupLT' i' sss
ssLookupMin :: IM.IntMap (SelectionSection a) -> Maybe (Int, Int, SelectionItem a) ssLookupMin :: IMSS a -> Maybe (Int, Int, SelectionItem a)
ssLookupMin sss = do ssLookupMin sss = do
(i, _) <- IM.lookupMin sss (i, _) <- IM.lookupMin sss
ssLookupGE' i sss ssLookupGE' i sss
ssLookupGT :: ssLookupGT :: Int -> Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)
Int ->
Int ->
IM.IntMap (SelectionSection a) ->
Maybe (Int, Int, SelectionItem a)
ssLookupGT i j sss = fromMaybe (ssLookupGT' i sss) $ do ssLookupGT i j sss = fromMaybe (ssLookupGT' i sss) $ do
ss <- sss ^? ix i ss <- sss ^? ix i
(j', si) <- IM.lookupGT j (ss ^. ssItems) (j', si) <- IM.lookupGT j (ss ^. ssItems)
return $ Just (i, j', si) return $ Just (i, j', si)
ssLookupGT' :: Int -> IM.IntMap (SelectionSection a) -> Maybe (Int, Int, SelectionItem a) ssLookupGT' :: Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)
ssLookupGT' i sss = do ssLookupGT' i sss = do
(i', ss) <- IM.lookupGT i sss (i', ss) <- IM.lookupGT i sss
case IM.lookupMin (ss ^. ssItems) of case IM.lookupMin (ss ^. ssItems) of
Just (j', si) -> return (i', j', si) Just (j', si) -> return (i', j', si)
Nothing -> ssLookupGT' i' sss Nothing -> ssLookupGT' i' sss
ssLookupGE' :: Int -> IM.IntMap (SelectionSection a) -> Maybe (Int, Int, SelectionItem a) ssLookupGE' :: Int -> IMSS a -> Maybe (Int, Int, SelectionItem a)
ssLookupGE' i sss = do ssLookupGE' i sss = do
(i', ss) <- IM.lookupGE i sss (i', ss) <- IM.lookupGE i sss
case IM.lookupMin (ss ^. ssItems) of case IM.lookupMin (ss ^. ssItems) of
Just (j', si) -> return (i', j', si) Just (j', si) -> return (i', j', si)
Nothing -> ssLookupGT' i' sss Nothing -> ssLookupGT' i' sss
selSecSelSize :: Int -> Int -> IM.IntMap (SelectionSection a) -> Maybe Int selSecSelSize :: Int -> Int -> IMSS a -> Maybe Int
selSecSelSize i j = (^? ix i . ssItems . ix j . siHeight) selSecSelSize i j = (^? ix i . ssItems . ix j . siHeight)
-- need to check that the vertical gap is correctly put in here -- need to check that the vertical gap is correctly put in here
posSelSecYint :: Configuration -> ListDisplayParams -> Float -> Int posSelSecYint :: Config -> ListDisplayParams -> Float -> Int
posSelSecYint cfig ldp y = floor $ (y0 - y) / (20 / ldp ^. ldpScale + ldp ^. ldpVerticalGap) posSelSecYint cfig ldp y = floor $ (y0 - y) / (20 / ldp ^. ldpScale + ldp ^. ldpVerticalGap)
where where
V2 _ y0 = screenPosAbs cfig (ldp ^. ldpPos) V2 _ y0 = screenPosAbs cfig (ldp ^. ldpPos)
selSecYint :: Int -> Int -> IM.IntMap (SelectionSection a) -> Maybe Int selSecYint :: Int -> Int -> IMSS a -> Maybe Int
selSecYint i j sss = do selSecYint i j sss = do
ss <- sss ^? ix i ss <- sss ^? ix i
return . (secpos +) return . (secpos +)
@@ -188,7 +161,7 @@ selSecYint i j sss = do
where where
secpos = sum . fmap _ssShownLength . fst $ IM.split i sss secpos = sum . fmap _ssShownLength . fst $ IM.split i sss
inverseSelSecYint :: Int -> IM.IntMap (SelectionSection a) -> XInfinity (Int, Int) inverseSelSecYint :: Int -> IMSS a -> XInfinity (Int, Int)
inverseSelSecYint yint sss inverseSelSecYint yint sss
| yint < 0 = NegInf | yint < 0 = NegInf
| otherwise = fromMaybe PosInf $ do | otherwise = fromMaybe PosInf $ do
@@ -202,11 +175,11 @@ inverseSelSecYint yint sss
return $ NonInf (i, j) return $ NonInf (i, j)
inverseSelSecYintXPosCheck :: inverseSelSecYintXPosCheck ::
Configuration -> Config ->
ListDisplayParams -> ListDisplayParams ->
Float -> Float ->
Int -> Int ->
IM.IntMap (SelectionSection a) -> IMSS a ->
Maybe (Int,Int) Maybe (Int,Int)
inverseSelSecYintXPosCheck cfig ldp x yint sss = do inverseSelSecYintXPosCheck cfig ldp x yint sss = do
(i,j) <- inverseSelSecYint yint sss ^? nonInf (i,j) <- inverseSelSecYint yint sss ^? nonInf
@@ -217,14 +190,6 @@ inverseSelSecYintXPosCheck cfig ldp x yint sss = do
guard $ x - x1 < 160 && x > x1 guard $ x - x1 < 160 && x > x1
return (i,j) return (i,j)
inverseSelNumPos :: inverseSelNumPos :: Config -> ListDisplayParams -> Point2 -> IMSS a -> Maybe (Int, Int)
Configuration -> inverseSelNumPos cfig ldp (V2 x y) =
ListDisplayParams -> inverseSelSecYintXPosCheck cfig ldp x (posSelSecYint cfig ldp y)
IM.IntMap (SelectionSection a) ->
Point2 ->
Maybe (Int, Int)
inverseSelNumPos cfig ldp sss (V2 x y) =
inverseSelSecYintXPosCheck cfig ldp x (posSelSecYint cfig ldp y) sss
--getIthPos :: Int -> IM.IntMap (SelectionItem a) -> Int
--getIthPos i sm = sum . fmap _siHeight . fst $ IM.split i sm
+3 -3
View File
@@ -16,7 +16,7 @@ import Picture.Base
drawSelectionSections :: drawSelectionSections ::
IM.IntMap (SelectionSection a) -> IM.IntMap (SelectionSection a) ->
ListDisplayParams -> ListDisplayParams ->
Configuration -> Config ->
Picture Picture
drawSelectionSections sss ldp cfig = drawSelectionSections sss ldp cfig =
translateScreenPos cfig (ldp ^. ldpPos) $ translateScreenPos cfig (ldp ^. ldpPos) $
@@ -36,7 +36,7 @@ drawSSCursor ::
IM.IntMap (SelectionSection a) -> IM.IntMap (SelectionSection a) ->
ListDisplayParams -> ListDisplayParams ->
CursorDisplay -> CursorDisplay ->
Configuration -> Config ->
Maybe (Int, Int) -> Maybe (Int, Int) ->
Picture Picture
drawSSCursor sss ldp curs cfig = drawSSCursor sss ldp curs cfig =
@@ -49,7 +49,7 @@ drawSSMultiCursor ::
Maybe Int -> Maybe Int ->
ListDisplayParams -> ListDisplayParams ->
CursorDisplay -> CursorDisplay ->
Configuration -> Config ->
Picture Picture
drawSSMultiCursor sss msel mextra ldp curs cfig = translateScreenPos cfig (ldp ^. ldpPos) drawSSMultiCursor sss msel mextra ldp curs cfig = translateScreenPos cfig (ldp ^. ldpPos)
. fold . fold
+9 -9
View File
@@ -339,12 +339,12 @@ checkTermDist w = fromMaybe w $ do
guard $ dist btpos (_crPos $ you w) > 40 guard $ dist btpos (_crPos $ you w) > 40
return $ w & hud . subInventory .~ NoSubInventory return $ w & hud . subInventory .~ NoSubInventory
updateMouseContext :: Configuration -> Universe -> Universe updateMouseContext :: Config -> Universe -> Universe
updateMouseContext cfig u = case u ^? uvScreenLayers . ix 0 of updateMouseContext cfig u = case u ^? uvScreenLayers . ix 0 of
Just screen -> u & uvWorld . input . mouseContext .~ getMenuMouseContext screen u Just screen -> u & uvWorld . input . mouseContext .~ getMenuMouseContext screen u
Nothing -> updateMouseContextGame cfig u Nothing -> updateMouseContextGame cfig u
updateMouseContextGame :: Configuration -> Universe -> Universe updateMouseContextGame :: Config -> Universe -> Universe
updateMouseContextGame cfig u = case u ^. uvWorld . input . mouseContext of updateMouseContextGame cfig u = case u ^. uvWorld . input . mouseContext of
OverInvDrag i _ -> u & uvWorld . input . mouseContext .~ invdrag i OverInvDrag i _ -> u & uvWorld . input . mouseContext .~ invdrag i
OverInvDragSelect{} -> u OverInvDragSelect{} -> u
@@ -362,25 +362,25 @@ updateMouseContextGame cfig u = case u ^. uvWorld . input . mouseContext of
| ButtonRight `M.member` (w ^. input . mouseButtons) = MouseAiming | ButtonRight `M.member` (w ^. input . mouseButtons) = MouseAiming
| otherwise = MouseInGame | otherwise = MouseInGame
mpos = w ^. input . mousePos mpos = w ^. input . mousePos
disss = w ^. hud . diSections
invdrag i' = fromMaybe (OverInvDrag i' Nothing) $ do invdrag i' = fromMaybe (OverInvDrag i' Nothing) $ do
sss <- w ^? hud . diSections -- sss <- w ^? hud . diSections
(i, j) <- inverseSelNumPos cfig invDP sss mpos (i, j) <- inverseSelNumPos cfig invDP mpos disss
return $ OverInvDrag i' (Just (i, j)) return $ OverInvDrag i' (Just (i, j))
overinv = do overinv = do
sss <- w ^? hud . diSections selpos@(i, j) <- inverseSelNumPos cfig invDP mpos disss
selpos@(i, j) <- inverseSelNumPos cfig invDP sss mpos
case w ^? hud . subInventory . ciSelection of case w ^? hud . subInventory . ciSelection of
Just _ | i == 0 -> return $ OverCombFiltInv selpos Just _ | i == 0 -> return $ OverCombFiltInv selpos
Just _ -> Nothing Just _ -> Nothing
_ -> do _ -> do
guard $ ButtonRight `M.notMember` (w ^. input . mouseButtons) guard $ ButtonRight `M.notMember` (w ^. input . mouseButtons)
guard =<< sss ^? ix i . ssItems . ix j . siIsSelectable guard =<< disss ^? ix i . ssItems . ix j . siIsSelectable
return $ OverInvSelect selpos return $ OverInvSelect selpos
overcomb = do overcomb = do
sss <- w ^? hud . subInventory . ciSections sss <- w ^? hud . subInventory . ciSections
Sel xl xr _ <- w ^? hud . subInventory . ciSelection . _Just Sel xl xr _ <- w ^? hud . subInventory . ciSelection . _Just
let msel = (xl, xr) let msel = (xl, xr)
let mpossel = inverseSelNumPos cfig secondColumnParams sss (w ^. input . mousePos) let mpossel = inverseSelNumPos cfig secondColumnParams (w ^. input . mousePos) sss
return $ case mpossel of return $ case mpossel of
Nothing -> OverCombEscape Nothing -> OverCombEscape
Just (-1, i) | (-1, i) == msel -> OverCombFilter Just (-1, i) | (-1, i) == msel -> OverCombFilter
@@ -405,7 +405,7 @@ getMenuMouseContext screen u = case screen ^. scOptions of
Just True -> MouseMenuClick yi Just True -> MouseMenuClick yi
_ -> NoMouseContext _ -> NoMouseContext
isOverTerminalScreen :: Configuration -> Point2 -> Bool isOverTerminalScreen :: Config -> Point2 -> Bool
isOverTerminalScreen cfig (V2 x y) = isOverTerminalScreen cfig (V2 x y) =
x <= xmax x <= xmax
&& x >= xmin - 5 && x >= xmin - 5
+8 -8
View File
@@ -27,12 +27,12 @@ import SDL (MouseButton (..))
{- Update the screen camera rotation and position, including any in rold scope/remote camera modifiers; {- Update the screen camera rotation and position, including any in rold scope/remote camera modifiers;
update where your avatar's view is from. -} update where your avatar's view is from. -}
updateCamera :: Configuration -> World -> World updateCamera :: Config -> World -> World
updateCamera cfig w = case w ^. wCam . camControl of updateCamera cfig w = case w ^. wCam . camControl of
CamInGame{} -> updateInGameCamera cfig w CamInGame{} -> updateInGameCamera cfig w
CamFloat -> updateFloatingCamera cfig w CamFloat -> updateFloatingCamera cfig w
updateFloatingCamera :: Configuration -> World -> World updateFloatingCamera :: Config -> World -> World
updateFloatingCamera cfig w = updateFloatingCamera cfig w =
w w
& updateBounds cfig & updateBounds cfig
@@ -76,7 +76,7 @@ zoomFloatingCamera theinput
-- the 39/40 is taken from zoomSpeed -- the 39/40 is taken from zoomSpeed
updateInGameCamera :: Configuration -> World -> World updateInGameCamera :: Config -> World -> World
updateInGameCamera cfig w = updateInGameCamera cfig w =
w w
& updateBounds cfig & updateBounds cfig
@@ -84,7 +84,7 @@ updateInGameCamera cfig w =
& rotateCamera cfig & rotateCamera cfig
& over wCam (setViewDistance cfig) -- I think this should be updated after the zoom? & over wCam (setViewDistance cfig) -- I think this should be updated after the zoom?
moveZoomCamera :: Configuration -> Input -> Creature -> World -> Camera -> Camera moveZoomCamera :: Config -> Input -> Creature -> World -> Camera -> Camera
moveZoomCamera cfig theinput cr w campos = moveZoomCamera cfig theinput cr w campos =
campos campos
& camCenter .~ fromMaybe (_crPos cr +.+ offset) mremotepos & camCenter .~ fromMaybe (_crPos cr +.+ offset) mremotepos
@@ -192,7 +192,7 @@ heldAimZoom = \case
viewDistanceFromItems :: Creature -> Float viewDistanceFromItems :: Creature -> Float
viewDistanceFromItems _ = 1 viewDistanceFromItems _ = 1
rotateCamera :: Configuration -> World -> World rotateCamera :: Config -> World -> World
rotateCamera cfig w rotateCamera cfig w
| MouseGameRotate <- w ^. input . mouseContext | MouseGameRotate <- w ^. input . mouseContext
, Just rotation <- , Just rotation <-
@@ -231,7 +231,7 @@ clipZoom ::
Float Float
clipZoom = min 20 . max 0.2 clipZoom = min 20 . max 0.2
setViewDistance :: Configuration -> Camera -> Camera setViewDistance :: Config -> Camera -> Camera
setViewDistance cfig w = setViewDistance cfig w =
w & camViewDistance w & camViewDistance
.~ sqrt (halfWidth cfig ** 2 + halfHeight cfig ** 2) / (w ^. camZoom) .~ sqrt (halfWidth cfig ** 2 + halfHeight cfig ** 2) / (w ^. camZoom)
@@ -243,7 +243,7 @@ farWallDistDirection p w = boundPoints $ map f $ getViewpoints p (_cWorld w)
wls q = filter wlIsOpaque $ wlsNearSeg p q w wls q = filter wlIsOpaque $ wlsNearSeg p q w
findPoint q = fromMaybe q . uncurry (intersectSegSeg p q) . _wlLine findPoint q = fromMaybe q . uncurry (intersectSegSeg p q) . _wlLine
findBoundDists :: Configuration -> World -> (Float, Float, Float, Float) findBoundDists :: Config -> World -> (Float, Float, Float, Float)
findBoundDists cfig w findBoundDists cfig w
| debugOn Bound_box_screen cfig = (hh, - hh, hw, - hw) | debugOn Bound_box_screen cfig = (hh, - hh, hw, - hw)
| otherwise = fromMaybe (0, 0, 0, 0) $ farWallDistDirection (w ^. wCam . camViewFrom) w | otherwise = fromMaybe (0, 0, 0, 0) $ farWallDistDirection (w ^. wCam . camViewFrom) w
@@ -253,7 +253,7 @@ findBoundDists cfig w
-- this probably doesn't need to be updated every frame, -- this probably doesn't need to be updated every frame,
-- though I'm not sure how often it should be updated -- though I'm not sure how often it should be updated
updateBounds :: Configuration -> World -> World updateBounds :: Config -> World -> World
updateBounds cfig w = case (w ^. cWorld . cClock) `mod` 5 of updateBounds cfig w = case (w ^. cWorld . cClock) `mod` 5 of
0 -> 0 ->
w w
+6 -6
View File
@@ -83,7 +83,7 @@ updateUseInputInGame u = updateFunctionKeys $ case u ^. uvWorld . hud of
& ciSelection .~ msel' & ciSelection .~ msel'
& ciFilter .~ filts' & ciFilter .~ filts'
updateMouseInGame :: Configuration -> World -> World updateMouseInGame :: Config -> World -> World
updateMouseInGame cfig w updateMouseInGame cfig w
| Just 0 <- lbpress = updateMouseClickInGame cfig w | Just 0 <- lbpress = updateMouseClickInGame cfig w
| Just _ <- lbpress = updateMouseHeldInGame cfig w | Just _ <- lbpress = updateMouseHeldInGame cfig w
@@ -93,13 +93,13 @@ updateMouseInGame cfig w
lbpress = w ^? input . mouseButtons . ix ButtonLeft lbpress = w ^? input . mouseButtons . ix ButtonLeft
lbrelease = w ^? input . mouseButtonsReleased . ix ButtonLeft lbrelease = w ^? input . mouseButtonsReleased . ix ButtonLeft
updateMouseHeldInGame :: Configuration -> World -> World updateMouseHeldInGame :: Config -> World -> World
updateMouseHeldInGame cfig w = case w ^. input . mouseContext of updateMouseHeldInGame cfig w = case w ^. input . mouseContext of
OverInvDragSelect{} | ButtonRight `M.member` (w ^. input . mouseButtons) -> OverInvDragSelect{} | ButtonRight `M.member` (w ^. input . mouseButtons) ->
w & input . mouseContext .~ MouseGameRotate w & input . mouseContext .~ MouseGameRotate
OverInvDragSelect (Just sstart) _ -> OverInvDragSelect (Just sstart) _ ->
let sss = w ^. hud . diSections let sss = w ^. hud . diSections
msel = inverseSelNumPos cfig invDP sss (w ^. input . mousePos) msel = inverseSelNumPos cfig invDP (w ^. input . mousePos) sss
in case msel of in case msel of
Nothing -> w & input . mouseContext . mcoSelEnd .~ Nothing Nothing -> w & input . mouseContext . mcoSelEnd .~ Nothing
Just (i, j) Just (i, j)
@@ -123,7 +123,7 @@ updateMouseHeldInGame cfig w = case w ^. input . mouseContext of
OverInvDrag k mmouseover -> doDrag cfig 30 k mmouseover w OverInvDrag k mmouseover -> doDrag cfig 30 k mmouseover w
_ -> w _ -> w
doDrag :: Configuration -> Int -> Int -> Maybe (Int, Int) -> World -> World doDrag :: Config -> Int -> Int -> Maybe (Int, Int) -> World -> World
doDrag cfig n k mmouseover w = fromMaybe w $ do doDrag cfig n k mmouseover w = fromMaybe w $ do
guard (n /= 0) guard (n /= 0)
ss <- w ^? hud . diSections . ix k . ssItems ss <- w ^? hud . diSections . ix k . ssItems
@@ -200,7 +200,7 @@ isGroupSelectableSection = \case
3 -> True 3 -> True
_ -> False _ -> False
updateMouseClickInGame :: Configuration -> World -> World updateMouseClickInGame :: Config -> World -> World
updateMouseClickInGame cfig w = case w ^. input . mouseContext of updateMouseClickInGame cfig w = case w ^. input . mouseContext of
MouseInGame -> fromMaybe (w & input . mouseContext .~ OverInvDragSelect Nothing Nothing) $ do MouseInGame -> fromMaybe (w & input . mouseContext .~ OverInvDragSelect Nothing Nothing) $ do
let sss = w ^. hud . diSections let sss = w ^. hud . diSections
@@ -303,7 +303,7 @@ collectInvItems secid is w = fromMaybe w $ do
return . h (j + 1) ks $ swapInvItems (\_ _ -> Just (j + 1)) k w' return . h (j + 1) ks $ swapInvItems (\_ _ -> Just (j + 1)) k w'
shiftInvItems :: shiftInvItems ::
Configuration -> Config ->
Int -> -- recurse limit Int -> -- recurse limit
Int -> -- section where drag started Int -> -- section where drag started
(Int, Int) -> -- selection item mouse is over (Int, Int) -> -- selection item mouse is over
+2 -2
View File
@@ -71,7 +71,7 @@ mouseClickOptionsList u = fromMaybe u $ do
return $ f u & uvSoundQueue .:~ click1S return $ f u & uvSoundQueue .:~ click1S
_ -> Nothing _ -> Nothing
ldpVerticalSelection :: Configuration -> ListDisplayParams -> Point2 -> Maybe Int ldpVerticalSelection :: Config -> ListDisplayParams -> Point2 -> Maybe Int
ldpVerticalSelection cfig ldp (V2 _ y) ldpVerticalSelection cfig ldp (V2 _ y)
| yupper == ylower = Just yupper | yupper == ylower = Just yupper
| otherwise = Nothing | otherwise = Nothing
@@ -84,6 +84,6 @@ ldpVerticalSelection cfig ldp (V2 _ y)
yupper = floor $ (top - (y + ygap)) / yoff yupper = floor $ (top - (y + ygap)) / yoff
ylower = ceiling ((top - y) / yoff) - 1 ylower = ceiling ((top - y) / yoff) - 1
setSelectionListRestriction :: Configuration -> ScreenLayer -> ScreenLayer setSelectionListRestriction :: Config -> ScreenLayer -> ScreenLayer
setSelectionListRestriction cfig = setSelectionListRestriction cfig =
scAvailableLines .~ getAvailableListLines menuDisplayParams cfig scAvailableLines .~ getAvailableListLines menuDisplayParams cfig
+1 -1
View File
@@ -19,7 +19,7 @@ colCrsWalls :: Universe -> Universe
--colCrsWalls uv = uv --colCrsWalls uv = uv
colCrsWalls uv = uv & uvWorld . cWorld . lWorld . creatures %~ fmap (noclipCheck (_uvConfig uv) (_uvWorld uv)) colCrsWalls uv = uv & uvWorld . cWorld . lWorld . creatures %~ fmap (noclipCheck (_uvConfig uv) (_uvWorld uv))
noclipCheck :: Configuration -> World -> Creature -> Creature noclipCheck :: Config -> World -> Creature -> Creature
noclipCheck cfig w c noclipCheck cfig w c
| debugOn Noclip cfig && _crID c == 0 = c -- for noclip | debugOn Noclip cfig && _crID c == 0 = c -- for noclip
| otherwise = colCrWall w c | otherwise = colCrWall w c
+1 -1
View File
@@ -2,7 +2,7 @@ module Dodge.WindowSize where
import Dodge.Data.Config import Dodge.Data.Config
getWindowSize :: Integral a => (Configuration -> ResFactor) -> Configuration -> (a,a) getWindowSize :: Integral a => (Config -> ResFactor) -> Config -> (a,a)
getWindowSize f cfig = (g _windowX, g _windowY) getWindowSize f cfig = (g _windowX, g _windowY)
where where
g h = fromIntegral $ applyResFactor (f cfig) (h cfig) g h = fromIntegral $ applyResFactor (f cfig) (h cfig)
+2 -2
View File
@@ -20,7 +20,7 @@ import Shader.Data
import Unsafe.Coerce import Unsafe.Coerce
sizeFBOs :: sizeFBOs ::
Configuration -> Config ->
RenderData -> RenderData ->
IO RenderData IO RenderData
sizeFBOs cfig rdata = sizeFBOs cfig rdata =
@@ -229,7 +229,7 @@ initializeTexture2D fbo attachpoint x y minfilt magfilt informat = do
glNamedFramebufferTexture (_unFBO fbo) attachpoint to1 0 glNamedFramebufferTexture (_unFBO fbo) attachpoint to1 0
return to1 return to1
--getWindowSize :: Integral a => (Configuration -> ResFactor) -> Configuration -> (a, a) --getWindowSize :: Integral a => (Config -> ResFactor) -> Config -> (a, a)
--getWindowSize f cfig = (g _windowX, g _windowY) --getWindowSize f cfig = (g _windowX, g _windowY)
-- where -- where
-- g h = fromIntegral $ h cfig `div` resFactorNum (f cfig) -- g h = fromIntegral $ h cfig `div` resFactorNum (f cfig)
+1 -1
View File
@@ -24,7 +24,7 @@ updatePreload u =
u u
renderDataResizeUpdate :: renderDataResizeUpdate ::
Configuration -> Config ->
RenderData -> RenderData ->
IO RenderData IO RenderData
renderDataResizeUpdate cfig rdata = do renderDataResizeUpdate cfig rdata = do
+1 -1
View File
@@ -24,7 +24,7 @@ import Shader.Data
away" from the shape colors. away" from the shape colors.
-} -}
createLightMap :: createLightMap ::
Configuration -> Config ->
-- | number of walls -- | number of walls
GLsizei -> GLsizei ->
-- | number of silhoutte lines to draw -- | number of silhoutte lines to draw
+65 -66
View File
@@ -239,7 +239,7 @@ CombClust src/Dodge/Combine/Graph.hs 19;" t
CombEdge src/Dodge/Combine/Graph.hs 32;" t CombEdge src/Dodge/Combine/Graph.hs 32;" t
CombNode src/Dodge/Combine/Graph.hs 25;" t CombNode src/Dodge/Combine/Graph.hs 25;" t
CombinableItem src/Dodge/Data/Combine.hs 5;" t CombinableItem src/Dodge/Data/Combine.hs 5;" t
CombineInventory src/Dodge/Data/HUD.hs 25;" C CombineInventory src/Dodge/Data/HUD.hs 24;" C
CombineInventoryChange src/Dodge/Data/World.hs 32;" C CombineInventoryChange src/Dodge/Data/World.hs 32;" C
ComsSS src/Dodge/Data/Scenario.hs 98;" C ComsSS src/Dodge/Data/Scenario.hs 98;" C
ConcurrentEffect src/Loop/Data.hs 6;" t ConcurrentEffect src/Loop/Data.hs 6;" t
@@ -343,7 +343,7 @@ DestroyItem src/Dodge/Data/Scenario.hs 7;" C
Detector src/Dodge/Data/Item/Combine.hs 183;" t Detector src/Dodge/Data/Item/Combine.hs 183;" t
Dirt src/Dodge/Data/Material.hs 11;" C Dirt src/Dodge/Data/Material.hs 11;" C
DisasterType src/Dodge/Data/Scenario.hs 24;" t DisasterType src/Dodge/Data/Scenario.hs 24;" t
DisplayTerminal src/Dodge/Data/HUD.hs 30;" C DisplayTerminal src/Dodge/Data/HUD.hs 29;" C
Distortion src/Dodge/Data/Distortion.hs 12;" t Distortion src/Dodge/Data/Distortion.hs 12;" t
DivineRetribution src/Dodge/Data/Scenario.hs 35;" C DivineRetribution src/Dodge/Data/Scenario.hs 35;" C
DoActionIf src/Dodge/Data/ActionPlan.hs 116;" C DoActionIf src/Dodge/Data/ActionPlan.hs 116;" C
@@ -416,7 +416,7 @@ EquipmentPlatformSF src/Dodge/Data/ComposedItem.hs 17;" C
Escape src/Dodge/Data/Scenario.hs 10;" C Escape src/Dodge/Data/Scenario.hs 10;" C
EscapeMenuOption src/Dodge/Data/Universe.hs 76;" t EscapeMenuOption src/Dodge/Data/Universe.hs 76;" t
Essential src/Shape/Data.hs 34;" C Essential src/Shape/Data.hs 34;" C
ExamineInventory src/Dodge/Data/HUD.hs 19;" C ExamineInventory src/Dodge/Data/HUD.hs 18;" C
Explore src/Dodge/Data/Scenario.hs 4;" C Explore src/Dodge/Data/Scenario.hs 4;" C
Explosion src/Dodge/Data/SoundOrigin.hs 38;" C Explosion src/Dodge/Data/SoundOrigin.hs 38;" C
ExplosionPayload src/Dodge/Data/Payload.hs 11;" C ExplosionPayload src/Dodge/Data/Payload.hs 11;" C
@@ -535,7 +535,7 @@ HEATSENSOR src/Dodge/Data/Item/Combine.hs 83;" C
HELD src/Dodge/Data/Item/Combine.hs 17;" C HELD src/Dodge/Data/Item/Combine.hs 17;" C
HOMINGMODULE src/Dodge/Data/Item/Combine.hs 102;" C HOMINGMODULE src/Dodge/Data/Item/Combine.hs 102;" C
HOSE src/Dodge/Data/Item/Combine.hs 55;" C HOSE src/Dodge/Data/Item/Combine.hs 55;" C
HUD src/Dodge/Data/HUD.hs 32;" t HUD src/Dodge/Data/HUD.hs 31;" t
HalfRes src/Dodge/Data/Config.hs 97;" C HalfRes src/Dodge/Data/Config.hs 97;" C
HammerTrigger src/Dodge/Data/TriggerType.hs 10;" C HammerTrigger src/Dodge/Data/TriggerType.hs 10;" C
HardQuit src/Dodge/Data/Universe.hs 70;" C HardQuit src/Dodge/Data/Universe.hs 70;" C
@@ -753,7 +753,7 @@ MakeTempLight src/Dodge/Data/WorldEffect.hs 34;" C
ManipulatedObject src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 22;" t ManipulatedObject src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 22;" t
Manipulation src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 16;" t Manipulation src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 16;" t
Manipulator src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 17;" C Manipulator src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 17;" C
MapperInventory src/Dodge/Data/HUD.hs 20;" C MapperInventory src/Dodge/Data/HUD.hs 19;" C
MapperSF src/Dodge/Data/ComposedItem.hs 39;" C MapperSF src/Dodge/Data/ComposedItem.hs 39;" C
Material src/Dodge/Data/Material.hs 11;" t Material src/Dodge/Data/Material.hs 11;" t
MaterialSound src/Dodge/Data/SoundOrigin.hs 35;" C MaterialSound src/Dodge/Data/SoundOrigin.hs 35;" C
@@ -866,10 +866,9 @@ NoResurrection src/Dodge/Data/Corpse.hs 14;" C
NoRightButtonOptions src/Dodge/Data/RightButtonOptions.hs 16;" C NoRightButtonOptions src/Dodge/Data/RightButtonOptions.hs 16;" C
NoRoomClipBoundaries src/Dodge/Data/Config.hs 107;" C NoRoomClipBoundaries src/Dodge/Data/Config.hs 107;" C
NoSF src/Dodge/Data/ComposedItem.hs 29;" C NoSF src/Dodge/Data/ComposedItem.hs 29;" C
NoSel src/Dodge/Data/HUD.hs 47;" C
NoShadowFidelity src/Shape/Data.hs 25;" C NoShadowFidelity src/Shape/Data.hs 25;" C
NoShadows src/Dodge/Data/Config.hs 103;" C NoShadows src/Dodge/Data/Config.hs 103;" C
NoSubInventory src/Dodge/Data/HUD.hs 18;" C NoSubInventory src/Dodge/Data/HUD.hs 17;" C
NoTrigger src/Dodge/Data/TriggerType.hs 11;" C NoTrigger src/Dodge/Data/TriggerType.hs 11;" C
NoWorldEffect src/Dodge/Data/WorldEffect.hs 23;" C NoWorldEffect src/Dodge/Data/WorldEffect.hs 23;" C
Noclip src/Dodge/Data/Config.hs 70;" C Noclip src/Dodge/Data/Config.hs 70;" C
@@ -1198,14 +1197,14 @@ SecretCabal src/Dodge/Data/Scenario.hs 44;" C
SectionCursor src/Dodge/Data/SelectionList.hs 23;" t SectionCursor src/Dodge/Data/SelectionList.hs 23;" t
SeeAbove src/Dodge/Data/Wall.hs 42;" C SeeAbove src/Dodge/Data/Wall.hs 42;" C
SeeThrough src/Dodge/Data/Wall.hs 41;" C SeeThrough src/Dodge/Data/Wall.hs 41;" C
Sel src/Dodge/Data/HUD.hs 46;" C Sel src/Dodge/Data/HUD.hs 44;" C
SelCloseButton src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 33;" C SelCloseButton src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 33;" C
SelCloseItem src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 31;" C SelCloseItem src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 31;" C
SelItem src/Dodge/Data/SelectionList.hs 42;" C SelItem src/Dodge/Data/SelectionList.hs 42;" C
SelNothing src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 29;" C SelNothing src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 29;" C
Select_creature src/Dodge/Data/Config.hs 94;" C Select_creature src/Dodge/Data/Config.hs 94;" C
SelectedItem src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 24;" C SelectedItem src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 24;" C
Selection src/Dodge/Data/HUD.hs 45;" t Selection src/Dodge/Data/HUD.hs 44;" t
SelectionItem src/Dodge/Data/SelectionList.hs 41;" t SelectionItem src/Dodge/Data/SelectionList.hs 41;" t
SelectionSection src/Dodge/Data/SelectionList.hs 29;" t SelectionSection src/Dodge/Data/SelectionList.hs 29;" t
SelectionWidth src/Dodge/Data/SelectionList.hs 39;" t SelectionWidth src/Dodge/Data/SelectionList.hs 39;" t
@@ -1296,7 +1295,7 @@ Stone src/Dodge/Data/Material.hs 11;" C
StorageSS src/Dodge/Data/Scenario.hs 94;" C StorageSS src/Dodge/Data/Scenario.hs 94;" C
Strategy src/Dodge/Data/ActionPlan.hs 176;" t Strategy src/Dodge/Data/ActionPlan.hs 176;" t
StrategyActions src/Dodge/Data/ActionPlan.hs 188;" C StrategyActions src/Dodge/Data/ActionPlan.hs 188;" C
SubInventory src/Dodge/Data/HUD.hs 17;" t SubInventory src/Dodge/Data/HUD.hs 16;" t
Superfluous src/Shape/Data.hs 38;" C Superfluous src/Shape/Data.hs 38;" C
Surface src/Shape/Data.hs 41;" t Surface src/Shape/Data.hs 41;" t
Survive src/Dodge/Data/Scenario.hs 5;" C Survive src/Dodge/Data/Scenario.hs 5;" C
@@ -1638,9 +1637,9 @@ _camViewFrom src/Dodge/Data/Camera.hs 29;" f
_camZoom src/Dodge/Data/Camera.hs 26;" f _camZoom src/Dodge/Data/Camera.hs 26;" f
_canID src/Dodge/Data/LWorld.hs 170;" f _canID src/Dodge/Data/LWorld.hs 170;" f
_carriage src/Dodge/Data/Creature/Stance.hs 14;" f _carriage src/Dodge/Data/Creature/Stance.hs 14;" f
_carteCenter src/Dodge/Data/HUD.hs 38;" f _carteCenter src/Dodge/Data/HUD.hs 37;" f
_carteRot src/Dodge/Data/HUD.hs 40;" f _carteRot src/Dodge/Data/HUD.hs 39;" f
_carteZoom src/Dodge/Data/HUD.hs 39;" f _carteZoom src/Dodge/Data/HUD.hs 38;" f
_cdtCloseLeft src/Dodge/Data/DoubleTree.hs 88;" f _cdtCloseLeft src/Dodge/Data/DoubleTree.hs 88;" f
_cdtCloseLeft src/Dodge/Data/DoubleTree.hs 96;" f _cdtCloseLeft src/Dodge/Data/DoubleTree.hs 96;" f
_cdtCloseRight src/Dodge/Data/DoubleTree.hs 90;" f _cdtCloseRight src/Dodge/Data/DoubleTree.hs 90;" f
@@ -1656,11 +1655,11 @@ _ceString src/Dodge/Data/Universe.hs 67;" f
_chasmShader src/Data/Preload/Render.hs 46;" f _chasmShader src/Data/Preload/Render.hs 46;" f
_chasmVBO src/Data/Preload/Render.hs 45;" f _chasmVBO src/Data/Preload/Render.hs 45;" f
_chasms src/Dodge/Data/CWorld.hs 30;" f _chasms src/Dodge/Data/CWorld.hs 30;" f
_ciFilter src/Dodge/Data/HUD.hs 28;" f _ciFilter src/Dodge/Data/HUD.hs 27;" f
_ciInvIDs src/Dodge/Data/Combine.hs 6;" f _ciInvIDs src/Dodge/Data/Combine.hs 6;" f
_ciItem src/Dodge/Data/Combine.hs 7;" f _ciItem src/Dodge/Data/Combine.hs 7;" f
_ciSections src/Dodge/Data/HUD.hs 26;" f _ciSections src/Dodge/Data/HUD.hs 25;" f
_ciSelection src/Dodge/Data/HUD.hs 27;" f _ciSelection src/Dodge/Data/HUD.hs 26;" f
_cigType src/Dodge/Data/Camera.hs 19;" f _cigType src/Dodge/Data/Camera.hs 19;" f
_clPos src/Dodge/Data/Cloud.hs 15;" f _clPos src/Dodge/Data/Cloud.hs 15;" f
_clTimer src/Dodge/Data/Cloud.hs 17;" f _clTimer src/Dodge/Data/Cloud.hs 17;" f
@@ -1681,8 +1680,8 @@ _cldtUp src/Dodge/Data/DoubleTree.hs 45;" f
_cldtUp src/Dodge/Data/DoubleTree.hs 53;" f _cldtUp src/Dodge/Data/DoubleTree.hs 53;" f
_clickPos src/Dodge/Data/Input.hs 42;" f _clickPos src/Dodge/Data/Input.hs 42;" f
_clickWorldPos src/Dodge/Data/Input.hs 44;" f _clickWorldPos src/Dodge/Data/Input.hs 44;" f
_closeButtons src/Dodge/Data/HUD.hs 42;" f _closeButtons src/Dodge/Data/HUD.hs 41;" f
_closeItems src/Dodge/Data/HUD.hs 41;" f _closeItems src/Dodge/Data/HUD.hs 40;" f
_cloudEBO src/Data/Preload/Render.hs 51;" f _cloudEBO src/Data/Preload/Render.hs 51;" f
_cloudShader src/Data/Preload/Render.hs 50;" f _cloudShader src/Data/Preload/Render.hs 50;" f
_cloudVBO src/Data/Preload/Render.hs 49;" f _cloudVBO src/Data/Preload/Render.hs 49;" f
@@ -1767,10 +1766,10 @@ _debugV3 src/Dodge/Data/Universe.hs 59;" f
_debug_booleans src/Dodge/Data/Config.hs 57;" f _debug_booleans src/Dodge/Data/Config.hs 57;" f
_debug_view_clip_bounds src/Dodge/Data/Config.hs 56;" f _debug_view_clip_bounds src/Dodge/Data/Config.hs 56;" f
_delayedEvents src/Dodge/Data/LWorld.hs 137;" f _delayedEvents src/Dodge/Data/LWorld.hs 137;" f
_diCloseFilter src/Dodge/Data/HUD.hs 37;" f _diCloseFilter src/Dodge/Data/HUD.hs 36;" f
_diInvFilter src/Dodge/Data/HUD.hs 36;" f _diInvFilter src/Dodge/Data/HUD.hs 35;" f
_diSections src/Dodge/Data/HUD.hs 34;" f _diSections src/Dodge/Data/HUD.hs 33;" f
_diSelection src/Dodge/Data/HUD.hs 35;" f _diSelection src/Dodge/Data/HUD.hs 34;" f
_dimAttachPos src/Dodge/Data/Item/Misc.hs 16;" f _dimAttachPos src/Dodge/Data/Item/Misc.hs 16;" f
_dimCenter src/Dodge/Data/Item/Misc.hs 15;" f _dimCenter src/Dodge/Data/Item/Misc.hs 15;" f
_dimRad src/Dodge/Data/Item/Misc.hs 14;" f _dimRad src/Dodge/Data/Item/Misc.hs 14;" f
@@ -2019,9 +2018,9 @@ _magBelowID src/Dodge/Data/Muzzle.hs 22;" f
_magnets src/Dodge/Data/LWorld.hs 130;" f _magnets src/Dodge/Data/LWorld.hs 130;" f
_mainAction src/Dodge/Data/ActionPlan.hs 171;" f _mainAction src/Dodge/Data/ActionPlan.hs 171;" f
_manObject src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 17;" f _manObject src/Dodge/Data/Item/Use/Consumption/LoadAction.hs 17;" f
_mapInvItmID src/Dodge/Data/HUD.hs 23;" f _mapInvItmID src/Dodge/Data/HUD.hs 22;" f
_mapInvOffset src/Dodge/Data/HUD.hs 21;" f _mapInvOffset src/Dodge/Data/HUD.hs 20;" f
_mapInvZoom src/Dodge/Data/HUD.hs 22;" f _mapInvZoom src/Dodge/Data/HUD.hs 21;" f
_matUBO src/Data/Preload/Render.hs 39;" f _matUBO src/Data/Preload/Render.hs 39;" f
_mbAttach src/Dodge/Data/MetaTree.hs 16;" f _mbAttach src/Dodge/Data/MetaTree.hs 16;" f
_mbTree src/Dodge/Data/MetaTree.hs 16;" f _mbTree src/Dodge/Data/MetaTree.hs 16;" f
@@ -2351,9 +2350,9 @@ _skVel src/Dodge/Data/Spark.hs 15;" f
_skinHead src/Dodge/Data/Creature/Misc.hs 78;" f _skinHead src/Dodge/Data/Creature/Misc.hs 78;" f
_skinLower src/Dodge/Data/Creature/Misc.hs 80;" f _skinLower src/Dodge/Data/Creature/Misc.hs 80;" f
_skinUpper src/Dodge/Data/Creature/Misc.hs 79;" f _skinUpper src/Dodge/Data/Creature/Misc.hs 79;" f
_slInt src/Dodge/Data/HUD.hs 46;" f _slInt src/Dodge/Data/HUD.hs 44;" f
_slSec src/Dodge/Data/HUD.hs 46;" f _slSec src/Dodge/Data/HUD.hs 44;" f
_slSet src/Dodge/Data/HUD.hs 46;" f _slSet src/Dodge/Data/HUD.hs 44;" f
_smoothScrollAmount src/Dodge/Data/Input.hs 41;" f _smoothScrollAmount src/Dodge/Data/Input.hs 41;" f
_soundAngDist src/Sound/Data.hs 49;" f _soundAngDist src/Sound/Data.hs 49;" f
_soundChannel src/Sound/Data.hs 48;" f _soundChannel src/Sound/Data.hs 48;" f
@@ -2381,7 +2380,7 @@ _stuckCrID src/Dodge/Data/Projectile.hs 50;" f
_stuckCrOffset src/Dodge/Data/Projectile.hs 50;" f _stuckCrOffset src/Dodge/Data/Projectile.hs 50;" f
_stuckCrRot src/Dodge/Data/Projectile.hs 50;" f _stuckCrRot src/Dodge/Data/Projectile.hs 50;" f
_stuckWlID src/Dodge/Data/Projectile.hs 51;" f _stuckWlID src/Dodge/Data/Projectile.hs 51;" f
_subInventory src/Dodge/Data/HUD.hs 33;" f _subInventory src/Dodge/Data/HUD.hs 32;" f
_swColor src/Dodge/Data/Shockwave.hs 18;" f _swColor src/Dodge/Data/Shockwave.hs 18;" f
_swDam src/Dodge/Data/Shockwave.hs 23;" f _swDam src/Dodge/Data/Shockwave.hs 23;" f
_swDirection src/Dodge/Data/Shockwave.hs 19;" f _swDirection src/Dodge/Data/Shockwave.hs 19;" f
@@ -2402,7 +2401,7 @@ _tbPos src/Dodge/Data/TractorBeam.hs 14;" f
_tbStartPos src/Dodge/Data/TractorBeam.hs 15;" f _tbStartPos src/Dodge/Data/TractorBeam.hs 15;" f
_tbTime src/Dodge/Data/TractorBeam.hs 17;" f _tbTime src/Dodge/Data/TractorBeam.hs 17;" f
_tbVel src/Dodge/Data/TractorBeam.hs 16;" f _tbVel src/Dodge/Data/TractorBeam.hs 16;" f
_termID src/Dodge/Data/HUD.hs 30;" f _termID src/Dodge/Data/HUD.hs 29;" f
_terminals src/Dodge/Data/LWorld.hs 128;" f _terminals src/Dodge/Data/LWorld.hs 128;" f
_teslaArcs src/Dodge/Data/LWorld.hs 116;" f _teslaArcs src/Dodge/Data/LWorld.hs 116;" f
_testFloat src/Dodge/Data/World.hs 43;" f _testFloat src/Dodge/Data/World.hs 43;" f
@@ -2842,9 +2841,9 @@ centroid src/Geometry/Polygon.hs 136;" f
centroidNum src/Geometry/Polygon.hs 139;" f centroidNum src/Geometry/Polygon.hs 139;" f
chainCreatureUpdates src/Dodge/Creature/ChainUpdates.hs 6;" f chainCreatureUpdates src/Dodge/Creature/ChainUpdates.hs 6;" f
chainPairs src/Geometry.hs 363;" f chainPairs src/Geometry.hs 363;" f
changeSwapOther src/Dodge/Inventory.hs 149;" f changeSwapOther src/Dodge/Inventory.hs 148;" f
changeSwapSel src/Dodge/Inventory.hs 142;" f changeSwapSel src/Dodge/Inventory.hs 141;" f
changeSwapWith src/Dodge/Inventory.hs 183;" f changeSwapWith src/Dodge/Inventory.hs 182;" f
charToTuple src/Picture/Base.hs 317;" f charToTuple src/Picture/Base.hs 317;" f
charToTupleGrad src/Picture/Text.hs 18;" f charToTupleGrad src/Picture/Text.hs 18;" f
chartreuse src/Color.hs 24;" f chartreuse src/Color.hs 24;" f
@@ -3213,12 +3212,12 @@ deleteWallFromZones src/Dodge/Wall/Zone.hs 23;" f
deleteWallID src/Dodge/Wall/Delete.hs 13;" f deleteWallID src/Dodge/Wall/Delete.hs 13;" f
deleteWallIDs src/Dodge/Wall/Delete.hs 28;" f deleteWallIDs src/Dodge/Wall/Delete.hs 28;" f
denormalEdges src/Polyhedra.hs 136;" f denormalEdges src/Polyhedra.hs 136;" f
destroyAllInvItems src/Dodge/Inventory.hs 55;" f destroyAllInvItems src/Dodge/Inventory.hs 54;" f
destroyBlock src/Dodge/Block.hs 52;" f destroyBlock src/Dodge/Block.hs 52;" f
destroyCreature src/Dodge/Creature/Update.hs 94;" f destroyCreature src/Dodge/Creature/Update.hs 94;" f
destroyDoor src/Dodge/Block.hs 80;" f destroyDoor src/Dodge/Block.hs 80;" f
destroyInvItem src/Dodge/Inventory.hs 40;" f destroyInvItem src/Dodge/Inventory.hs 39;" f
destroyItem src/Dodge/Inventory.hs 64;" f destroyItem src/Dodge/Inventory.hs 63;" f
destroyLS src/Dodge/LightSource.hs 32;" f destroyLS src/Dodge/LightSource.hs 32;" f
destroyLSFlashAt src/Dodge/LightSource.hs 42;" f destroyLSFlashAt src/Dodge/LightSource.hs 42;" f
destroyMachine src/Dodge/Machine/Destroy.hs 13;" f destroyMachine src/Dodge/Machine/Destroy.hs 13;" f
@@ -3905,14 +3904,14 @@ invItemEffs src/Dodge/Creature/State.hs 62;" f
invItemLocUpdate src/Dodge/Creature/State.hs 70;" f invItemLocUpdate src/Dodge/Creature/State.hs 70;" f
invRootMap src/Dodge/Item/Grammar.hs 226;" f invRootMap src/Dodge/Item/Grammar.hs 226;" f
invSelectionItem src/Dodge/Inventory/SelectionList.hs 32;" f invSelectionItem src/Dodge/Inventory/SelectionList.hs 32;" f
invSetSelection src/Dodge/Inventory.hs 195;" f invSetSelection src/Dodge/Inventory.hs 194;" f
invSetSelectionPos src/Dodge/Inventory.hs 203;" f invSetSelectionPos src/Dodge/Inventory.hs 202;" f
invShiftPointBy src/Dodge/ShiftPoint.hs 8;" f invShiftPointBy src/Dodge/ShiftPoint.hs 8;" f
invSize src/Dodge/Inventory/CheckSlots.hs 33;" f invSize src/Dodge/Inventory/CheckSlots.hs 33;" f
inventoryX src/Dodge/Creature.hs 113;" f inventoryX src/Dodge/Creature.hs 113;" f
inverseSelNumPos src/Dodge/SelectionSections.hs 231;" f inverseSelNumPos src/Dodge/SelectionSections.hs 197;" f
inverseSelSecYint src/Dodge/SelectionSections.hs 202;" f inverseSelSecYint src/Dodge/SelectionSections.hs 168;" f
inverseSelSecYintXPosCheck src/Dodge/SelectionSections.hs 215;" f inverseSelSecYintXPosCheck src/Dodge/SelectionSections.hs 181;" f
inverseShockwaveAt src/Dodge/WorldEvent/Shockwave.hs 43;" f inverseShockwaveAt src/Dodge/WorldEvent/Shockwave.hs 43;" f
invertEncircleDistP src/Dodge/Creature/Boid.hs 14;" f invertEncircleDistP src/Dodge/Creature/Boid.hs 14;" f
invertIntMap src/IntMapHelp.hs 99;" f invertIntMap src/IntMapHelp.hs 99;" f
@@ -4349,7 +4348,7 @@ newKey src/IntMapHelp.hs 60;" f
newSounds src/Dodge/Creature/Perception.hs 171;" f newSounds src/Dodge/Creature/Perception.hs 171;" f
newTextureFramebuffer src/Framebuffer/Setup.hs 16;" f newTextureFramebuffer src/Framebuffer/Setup.hs 16;" f
nextArc src/Dodge/Tesla.hs 61;" f nextArc src/Dodge/Tesla.hs 61;" f
nextInSectionSS src/Dodge/SelectionSections.hs 37;" f nextInSectionSS src/Dodge/SelectionSections.hs 34;" f
nextLayoutInt src/Dodge/Annotation/Data.hs 39;" f nextLayoutInt src/Dodge/Annotation/Data.hs 39;" f
noPic src/ShapePicture.hs 25;" f noPic src/ShapePicture.hs 25;" f
noShape src/ShapePicture.hs 29;" f noShape src/ShapePicture.hs 29;" f
@@ -4579,7 +4578,7 @@ polygonWire src/Picture/Base.hs 63;" f
polysToPic src/Polyhedra.hs 130;" f polysToPic src/Polyhedra.hs 130;" f
popScreen src/Dodge/Menu/PushPop.hs 6;" f popScreen src/Dodge/Menu/PushPop.hs 6;" f
posRms src/Dodge/Tree/Shift.hs 44;" f posRms src/Dodge/Tree/Shift.hs 44;" f
posSelSecYint src/Dodge/SelectionSections.hs 185;" f posSelSecYint src/Dodge/SelectionSections.hs 151;" f
positionRoomsFromTree src/Dodge/Tree/Shift.hs 35;" f positionRoomsFromTree src/Dodge/Tree/Shift.hs 35;" f
postGenerationProcessing src/Dodge/LevelGen.hs 34;" f postGenerationProcessing src/Dodge/LevelGen.hs 34;" f
postUniverseLoadSideEffect src/Dodge/WorldLoad.hs 11;" f postUniverseLoadSideEffect src/Dodge/WorldLoad.hs 11;" f
@@ -4804,7 +4803,7 @@ rightPadNoSquash src/Padding.hs 23;" f
rlPosDir src/Dodge/RoomLink.hs 94;" f rlPosDir src/Dodge/RoomLink.hs 94;" f
rlauncherPic src/Dodge/Item/Draw/SPic.hs 409;" f rlauncherPic src/Dodge/Item/Draw/SPic.hs 409;" f
rmInLinks src/Dodge/RoomLink.hs 138;" f rmInLinks src/Dodge/RoomLink.hs 138;" f
rmInvItem src/Dodge/Inventory.hs 76;" f rmInvItem src/Dodge/Inventory.hs 75;" f
rmLinksOfType src/Dodge/RoomLink.hs 135;" f rmLinksOfType src/Dodge/RoomLink.hs 135;" f
rmOutLinks src/Dodge/RoomLink.hs 138;" f rmOutLinks src/Dodge/RoomLink.hs 138;" f
roomC src/Dodge/Room/Room.hs 38;" f roomC src/Dodge/Room/Room.hs 38;" f
@@ -4896,11 +4895,11 @@ screenPolygon src/Dodge/Base/Window.hs 17;" f
screenPolygonBord src/Dodge/Base/Window.hs 27;" f screenPolygonBord src/Dodge/Base/Window.hs 27;" f
screenPosAbs src/Dodge/ScreenPos.hs 15;" f screenPosAbs src/Dodge/ScreenPos.hs 15;" f
screenToWorldPos src/Dodge/Base/Coordinate.hs 51;" f screenToWorldPos src/Dodge/Base/Coordinate.hs 51;" f
scrollAugInvSel src/Dodge/Inventory.hs 214;" f scrollAugInvSel src/Dodge/Inventory.hs 213;" f
scrollAugNextInSection src/Dodge/Inventory.hs 227;" f scrollAugNextInSection src/Dodge/Inventory.hs 226;" f
scrollDebugInfoInt src/Dodge/Debug.hs 71;" f scrollDebugInfoInt src/Dodge/Debug.hs 71;" f
scrollRBOption src/Dodge/Update/Scroll.hs 217;" f scrollRBOption src/Dodge/Update/Scroll.hs 217;" f
scrollSelectionSections src/Dodge/SelectionSections.hs 27;" f scrollSelectionSections src/Dodge/SelectionSections.hs 28;" f
scrollTimeBack src/Dodge/Update.hs 218;" f scrollTimeBack src/Dodge/Update.hs 218;" f
scrollTimeForward src/Dodge/Update.hs 241;" f scrollTimeForward src/Dodge/Update.hs 241;" f
seagullBarkS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 570;" f seagullBarkS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 570;" f
@@ -4924,8 +4923,8 @@ selNumPosCardinal src/Dodge/Render/HUD.hs 473;" f
selSecDrawCursor src/Dodge/Render/List.hs 126;" f selSecDrawCursor src/Dodge/Render/List.hs 126;" f
selSecDrawCursorAt src/Dodge/Render/List.hs 104;" f selSecDrawCursorAt src/Dodge/Render/List.hs 104;" f
selSecSelCol src/Dodge/Render/HUD.hs 504;" f selSecSelCol src/Dodge/Render/HUD.hs 504;" f
selSecSelSize src/Dodge/SelectionSections.hs 181;" f selSecSelSize src/Dodge/SelectionSections.hs 147;" f
selSecYint src/Dodge/SelectionSections.hs 190;" f selSecYint src/Dodge/SelectionSections.hs 156;" f
selectCreatureDebugItem src/Dodge/Debug.hs 55;" f selectCreatureDebugItem src/Dodge/Debug.hs 55;" f
selectedItemScroll src/Dodge/Update/Scroll.hs 51;" f selectedItemScroll src/Dodge/Update/Scroll.hs 51;" f
sensAboveDoor src/Dodge/Room/SensorDoor.hs 52;" f sensAboveDoor src/Dodge/Room/SensorDoor.hs 52;" f
@@ -5151,21 +5150,21 @@ square src/Geometry/Polygon.hs 46;" f
squareDecoration src/Dodge/Placement/TopDecoration.hs 41;" f squareDecoration src/Dodge/Placement/TopDecoration.hs 41;" f
squashIntersectCirclePoint src/Dodge/WallCreatureCollisions.hs 112;" f squashIntersectCirclePoint src/Dodge/WallCreatureCollisions.hs 112;" f
squashNormalizeV src/Geometry/Vector.hs 157;" f squashNormalizeV src/Geometry/Vector.hs 157;" f
ssLookupDown src/Dodge/SelectionSections.hs 100;" f ssLookupDown src/Dodge/SelectionSections.hs 82;" f
ssLookupGE' src/Dodge/SelectionSections.hs 174;" f ssLookupGE' src/Dodge/SelectionSections.hs 140;" f
ssLookupGT src/Dodge/SelectionSections.hs 157;" f ssLookupGT src/Dodge/SelectionSections.hs 123;" f
ssLookupGT' src/Dodge/SelectionSections.hs 167;" f ssLookupGT' src/Dodge/SelectionSections.hs 133;" f
ssLookupLE' src/Dodge/SelectionSections.hs 145;" f ssLookupLE' src/Dodge/SelectionSections.hs 111;" f
ssLookupLT src/Dodge/SelectionSections.hs 125;" f ssLookupLT src/Dodge/SelectionSections.hs 98;" f
ssLookupLT' src/Dodge/SelectionSections.hs 135;" f ssLookupLT' src/Dodge/SelectionSections.hs 104;" f
ssLookupMax src/Dodge/SelectionSections.hs 86;" f ssLookupMax src/Dodge/SelectionSections.hs 72;" f
ssLookupMaxInSection src/Dodge/SelectionSections.hs 118;" f ssLookupMaxInSection src/Dodge/SelectionSections.hs 92;" f
ssLookupMin src/Dodge/SelectionSections.hs 152;" f ssLookupMin src/Dodge/SelectionSections.hs 118;" f
ssLookupNextMax src/Dodge/SelectionSections.hs 109;" f ssLookupNextMax src/Dodge/SelectionSections.hs 87;" f
ssLookupUp src/Dodge/SelectionSections.hs 91;" f ssLookupUp src/Dodge/SelectionSections.hs 77;" f
ssScrollMinOnFail src/Dodge/SelectionSections.hs 58;" f ssScrollMinOnFail src/Dodge/SelectionSections.hs 44;" f
ssScrollUsing src/Dodge/SelectionSections.hs 48;" f ssScrollUsing src/Dodge/SelectionSections.hs 37;" f
ssSetCursor src/Dodge/SelectionSections.hs 73;" f ssSetCursor src/Dodge/SelectionSections.hs 59;" f
ssfold src/FoldableHelp.hs 105;" f ssfold src/FoldableHelp.hs 105;" f
stackPicturesAt src/Dodge/Render/List.hs 98;" f stackPicturesAt src/Dodge/Render/List.hs 98;" f
stackPicturesAtOff src/Dodge/Render/List.hs 101;" f stackPicturesAtOff src/Dodge/Render/List.hs 101;" f
@@ -5206,7 +5205,7 @@ swapAnyExtraSelection src/Dodge/Inventory/Swap.hs 56;" f
swapInOutLinks src/Dodge/RoomLink.hs 80;" f swapInOutLinks src/Dodge/RoomLink.hs 80;" f
swapIndices src/ListHelp.hs 50;" f swapIndices src/ListHelp.hs 50;" f
swapInvItems src/Dodge/Inventory/Swap.hs 21;" f swapInvItems src/Dodge/Inventory/Swap.hs 21;" f
swapItemWith src/Dodge/Inventory.hs 172;" f swapItemWith src/Dodge/Inventory.hs 171;" f
swarmCrit src/Dodge/Creature/SwarmCrit.hs 10;" f swarmCrit src/Dodge/Creature/SwarmCrit.hs 10;" f
swarmUsingCenter src/Dodge/Creature/Boid.hs 172;" f swarmUsingCenter src/Dodge/Creature/Boid.hs 172;" f
switchDoor src/Dodge/Placement/Instance/Door.hs 96;" f switchDoor src/Dodge/Placement/Instance/Door.hs 96;" f
@@ -5456,7 +5455,7 @@ updateBulVel src/Dodge/Bullet.hs 56;" f
updateBullet src/Dodge/Bullet.hs 21;" f updateBullet src/Dodge/Bullet.hs 21;" f
updateBullets src/Dodge/Update.hs 576;" f updateBullets src/Dodge/Update.hs 576;" f
updateCamera src/Dodge/Update/Camera.hs 30;" f updateCamera src/Dodge/Update/Camera.hs 30;" f
updateCloseObjects src/Dodge/Inventory.hs 122;" f updateCloseObjects src/Dodge/Inventory.hs 121;" f
updateCloud src/Dodge/Update.hs 814;" f updateCloud src/Dodge/Update.hs 814;" f
updateClouds src/Dodge/Update.hs 682;" f updateClouds src/Dodge/Update.hs 682;" f
updateCombinePositioning src/Dodge/DisplayInventory.hs 39;" f updateCombinePositioning src/Dodge/DisplayInventory.hs 39;" f