Class TooltipPart
Server side implmentation of the tooltip part, built from members with NewTooltip attributes on them.
It stores all the relevant data about the part and shares it with the client.
It also contains the actual cached data for each tooltip part, which is used to get the text
when a user queries a tooltip.
Inheritance
System.Object
TooltipPart
Assembly: Eco.Gameplay.dll
public class TooltipPart : TooltipPartBase, IController, IViewController, IHasUniversalID
Constructors
Create the tooltip part for the given member, passing in the attribute (to avoid a requery) and the root type (which may be different
than the member declared type, in the case of TooltipLibraries that specify an override type).
Declaration
public TooltipPart(MemberInfo member, NewTooltipAttribute attr, Type rootType)
Parameters
| Type |
Name |
Description |
| System.Reflection.MemberInfo |
member |
|
| NewTooltipAttribute |
attr |
|
| System.Type |
rootType |
|
Properties
The attribute from which this part was created.
Declaration
public NewTooltipAttribute Attribute { get; set; }
Property Value
Declaration
public TTCat Categories { get; }
Property Value
CustomEcopediaPage
Declaration
public string CustomEcopediaPage { get; }
Property Value
| Type |
Description |
| System.String |
|
Declaration
public override bool IsImage { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Overrides
Declaration
public override bool IsTitle { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Overrides
Declaration
public float Priority { get; }
Property Value
| Type |
Description |
| System.Single |
|
Methods
Clear the cache of all tooltip parts.
Declaration
public static void ClearAllCache()
Clear cache for object with given id.
Declaration
public override void ClearCache(int id)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
Overrides
GenerateDebugText(IController, TooltipOrigin, User)
Declaration
public override LocString GenerateDebugText(IController controller, TooltipOrigin origin, User user)
Parameters
Returns
Overrides
Declaration
public override List<KeyValuePair<(int, TooltipOrigin), LocString>> GetInternalCache()
Returns
| Type |
Description |
| System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.ValueTuple<System.Int32, TooltipOrigin>, LocString>> |
|
Overrides
GetText(Type, IController, TooltipOrigin, User)
Main cache querying function. Get thes type + obj + origin + user and returns the cache for that combo, or builds it if it doesnt exist
Declaration
public LocString GetText(Type type, IController controller, TooltipOrigin origin, User user)
Parameters
Returns
Declaration
public static void InitializeCache(int size)
Parameters
| Type |
Name |
Description |
| System.Int32 |
size |
|
Takes delegate generated by base class and after adding necessary casts sets it as tooltip generator.
Declaration
protected override void SetGenerator(TooltipPartBase.GetValueFromMember generator)
Parameters
Overrides
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Implements
Extension Methods