Inventool Action Menu

πŸ“‹ InventoolActionMenu Class

A pop-up menu for custom actions.

Namespace: Esper.Inventool.UI Access: public Type: class Inherits: CrossInputSupportedWindow


πŸ“¦ Fields

Access
Field
Type
Description

protected

root

VisualElement

The root of the content.

protected

optionContainer

VisualElement

The visual element that contains options.

protected

closeButton

Button

The full-screen invisible close button.


πŸ” Properties

Access
Property
Type
Description

public static

Instance

InventoolActionMenu

Active singleton instance.


🧰 Methods

Access
Method
Returns
Description

protected override

Awake()

void

Initialize singleton and cache UI elements.

protected virtual

CreateMenuOption(ActionMenuOption actionMenuOption)

Button

Create a button for a menu option.

public virtual

Open(VisualElement target, params ActionMenuOption[] options)

void

Display menu at target with specified options.

public virtual

Open(VisualElement target, List<ActionMenuOption> options)

void

Display menu at target with an option list.

public virtual

Close()

void

Hide menu and invoke close callbacks.

protected

ForceInsideView()

IEnumerator

Ensure the menu stays within the viewport.

Active Instance

You can get the active InventoolActionMenu instance with InventoolActionMenu.Instance. Ensure there's an instance of it in your scene before using this field.

Opening

Opening the action menu requires a VisualElement target and a list of Action Menu Option.

Closing

Customizations

The options displayed on the action menu are customizable through scripting.

Customize For Inventory Item Stacks

To customize the action menu options displayed when an item stack in the inventory is clicked, edit the ItemStack.actionMenuOptionsGetter field.

If you'd like a reference, you can find the original in the ItemStack.actionMenuOptionsGetter field in the ItemStack.cs script.

Customize For Equipment Slots

To customize the action menu options displayed when an equipment slot in the inventory is clicked, edit the EquipmentSlot.actionMenuOptionsGetter field.

If you'd like a reference, you can find the original in the EquipmentSlot.actionMenuOptionsGetter field in the EquipmentSlot.cs script.

Last updated