When a ui object has no custom tooltipUi set, the standard tooltipUi will be used like before. UiTooltip has been trimmed down to its essentials.
Ui.setCustomTooltip
Ui objects can define their own custom tooltipUi objects with Ui:setCustomTooltip(tooltipUi). This custom tooltipUi will then be shown instead of the standard tooltipUi.
Supports a single tooltipUi for each element.
Custom tooltipUi
The object can be of any class inheriting Ui, and does not require any special values set.
The UiTooltipManager will call certain functions if they are set in either the hoveredUi or the tooltipUi. All of these functions have defaults that will be used if not overridden:
hoveredUi:onTooltipShown(tooltipUi) - called every frame the hoveredUi is hovered.
tooltipUi:onTooltipShown(hoveredUi) - called every frame the hoveredUi is hovered.
tooltipUi.updatePosition(tooltipManagerUi, tooltipUi, hoveredUi) - called every frame the hoveredUi is hovered.
Certain values can be set for tooltipUi or hoveredUi. All of them have defaults if not set:
tooltipUi.tooltip_static - sets this tooltipUi as always being static for all hoveredUi.
hoveredUi.tooltip_static - sets this hoveredUi as always having static tooltipUi (unless the tooltipUi has overridden updatePosition and have different position logic).
tooltipUi.tooltipOffset - sets the distance the tooltipUi will be drawn from the hoveredUi's edges (unless the tooltipUi has overridden updatePosition and have different position logic).
Removals
The following has been removed as they are no longer needed. Everything tooltipUi related is being managed in UiTooltipManager
Legend
UiTooltipManager
tooltipUi
.tooltipUi
set, the standardtooltipUi
will be used like before.UiTooltip
has been trimmed down to its essentials.Ui.setCustomTooltip
tooltipUi
objects withUi:setCustomTooltip(tooltipUi)
. This customtooltipUi
will then be shown instead of the standardtooltipUi
.tooltipUi
for each element.Custom
tooltipUi
Ui
, and does not require any special values set.UiTooltipManager
will call certain functions if they are set in either thehoveredUi
or thetooltipUi
. All of these functions have defaults that will be used if not overridden:hoveredUi:onTooltipShown(tooltipUi)
- called every frame thehoveredUi
is hovered.tooltipUi:onTooltipShown(hoveredUi)
- called every frame thehoveredUi
is hovered.tooltipUi.updatePosition(tooltipManagerUi, tooltipUi, hoveredUi)
- called every frame thehoveredUi
is hovered.tooltipUi
orhoveredUi
. All of them have defaults if not set:tooltipUi
as always being static for allhoveredUi
.hoveredUi
as always having statictooltipUi
(unless thetooltipUi
has overriddenupdatePosition
and have different position logic).tooltipUi
will be drawn from thehoveredUi
's edges (unless thetooltipUi
has overriddenupdatePosition
and have different position logic).Removals
The following has been removed as they are no longer needed. Everything
tooltipUi
related is being managed inUiTooltipManager