| Safe Haskell | None |
|---|
Game.LambdaHack.Action.Frontend
Description
Display game data on the screen and receive user input using one of the available raw frontends and derived operations.
- data FrontendSession
- startup :: String -> (FrontendSession -> IO ()) -> IO ()
- frontendName :: String
- nextEvent :: FrontendSession -> Maybe Bool -> IO (Key, Modifier)
- displayFrame :: FrontendSession -> Bool -> Maybe SingleFrame -> IO ()
- promptGetKey :: FrontendSession -> [(Key, Modifier)] -> SingleFrame -> IO (Key, Modifier)
Re-exported part of the raw frontend
data FrontendSession Source
Session data maintained by the frontend.
startup :: String -> (FrontendSession -> IO ()) -> IO ()Source
Spawns the gtk input and output thread, which spawns all the other
required threads. We create a separate thread for gtk to minimize
communication with the heavy main thread. The other threads have to be
spawned after gtk is initialized, because they call postGUIAsync,
and need sview and stags.
The name of the frontend.
nextEvent :: FrontendSession -> Maybe Bool -> IO (Key, Modifier)Source
Input key via the frontend. Fail if there is no frame to show to the player as a prompt for the keypress.
Derived operations
displayFrame :: FrontendSession -> Bool -> Maybe SingleFrame -> IO ()Source
Push a frame or a single frame's worth of delay to the frame queue.
promptGetKey :: FrontendSession -> [(Key, Modifier)] -> SingleFrame -> IO (Key, Modifier)Source
Display a prompt, wait for any of the specified keys (for any key, if the list is empty). Repeat if an unexpected key received.