Function resourceAction

  • An attribute that can be added to a static method to create a new Resource action. Resource actions allow developers to extend toolbars and context menus for library resource specific actions such as right-clicking a resource in the library window or a resource browser.

    Whenever the associated key combination is pressed the corresponding editing context, the associated method will be invoked. For instance, if the focus is on the library window and the associated shortcut is pressed, the action will be invoked on the selected resource.

    When the function is invoked, the Resource represented by the passed ResourceEntry might not necessarily be loaded into memory. Avoid loading the resource unless required to perform the action as the load will penalize the user experience.

    Parameters

    • displayName: string

      The name/path of the shortcut action. Use the {name} token to subsitute the token dynamically with the object name.

    • onIsVisible: ((resources: ResourceEntry[]) => boolean)

      An optional callback invoked to determine if the action should be visible. Use this method to filter the action for specific types and single/multi-selection.

        • (resources): boolean
        • Parameters

          Returns boolean

    • OptionalshortcutModifier: EnumValue<ButtonModifier, number>

      A modifier key to bind the action to by default.

    • OptionalshortcutKey: EnumValue<ButtonCode, number>

      A key code to bind the action to by default.

    • Optionalflags: EnumValue<ShortcutBindingFlag, number>

      A set of optional flags to be given to the default key binding.

    • Optionalpriority: number

      An optional priority value for the new action.

    • Optionalplatform: EnumValue<ShortcutPlatformID, number>

      The platform for which this shortcut is enabled.

    Returns AttributeDecorator<Attribute>

    The method must have the following signature