This commit is contained in:
2023-05-03 20:02:56 +01:00
parent 748e24137f
commit ff512348e0
10 changed files with 81 additions and 111 deletions
+10 -2
View File
@@ -6,8 +6,7 @@ Description : Simulation update
-}
module Dodge.Update (updateUniverse) where
--import Dodge.InputFocus
import Control.Monad
import Dodge.Update.Input.InGame
import Dodge.Update.Input.ScreenLayer
import Dodge.Debug
@@ -279,6 +278,15 @@ functionalUpdate w =
-- . over uvWorld updateInventorySelectionList
$ over uvWorld updatePastWorlds w
checkTermDist :: World -> World
checkTermDist w = fromMaybe w $ do
tmid <- w ^? hud . hudElement . subInventory . termID
btid <- w ^? cWorld . lWorld . terminals . ix tmid . tmButtonID
btpos <- w ^? cWorld . lWorld . buttons . ix btid . btPos
guard $ dist btpos (_crPos $ you w) > 40
return (w & hud . hudElement . subInventory .~ NoSubInventory)
updateWheelEvents :: World -> World
updateWheelEvents w
| yi == 0 = w