swarm-0.1.0.0: 2D resource gathering game with programmable robots
CopyrightBrent Yorgey
LicenseBSD-3-Clause
Maintainerbyorgey@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.TUI.View

Description

Code for drawing the TUI.

Synopsis

Documentation

drawUI :: AppState -> [Widget Name] Source #

The main entry point for drawing the entire UI. Figures out which menu screen we should show (if any), or just the game itself.

drawTPS :: AppState -> Widget Name Source #

Draw info about the current number of ticks per second.

Dialog box

drawDialog :: AppState -> Widget Name Source #

Draw the error dialog window, if it should be displayed right now.

generateModal :: AppState -> ModalType -> Modal Source #

Generate a fresh modal window of the requested type.

chooseCursor :: AppState -> [CursorLocation n] -> Maybe (CursorLocation n) Source #

Hide the cursor when a modal is set

Key hint menu

drawKeyMenu :: AppState -> Widget Name Source #

Draw a menu explaining what key commands are available for the current panel. This menu is displayed as a single line in between the world panel and the REPL.

This excludes the F-key modals that are shown elsewhere.

drawModalMenu :: AppState -> Widget Name Source #

Draw the F-key modal menu. This is displayed in the top left world corner.

drawKeyCmd :: (KeyHighlight, Text, Text) -> Widget Name Source #

Draw a single key command in the menu.

World

drawWorld :: GameState -> Widget Name Source #

Draw the current world view.

Robot panel

drawRobotPanel :: AppState -> Widget Name Source #

Draw info about the currently focused robot, such as its name, position, orientation, and inventory.

drawItem Source #

Arguments

:: Maybe Int

The index of the currently selected inventory entry

-> Int

The index of the entry we are drawing

-> Bool

Whether this entry is selected; we can ignore this because it will automatically have a special attribute applied to it.

-> InventoryListEntry

The entry to draw.

-> Widget Name 

Draw an inventory entry.

drawLabelledEntityName :: Entity -> Widget Name Source #

Draw the name of an entity, labelled with its visual representation as a cell in the world.

Info panel

drawInfoPanel :: AppState -> Widget Name Source #

Draw the info panel in the bottom-left corner, which shows info about the currently focused inventory item.

explainFocusedItem :: AppState -> Widget Name Source #

Display info about the currently focused inventory entity, such as its description and relevant recipes.

REPL

drawREPL :: AppState -> Widget Name Source #

Draw the REPL.