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.
- class MonadClient m => MonadClientUI m where
- putSession :: MonadClientUI m => SessionUI -> m ()
- queryUI :: MonadClientUI m => m RequestUI
- displayRespUpdAtomicUI :: MonadClientUI m => Bool -> StateClient -> UpdAtomic -> m ()
- displayRespSfxAtomicUI :: MonadClientUI m => Bool -> SfxAtomic -> m ()
- data KeyKind
- data SessionUI = SessionUI {
- sxhair :: Target
- sactorUI :: ActorDictUI
- sslots :: ItemSlots
- slastSlot :: SlotChar
- slastItemMove :: Maybe (CStore, CStore)
- schanF :: ChanFrontend
- sbinding :: Binding
- sconfig :: Config
- saimMode :: Maybe AimMode
- sxhairMoused :: Bool
- sitemSel :: Maybe (CStore, ItemId)
- sselected :: EnumSet ActorId
- srunning :: Maybe RunParams
- _sreport :: Report
- shistory :: History
- spointer :: Point
- slastRecord :: LastRecord
- slastPlay :: [KM]
- slastLost :: EnumSet ActorId
- swaitTimes :: Int
- smarkVision :: Bool
- smarkSmell :: Bool
- smenuIxMap :: Map String Int
- sdisplayNeeded :: Bool
- skeysHintMode :: KeysHintMode
- sstart :: POSIXTime
- sgstart :: POSIXTime
- sallTime :: Time
- snframes :: Int
- sallNframes :: Int
- emptySessionUI :: Config -> SessionUI
- data Config
- applyConfigToDebug :: COps -> Config -> DebugModeCli -> DebugModeCli
- configCmdline :: Config -> [String]
- mkConfig :: COps -> Bool -> IO Config
- data ChanFrontend
- chanFrontend :: MonadClientUI m => DebugModeCli -> m ChanFrontend
- frontendShutdown :: MonadClientUI m => m ()
- data ColorMode
- reportToSlideshow :: MonadClientUI m => [KM] -> m Slideshow
- getConfirms :: MonadClientUI m => ColorMode -> [KM] -> Slideshow -> m KM
- msgAdd :: MonadClientUI m => Text -> m ()
- promptAdd :: MonadClientUI m => Text -> m ()
- addPressedEsc :: MonadClientUI m => m ()
- tryRestore :: MonadClientUI m => m (Maybe (State, StateClient, Maybe SessionUI))
- stdBinding :: KeyKind -> Config -> Binding
- humanCommand :: forall m. MonadClientUI m => m ReqUI
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 #
modifySession :: (SessionUI -> SessionUI) -> m () Source #
Assorted UI operations
putSession :: MonadClientUI m => SessionUI -> m () Source #
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
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.
SessionUI | |
|
emptySessionUI :: Config -> SessionUI Source #
Initial empty game client state.
Fully typed contents of the UI config file. This config is a part of a game client.
applyConfigToDebug :: COps -> Config -> DebugModeCli -> DebugModeCli Source #
configCmdline :: Config -> [String] Source #
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 => DebugModeCli -> m ChanFrontend Source #
frontendShutdown :: MonadClientUI m => m () Source #
Operations exposed for LoopClient
Color mode for the display.
reportToSlideshow :: MonadClientUI m => [KM] -> m Slideshow Source #
Split current report into a slideshow.
getConfirms :: MonadClientUI m => ColorMode -> [KM] -> Slideshow -> m KM Source #
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.
addPressedEsc :: MonadClientUI m => m () Source #
tryRestore :: MonadClientUI m => m (Maybe (State, StateClient, Maybe SessionUI)) Source #
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.