LambdaHack-0.4.9.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone

Game.LambdaHack.Client.UI

Contents

Description

Ways for the client to use player input via UI to produce server requests, based on the client's view (visualized for the player) of the game state.

Synopsis

Client UI monad

Assorted UI operations

queryUI :: MonadClientUI m => m RequestUISource

Handle the move of a UI player.

pongUI :: MonadClientUI m => m RequestUISource

Client signals to the server that it's still online, flushes frames (if needed) and sends some extra info.

displayRespUpdAtomicUI :: MonadClientUI m => Bool -> State -> StateClient -> UpdAtomic -> m ()Source

Visualize atomic actions sent to the client. This is done in the global state after the command is executed and after the client state is modified by the command.

displayRespSfxAtomicUI :: MonadClientUI m => Bool -> SfxAtomic -> m ()Source

Display special effects (text, animation) sent to the client.

Startup

srtFrontend :: (DebugModeCli -> SessionUI -> State -> StateClient -> chanServerUI -> IO ()) -> (DebugModeCli -> SessionUI -> State -> StateClient -> chanServerAI -> IO ()) -> KeyKind -> COps -> DebugModeCli -> ((FactionId -> chanServerUI -> IO ()) -> (FactionId -> chanServerAI -> IO ()) -> IO ()) -> IO ()Source

Wire together game content, the main loop of game clients, the main game loop assigned to this frontend (possibly containing the server loop, if the whole game runs in one process), UI config and the definitions of game commands.

data KeyKind Source

Key-command mappings to be used for the UI.

data SessionUI Source

The information that is constant across a client playing session, including many consecutive games in a single session, but is completely disregarded and reset when a new playing session starts. Auxiliary AI and computer player clients have no sfs nor sbinding.

Operations exposed for LoopClient

data ColorMode Source

Color mode for the display.

Constructors

ColorFull

normal, with full colours

ColorBW

black+white only

displayMore :: MonadClientUI m => ColorMode -> Msg -> m BoolSource

Display a message with a -more- prompt. Return value indicates if the player tried to cancel/escape.

msgAdd :: MonadClientUI m => Msg -> m ()Source

Add a message to the current report.

humanCommand :: forall m. MonadClientUI m => Maybe Msg -> m RequestUISource

Determine and process the next human player command. The argument is the last stop message due to running, if any.