Keep track of seen walls in external list
This commit is contained in:
+16
-5
@@ -364,18 +364,29 @@ displayListEndCoords cfig ss = map (doWindowScale cfig) $ zipWith h ss $ map f [
|
||||
mapOverlay :: Configuration -> World -> [Picture]
|
||||
mapOverlay cfig w =
|
||||
(color (withAlpha 0.5 black) . polygon $ reverse $ rectNSWE 1 (-1) 1 (-1)) :
|
||||
(mapMaybe (mapWall cfig (w ^. hud)) . IM.elems $ w ^. cWorld . lWorld . walls)
|
||||
[foldMap (drawMapWall cfig (w ^. hud)) $ IM.restrictKeys (lw ^. walls) (lw ^. seenWalls)]
|
||||
--(mapMaybe (mapWall cfig (w ^. hud)) . IM.elems $ w ^. cWorld . lWorld . walls)
|
||||
where
|
||||
lw = w ^. cWorld . lWorld
|
||||
|
||||
mapWall :: Configuration -> HUD -> Wall -> Maybe Picture
|
||||
mapWall cfig thehud wl
|
||||
| _wlSeen wl = Just . color c . polygon $ map (cartePosToScreen cfig thehud) [x, x +.+ n2, y +.+ n2, y]
|
||||
| otherwise = Nothing
|
||||
drawMapWall :: Configuration -> HUD -> Wall -> Picture
|
||||
drawMapWall cfig thehud wl = color c . polygon $ map (cartePosToScreen cfig thehud) [x, x +.+ n2, y +.+ n2, y]
|
||||
where
|
||||
t = normalizeV (y -.- x)
|
||||
n2 = 20 *.* vNormal t
|
||||
(x, y) = _wlLine wl
|
||||
c = _wlColor wl
|
||||
|
||||
--mapWall :: Configuration -> HUD -> Wall -> Maybe Picture
|
||||
--mapWall cfig thehud wl
|
||||
-- | _wlSeen wl = Just . color c . polygon $ map (cartePosToScreen cfig thehud) [x, x +.+ n2, y +.+ n2, y]
|
||||
-- | otherwise = Nothing
|
||||
-- where
|
||||
-- t = normalizeV (y -.- x)
|
||||
-- n2 = 20 *.* vNormal t
|
||||
-- (x, y) = _wlLine wl
|
||||
-- c = _wlColor wl
|
||||
|
||||
--selectedCloseObjectLink :: Configuration -> World -> Picture
|
||||
--selectedCloseObjectLink cfig w = mempty
|
||||
|
||||
|
||||
Reference in New Issue
Block a user