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:
+2
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user