License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Swarm.TUI.View.Util
Description
Synopsis
- data ScenarioSeriesContext = ScenarioSeriesContext {
- scenarioSeries :: [ScenarioWith ScenarioPath]
- currentMenuName :: Maybe Text
- hasMenu :: Bool
- generateScenarioEndModal :: ScenarioSeriesContext -> EndScenarioModalType -> ScenarioState -> Modal
- generateModal :: ScenarioState -> MidScenarioModalType -> Modal
- drawType :: Polytype -> Widget Name
- drawMarkdown :: Document Syntax -> Widget Name
- drawLabeledTerrainSwatch :: TerrainMap -> TerrainType -> Widget Name
- descriptionTitle :: Entity -> String
- maxModalWindowWidth :: Int
- curMenuName :: Menu -> Maybe Text
- quitMsg :: Bool -> Text
- displayParagraphs :: [Text] -> Widget Name
- layoutParagraphs :: [Widget Name] -> Widget Name
- data EllipsisSide
- withEllipsis :: EllipsisSide -> Text -> Widget Name
- maybeScroll :: (Ord n, Show n) => n -> Widget n -> Widget n
- drawLabelledEntityName :: Entity -> Widget n
- bindingText :: KeyConfig SwarmEvent -> SwarmEvent -> Text
Documentation
data ScenarioSeriesContext Source #
Constructors
ScenarioSeriesContext | |
Fields
|
generateScenarioEndModal :: ScenarioSeriesContext -> EndScenarioModalType -> ScenarioState -> Modal Source #
generateModal :: ScenarioState -> MidScenarioModalType -> Modal Source #
Generate a fresh modal window of the requested type.
drawType :: Polytype -> Widget Name Source #
Render the type of the current REPL input to be shown to the user.
drawMarkdown :: Document Syntax -> Widget Name Source #
Draw markdown document with simple codebolditalic attributes.
TODO: #574 Code blocks should probably be handled separately.
drawLabeledTerrainSwatch :: TerrainMap -> TerrainType -> Widget Name Source #
descriptionTitle :: Entity -> String Source #
maxModalWindowWidth :: Int Source #
Width cap for modal and error message windows
displayParagraphs :: [Text] -> Widget Name Source #
Display a list of text-wrapped paragraphs with one blank line after each.
layoutParagraphs :: [Widget Name] -> Widget Name Source #
Display a list of paragraphs with one blank line after each.
For the common case of `[Text]` use displayParagraphs
.
data EllipsisSide Source #
withEllipsis :: EllipsisSide -> Text -> Widget Name Source #
maybeScroll :: (Ord n, Show n) => n -> Widget n -> Widget n Source #
Make a widget scrolling if it is bigger than the available vertical space. Thanks to jtdaugherty for this code.
drawLabelledEntityName :: Entity -> Widget n Source #
Draw the name of an entity, labelled with its visual representation as a cell in the world.
bindingText :: KeyConfig SwarmEvent -> SwarmEvent -> Text Source #
Render the keybinding bound to a specific event.