License | BSD-3-Clause |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Sum types that represent menu options, modal dialogs, and buttons.
Synopsis
- data ScenarioOutcome
- data ModalType
- data ButtonAction
- data Modal = Modal {}
- modalType :: Lens' Modal ModalType
- modalDialog :: Lens' Modal (Dialog ButtonAction Name)
- data MainMenuEntry
- data Menu
- mainMenu :: MainMenuEntry -> List Name MainMenuEntry
- _AboutMenu :: Prism' Menu ()
- _MessagesMenu :: Prism' Menu ()
- _AchievementsMenu :: Prism' Menu (List Name CategorizedAchievement)
- _NewGameMenu :: Prism' Menu (NonEmpty (List Name ScenarioItem))
- _MainMenu :: Prism' Menu (List Name MainMenuEntry)
- _NoMenu :: Prism' Menu ()
- mkScenarioList :: Bool -> ScenarioCollection -> List Name ScenarioItem
- mkNewGameMenu :: Bool -> ScenarioCollection -> FilePath -> Maybe Menu
- data InventoryListEntry
- _EquippedEntry :: Prism' InventoryListEntry Entity
- _InventoryEntry :: Prism' InventoryListEntry (Count, Entity)
- _Separator :: Prism' InventoryListEntry Text
Documentation
data ScenarioOutcome Source #
Instances
Show ScenarioOutcome Source # | |
Defined in Swarm.TUI.Model.Menu showsPrec :: Int -> ScenarioOutcome -> ShowS # show :: ScenarioOutcome -> String # showList :: [ScenarioOutcome] -> ShowS # |
data ButtonAction Source #
data MainMenuEntry Source #
Instances
NoMenu | We started playing directly from command line, no menu to show |
MainMenu (List Name MainMenuEntry) | |
NewGameMenu (NonEmpty (List Name ScenarioItem)) | Stack of scenario item lists. INVARIANT: the currently selected menu item is ALWAYS the same as the scenario currently being played. See https://github.com/swarm-game/swarm/issues/1064 and https://github.com/swarm-game/swarm/pull/1065. |
AchievementsMenu (List Name CategorizedAchievement) | |
MessagesMenu | |
AboutMenu |
_AboutMenu :: Prism' Menu () Source #
_MessagesMenu :: Prism' Menu () Source #
_NewGameMenu :: Prism' Menu (NonEmpty (List Name ScenarioItem)) Source #
mkScenarioList :: Bool -> ScenarioCollection -> List Name ScenarioItem Source #
Create a brick List
of scenario items from a ScenarioCollection
.
mkNewGameMenu :: Bool -> ScenarioCollection -> FilePath -> Maybe Menu Source #
Given a ScenarioCollection
and a FilePath
which is the canonical
path to some folder or scenario, construct a NewGameMenu
stack
focused on the given item, if possible.
data InventoryListEntry Source #
An entry in the inventory list displayed in the info panel. We can either have an entity with a count in the robot's inventory, an entity equipped on the robot, or a labelled separator. The purpose of the separators is to show a clear distinction between the robot's inventory and its equipped devices.
Instances
Eq InventoryListEntry Source # | |
Defined in Swarm.TUI.Model.Menu (==) :: InventoryListEntry -> InventoryListEntry -> Bool # (/=) :: InventoryListEntry -> InventoryListEntry -> Bool # |