Safe Haskell | None |
---|
Game messages displayed on top of the screen for the player to read.
- makePhrase :: [Part] -> Text
- makeSentence :: [Part] -> Text
- type Msg = Text
- (<>) :: Text -> Text -> Text
- (<+>) :: Text -> Text -> Text
- showT :: Show a => a -> Text
- moreMsg :: Msg
- yesnoMsg :: Msg
- padMsg :: X -> Text -> Text
- data Report
- emptyReport :: Report
- nullReport :: Report -> Bool
- singletonReport :: Msg -> Report
- addMsg :: Report -> Msg -> Report
- splitReport :: Report -> [Text]
- renderReport :: Report -> Text
- data History
- emptyHistory :: History
- singletonHistory :: Report -> History
- addReport :: Report -> History -> History
- renderHistory :: History -> Overlay
- takeHistory :: Int -> History -> History
- type Overlay = [Text]
- splitOverlay :: Y -> Overlay -> [Overlay]
- stringByLocation :: X -> Y -> Overlay -> (Text, PointXY -> Maybe Char, Maybe Text)
Documentation
makePhrase :: [Part] -> TextSource
Re-exported English phrase creation functions, applied to default irregular word sets.
makeSentence :: [Part] -> TextSource
Re-exported English phrase creation functions, applied to default irregular word sets.
Separated by space unless one of them is empty (in which case just the non-empty one).
padMsg :: X -> Text -> TextSource
Add spaces at the message end, for display overlayed over the level map. Also trims (does not wrap!) too long lines.
The type of a set of messages to show at the screen at once.
Empty set of messages.
nullReport :: Report -> BoolSource
Test if the set of messages is empty.
singletonReport :: Msg -> ReportSource
Construct a singleton set of messages.
splitReport :: Report -> [Text]Source
Split a messages into chunks that fit in one line. We assume the width of the messages line is the same as of level map.
renderReport :: Report -> TextSource
Render a report as a (possibly very long) string.
Empty history of reports.
singletonHistory :: Report -> HistorySource
Construct a singleton history of reports.
renderHistory :: History -> OverlaySource
Render history as many lines of text, wrapping if necessary.
takeHistory :: Int -> History -> HistorySource
Take the given prefix of reports from a history.
A screenful of text lines. When displayed, they are trimmed, not wrapped and any lines below the lower screen edge are not visible.
splitOverlay :: Y -> Overlay -> [Overlay]Source
Split an overlay into overlays that fit on the screen.