Show / Hide Table of Contents

Class TooltipManagerServer

Handles constructing tooltips from a set of tooltip parts for controllers, using caching to prevent duplicate queries, and error detection to detect non-dirted parts, etc. See Tooltip.md for a full description.

Inheritance
System.Object
TooltipManagerServer
Implements
IController
IViewController
IHasUniversalID
Namespace: Eco.Gameplay.Systems.NewTooltip
Assembly: Eco.Gameplay.dll
Syntax
[ChatCommandHandler]
public class TooltipManagerServer : Singleton<TooltipManagerServer>, IController, IViewController, IHasUniversalID
Remarks

See 'Tooltip.md' for more info.

Constructors

TooltipManagerServer()

Using reflection in default constructor to find all the members tagged with the NewTooltipAttribute and register them for the types that they apply to.

Declaration
public TooltipManagerServer()

TooltipManagerServer(IEnumerable<Type>, IEnumerable<Type>)

Declaration
public TooltipManagerServer(IEnumerable<Type> controllerClasses, IEnumerable<Type> tooltipLibraries)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Type> controllerClasses

Represents collection of classes that derived from IController. This collection will be scanned for tooltip parts to register.

System.Collections.Generic.IEnumerable<System.Type> tooltipLibraries

Represents collection of tooltip libraries (classes with 'TooltipLibrary' attribute). This collection will be scanned for tooltip parts to register.

Fields

CacheCleanupRate

Number of seconds between scans of tooltip cache taht remove entries that reference objects that were already garbage collected.

Declaration
public static readonly double CacheCleanupRate
Field Value
Type Description
System.Double

CacheRefreshRate

Number of seconds between applying cache updates from Eco.Gameplay.Systems.NewTooltip.TooltipSubscriptions.queuedDirty.

Declaration
public const float CacheRefreshRate = 5F
Field Value
Type Description
System.Single

Properties

ClientTypeToParts

Declaration
public Dictionary<Type, List<TooltipPart>> ClientTypeToParts { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.Type, System.Collections.Generic.List<TooltipPart>>

ClientTypeToTooltipChildren

Declaration
public Dictionary<Type, List<TooltipChildrenPart>> ClientTypeToTooltipChildren { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.Type, System.Collections.Generic.List<TooltipChildrenPart>>

ControllerID

Declaration
public ref int ControllerID { get; }
Property Value
Type Description
System.Int32

NameToPart

Declaration
public Dictionary<(Type, string), TooltipPartBase> NameToPart { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.ValueTuple<System.Type, System.String>, TooltipPartBase>

TypeToChildrenParts

Declaration
public Dictionary<Type, List<TooltipChildrenPart>> TypeToChildrenParts { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.Type, System.Collections.Generic.List<TooltipChildrenPart>>

TypeToParts

Declaration
public Dictionary<Type, List<TooltipPart>> TypeToParts { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.Type, System.Collections.Generic.List<TooltipPart>>

Methods

ClearCache()

Removes all cached data in ourselves and children support classes.

Declaration
public void ClearCache()

GetTooltipParts(User, TooltipServerRequest, TooltipOrigin, TTCat)

Declaration
public TooltipServerResponse GetTooltipParts(User user, TooltipServerRequest request, TooltipOrigin origin, TTCat exclusions)
Parameters
Type Name Description
User user
TooltipServerRequest request
TooltipOrigin origin
TTCat exclusions
Returns
Type Description
TooltipServerResponse

GetTooltipPartsByLinkId(Player, String, TooltipOrigin, TTCat)

Returns tooltip parts for controller referenced by passed link. May be used for late bounded links for objects which isn't persistent or doesn't have serialized universal ID. When requested returns TooltipServerResponse with all necessary information for tooltip rendering and caching on client side. Client then will have resolved Universal ID and type info for that link id and will use GetTooltipParts(User, TooltipServerRequest, TooltipOrigin, TTCat) for further requests using link id only for initial tooltip content request.

Declaration
public BSONObject GetTooltipPartsByLinkId(Player player, string linkId, TooltipOrigin origin, TTCat exclusions)
Parameters
Type Name Description
Player player
System.String linkId
TooltipOrigin origin
TTCat exclusions
Returns
Type Description
BSONObject

Initialize()

Declaration
public void Initialize()

PrepareCache()

Declaration
public static Task PrepareCache()
Returns
Type Description
System.Threading.Tasks.Task

Events

PropertyChanged

Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type Description
System.ComponentModel.PropertyChangedEventHandler

Implements

IController
IViewController
IHasUniversalID

Extension Methods

TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
TypeTooltipExtensions.UILinkGeneric(Object)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