LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Client.UI.SessionUI

Description

The client UI session state.

Synopsis

- data SessionUI = SessionUI {
  - sreqPending :: Maybe RequestUI
  - sreqDelay :: ReqDelay
  - sreqQueried :: Bool
  - sregainControl :: Bool
  - sxhair :: Maybe Target
  - sxhairGoTo :: Maybe Target
  - sactorUI :: ActorDictUI
  - sitemUI :: ItemDictUI
  - sroles :: ItemRoles
  - slastItemMove :: Maybe (CStore, CStore)
  - schanF :: ChanFrontend
  - sccui :: CCUI
  - sUIOptions :: UIOptions
  - saimMode :: Maybe AimMode
  - sxhairMoused :: Bool
  - sitemSel :: Maybe (ItemId, CStore, Bool)
  - sselected :: EnumSet ActorId
  - srunning :: Maybe RunParams
  - shistory :: History
  - svictories :: EnumMap (ContentId ModeKind) (Map Challenge Int)
  - scampings :: EnumSet (ContentId ModeKind)
  - srestarts :: EnumSet (ContentId ModeKind)
  - spointer :: PointUI
  - sautoYes :: Bool
  - smacroFrame :: KeyMacroFrame
  - smacroStack :: [KeyMacroFrame]
  - slastLost :: EnumSet ActorId
  - swaitTimes :: Int
  - swasAutomated :: Bool
  - smarkVision :: Int
  - smarkSmell :: Bool
  - snxtScenario :: Int
  - scurTutorial :: Bool
  - snxtTutorial :: Bool
  - soverrideTut :: Maybe Bool
  - susedHints :: Set Msg
  - smuteMessages :: Bool
  - smenuIxMap :: Map String Int
  - schosenLore :: ChosenLore
  - sdisplayNeeded :: Bool
  - sturnDisplayed :: Bool
  - sreportNull :: Bool
  - sstart :: POSIXTime
  - sgstart :: POSIXTime
  - sallTime :: Time
  - snframes :: Int
  - sallNframes :: Int
  - srandomUI :: SMGen
  }
- data ReqDelay
  - = ReqDelayNot
  - | ReqDelayHandled
  - | ReqDelayAlarm
- type ItemDictUI = EnumMap ItemId LevelId
- newtype ItemRoles = ItemRoles (EnumMap SLore (EnumSet ItemId))
- data AimMode = AimMode {
  - aimLevelId :: LevelId
  - detailLevel :: DetailLevel
  }
- newtype KeyMacro = KeyMacro {
  - unKeyMacro :: [KM]
  }
- data KeyMacroFrame = KeyMacroFrame {
  - keyMacroBuffer :: Either [KM] KeyMacro
  - keyPending :: KeyMacro
  - keyLast :: Maybe KM
  }
- data RunParams = RunParams {
  - runLeader :: ActorId
  - runMembers :: [ActorId]
  - runInitial :: Bool
  - runStopMsg :: Maybe Text
  - runWaiting :: Int
  }
- data ChosenLore
  - = ChosenLore [(ActorId, Actor)] [(ItemId, ItemQuant)]
  - | ChosenNothing
- emptySessionUI :: UIOptions -> SessionUI
- emptyMacroFrame :: KeyMacroFrame
- cycleMarkVision :: Int -> SessionUI -> SessionUI
- toggleMarkSmell :: SessionUI -> SessionUI
- cycleOverrideTut :: Int -> SessionUI -> SessionUI
- getActorUI :: ActorId -> SessionUI -> ActorUI

# Documentation

data SessionUI Source #

The information that is used across a human player playing session, including many consecutive games in a single session, including playing different teams. Some of it is saved, some is reset when a new playing session starts. Nothing is tied to a faction/team, but instead all to UI configuration and UI input and display history. An important component is the frontend session.

Constructors

SessionUI |

Fields

- sreqPending :: Maybe RequestUI

  request created by a UI query but not yet sent to the server

- sreqDelay :: ReqDelay

  server delayed sending query to client or receiving request from client

- sreqQueried :: Bool

  player is now queried for a command

- sregainControl :: Bool

  player requested to regain control from AI ASAP

- sxhair :: Maybe Target

  the common xhair

- sxhairGoTo :: Maybe Target

  xhair set for last GoTo

- sactorUI :: ActorDictUI

  assigned actor UI presentations

- sitemUI :: ItemDictUI

  assigned item first seen level

- sroles :: ItemRoles

  assignment of roles to items

