swarm-0.7.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellNone
LanguageHaskell2010

Swarm.TUI.Model.UI

Description

 
Synopsis

Documentation

data UIState Source #

UI state independent of an actively-playing scenario. Compare to UIGameplay, which contains UI state for an active scenario.

uiMenu :: Lens' UIState Menu Source #

The current menu state.

uiPlaying :: Lens' UIState Bool Source #

Are we currently playing the game?

  • True = we are playing, and should thus display a world, REPL, etc.
  • False = we should display the current menu.

uiDebugOptions :: Lens' UIState (Set DebugOption) Source #

Debugging features, for example are we allowed to turn creative mode on and off?

uiLaunchConfig :: Lens' UIState LaunchOptions Source #

Configuration modal when launching a scenario

Initialization

initFocusRing :: FocusRing Name Source #

The initial state of the focus ring. NOTE: Normally, the Tab key might cycle through the members of the focus ring. However, the REPL already uses Tab. So, to is not used at all right now for navigating the toplevel focus ring.

defaultInitLgTicksPerSecond :: Int Source #

The initial tick speed.

initUIState :: forall (sig :: (Type -> Type) -> Type -> Type) m. (Has (Accum (Seq SystemFailure)) sig m, Has (Lift IO) sig m) => UIInitOptions -> m UIState Source #

Initialize the UI state. This needs to be in the IO monad since it involves reading a REPL history file, getting the current time, and loading text files from the data directory.