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

Safe HaskellNone

Game.LambdaHack.Client.UI.MonadClientUI

Contents

Description

Client monad for interacting with a human through UI.

Synopsis

Client UI monad

class MonadClient m => MonadClientUI m whereSource

Methods

getsSession :: (SessionUI -> a) -> m aSource

liftIO :: IO a -> m aSource

Instances

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.

Constructors

SessionUI 

Fields

schanF :: !ChanFrontend

connection with the frontend

sbinding :: !Binding

binding of keys to commands

sescMVar :: !(Maybe (MVar ()))
 
sconfig :: !Config
 

Display and key input

data ColorMode Source

Color mode for the display.

Constructors

ColorFull

normal, with full colours

ColorBW

black+white only

getKeyOverlayCommand :: MonadClientUI m => Bool -> Overlay -> m KMSource

Display an overlay and wait for a human player command.

getInitConfirms :: MonadClientUI m => ColorMode -> [KM] -> Slideshow -> m BoolSource

Display a slideshow, awaiting confirmation for each slide except the last.

displayFrames :: MonadClientUI m => Frames -> m ()Source

Push frames or delays to the frame queue.

displayActorStart :: MonadClientUI m => Actor -> Frames -> m ()Source

Push frames or delays to the frame queue. Additionally set sdisplayed. because animations not always happen after SfxActorStart on the leader's level (e.g., death can lead to leader change to another level mid-turn, and there could be melee and animations on that level at the same moment).

drawOverlay :: MonadClientUI m => Bool -> ColorMode -> Overlay -> m SingleFrameSource

Draw the current level with the overlay on top.

Assorted primitives

askBinding :: MonadClientUI m => m BindingSource

Get the key binding.

syncFrames :: MonadClientUI m => m ()Source

Sync frames display with the frontend.