LambdaHack-0.10.2.0: A game engine library for tactical squad ASCII roguelike dungeon crawlers
Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client.UI

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

Querying the human player

queryUI :: (MonadClient m, MonadClientUI m) => m RequestUI Source #

Handle the move of a human player.

UI monad and session type

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 the frontend session.

Constructors

SessionUI 

Fields

Instances

Instances details
Binary SessionUI Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.SessionUI

Updating UI state wrt game state changes

displayRespUpdAtomicUI :: (MonadClient m, MonadClientUI m) => UpdAtomic -> m () Source #

Visualize atomic updates 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. Doesn't modify client state (except a few fields), but only client session (e.g., by displaying messages). This is enforced by types.

displayRespSfxAtomicUI :: (MonadClient m, MonadClientUI m) => SfxAtomic -> m () Source #

Display special effects (text, animation) sent to the client. Don't modify client state (except a few fields), but only client session (e.g., by displaying messages). This is enforced by types.

Startup and initialization

data CCUI Source #

Operations for all content types, gathered together.

Constructors

CCUI 

data UIOptions Source #

Options that affect the UI of the client, specified in the config file. More documentation is in the default config file.

Instances

Instances details
Show UIOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

Generic UIOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

Associated Types

type Rep UIOptions :: Type -> Type #

Binary UIOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

NFData UIOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

Methods

rnf :: UIOptions -> () #

type Rep UIOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

type Rep UIOptions = D1 ('MetaData "UIOptions" "Game.LambdaHack.Client.UI.UIOptions" "LambdaHack-0.10.2.0-inplace" 'False) (C1 ('MetaCons "UIOptions" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "uCommands") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(KM, CmdTriple)]) :*: S1 ('MetaSel ('Just "uHeroNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(Int, (Text, Text))])) :*: (S1 ('MetaSel ('Just "uVi") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "uLeftHand") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))) :*: ((S1 ('MetaSel ('Just "uChosenFontset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "uAllFontsScale") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Just "uScreen1PerLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "uHistory1PerLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool)))) :*: (((S1 ('MetaSel ('Just "uHistoryMax") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "uMaxFps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Just "uNoAnim") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "uhpWarningPercent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))) :*: ((S1 ('MetaSel ('Just "uMessageColors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(String, Color)]) :*: S1 ('MetaSel ('Just "uCmdline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [String])) :*: (S1 ('MetaSel ('Just "uFonts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(Text, FontDefinition)]) :*: (S1 ('MetaSel ('Just "uFontsets") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(Text, FontSet)]) :*: S1 ('MetaSel ('Just "uFullscreenMode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FullscreenMode)))))))

applyUIOptions :: COps -> UIOptions -> ClientOptions -> ClientOptions Source #

Modify client options with UI options.

uCmdline :: UIOptions -> [String] Source #

Hardwired commandline arguments to process.

mkUIOptions :: RuleContent -> ClientOptions -> IO UIOptions Source #

Read and parse UI config file.

Operations exposed for Game.LambdaHack.Client.LoopM

data ChanFrontend Source #

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

chanFrontend :: MonadClientUI m => ScreenContent -> ClientOptions -> m ChanFrontend Source #

Initialize the frontend chosen by the player via client options.

tryRestore :: MonadClientUI m => m (Maybe (StateClient, Maybe SessionUI)) Source #

Try to read saved client game state from the file system.

Internal operations

humanCommand :: forall m. (MonadClient m, MonadClientUI m) => m ReqUI Source #

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