- slastItemMove :: Maybe (CStore, CStore)

  last item move stores

- schanF :: ChanFrontend

  connection with the frontend

- sccui :: CCUI

  UI client content

- sUIOptions :: UIOptions

  UI options as set by the player

- saimMode :: Maybe AimMode

  aiming mode

- sxhairMoused :: Bool

  last mouse aiming not vacuus

- sitemSel :: Maybe (ItemId, CStore, Bool)

  selected item, if any, it's store and whether to override suitability check

- sselected :: EnumSet ActorId

  the set of currently selected actors

- srunning :: Maybe RunParams

  parameters of the current run, if any

- shistory :: History

  history of messages

- svictories :: EnumMap (ContentId ModeKind) (Map Challenge Int)

  the number of games won by the UI faction per game mode and per difficulty level

- scampings :: EnumSet (ContentId ModeKind)

  camped games

- srestarts :: EnumSet (ContentId ModeKind)

  restarted games

- spointer :: PointUI

  mouse pointer position

- sautoYes :: Bool

  whether to auto-clear prompts

- smacroFrame :: KeyMacroFrame

  the head of the key macro stack

- smacroStack :: [KeyMacroFrame]

  the tail of the key macro stack

- slastLost :: EnumSet ActorId

  actors that just got out of sight

- swaitTimes :: Int

  player just waited this many times

- swasAutomated :: Bool

  the player just exited AI automation

- smarkVision :: Int

  mark leader and party FOV

- smarkSmell :: Bool

  mark smell, if the leader can smell

- snxtScenario :: Int

  next game scenario number

- scurTutorial :: Bool

  whether current game is a tutorial

- snxtTutorial :: Bool

  whether next game is to be tutorial

- soverrideTut :: Maybe Bool

  override display of tutorial hints

- susedHints :: Set Msg

  tutorial hints already shown this game

- smuteMessages :: Bool

  whether to mute all new messages

- smenuIxMap :: Map String Int

  indices of last used menu items

- schosenLore :: ChosenLore

  last lore chosen to display

- sdisplayNeeded :: Bool

  current level needs displaying

- sturnDisplayed :: Bool

  a frame was already displayed this turn

- sreportNull :: Bool

  whether no visible report created last UI faction turn or the report wiped out from screen since

- sstart :: POSIXTime

  this session start time

- sgstart :: POSIXTime

  this game start time

- sallTime :: Time

  clips from start of session to current game start

- snframes :: Int

  this game current frame count

- sallNframes :: Int

  frame count from start of session to current game start

- srandomUI :: SMGen

  current random generator for UI

#### Instances

Instances details

Binary SessionUI Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods put :: SessionUI -> Put Source # get :: Get SessionUI Source # putList :: [SessionUI] -> Put Source #

data ReqDelay Source #

Constructors

ReqDelayNot |
ReqDelayHandled |
ReqDelayAlarm |

#### Instances

Instances details

Eq ReqDelay Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods (==) :: ReqDelay -> ReqDelay -> Bool Source # (/=) :: ReqDelay -> ReqDelay -> Bool Source #

type ItemDictUI = EnumMap ItemId LevelId Source #

newtype ItemRoles Source #

A collection of item identifier sets indicating what roles (possibly many) an item has assigned.

Constructors

ItemRoles (EnumMap SLore (EnumSet ItemId)) |

#### Instances

Instances details

Binary ItemRoles Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods put :: ItemRoles -> Put Source # get :: Get ItemRoles Source # putList :: [ItemRoles] -> Put Source #
Show ItemRoles Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods showsPrec :: Int -> ItemRoles -> ShowS Source # show :: ItemRoles -> String Source # showList :: [ItemRoles] -> ShowS Source #

data AimMode Source #

Current aiming mode of a client.

Constructors

AimMode |

Fields

- aimLevelId :: LevelId
- detailLevel :: DetailLevel

#### Instances

Instances details

Binary AimMode Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods put :: AimMode -> Put Source # get :: Get AimMode Source # putList :: [AimMode] -> Put Source #
Generic AimMode Source # |

Instance details

Defined in Game.LambdaHack.Client.UI.SessionUI

Associated Types

type Rep AimMode |

Instance details

Defined in Game.LambdaHack.Client.UI.SessionUI

