Class HyperlinkTooltipResolver
- Namespace
- MonkeyLoader.Resonite.UI.Tooltips
- Assembly
- MonkeyLoader.Resonite.Integration.dll
Handles resolving the tooltip for buttons with a FrooxEngine.Hyperlink.Reason.
public sealed class HyperlinkTooltipResolver : ResoniteCancelableEventHandlerMonkey<HyperlinkTooltipResolver, ResolveTooltipLabelEvent>, IResoniteMonkey, IMonkey, IRun, IShutdown, IComparable<IMonkey>, INestedIdentifiable<Mod>, INestedIdentifiable, IIdentifiable, IAuthorable, IDisplayable, ICancelableEventHandler<ResolveTooltipLabelEvent>, IPrioritizable
- Inheritance
-
HyperlinkTooltipResolver
- Implements
- Inherited Members
- Extension Methods
Fields
LabelArg
The key used for the Elements.Core.LocaleString.content on label-Elements.Core.LocaleStrings, when the existing label is not a locale key.
public const string LabelArg = "label"
Field Value
ReasonArg
The key used for the FrooxEngine.Hyperlink.Reason on label-Elements.Core.LocaleStrings.
public const string ReasonArg = "reason"
Field Value
UrlArg
The key used for the FrooxEngine.Hyperlink.URL on label-Elements.Core.LocaleStrings.
public const string UrlArg = "url"
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
trueif 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
eventDataResolveTooltipLabelEventAn object containing all the relevant information for the applicable event.
TryGetTooltipLabel(IButton, out LocaleString?, LocaleString?)
Tries to find a FrooxEngine.Hyperlink on the button's FrooxEngine.Slot
and extracts the tooltip label from its reason for opening.
public static bool TryGetTooltipLabel(IButton button, out LocaleString? label, LocaleString? existingLabel = null)
Parameters
buttonIButtonThe button component next to which a FrooxEngine.Hyperlink will be searched.
labelLocaleString?The found label if a suitable Hyperlink is found; otherwise,
null.existingLabelLocaleString?The optional label already existing for this button.
Returns
- bool
trueif a suitable FrooxEngine.Hyperlink was found; otherwise,false.
Remarks
If an existingLabel is set, the hyperlink information will be added to it if present.
If the existingLabel is already a hyperlink label, it will be used.