LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Client.UI.Slideshow

Contents

- Internal operations

Description

Slideshows.

Synopsis

- type FontOverlayMap = EnumMap DisplayFont Overlay
- maxYofFontOverlayMap :: FontOverlayMap -> Int
- type KeyOrSlot = Either KM MenuSlot
- data MenuSlot
- natSlots :: [MenuSlot]
- data ButtonWidth = ButtonWidth {
  - buttonFont :: DisplayFont
  - buttonWidth :: Int
  }
- type KYX = (KeyOrSlot, (PointUI, ButtonWidth))
- xytranslateKXY :: Int -> Int -> KYX -> KYX
- xtranslateKXY :: Int -> KYX -> KYX
- ytranslateKXY :: Int -> KYX -> KYX
- yrenumberKXY :: Int -> KYX -> KYX
- type OKX = (FontOverlayMap, [KYX])
- emptyOKX :: OKX
- xytranslateOKX :: Int -> Int -> OKX -> OKX
- sideBySideOKX :: Int -> Int -> OKX -> OKX -> OKX
- labDescOKX :: DisplayFont -> DisplayFont -> [(AttrString, AttrString, KeyOrSlot)] -> OKX
- data Slideshow
- emptySlideshow :: Slideshow
- unsnocSlideshow :: Slideshow -> Maybe (Slideshow, OKX)
- toSlideshow :: FontSetup -> Bool -> [OKX] -> Slideshow
- attrLinesToFontMap :: [(DisplayFont, [AttrLine])] -> FontOverlayMap
- menuToSlideshow :: OKX -> Slideshow
- wrapOKX :: DisplayFont -> Int -> Int -> Int -> [(KM, String)] -> (Overlay, [KYX])
- splitOverlay :: FontSetup -> Bool -> Int -> Int -> Int -> Report -> [KM] -> OKX -> Slideshow
- splitOKX :: FontSetup -> Bool -> Int -> Int -> Int -> AttrString -> [KM] -> OKX -> [OKX]
- highSlideshow :: FontSetup -> Bool -> Int -> Int -> ScoreTable -> Int -> Text -> TimeZone -> Slideshow
- keysOKX :: DisplayFont -> Int -> Int -> Int -> [KM] -> (Overlay, [KYX])
- showTable :: TimeZone -> Int -> ScoreTable -> Int -> Int -> [AttrLine]
- showNearbyScores :: TimeZone -> Int -> ScoreTable -> Int -> [[AttrLine]]

# Documentation

type FontOverlayMap = EnumMap DisplayFont Overlay Source #

maxYofFontOverlayMap :: FontOverlayMap -> Int Source #

type KeyOrSlot = Either KM MenuSlot Source #

data MenuSlot Source #

#### Instances

Instances details

Binary MenuSlot Source # |
Instance details Defined in Game.LambdaHack.Client.UI.Slideshow Methods put :: MenuSlot -> Put Source # get :: Get MenuSlot Source # putList :: [MenuSlot] -> Put Source #
Enum MenuSlot Source # |

Instance details

Defined in Game.LambdaHack.Client.UI.Slideshow

Methods

succ :: MenuSlot -> MenuSlot Source #

pred :: MenuSlot -> MenuSlot Source #

toEnum :: Int -> MenuSlot Source #

fromEnum :: MenuSlot -> Int Source #

enumFrom :: MenuSlot -> [MenuSlot] Source #

enumFromThen :: MenuSlot -> MenuSlot -> [MenuSlot] Source #

enumFromTo :: MenuSlot -> MenuSlot -> [MenuSlot] Source #

enumFromThenTo :: MenuSlot -> MenuSlot -> MenuSlot -> [MenuSlot] Source #

Show MenuSlot Source # |
Instance details Defined in Game.LambdaHack.Client.UI.Slideshow Methods showsPrec :: Int -> MenuSlot -> ShowS Source # show :: MenuSlot -> String Source # showList :: [MenuSlot] -> ShowS Source #
Eq MenuSlot Source # |
Instance details Defined in Game.LambdaHack.Client.UI.Slideshow Methods (==) :: MenuSlot -> MenuSlot -> Bool Source # (/=) :: MenuSlot -> MenuSlot -> Bool Source #
Ord MenuSlot Source # |

Instance details

Defined in Game.LambdaHack.Client.UI.Slideshow

Methods

compare :: MenuSlot -> MenuSlot -> Ordering Source #

(<) :: MenuSlot -> MenuSlot -> Bool Source #

(<=) :: MenuSlot -> MenuSlot -> Bool Source #

(>) :: MenuSlot -> MenuSlot -> Bool Source #