type Rep AimMode = D1 ('MetaData "AimMode" "Game.LambdaHack.Client.UI.SessionUI" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "AimMode" 'PrefixI 'True) (S1 ('MetaSel ('Just "aimLevelId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 LevelId) :*: S1 ('MetaSel ('Just "detailLevel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DetailLevel)))

Methods

from :: AimMode -> Rep AimMode x Source #

to :: Rep AimMode x -> AimMode Source #

Show AimMode Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods showsPrec :: Int -> AimMode -> ShowS Source # show :: AimMode -> String Source # showList :: [AimMode] -> ShowS Source #
Eq AimMode Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods (==) :: AimMode -> AimMode -> Bool Source # (/=) :: AimMode -> AimMode -> Bool Source #
type Rep AimMode Source # |

Instance details

Defined in Game.LambdaHack.Client.UI.SessionUI

type Rep AimMode = D1 ('MetaData "AimMode" "Game.LambdaHack.Client.UI.SessionUI" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "AimMode" 'PrefixI 'True) (S1 ('MetaSel ('Just "aimLevelId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 LevelId) :*: S1 ('MetaSel ('Just "detailLevel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DetailLevel)))

newtype KeyMacro Source #

In-game macros. We record menu navigation keystrokes and keystrokes bound to commands with one exception --- we exclude keys that invoke the `Record` command, to avoid surprises. Keys are kept in the same order in which they're meant to be replayed, i.e. the first element of the list is replayed also as the first one.

Constructors

KeyMacro |

Fields

- unKeyMacro :: [KM]

#### Instances

Instances details

Binary KeyMacro Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods put :: KeyMacro -> Put Source # get :: Get KeyMacro Source # putList :: [KeyMacro] -> Put Source #
Monoid KeyMacro Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods mempty :: KeyMacro Source # mappend :: KeyMacro -> KeyMacro -> KeyMacro Source # mconcat :: [KeyMacro] -> KeyMacro Source #
Semigroup KeyMacro Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods (<>) :: KeyMacro -> KeyMacro -> KeyMacro Source # sconcat :: NonEmpty KeyMacro -> KeyMacro Source # stimes :: Integral b => b -> KeyMacro -> KeyMacro Source #
Show KeyMacro Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods showsPrec :: Int -> KeyMacro -> ShowS Source # show :: KeyMacro -> String Source # showList :: [KeyMacro] -> ShowS Source #
Eq KeyMacro Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods (==) :: KeyMacro -> KeyMacro -> Bool Source # (/=) :: KeyMacro -> KeyMacro -> Bool Source #

data KeyMacroFrame Source #

Local macro buffer frame. Predefined macros have their own in-game macro buffer, allowing them to record in-game macro, queue actions and repeat the last macro's action. Running predefined macro pushes new `KeyMacroFrame` onto the stack. We pop buffers from the stack if locally there are no actions pending to be handled.

Constructors

KeyMacroFrame |

Fields

- keyMacroBuffer :: Either [KM] KeyMacro

  record keystrokes in Left; repeat from Right

- keyPending :: KeyMacro

  actions pending to be handled

- keyLast :: Maybe KM

  last pressed key

#### Instances

Instances details

Show KeyMacroFrame Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods showsPrec :: Int -> KeyMacroFrame -> ShowS Source # show :: KeyMacroFrame -> String Source # showList :: [KeyMacroFrame] -> ShowS Source #

data RunParams Source #

Parameters of the current run.

Constructors

RunParams |

Fields

- runLeader :: ActorId

  the original leader from run start

- runMembers :: [ActorId]

  the list of actors that take part

- runInitial :: Bool

  initial run continuation by any run participant, including run leader

- runStopMsg :: Maybe Text

  message with the next stop reason

- runWaiting :: Int

  waiting for others to move out of the way

#### Instances

Instances details

Binary RunParams Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods put :: RunParams -> Put Source # get :: Get RunParams Source # putList :: [RunParams] -> Put Source #
Show RunParams Source # |
Instance details Defined in Game.LambdaHack.Client.UI.SessionUI Methods showsPrec :: Int -> RunParams -> ShowS Source # show :: RunParams -> String Source # showList :: [RunParams] -> ShowS Source #

data ChosenLore Source #

Last lore being aimed at.

Constructors

ChosenLore [(ActorId, Actor)] [(ItemId, ItemQuant)] |
ChosenNothing |

emptySessionUI :: UIOptions -> SessionUI Source #

emptyMacroFrame :: KeyMacroFrame Source #

cycleMarkVision :: Int -> SessionUI -> SessionUI Source #

toggleMarkSmell :: SessionUI -> SessionUI Source #

cycleOverrideTut :: Int -> SessionUI -> SessionUI Source #

getActorUI :: ActorId -> SessionUI -> ActorUI Source #