Class ContextMenuItemsGenerationEvent<T>
- Namespace
- MonkeyLoader.Resonite.UI.ContextMenus
- Assembly
- MonkeyLoader.Resonite.Integration.dll
Represents a generic (base) class for all events that generate a FrooxEngine.ContextMenu.
public class ContextMenuItemsGenerationEvent<T> : ContextMenuItemsGenerationEvent where T : class, IWorldElement
Type Parameters
T
The type of the Summoner.
- Inheritance
-
ContextMenuItemsGenerationEvent<T>
- Derived
- Inherited Members
Remarks
These events are always additive to the options added by the vanilla implementation.
This event is triggered automatically when OpenContextMenu(MenuOptions, float?)
or FrooxEngine.ContextMenuExtensions.OpenContextMenu(FrooxEngine.User, FrooxEngine.IWorldElement, FrooxEngine.Slot, FrooxEngine.ContextMenuOptions) are called.
If you want to avoid the event being triggered for something,
first use FrooxEngine.ContextMenuExtensions.GetUserContextMenu(FrooxEngine.User)
and then open it using FrooxEngine.ContextMenu.OpenMenu(FrooxEngine.IWorldElement, FrooxEngine.Slot, FrooxEngine.ContextMenuOptions).
Constructors
ContextMenuItemsGenerationEvent(ContextMenu)
Creates a new FrooxEngine.ContextMenu items generation event with the given
contextMenu
and its active FrooxEngine.User.
public ContextMenuItemsGenerationEvent(ContextMenu contextMenu)
Parameters
contextMenu
ContextMenuThe FrooxEngine.ContextMenu being summoned.
Remarks
This method dynamically uses the best registered concrete derived event type
for the
,
falling back to the concrete ContextMenuItemsGenerationEvent<T>.contextMenu
.CurrentSummoner
Exceptions
- ArgumentNullException
When the
contextMenu
is null.- ArgumentException
When the
contextMenu
's active FrooxEngine.User is null.
Properties
Summoner
Gets the T
that the
ContextMenu
is being summoned by.
public T Summoner { get; }
Property Value
- T