Skip to content

game_tooltips

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

Notes

Tooltip recipes for the 3D view, loaded with ug_require "/gui/main/game_tooltips.tl".

Example

-- from gui/main/selector_react_util.tl
builtin.ActionTooltip{
    recipe = tooltips.DefaultEntityToolTip,
    param = { entityRef = selectedEntityRef },
}

GameTooltips

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

global record GameTooltips

Load: local tooltips = ug_require "/gui/main/game_tooltips.tl"

Notes

Tooltip recipes for hovered entities and terrain in the 3D view.

Fields

Name Type Description
DefaultEntityToolTip Recipe<DefaultEntityTooltipParam> Tooltip with the name of the hovered entity and the explanation texts of its persisting notifications. used 8× in the base game
TerrainTooltip Recipe<TerrainTooltipParam> Tooltip that shows the terrain height, noise or pollution value under the mouse, used by the terrain, noise and pollution layers. used 3× in the base game

GameTooltips.DefaultEntityTooltipParam

interface base/tealdef/gui/main/game_tooltips.d.tl:4

interface DefaultEntityTooltipParam

Notes

Parameters of the entity tooltip.

Used in the base game: 1 time in 1 file

base/content/gui/gui/main/game_tooltips.tl:145

tooltips.DefaultEntityToolTip = react.RegisterRecipe("DefaultEntityToolTip", function(param : GameTooltips.DefaultEntityTooltipParam) : TreeNodeId

Fields

Name Type Description
entityRef ReactRefT<Engine.Entity> Reference holding the hovered entity (typically the one the selector writes on hover); -1 or nil for none.

Functions

filter(entity : Engine.Entity) : boolean base/tealdef/gui/main/game_tooltips.d.tl:6

Notes

Optional filter; entities for which it returns false get no tooltip.

Returns boolean

GameTooltips.TerrainTooltipMode

enum base/tealdef/gui/main/game_tooltips.d.tl:10

enum TerrainTooltipMode

Notes

Value the terrain tooltip shows.

Value Description
"Height" Terrain altitude at the mouse position.
"Noise" Noise level at the mouse position, as a step index of the noise layer.
"Pollution" Pollution level at the mouse position, as a step index of the pollution layer.

GameTooltips.TerrainTooltipParam

record base/tealdef/gui/main/game_tooltips.d.tl:15

record TerrainTooltipParam is DefaultEntityTooltipParam

Notes

Parameters of the terrain tooltip.

Used in the base game: 1 time in 1 file

base/content/gui/gui/main/game_tooltips.tl:225

tooltips.TerrainTooltip = react.RegisterRecipe("TerrainTooltip", function(param : GameTooltips.TerrainTooltipParam) : TreeNodeId

Fields

Name Type Description
mode TerrainTooltipMode Value to show.