(>=) :: MenuSlot -> MenuSlot -> Bool Source #

max :: MenuSlot -> MenuSlot -> MenuSlot Source #

min :: MenuSlot -> MenuSlot -> MenuSlot Source #

natSlots :: [MenuSlot] Source #

data ButtonWidth Source #

Width of on-screen button text, expressed in characters, and so UI (mono font) width is deduced from the used font.

Constructors

ButtonWidth |

Fields

- buttonFont :: DisplayFont
- buttonWidth :: Int

#### Instances

Instances details

Show ButtonWidth Source # |
Instance details Defined in Game.LambdaHack.Client.UI.Slideshow Methods showsPrec :: Int -> ButtonWidth -> ShowS Source # show :: ButtonWidth -> String Source # showList :: [ButtonWidth] -> ShowS Source #
Eq ButtonWidth Source # |
Instance details Defined in Game.LambdaHack.Client.UI.Slideshow Methods (==) :: ButtonWidth -> ButtonWidth -> Bool Source # (/=) :: ButtonWidth -> ButtonWidth -> Bool Source #

type KYX = (KeyOrSlot, (PointUI, ButtonWidth)) Source #

A key or a menu slot at a given position on the screen.

xytranslateKXY :: Int -> Int -> KYX -> KYX Source #

xtranslateKXY :: Int -> KYX -> KYX Source #

ytranslateKXY :: Int -> KYX -> KYX Source #

yrenumberKXY :: Int -> KYX -> KYX Source #

type OKX = (FontOverlayMap, [KYX]) Source #

An Overlay of text with an associated list of keys or slots that activate when the specified screen position is pointed at. The list should be sorted wrt rows and then columns.

emptyOKX :: OKX Source #

xytranslateOKX :: Int -> Int -> OKX -> OKX Source #

sideBySideOKX :: Int -> Int -> OKX -> OKX -> OKX Source #

labDescOKX :: DisplayFont -> DisplayFont -> [(AttrString, AttrString, KeyOrSlot)] -> OKX Source #

data Slideshow Source #

A list of active screenfulls to be shown one after another. Each screenful has an independent numbering of rows and columns.

#### Instances

Instances details

Show Slideshow Source # |
Instance details Defined in Game.LambdaHack.Client.UI.Slideshow Methods showsPrec :: Int -> Slideshow -> ShowS Source # show :: Slideshow -> String Source # showList :: [Slideshow] -> ShowS Source #
Eq Slideshow Source # |
Instance details Defined in Game.LambdaHack.Client.UI.Slideshow Methods (==) :: Slideshow -> Slideshow -> Bool Source # (/=) :: Slideshow -> Slideshow -> Bool Source #

emptySlideshow :: Slideshow Source #

unsnocSlideshow :: Slideshow -> Maybe (Slideshow, OKX) Source #

toSlideshow :: FontSetup -> Bool -> [OKX] -> Slideshow Source #

attrLinesToFontMap :: [(DisplayFont, [AttrLine])] -> FontOverlayMap Source #

This appends vertically a list of blurbs into a single font overlay map. Not to be used if some blurbs need to be places overlapping vertically, e.g., when the square font symbol needs to be in the same line as the start of the descritpion of the denoted item or when mono font buttons need to be after a prompt.

menuToSlideshow :: OKX -> Slideshow Source #

wrapOKX :: DisplayFont -> Int -> Int -> Int -> [(KM, String)] -> (Overlay, [KYX]) Source #

splitOverlay :: FontSetup -> Bool -> Int -> Int -> Int -> Report -> [KM] -> OKX -> Slideshow Source #

splitOKX :: FontSetup -> Bool -> Int -> Int -> Int -> AttrString -> [KM] -> OKX -> [OKX] Source #

highSlideshow Source #

Arguments

:: FontSetup |
-> Bool |
-> Int | width of the display area
-> Int | height of the display area
-> ScoreTable | current score table
-> Int | position of the current score in the table
-> Text | the name of the game mode
-> TimeZone | the timezone where the game is run
-> Slideshow |

Generate a slideshow with the current and previous scores.

# Internal operations

keysOKX :: DisplayFont -> Int -> Int -> Int -> [KM] -> (Overlay, [KYX]) Source #

showTable :: TimeZone -> Int -> ScoreTable -> Int -> Int -> [AttrLine] Source #

Show a screenful of the high scores table. Parameter `entries` is the number of (3-line) scores to be shown.

showNearbyScores :: TimeZone -> Int -> ScoreTable -> Int -> [[AttrLine]] Source #

Produce a couple of renderings of the high scores table.