Class CommentTooltipResolver
- Namespace
- MonkeyLoader.Resonite.UI.Tooltips
- Assembly
- MonkeyLoader.Resonite.Integration.dll
Handles resolving the tooltip for buttons with a FrooxEngine.Comment text that starts with the right prefix.
public sealed class CommentTooltipResolver : ResoniteCancelableEventHandlerMonkey<CommentTooltipResolver, ResolveTooltipLabelEvent>, IResoniteMonkey, IMonkey, IRun, IShutdown, IComparable<IMonkey>, INestedIdentifiable<Mod>, INestedIdentifiable, IIdentifiable, IAuthorable, ICancelableEventHandler<ResolveTooltipLabelEvent>, IPrioritizable
- Inheritance
-
CommentTooltipResolver
- Implements
- Inherited Members
- Extension Methods
Remarks
This covers backwards-compatibility to Psychpsyo's old Neos mod Tooltippery.
Fields
CommentTextPrefix
The prefix that a FrooxEngine.Comment's text must have to define a tooltip label.
public const string CommentTextPrefix = "TooltipperyLabel:"
Field Value
Properties
CanBeDisabled
Gets whether this monkey can be disabled, that is, whether it's
permitted to set Enabled to false
,
and there is an EnabledToggle.
public override bool CanBeDisabled { get; }
Property Value
- bool
true
if this monkey respects the MonkeyToggles config.
Remarks
By default: false
.
Priority
Gets the priority of this item. Use an agreed standard as a base.
public override int Priority { get; }
Property Value
- int
An interger used to sort the prioritizable items.
Higher comes first with the default comparer.
SkipCanceled
Gets whether this handler should be skipped for events that have been canceled by a previous event handler.
public override bool SkipCanceled { get; }
Property Value
Methods
Handle(ResolveTooltipLabelEvent)
Handles the given event based on its data, if AppliesTo returned true
.
protected override void Handle(ResolveTooltipLabelEvent eventData)
Parameters
eventData
ResolveTooltipLabelEventAn object containing all the relevant information for the applicable event.
TryGetTooltipLabel(IButton, out string?)
Tries to find a FrooxEngine.Comment on the button
's FrooxEngine.Slot
that starts with the right prefix
and extracts the tooltip label from it.
public static bool TryGetTooltipLabel(IButton button, out string? label)
Parameters
button
IButtonThe button component next to which a FrooxEngine.Comment will be searched.
label
stringThe found label if a suitable comment is found; otherwise,
null
.
Returns
- bool
true
if a suitable FrooxEngine.Comment was found; otherwise,false
.