| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Game.LambdaHack.Client.UI.Frontend
Description
Display game data on the screen and receive user input using one of the available raw frontends and derived operations.
Synopsis
- data FrontReq :: * -> * where
- FrontFrame :: {..} -> FrontReq ()
 - FrontDelay :: Int -> FrontReq ()
 - FrontKey :: {..} -> FrontReq KMP
 - FrontPressed :: FrontReq Bool
 - FrontDiscard :: FrontReq ()
 - FrontAdd :: KMP -> FrontReq ()
 - FrontAutoYes :: Bool -> FrontReq ()
 - FrontShutdown :: FrontReq ()
 - FrontPrintScreen :: FrontReq ()
 
 - newtype ChanFrontend = ChanFrontend (forall a. FrontReq a -> IO a)
 - chanFrontendIO :: ClientOptions -> IO ChanFrontend
 - frontendName :: String
 - data FrontSetup
 - getKey :: ClientOptions -> FrontSetup -> RawFrontend -> [KM] -> FrameForall -> IO KMP
 - fchanFrontend :: ClientOptions -> FrontSetup -> RawFrontend -> ChanFrontend
 - display :: RawFrontend -> FrameForall -> IO ()
 - defaultMaxFps :: Int
 - microInSec :: Int
 - frameTimeoutThread :: Int -> MVar Int -> RawFrontend -> IO ()
 - lazyStartup :: IO RawFrontend
 - nullStartup :: IO RawFrontend
 - seqFrame :: SingleFrame -> IO ()
 
Connection and initialization
data FrontReq :: * -> * where Source #
The instructions sent by clients to the raw frontend, indexed by the returned value.
Constructors
| FrontFrame :: {..} -> FrontReq () | Show a frame.  | 
Fields  | |
| FrontDelay :: Int -> FrontReq () | Perform an explicit delay of the given length.  | 
| FrontKey :: {..} -> FrontReq KMP | Flush frames, display a frame and ask for a keypress.  | 
Fields 
  | |
| FrontPressed :: FrontReq Bool | Tell if a keypress is pending.  | 
| FrontDiscard :: FrontReq () | Discard a key in the queue, if any.  | 
| FrontAdd :: KMP -> FrontReq () | Add a key to the queue.  | 
| FrontAutoYes :: Bool -> FrontReq () | Set in the frontend that it should auto-answer prompts.  | 
| FrontShutdown :: FrontReq () | Shut the frontend down.  | 
| FrontPrintScreen :: FrontReq () | Take screenshot.  | 
newtype ChanFrontend Source #
Connection channel between a frontend and a client. Frontend acts as a server, serving keys, etc., when given frames to display.
Constructors
| ChanFrontend (forall a. FrontReq a -> IO a) | 
chanFrontendIO :: ClientOptions -> IO ChanFrontend Source #
Initialize the frontend chosen by the player via client options.
Re-exported part of the raw frontend
frontendName :: String Source #
The name of the chosen frontend.
Internal operations
data FrontSetup Source #
Machinery allocated for an individual frontend at its startup, unchanged for its lifetime.
getKey :: ClientOptions -> FrontSetup -> RawFrontend -> [KM] -> FrameForall -> IO KMP Source #
fchanFrontend :: ClientOptions -> FrontSetup -> RawFrontend -> ChanFrontend Source #
display :: RawFrontend -> FrameForall -> IO () Source #
defaultMaxFps :: Int Source #
microInSec :: Int Source #
frameTimeoutThread :: Int -> MVar Int -> RawFrontend -> IO () Source #
seqFrame :: SingleFrame -> IO () Source #