Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Swarm.TUI.Model.Popup
Synopsis
- data Popup
- = AchievementPopup CategorizedAchievement
- | RecipesPopup
- | CommandsPopup [Const]
- data PopupState
- currentPopup :: Lens' PopupState (Maybe (Popup, Int))
- popupQueue :: Lens' PopupState (Seq Popup)
- initPopupState :: PopupState
- addPopup :: Popup -> PopupState -> PopupState
- popupFrames :: Int
- progressPopups :: MonadState PopupState m => m Bool
Popup types
Different types of popups that can be displayed to the player.
Constructors
AchievementPopup CategorizedAchievement | |
RecipesPopup | |
CommandsPopup [Const] |
Popup state
data PopupState Source #
State to track pending popup queue as well as any popup which is currently being displayed.
currentPopup :: Lens' PopupState (Maybe (Popup, Int)) Source #
popupQueue :: Lens' PopupState (Seq Popup) Source #
initPopupState :: PopupState Source #
Initial, empty popup state.
addPopup :: Popup -> PopupState -> PopupState Source #
Add a popup to the end of the queue.
Popup animation
popupFrames :: Int Source #
The number of frames for which to display a popup.
progressPopups :: MonadState PopupState m => m Bool Source #
Progress the popup state by one frame: pull the next popup from the queue if there is no current popup or the current popup has reached the max frame count; otherwise just increment the frame count of the current popup.
Return True if something was updated that might require redrawing the UI.