Commit before pushing more input events into update

This commit is contained in:
2022-10-29 22:33:10 +01:00
parent afaef480db
commit e3155752ba
36 changed files with 121 additions and 147 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ targetDistanceDraw :: Item -> Creature -> Configuration -> World -> Picture
targetDistanceDraw itm _ cfig w = fromMaybe mempty $ do
p <- itm ^? itTargeting . tgPos . _Just
let p1 = worldPosToScreen cam p
mwp = mouseWorldPos (w ^. input) (w ^. cWorld . lWorld . camPos)
mwp = mouseWorldPos (w ^. input) (w ^. cWorld . camPos)
p2 = worldPosToScreen cam mwp
thecol = if dist p mwp > 100 then red else white
return $
@@ -33,7 +33,7 @@ targetDistanceDraw itm _ cfig w = fromMaybe mempty $ do
line [p1, p2]
<> transMidLine p1 p2 (scale 0.1 0.1 . text . shortShow $ dist p mwp)
where
cam = w ^. cWorld . lWorld . camPos
cam = w ^. cWorld . camPos
targetDraw :: (Item -> Picture) -> Item -> Creature -> Configuration -> World -> Picture
targetDraw f it _ cfig w = fromMaybe mempty $ do
@@ -45,7 +45,7 @@ targetDraw f it _ cfig w = fromMaybe mempty $ do
uncurryV translate (worldPosToScreen cam p) $
f it
where
cam = w ^. cWorld . lWorld . camPos
cam = w ^. cWorld . camPos
activeTargetCursorPic :: Picture
activeTargetCursorPic =