Skip to content

menu_icon_react_util

Source: base/tealdef/gui/menu/menu_icon_react_util.d.tl

Notes

Building blocks of the main menu pages (buttons, image cards, paged card grids, page frame, hint panel), loaded with ug_require "/gui/menu/menu_icon_react_util.tl".

record global base/tealdef/gui/menu/menu_icon_react_util.d.tl:3

global record MenuIconReactUtil

Load: local menu_icon_react_util = ug_require "/gui/menu/menu_icon_react_util.tl"

Notes

Layout helpers and recipes for main menu pages.

Fields

Name Type Description
CardButton Recipe<CardButtonParams> Large menu button with cycling background images and a label at the bottom. used 3× in the base game
HintWidget RecipeWithApi<HintWidgetParam, HintWidgetApi> Panel showing the title and description of the hint for the hovered item of the selected tab. used 6× in the base game
HintImage RecipeWithApi<HintWidgetParam, HintWidgetApi> Default hint image of the settings pages. Its API functions do nothing. used 3× in the base game

Functions

record base/tealdef/gui/menu/menu_icon_react_util.d.tl:4

record CardButtonParams

Notes

Parameters of CardButton.

Used in the base game: 1 time in 1 file

base/content/gui/gui/menu/menu_icon_react_util.tl:75

menu_icon_react_util.CardButton = react.RegisterRecipe("CardButton", function(cardButtonParams : MenuIconReactUtil.CardButtonParams) : TreeNodeId

Fields

Name Type Description
bottomComponent TreeNodeId Content of the label at the bottom of the card, for example from makeCardLabelBottomComponent.
tooltip string Tooltip of the card.
images {string | Builtin.ImageViewParam} Background images (paths or image view parameters). With more than one image they are shown in turn with a cross-fade.
initialImageIndex integer Index of the first image to show (default 1).
imageSwapOffsetSeconds number Time offset of the image cycle in seconds, to keep several cards from switching at the same moment (default 0).
displayDurationSeconds number Time each image is shown, in seconds (default 24).
class string Style class of the card (default small-card); main-menu-card is always added.
extraChildren {TreeNodeId} Additional floating layout children placed on the card.
localKey string Local key of the card button.
enabled boolean Whether the card is enabled.
clipper boolean Whether to clip the images to the card.

Functions

record base/tealdef/gui/menu/menu_icon_react_util.d.tl:94

record HintWidgetParam

Notes

Parameters of HintWidget and HintImage.

Used in the base game: 5 times in 2 files

base/content/gui/gui/menu/menu_icon_react_util.tl:761

menu_icon_react_util.HintWidget = react.RegisterRecipe("HintWidget", function(param : MenuIconReactUtil.HintWidgetParam) : TreeNodeId
base/content/gui/gui/menu/settings_page.tl:1539
hintWidgetRef : ReactRefWrapApiT<MenuIconReactUtil.HintWidgetParam, MenuIconReactUtil.HintWidgetApi>

Fields

Name Type Description
tabId2Hints {any : {Data}} integer|number|string
selectedTab any integer|number|string
placeHolderHint Data Hint shown when no item is hovered or the tab has no hints.

record base/tealdef/gui/menu/menu_icon_react_util.d.tl:95

record Data

Notes

Text of one hint.

Used in the base game: 11 times in 4 files

base/content/gui/gui/menu/new_game_or_map_settings_page.tl:753

local makeGenericHint = function() : MenuIconReactUtil.HintWidgetParam.Data
base/content/gui/gui/menu/advanced_settings.tl:70
local idData : {MenuIconReactUtil.HintWidgetParam.Data} = {}
base/content/gui/gui/menu/settings_page.tl:1563
local tab2id : {integer : {MenuIconReactUtil.HintWidgetParam.Data}} = {}
base/content/gui/gui/main/script_param_util.tl:605
) : MenuIconReactUtil.HintWidgetParam.Data, TreeNodeId

Fields

Name Type Description
title string Hint title.
description string Hint text.
imagePath string Image of the hint; set by the settings page but not displayed by HintWidget or HintImage.

record base/tealdef/gui/menu/menu_icon_react_util.d.tl:105

record HintWidgetApi

Notes

API of HintWidget for setting the hovered item.

Used in the base game: 3 times in 2 files

base/content/gui/gui/menu/menu_icon_react_util.tl:808

end) as RecipeWithApi<MenuIconReactUtil.HintWidgetParam, MenuIconReactUtil.HintWidgetApi>
base/content/gui/gui/menu/settings_page.tl:1539
hintWidgetRef : ReactRefWrapApiT<MenuIconReactUtil.HintWidgetParam, MenuIconReactUtil.HintWidgetApi>

Functions