Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- queryUI :: MonadClientUI m => m RequestUI
- class MonadClient m => MonadClientUI m where
- data SessionUI = SessionUI {
- sxhair :: Target
- sactorUI :: ActorDictUI
- sslots :: ItemSlots
- slastItemMove :: Maybe (CStore, CStore)
- schanF :: ChanFrontend
- sbinding :: Binding
- sUIOptions :: UIOptions
- saimMode :: Maybe AimMode
- sxhairMoused :: Bool
- sitemSel :: Maybe (ItemId, CStore, Bool)
- sselected :: EnumSet ActorId
- srunning :: Maybe RunParams
- shistory :: History
- spointer :: Point
- slastRecord :: LastRecord
- slastPlay :: [KM]
- slastLost :: EnumSet ActorId
- swaitTimes :: Int
- smarkVision :: Bool
- smarkSmell :: Bool
- smenuIxMap :: Map String Int
- sdisplayNeeded :: Bool
- shintMode :: HintMode
- sreportNull :: Bool
- sstart :: POSIXTime
- sgstart :: POSIXTime
- sallTime :: Time
- snframes :: Int
- sallNframes :: Int
- displayRespUpdAtomicUI :: MonadClientUI m => Bool -> UpdAtomic -> m ()
- displayRespSfxAtomicUI :: MonadClientUI m => Bool -> SfxAtomic -> m ()
- data KeyKind
- data UIOptions
- applyUIOptions :: COps -> UIOptions -> ClientOptions -> ClientOptions
- uCmdline :: UIOptions -> [String]
- mkUIOptions :: COps -> Bool -> IO UIOptions
- data ChanFrontend
- chanFrontend :: MonadClientUI m => ClientOptions -> m ChanFrontend
- msgAdd :: MonadClientUI m => Text -> m ()
- tryRestore :: MonadClientUI m => m (Maybe (StateClient, Maybe SessionUI))
- stdBinding :: KeyKind -> UIOptions -> Binding
- humanCommand :: forall m. MonadClientUI m => m ReqUI
Querying the human player
queryUI :: MonadClientUI m => m RequestUI Source #
Handle the move of a human player.
UI monad and session type
class MonadClient m => MonadClientUI m where Source #
The monad that gives the client access to UI operations.
getsSession :: (SessionUI -> a) -> m a Source #
modifySession :: (SessionUI -> SessionUI) -> m () Source #
Instances
MonadClientUI CliImplementation Source # | |
Defined in Game.LambdaHack.SampleImplementation.SampleMonadClient getsSession :: (SessionUI -> a) -> CliImplementation a Source # modifySession :: (SessionUI -> SessionUI) -> CliImplementation () Source # liftIO :: IO a -> CliImplementation a 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.
SessionUI | |
|
Updating UI state wrt game state changes
displayRespUpdAtomicUI :: MonadClientUI m => Bool -> 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.
displayRespSfxAtomicUI :: MonadClientUI m => Bool -> SfxAtomic -> m () Source #
Display special effects (text, animation) sent to the client.
Startup and initialization
Options that affect the UI of the client.
Instances
applyUIOptions :: COps -> UIOptions -> ClientOptions -> ClientOptions Source #
Modify client options with UI options.
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 => ClientOptions -> m ChanFrontend Source #
Initialize the frontend chosen by the player via client options.
msgAdd :: MonadClientUI m => Text -> m () Source #
Add a message to the current report. Do not report if it was a duplicate.
tryRestore :: MonadClientUI m => m (Maybe (StateClient, Maybe SessionUI)) Source #
Try to read saved client game state from the file system.
:: KeyKind | default key bindings from the content |
-> UIOptions | UI client options |
-> Binding | concrete binding |
Create 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.