Record aim position in LWorld

This commit is contained in:
2025-06-03 09:34:18 +01:00
parent 1de90a97f0
commit a73db304d0
9 changed files with 26 additions and 29 deletions
+5 -8
View File
@@ -2,7 +2,6 @@ module Dodge.Render.Picture (
fixedCoordPictures,
) where
import Control.Monad
import Control.Lens
import Data.Maybe
import Dodge.Base.Coordinate
@@ -17,7 +16,8 @@ import Picture
fixedCoordPictures :: Universe -> Picture
fixedCoordPictures u =
drawMenuOrHUD cfig u
aimDelaySweep u
<> drawMenuOrHUD cfig u
<> drawConcurrentMessage u
<> ttl (translate hw 0 $ drawList (map text (_uvTestString u u)))
<> ttl
@@ -28,7 +28,6 @@ fixedCoordPictures u =
(u ^. uvWorld . cWorld . lWorld . lTestString)
)
<> displayFrameTicks u
<> aimDelaySweep u
<> drawMouseCursor u
<> ( toTopLeft cfig . translate (1.3 * halfWidth cfig) 0
. drawList
@@ -119,7 +118,7 @@ mouseCursorType u = case u ^. uvWorld . input . mouseContext of
a = fromMaybe 0 $ do
cpos <- w ^? cWorld . lWorld . creatures . ix 0 . crPos
return . toClosestMultiple (pi / 32) $
argV (mouseWorldPos (w ^. input) (w ^. wCam) -.- cpos)
argV (w ^. cWorld . lWorld . lAimPos -.- cpos)
- w ^. wCam . camRot
drawEmptySet :: Float -> Picture
@@ -195,7 +194,7 @@ drawDrag x =
drawVerticalDoubleArrow :: Float -> Picture
drawVerticalDoubleArrow x =
line [V2 0 z, V2 0 (- z)]
line [V2 0 z, V2 0 (- z)]
<> line [V2 (- w) (z - w), V2 0 z, V2 w (z - w)]
<> line [V2 (- w) (w - z), V2 0 (- z), V2 w (w - z)]
where
@@ -265,7 +264,6 @@ drawGapPlus x =
aimDelaySweep :: Universe -> Picture
aimDelaySweep u = fold $ do
let w = u ^. uvWorld
guard $ null $ u ^. uvScreenLayers
cr <- w ^? cWorld . lWorld . creatures . ix 0
Aiming{} <- cr ^? crStance . posture
return $ drawAimSweep cr w
@@ -281,5 +279,4 @@ drawAimSweep cr w = fold $ do
rot = campos ^. camRot
p = _crPos cr
campos = w ^. wCam
theinput = w ^. input
mwp = mouseWorldPos theinput campos
mwp = w ^. cWorld . lWorld . lAimPos