This commit is contained in:
2022-06-07 20:39:52 +01:00
parent 956ee87168
commit 5a42e0b801
6 changed files with 30 additions and 18 deletions
-2
View File
@@ -95,8 +95,6 @@ onRemoveWristShield itm cr w = w
setWristShieldPos :: Item -> Creature -> World -> World
setWristShieldPos itm cr w = w
& moveWallIDUnsafe i wlline
-- & testString .~ (\w' -> [shortShow $ _wlLine (_walls w' IM.! i)])
-- & tempLightSources .:~ tlsTimeRadColPos 1 200 0.7 (fst wlline `v2z` 40)
where
i = _eparamID $ _eqParams $ _eqEq $ _itUse itm
wlline = (f (V3 (-10) 7 0), f (V3 10 7 0))
+6 -2
View File
@@ -98,8 +98,11 @@ targetDistanceDraw itm _ cfig w = fromMaybe mempty $ do
return $ winScale cfig
$ setLayer FixedCoordLayer
$ color thecol
$ line [p1, p2]
<> translate (20) (f p1 p2) (uncurryV translate (0.5 *.* (p1 +.+ p2)) . scale 0.1 0.1 $ text $ shortShow $ dist p mwp)
$ line [p1, p2]
<> transMidLine p1 p2 (scale 0.1 0.1 . text . shortShow $ dist p mwp)
transMidLine :: Point2 -> Point2 -> Picture -> Picture
transMidLine p1 p2 = translate 20 (f p1 p2) . uncurryV translate (0.5 *.* (p1 +.+ p2))
where
f (V2 x y) (V2 x' y')
| y > y' && x > x' = max (-10) (x'-x)
@@ -107,6 +110,7 @@ targetDistanceDraw itm _ cfig w = fromMaybe mempty $ do
| x > x' = min 10 (x-x')
| otherwise = max (-10) (x-x')
targetRBCreatureUp :: Item -> Creature -> World -> Targeting -> (World, Targeting)
targetRBCreatureUp it cr w t
| not $ _itIsHeld it = (w, t