Simplify the main loop, events only perform functional update

This commit is contained in:
2022-11-01 11:05:51 +00:00
parent 82c4b992b0
commit d982ac728a
14 changed files with 232 additions and 150 deletions
+5 -1
View File
@@ -6,7 +6,6 @@ import qualified Data.Text as T
import Dodge.Base
import Dodge.Combine
import Dodge.Data.Universe
import Dodge.Event.Keyboard
import Dodge.HeldScroll
import Dodge.InputFocus
import Dodge.Inventory
@@ -75,6 +74,11 @@ updateWheelEvent yi w = case w ^. cWorld . lWorld . hud . hudElement of
lbDown = ButtonLeft `M.member` _mouseButtons (_input w)
invKeyDown = ScancodeCapsLock `M.member` _pressedKeys (_input w)
guardDisconnectedID :: Int -> World -> World -> World
guardDisconnectedID tmid w w' = case w ^? cWorld . lWorld . terminals . ix tmid . tmStatus of
Just TerminalReady -> w'
_ -> w
scrollRBOption :: Float -> World -> World
scrollRBOption y w
| y < 0 = w & rbOptions . opSel %~ (min (length (_opEquip (_rbOptions w)) -1) . (+ 1))