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

Safe HaskellNone
LanguageHaskell2010

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

class MonadClient m => MonadClientUI m where Source #

The monad that gives the client access to UI operations.

Minimal complete definition

getsSession, modifySession, liftIO

Methods

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

modifySession :: (SessionUI -> SessionUI) -> m () Source #

liftIO :: IO a -> m a Source #

Assorted UI operations

queryUI :: MonadClientUI m => m RequestUI Source #

Handle the move of a UI player.

displayRespUpdAtomicUI :: MonadClientUI m => Bool -> 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

data KeyKind Source #

Key-command mappings to be used for the UI.

data SessionUI Source #

The information that is used across a client playing session, including many consecutive games in a single session. Some of it is saved, some is reset when a new playing session starts. An important component is a frontend session.

Constructors

SessionUI 

Fields

emptySessionUI :: Config -> SessionUI Source #

Initial empty game client state.

data Config Source #

Fully typed contents of the UI config file. This config is a part of a game client.

Instances

Show Config Source # 
Generic Config Source # 

Associated Types

type Rep Config :: * -> * #

Methods

from :: Config -> Rep Config x #

to :: Rep Config x -> Config #

Binary Config Source # 

Methods

put :: Config -> Put #

get :: Get Config #

putList :: [Config] -> Put #

NFData Config Source # 

Methods

rnf :: Config -> () #

type Rep Config Source # 
type Rep Config = D1 * (MetaData "Config" "Game.LambdaHack.Client.UI.Config" "LambdaHack-0.6.1.0-HURqEs4cFyW7LJywblRLqn" False) (C1 * (MetaCons "Config" PrefixI True) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "configCommands") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * [(KM, CmdTriple)])) ((:*:) * (S1 * (MetaSel (Just Symbol "configHeroNames") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * [(Int, (Text, Text))])) (S1 * (MetaSel (Just Symbol "configVi") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Bool)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "configLaptop") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "configGtkFontFamily") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Text))) ((:*:) * (S1 * (MetaSel (Just Symbol "configSdlFontFile") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Text)) (S1 * (MetaSel (Just Symbol "configSdlTtfSizeAdd") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Int))))) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "configSdlFonSizeAdd") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Int)) (S1 * (MetaSel (Just Symbol "configFontSize") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Int))) ((:*:) * (S1 * (MetaSel (Just Symbol "configColorIsBold") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "configHistoryMax") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Int)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "configMaxFps") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Int)) (S1 * (MetaSel (Just Symbol "configNoAnim") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Bool))) ((:*:) * (S1 * (MetaSel (Just Symbol "configRunStopMsgs") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "configCmdline") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * [String])))))))

data ChanFrontend Source #

Connection channel between a frontend and a client. Frontend acts as a server, serving keys, etc., when given frames to display.

Operations exposed for LoopClient

data ColorMode Source #

Color mode for the display.

Constructors

ColorFull

normal, with full colours

ColorBW

black+white only

Instances

reportToSlideshow :: MonadClientUI m => [KM] -> m Slideshow Source #

Split current report into a slideshow.

msgAdd :: MonadClientUI m => Text -> m () Source #

Add a message to the current report.

promptAdd :: MonadClientUI m => Text -> m () Source #

Add a prompt to the current report.

stdBinding Source #

Arguments

:: KeyKind

default key bindings from the content

-> Config

game config

-> Binding

concrete binding

Binding of keys to movement and other standard commands, as well as commands defined in the config file.

Internal operations

humanCommand :: forall m. MonadClientUI m => m ReqUI Source #

Let the human player issue commands until any command takes time.