Refactor window size, update selection cursor on new screen
This commit is contained in:
@@ -23,31 +23,27 @@ targetSimpleDraw :: Creature -> Configuration -> World -> Picture
|
||||
targetSimpleDraw = targetDraw activeTargetCursorPic
|
||||
|
||||
targetDistanceDraw :: Creature -> Configuration -> World -> Picture
|
||||
targetDistanceDraw cr cfig w = fromMaybe mempty $ do
|
||||
targetDistanceDraw cr _ w = fromMaybe mempty $ do
|
||||
p <- cr ^? crTargeting . ctPos . _Just
|
||||
let p1 = worldPosToScreen cam p
|
||||
mwp = mouseWorldPos (w ^. input) (w ^. cWorld . camPos)
|
||||
mwp = mouseWorldPos (w ^. input) (w ^. cWorld . cwCamPos)
|
||||
p2 = worldPosToScreen cam mwp
|
||||
thecol = if dist p mwp > 100 then red else white
|
||||
return $
|
||||
winScale cfig $
|
||||
return .
|
||||
setLayer FixedCoordLayer $
|
||||
color thecol $
|
||||
line [p1, p2]
|
||||
<> transMidLine p1 p2 (scale 0.1 0.1 . text . shortShow $ dist p mwp)
|
||||
where
|
||||
cam = w ^. cWorld . camPos
|
||||
cam = w ^. cWorld . cwCamPos
|
||||
|
||||
targetDraw :: Picture -> Creature -> Configuration -> World -> Picture
|
||||
targetDraw f cr cfig w = fromMaybe mempty $ do
|
||||
targetDraw f cr _ _ = fromMaybe mempty $ do
|
||||
p <- cr ^? crTargeting . ctPos . _Just
|
||||
return $
|
||||
winScale cfig $
|
||||
setLayer FixedCoordLayer $
|
||||
return .
|
||||
setLayer DebugLayer $
|
||||
color white $
|
||||
uncurryV translate (worldPosToScreen cam p) f
|
||||
where
|
||||
cam = w ^. cWorld . camPos
|
||||
uncurryV translate p f
|
||||
|
||||
activeTargetCursorPic :: Picture
|
||||
activeTargetCursorPic =
|
||||
|
||||
Reference in New Issue
Block a user