License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Swarm.TUI.Model.Menu
Description
Sum types that represent menu options, modal dialogs, and buttons.
Synopsis
- data ScenarioOutcome
- data MidScenarioModalType
- data EndScenarioModalType
- data ModalType
- data ButtonAction
- = Cancel
- | KeepPlaying
- | StartOver Seed (ScenarioWith ScenarioPath)
- | QuitAction
- | Next (NonEmpty (ScenarioWith ScenarioPath))
- data Modal = Modal {}
- modalDialog :: Lens' Modal (Dialog ButtonAction Name)
- modalType :: Lens' Modal ModalType
- data MainMenuEntry
- data Menu
- = NoMenu
- | MainMenu (List Name MainMenuEntry)
- | NewGameMenu (NonEmpty (List Name (ScenarioItem ScenarioPath)))
- | AchievementsMenu (List Name CategorizedAchievement)
- | MessagesMenu
- | AboutMenu
- mainMenu :: MainMenuEntry -> List Name MainMenuEntry
- _NoMenu :: Prism' Menu ()
- _MainMenu :: Prism' Menu (List Name MainMenuEntry)
- _NewGameMenu :: Prism' Menu (NonEmpty (List Name (ScenarioItem ScenarioPath)))
- _AchievementsMenu :: Prism' Menu (List Name CategorizedAchievement)
- _MessagesMenu :: Prism' Menu ()
- _AboutMenu :: Prism' Menu ()
- mkScenarioList :: ScenarioCollection a -> List Name (ScenarioItem a)
- data InventoryListEntry
- = Separator Text
- | InventoryEntry Count Entity
- | EquippedEntry Entity
- _Separator :: Prism' InventoryListEntry Text
- _InventoryEntry :: Prism' InventoryListEntry (Count, Entity)
- _EquippedEntry :: Prism' InventoryListEntry Entity
Documentation
data ScenarioOutcome Source #
Instances
Show ScenarioOutcome Source # | |
Defined in Swarm.TUI.Model.Menu Methods showsPrec :: Int -> ScenarioOutcome -> ShowS # show :: ScenarioOutcome -> String # showList :: [ScenarioOutcome] -> ShowS # | |
Eq ScenarioOutcome Source # | |
Defined in Swarm.TUI.Model.Menu Methods (==) :: ScenarioOutcome -> ScenarioOutcome -> Bool # (/=) :: ScenarioOutcome -> ScenarioOutcome -> Bool # |
data MidScenarioModalType Source #
Constructors
HelpModal | |
RecipesModal | |
CommandsModal | |
MessagesModal | |
StructuresModal | |
EntityPaletteModal | |
TerrainPaletteModal | |
RobotsModal | |
DescriptionModal Entity | |
GoalModal |
Instances
Show MidScenarioModalType Source # | |
Defined in Swarm.TUI.Model.Menu Methods showsPrec :: Int -> MidScenarioModalType -> ShowS # show :: MidScenarioModalType -> String # showList :: [MidScenarioModalType] -> ShowS # | |
Eq MidScenarioModalType Source # | |
Defined in Swarm.TUI.Model.Menu Methods (==) :: MidScenarioModalType -> MidScenarioModalType -> Bool # (/=) :: MidScenarioModalType -> MidScenarioModalType -> Bool # |
data EndScenarioModalType Source #
Constructors
ScenarioFinishModal ScenarioOutcome | |
QuitModal | |
KeepPlayingModal |
Instances
Show EndScenarioModalType Source # | |
Defined in Swarm.TUI.Model.Menu Methods showsPrec :: Int -> EndScenarioModalType -> ShowS # show :: EndScenarioModalType -> String # showList :: [EndScenarioModalType] -> ShowS # | |
Eq EndScenarioModalType Source # | |
Defined in Swarm.TUI.Model.Menu Methods (==) :: EndScenarioModalType -> EndScenarioModalType -> Bool # (/=) :: EndScenarioModalType -> EndScenarioModalType -> Bool # |
data ButtonAction Source #
Constructors
Cancel | |
KeepPlaying | |
StartOver Seed (ScenarioWith ScenarioPath) | |
QuitAction | |
Next (NonEmpty (ScenarioWith ScenarioPath)) |
Constructors
Modal | |
Fields |
data MainMenuEntry Source #
Instances
Constructors
NoMenu | We started playing directly from command line, no menu to show |
MainMenu (List Name MainMenuEntry) | |
NewGameMenu (NonEmpty (List Name (ScenarioItem ScenarioPath))) | 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 |
_MessagesMenu :: Prism' Menu () Source #
_AboutMenu :: Prism' Menu () Source #
mkScenarioList :: ScenarioCollection a -> List Name (ScenarioItem a) Source #
Create a brick List
of scenario items from a ScenarioCollection
.
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.
Constructors
Separator Text | |
InventoryEntry Count Entity | |
EquippedEntry Entity |
Instances
Eq InventoryListEntry Source # | |
Defined in Swarm.TUI.Model.Menu Methods (==) :: InventoryListEntry -> InventoryListEntry -> Bool # (/=) :: InventoryListEntry -> InventoryListEntry -> Bool # |
_InventoryEntry :: Prism' InventoryListEntry (Count, Entity) Source #
_EquippedEntry :: Prism' InventoryListEntry Entity Source #