Mapper, ARHUD, radar sweeps update. Add dropper items

This commit is contained in:
2025-01-03 10:43:06 +00:00
parent e9f5a39ed7
commit 386d6f47b0
27 changed files with 802 additions and 700 deletions
+12 -5
View File
@@ -1,17 +1,24 @@
module Dodge.Targeting.Draw (
drawTargeting,
drawTargetingAR,
drawMapperAR,
) where
import Control.Lens
import Data.Maybe
import Dodge.Base.Coordinate
import Dodge.Data.Universe
import Geometry.Data
import Picture
-- it would be nice to get rid of some redundant checks here
drawTargeting :: Item -> World -> Picture
drawTargeting itm w = fromMaybe mempty $ do
drawMapperAR :: Item -> World -> Maybe Picture
drawMapperAR itm w = do
ls <- itm ^? itUse . useMapperLines
let _ = w ^. wCam . camRot
return . setLayer FixedCoordLayer . color red $ foldMap (\(x,y) -> line [f x,f y]) ls
where
f = worldPosToScreen (w ^. wCam)
drawTargetingAR :: Item -> World -> Maybe Picture
drawTargetingAR itm w = do
p <- itm ^? itTargeting . itTgPos . _Just
let thepic = case itm ^? itTargeting . itTgActive of
Just True -> activeTargetCursorPic