LambdaHack- A game engine library for roguelike dungeon crawlers

Safe HaskellNone




Client monad for interacting with a human through UI.


Client UI monad

class MonadClient m => MonadClientUI m where Source

The monad that gives the client access to UI operations.


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

liftIO :: IO a -> m a Source


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. This includes a frontend session and keybinding info.




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.



normal, with full colours


black+white only

getKeyOverlayCommand :: MonadClientUI m => Maybe Bool -> Overlay -> m KM Source

Display an overlay and wait for a human player command.

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

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

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). Insert delays, so that the animations don't look rushed.

drawOverlay :: MonadClientUI m => Bool -> ColorMode -> Overlay -> m SingleFrame Source

Draw the current level with the overlay on top.

Assorted primitives

askBinding :: MonadClientUI m => m Binding Source

Get the key binding.

syncFrames :: MonadClientUI m => m () Source

Sync frames display with the frontend.