License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Swarm.TUI.View
Description
Code for drawing the TUI.
Synopsis
- drawUI :: AppState -> [Widget Name]
- drawTPS :: UITiming -> Widget Name
- drawDialog :: ToplevelConfigurationHelp -> Bool -> ScenarioState -> Widget Name
- chooseCursor :: AppState -> [CursorLocation n] -> Maybe (CursorLocation n)
- drawKeyMenu :: ScenarioState -> KeyConfig SwarmEvent -> Set DebugOption -> Widget Name
- drawModalMenu :: GameState -> KeyConfig SwarmEvent -> Widget Name
- drawKeyCmd :: KeyCmd -> Widget Name
- drawRobotPanel :: ScenarioState -> Widget Name
- drawItem :: Maybe Int -> Int -> Bool -> InventoryListEntry -> Widget Name
- drawInfoPanel :: ScenarioState -> Widget Name
- explainFocusedItem :: ScenarioState -> Widget Name
- drawREPL :: ScenarioState -> Widget Name
Documentation
Dialog box
drawDialog :: ToplevelConfigurationHelp -> Bool -> ScenarioState -> Widget Name Source #
Draw a dialog window, if one should be displayed right now.
chooseCursor :: AppState -> [CursorLocation n] -> Maybe (CursorLocation n) Source #
Hide the cursor when a modal is set
Key hint menu
drawKeyMenu :: ScenarioState -> KeyConfig SwarmEvent -> Set DebugOption -> Widget Name Source #
Draw a menu explaining what key commands are available for the current panel. This menu is displayed as one or two lines in between the world panel and the REPL.
This excludes the F-key modals that are shown elsewhere.
drawModalMenu :: GameState -> KeyConfig SwarmEvent -> Widget Name Source #
Draw the F-key modal menu. This is displayed in the top left world corner.
drawKeyCmd :: KeyCmd -> Widget Name Source #
Draw a single key command in the menu.
Robot panel
drawRobotPanel :: ScenarioState -> Widget Name Source #
Draw info about the currently focused robot, such as its name, position, orientation, and inventory, as long as it is not too far away.
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.
Info panel
drawInfoPanel :: ScenarioState -> Widget Name Source #
Draw the info panel in the bottom-left corner, which shows info about the currently focused inventory item.
explainFocusedItem :: ScenarioState -> Widget Name Source #
Display info about the currently focused inventory entity, such as its description and relevant recipes.