License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Swarm.TUI.Model.UI.Gameplay
Description
Sub-records utilized by UI
This exists as a separate module to avoid import cycles.
Synopsis
- data UIGameplay = UIGameplay {
- _uiFocusRing :: FocusRing Name
- _uiWorldCursor :: Maybe (Cosmic Coords)
- _uiWorldEditor :: WorldEditor Name
- _uiREPL :: REPLState
- _uiInventory :: UIInventory
- _uiScrollToEnd :: Bool
- _uiDialogs :: UIDialogs
- _uiIsAutoPlay :: Bool
- _uiAutoShowObjectives :: Bool
- _uiShowREPL :: Bool
- _uiShowDebug :: Bool
- _uiHideRobotsUntil :: TimeSpec
- _uiTiming :: UITiming
- _scenarioRef :: Maybe (ScenarioWith ScenarioPath)
- data UITiming = UITiming {}
- data UIInventory = UIInventory {}
- data GoalDisplay = GoalDisplay {}
- data UIDialogs = UIDialogs {}
- uiTiming :: Lens' UIGameplay UITiming
- uiInventory :: Lens' UIGameplay UIInventory
- uiFocusRing :: Lens' UIGameplay (FocusRing Name)
- uiWorldCursor :: Lens' UIGameplay (Maybe (Cosmic Coords))
- uiWorldEditor :: Lens' UIGameplay (WorldEditor Name)
- uiREPL :: Lens' UIGameplay REPLState
- uiInventoryList :: Lens' UIInventory (Maybe (Int, List Name InventoryListEntry))
- uiInventorySort :: Lens' UIInventory InventorySortOptions
- uiInventorySearch :: Lens' UIInventory (Maybe Text)
- uiScrollToEnd :: Lens' UIGameplay Bool
- uiModal :: Lens' UIDialogs (Maybe Modal)
- uiGoal :: Lens' UIDialogs GoalDisplay
- uiStructure :: Lens' UIDialogs StructureDisplay
- uiRobot :: Lens' UIDialogs RobotDisplay
- uiDialogs :: Lens' UIGameplay UIDialogs
- uiIsAutoPlay :: Lens' UIGameplay Bool
- uiAutoShowObjectives :: Lens' UIGameplay Bool
- lgTicksPerSecond :: Lens' UITiming Int
- lastFrameTime :: Lens' UITiming TimeSpec
- accumulatedTime :: Lens' UITiming TimeSpec
- tickCount :: Lens' UITiming Int
- frameCount :: Lens' UITiming Int
- frameTickCount :: Lens' UITiming Int
- lastInfoTime :: Lens' UITiming TimeSpec
- uiShowFPS :: Lens' UITiming Bool
- uiShowREPL :: Lens' UIGameplay Bool
- uiShowZero :: Lens' UIInventory Bool
- uiShowDebug :: Lens' UIGameplay Bool
- uiShowRobots :: Getter UIGameplay Bool
- uiHideRobotsUntil :: Lens' UIGameplay TimeSpec
- uiInventoryShouldUpdate :: Lens' UIInventory Bool
- uiTPF :: Lens' UITiming Double
- uiFPS :: Lens' UITiming Double
- scenarioRef :: Lens' UIGameplay (Maybe (ScenarioWith ScenarioPath))
Documentation
data UIGameplay Source #
UI state specific to an actively-playing scenario.
Compare to UIState
, which contains UI state independent of an
active scenario.
For access to the fields, see the lenses below.
Constructors
UIGameplay | |
Fields
|
Constructors
UITiming | |
Fields
|
data UIInventory Source #
Constructors
UIInventory | |
data GoalDisplay Source #
Constructors
GoalDisplay | |
Fields
|
State that backs various modal dialogs
Constructors
UIDialogs | |
Fields |
uiInventory :: Lens' UIGameplay UIInventory Source #
Inventory information for gameplay UI
uiFocusRing :: Lens' UIGameplay (FocusRing Name) Source #
The focus ring is the set of UI panels we can cycle among using
the Tab
key.
uiWorldCursor :: Lens' UIGameplay (Maybe (Cosmic Coords)) Source #
The last clicked position on the world view.
uiWorldEditor :: Lens' UIGameplay (WorldEditor Name) Source #
State of all World Editor widgets
uiInventoryList :: Lens' UIInventory (Maybe (Int, List Name InventoryListEntry)) Source #
The hash value of the focused robot entity (so we can tell if its inventory changed) along with a list of the items in the focused robot's inventory.
uiInventorySort :: Lens' UIInventory InventorySortOptions Source #
The order and direction of sorting inventory list.
uiInventorySearch :: Lens' UIInventory (Maybe Text) Source #
The current search string used to narrow the inventory view.
uiScrollToEnd :: Lens' UIGameplay Bool Source #
A flag telling the UI to scroll the info panel to the very end (used when a new log message is appended).
uiModal :: Lens' UIDialogs (Maybe Modal) Source #
When this is Just
, it represents a modal to be displayed on
top of the UI, e.g. for the Help screen.
uiGoal :: Lens' UIDialogs GoalDisplay Source #
Status of the scenario goal: whether there is one, and whether it has been displayed to the user initially.
uiStructure :: Lens' UIDialogs StructureDisplay Source #
Definition and status of a recognizable structure
uiIsAutoPlay :: Lens' UIGameplay Bool Source #
When running with --autoplay
the progress will not be saved.
uiAutoShowObjectives :: Lens' UIGameplay Bool Source #
Do not open objectives modals on objective completion.
lgTicksPerSecond :: Lens' UITiming Int Source #
The base-2 logarithm of the current game speed in ticks/second. Note that we cap this value to the range of +/- log2 INTMAX.
accumulatedTime :: Lens' UITiming TimeSpec Source #
The amount of accumulated real time. Every time we get a Frame
event, we accumulate the amount of real time that happened since
the last frame, then attempt to take an appropriate number of
ticks to "catch up", based on the target tick rate.
tickCount :: Lens' UITiming Int Source #
A counter used to track how many ticks have happened since the last time we updated the ticks/frame statistics.
frameCount :: Lens' UITiming Int Source #
A counter used to track how many frames have been rendered since the last time we updated the ticks/frame statistics.
frameTickCount :: Lens' UITiming Int Source #
A counter used to track how many ticks have happened in the current frame, so we can stop when we get to the tick cap.
uiShowREPL :: Lens' UIGameplay Bool Source #
A toggle to expand or collapse the REPL by pressing Ctrl-k
uiShowZero :: Lens' UIInventory Bool Source #
A toggle to show or hide inventory items with count 0 by pressing 0
uiShowDebug :: Lens' UIGameplay Bool Source #
A toggle to show CESK machine debug view and step through it.
Note that the ability to use it can be enabled by player robot
gaining the capability, or being in creative mode or with
the debug option DebugCESK
.
uiShowRobots :: Getter UIGameplay Bool Source #
Whether to show or hide robots on the world map.
uiHideRobotsUntil :: Lens' UIGameplay TimeSpec Source #
Hide robots on the world map.
uiInventoryShouldUpdate :: Lens' UIInventory Bool Source #
Whether the Inventory ui panel should update
scenarioRef :: Lens' UIGameplay (Maybe (ScenarioWith ScenarioPath)) Source #
The currently active Scenario description, useful for starting over.