Unify key press and mouse button press timings

Both now use Ints for presses.
Still no release timer for keyboard events.
This commit is contained in:
2025-07-28 23:16:05 +01:00
parent ea35753744
commit 81f88c32e9
15 changed files with 52 additions and 58 deletions
+2 -4
View File
@@ -129,7 +129,7 @@ updateWorldEventFlag wef = case wef of
maybeOpenConsole :: Universe -> Universe
maybeOpenConsole u = case u ^. uvWorld . input . pressedKeys . at ScancodeSemicolon of
Just InitialPress -> u & uvScreenLayers %~ openConsole
Just 0 -> u & uvScreenLayers %~ openConsole
_ -> u
openConsole :: [ScreenLayer] -> [ScreenLayer]
@@ -144,7 +144,7 @@ updateUniverseLast u =
& maybeOpenConsole
& advanceScrollAmount
& updateWorldEventFlags
& uvWorld . input . pressedKeys . each %~ f
& uvWorld . input . pressedKeys . each +~ 1
& uvWorld . input . mouseMoving .~ False
& uvWorld . input . mouseButtons . each +~ 1
& uvWorld . input . mouseButtonsReleased . each +~ 1
@@ -155,8 +155,6 @@ updateUniverseLast u =
where
mp = u ^. uvWorld . input . mousePos
mwp = screenToWorldPos (u ^. uvWorld . wCam) mp
f LongPress = LongPress
f _ = ShortPress
{- For most menus the only way to change the world is using event handling. -}
updateUniverseMid :: Universe -> Universe