Skip to content

credits_react_util

Source: base/tealdef/gui/main/credits_react_util.d.tl

Notes

The credits slide show of the main menu. The slides come from gui/menu/configs/credits_screen_data.lua, which returns a table of the form { slides = {...} }.

CreditsReactUtil

record global base/tealdef/gui/main/credits_react_util.d.tl:3

global record CreditsReactUtil

Load: local credits_react_util = ug_require "/gui/main/credits_react_util.tl"

Notes

Credits recipe and the data types of the credits slides.

Fields

Name Type Description
slides {Slide} The list of slides (filled from credits_screen_data.lua).
CreditsContent Recipe<CreditsContentParam> The credits slide show; the user can go back and forward (left/right or click), pause (up) and continue (down). used 2× in the base game

CreditsReactUtil.CreditsContentParam

record base/tealdef/gui/main/credits_react_util.d.tl:5

record CreditsContentParam

Notes

Parameters of CreditsContent.

Used in the base game: 1 time in 1 file

base/content/gui/gui/main/credits_react_util.tl:123

credits_react_util.CreditsContent = react.RegisterRecipe("CreditsContent", function(param : CreditsReactUtil.CreditsContentParam) : TreeNodeId

Fields

Name Type Description
stopOnBreakpoint boolean When true, the show stops at Breakpoint slides (and calls setFinished); otherwise they are skipped.

Functions

setPause(value : boolean) base/tealdef/gui/main/credits_react_util.d.tl:6

Notes

Called with true or false when the user pauses or continues the slide show.

getPause() : boolean base/tealdef/gui/main/credits_react_util.d.tl:7

Notes

Returns whether the slide show is paused.

Returns boolean

setFinished() base/tealdef/gui/main/credits_react_util.d.tl:8

Notes

Called when a Breakpoint slide is reached while stopOnBreakpoint is true.

CreditsReactUtil.Credit

record base/tealdef/gui/main/credits_react_util.d.tl:12

record Credit

Notes

One entry of a credits slide (a text line, an image, or two sub-columns).

Used in the base game: 4 times in 1 file

base/content/gui/gui/main/credits_react_util.tl:7

local makeVerticalLayoutOfItems : function(items : {CreditsReactUtil.Credit}, slideType : CreditsReactUtil.Slide.SlideType, extraClass? : string) : TreeNodeId

Fields

Name Type Description
filterOut any
type string Kind of text entry, which sets its style ("HEADER0", "HEADER1", "HEADER2", "NAME", "LICENSE", "LINK", or "TWO_COLUMNS" for an entry made of two columns in subItems).
text string Text of the entry.
rich boolean
image string Path of an image; when set, the entry shows only this image.
subItems {{Credit}} For type = "TWO_COLUMNS", the entries of the left ([1]) and right ([2]) column.

CreditsReactUtil.Slide

record base/tealdef/gui/main/credits_react_util.d.tl:21

record Slide

Notes

One slide of the credits.

Used in the base game: 1 time in 1 file

base/content/gui/gui/main/credits_react_util.tl:11

slide : CreditsReactUtil.Slide

Fields

Name Type Description
slideType SlideType Layout of the slide.
items {Credit} Entries of a SingleColumn or Scroller slide.
rows {{{Credit}}} Rows of a TwoColumns slide; each row is {leftEntries, rightEntries}.
duration number Display time of the slide, in seconds (default 6); not used for Scroller slides.

CreditsReactUtil.Slide.SlideType

enum base/tealdef/gui/main/credits_react_util.d.tl:22

enum SlideType

Notes

Layout of a slide.

Used in the base game: 4 times in 1 file

base/content/gui/gui/main/credits_react_util.tl:7

local makeVerticalLayoutOfItems : function(items : {CreditsReactUtil.Credit}, slideType : CreditsReactUtil.Slide.SlideType, extraClass? : string) : TreeNodeId

Value Description
"SingleColumn" The items in one column.
"TwoColumns" The rows, each with a left and a right column.
"Scroller" The items in an automatically scrolling area; the next slide starts when the end is reached.
"Breakpoint" No content; ends the show when stopOnBreakpoint is set, otherwise skipped.