RSX Code Reference
    Preparing search index...

    Class UILibraryTreeContextMenu

    Custom context menu for the UILibraryTree class.

    Hierarchy (View Summary)

    Index
    onSelectCustomTagButtonClicked: () => void

    Gets called when the user clicks on the "Tags.." button to assign custom tags to a resource.

    • get customElements(): UIElement[]

      Gets a list of all added custom elements to the Context Menu.

      Returns UIElement[]

    • set customElements(value: UIElement[]): void

      Parameters

      Returns void

    • Adds a new item to the menu.

      Parameters

      • path: string

        Path that determines where to add the element. See class information on how to specify paths. All sub-elements of a path will be added automatically.

      • fnOnSelected: () => void

        Callback to invoke when the path element is selected.

      • OptionalfnOnIsActive: () => boolean

        Callback to invoke when determining if the menuItem is active.

      • OptionalshortcutAction: ShortcutActionBase

        Shortcut action to display next to the item name.

      • Optionalimage: Image | ResourceHandle<Image>

        An icon to display next to the item name.

      Returns void

    • Adds a menu item with the given path to this Context menu.

      Parameters

      • path: string

        Path that determines where to add the element. See class information on how to specify paths. All sub-elements of a path will be added automatically.

      • fnAction: () => void

        Callback to trigger when the path element is selected.

      • OptionalfnIsEnabled: () => boolean

        Optional. Extra condition to display the item.

      • Optionaltarget: EditorWindowBase

        Optional. The callback EditorWindowBase for fetching shortcut actions.

      Returns void

    • Adds a new separator to the menu.

      Parameters

      • Optionalpath: string

        Path that determines where to add the element. See class information on how to specify paths. All sub-elements of a path will be added automatically.

      Returns void

    • Adds a new toggle to the menu.

      Parameters

      • path: string

        Path that determines where to add the element. See class information on how to specify paths. All sub-elements of a path will be added automatically.

      • initialState: boolean

        The initial state of the context menu toggle. If true, the toggle will start in toggled state.

      • callback: () => void

        Callback to trigger when the path element is selected.

      • OptionalshortcutAction: ShortcutActionBase

        Shortcut action to display next to the item name.

      • Optionalimage: Image | ResourceHandle<Image>

        An icon to display next to the item name.

      Returns void

    • Opens a context menu at the specified position relative to the provided ui element base.

      Parameters

      • position: Immutable<Vector2>

        The position where the context menu should be displayed.

      • uiElement: UIElementBase

        The UI element serving as a position reference.

      • OptionaluseNativeMenu: boolean

        Whether the context menu should be displayed using native context menu when available, use the engine context menu otherwise.

      Returns void

    • Normally menu items use values from their paths as their names. However path labels don't provide a way of localizing the menu item. This method allows you to set specific names (different from path labels) to each menu item. All the values are localized so they will also be updated according to the string table.

      Parameters

      • label: string

        Label of the element.

      • name: I18N

        Name to display when the menu is shown.

      Returns void

    • Creates a new instance of the UIContextMenu class that contains a list of menu items based on the specified enumType.

      Type Parameters

      Parameters

      • enumType: EnumClassOf<T>

        The enumeration type to create the context menu from.

      • onSelected: (value: EnumValue<T>) => void

        The callback to invoke when a menu item is selected.

      • OptionalinitialValue: EnumValue<T, number>

        Optional, the initial value that is selected when the menu is opened.

      • OptionalisIncludingZero: boolean

        Optional, if set to false, will exclude any enum value that is zero. Default is true.

      Returns UIContextMenu

      A new instance of the UIContextMenu class.