Class ContextMenuItemsGenerationEvent
- Namespace
- MonkeyLoader.Resonite.UI.ContextMenus
- Assembly
- MonkeyLoader.Resonite.Integration.dll
Represents a dispatchable base class for all events that generate a FrooxEngine.ContextMenu.
[DispatchableBaseEvent]
[SubscribableBaseEvent]
public abstract class ContextMenuItemsGenerationEvent : AsyncEvent
- Inheritance
-
ContextMenuItemsGenerationEvent
- Derived
- Inherited Members
Remarks
Use ContextMenuItemsGenerationEvent<T> for derived classes instead.
This class only exists as a subscribable catch-all event.
Properties
ContextMenu
Gets the FrooxEngine.ContextMenu being summoned.
public ContextMenu ContextMenu { get; }
Property Value
- ContextMenu
IsContextMenuOpen
Gets whether the ContextMenu is open.
public bool IsContextMenuOpen { get; }
Property Value
- bool
true if the ContextMenu is open; otherwise, false.
Summoner
Gets the FrooxEngine.IWorldElement that the ContextMenu is being summoned by.
public IWorldElement Summoner { get; }
Property Value
- IWorldElement
SummoningUser
Gets the FrooxEngine.User that the FrooxEngine.ContextMenu is being summoned for.
public User SummoningUser { get; }
Property Value
- User
Methods
AddConcreteEvent(Type, Func<ContextMenu, ContextMenuItemsGenerationEvent>, bool)
Adds the given constructorFunc as a concrete derived event
constructor for summoners
of the summonerType or a more derived type.
public static bool AddConcreteEvent(Type summonerType, Func<ContextMenu, ContextMenuItemsGenerationEvent> constructorFunc, bool replace = false)
Parameters
summonerTypeTypeThe type of the summoners to use the
constructorFuncfor.constructorFuncFunc<ContextMenu, ContextMenuItemsGenerationEvent>A function that constructs the concrete ContextMenuItemsGenerationEvent<T>-derived instance with the given FrooxEngine.ContextMenu.
replacebooltrue if the given
constructorFuncshould replace one that's already present; otherwise, false.
Returns
AddConcreteEvent<TSummoner>(Func<ContextMenu, ContextMenuItemsGenerationEvent>, bool)
Adds the given constructorFunc as a concrete derived event
constructor for summoners
of type TSummoner or a more derived type.
public static bool AddConcreteEvent<TSummoner>(Func<ContextMenu, ContextMenuItemsGenerationEvent> constructorFunc, bool replace = false)
Parameters
constructorFuncFunc<ContextMenu, ContextMenuItemsGenerationEvent>A function that constructs the concrete ContextMenuItemsGenerationEvent<T>-derived instance with the given FrooxEngine.ContextMenu.
replacebooltrue if the given
constructorFuncshould replace one that's already present; otherwise, false.
Returns
Type Parameters
TSummonerThe type of the summoners to use the
constructorFuncfor.
CloseContextMenu()
Closes the SummoningUser's FrooxEngine.ContextMenu.
public void CloseContextMenu()
HasConcreteEvent(Type)
Determines whether there is a concrete derived event constructor for the given summonerType.
public static bool HasConcreteEvent(Type summonerType)
Parameters
summonerTypeTypeThe type of the summoners to check.
Returns
HasConcreteEvent(Type, out Func<ContextMenu, ContextMenuItemsGenerationEvent>?)
Determines whether there is a concrete derived event constructor for the given summonerType.
public static bool HasConcreteEvent(Type summonerType, out Func<ContextMenu, ContextMenuItemsGenerationEvent>? constructorFunc)
Parameters
summonerTypeTypeThe type of the summoners to check.
constructorFuncFunc<ContextMenu, ContextMenuItemsGenerationEvent>The function that constructs the concrete ContextMenuItemsGenerationEvent<T>-derived instance with the given FrooxEngine.ContextMenu if there is one; otherwise, null.
Returns
HasConcreteEvent<TSummoner>()
Determines whether there is a concrete derived event constructor for the type TSummoner.
public static bool HasConcreteEvent<TSummoner>()
Returns
Type Parameters
TSummonerThe type of the summoners to check.
HasConcreteEvent<TSummoner>(out Func<ContextMenu, ContextMenuItemsGenerationEvent>?)
Determines whether there is a concrete derived event constructor for the type TSummoner.
public static bool HasConcreteEvent<TSummoner>(out Func<ContextMenu, ContextMenuItemsGenerationEvent>? constructorFunc)
Parameters
constructorFuncFunc<ContextMenu, ContextMenuItemsGenerationEvent>The function that constructs the concrete ContextMenuItemsGenerationEvent<T>-derived instance with the given FrooxEngine.ContextMenu if there is one; otherwise, null.
Returns
Type Parameters
TSummonerThe type of the summoners to check.
OpenContextMenuAsync(Slot, ContextMenuOptions)
Ensures that the SummoningUser's FrooxEngine.ContextMenu
is open at the position determined by the pointer using the given options.
public Task<ContextMenu?> OpenContextMenuAsync(Slot pointer, ContextMenuOptions options = default)
Parameters
pointerSlotThe slot that the FrooxEngine.ContextMenu will be centered at.
This is typically the slot of the FrooxEngine.TouchSource that triggered the opening.optionsContextMenuOptionsThe additional options for opening the menu.
Returns
Remarks
If options.keepPosition
is true the last position will be kept instead.
RemoveConcreteEvent(Type)
Removes the concrete derived event constructor for the given summonerType.
public static bool RemoveConcreteEvent(Type summonerType)
Parameters
summonerTypeTypeThe type of the summoners to remove the constructor function for.
Returns
RemoveConcreteEvent<TSummoner>()
Removes the concrete derived event constructor for the type TSummoner.
public static bool RemoveConcreteEvent<TSummoner>()
Returns
Type Parameters
TSummonerThe type of the summoners to remove the constructor function for.
ToggleContextMenuAsync(Slot, ContextMenuOptions)
Opens the SummoningUser's FrooxEngine.ContextMenu
at the position determined by the pointer using the given options
if it's not open already.
If it is open already, it will be closed instead.
public Task<ContextMenu?> ToggleContextMenuAsync(Slot pointer, ContextMenuOptions options = default)
Parameters
pointerSlotThe slot that the FrooxEngine.ContextMenu will be centered at.
This is typically the slot of the FrooxEngine.TouchSource that triggered the opening.optionsContextMenuOptionsThe additional options for opening the menu.
Returns
- Task<ContextMenu>
The SummoningUser's newly opened FrooxEngine.ContextMenu, or
nullif opening failed or it was already open before.
Remarks
If options.keepPosition
is true the last position will be kept instead.