Skip to content

Macros#

Defined in SDK.hpp. Convenience macros for declaring plugin metadata.

XENON_PLUGIN_INFO#

The standard plugin declaration macro.

XENON_PLUGIN_INFO(NAME, DISPLAY, AUTHOR, DESC, VERSION, HERO_ID, FLAGS)
Parameter Type Description
NAME string literal Internal name (no spaces, used as identifier and display name)
DISPLAY string literal Reserved — currently unused (pass same value as NAME)
AUTHOR string literal Author name
DESC string literal Short description
VERSION string literal Version string
HERO_ID uint64_t Target hero ID (0 = universal, or a HeroId:: constant)
FLAGS uint32_t Bitwise OR of PluginFlags
XENON_PLUGIN_INFO(
    "my_plugin",
    "My Plugin",
    "Author",
    "Does something cool",
    "1.0",
    0,
    PluginFlags::HasOverlay | PluginFlags::HasMenu
)

Expands to an on_get_info function that fills a PluginInfo struct.

Note

The DISPLAY parameter is accepted but currently not stored. The NAME value is used as both the internal identifier and the display name. Pass the same value for both, or use NAME for identification and DISPLAY as a placeholder for future use.


XENON_PLUGIN#

Simplified macro for universal plugins with overlay and menu.

XENON_PLUGIN(NAME, DISPLAY, DESC)
Parameter Type Description
NAME string literal Internal name
DISPLAY string literal Display name
DESC string literal Short description
XENON_PLUGIN("my_esp", "My ESP", "Simple enemy ESP")

Equivalent to:

XENON_PLUGIN_INFO("my_esp", "My ESP", "Unknown", "Simple enemy ESP", "1.0", 0,
    PluginFlags::HasOverlay | PluginFlags::HasMenu)

XENON_LIBRARY_INFO#

Declares a library plugin that provides a named service.

XENON_LIBRARY_INFO(NAME, AUTHOR, DESC, VERSION, PROVIDES)
Parameter Type Description
NAME string literal Internal name
AUTHOR string literal Author name
DESC string literal Short description
VERSION string literal Version string
PROVIDES string literal Service name this library provides
XENON_LIBRARY_INFO(
    "math_helpers_lib",
    "Xenon",
    "Shared math utils",
    "1.0",
    "math_helpers"
)

Sets targetHeroId = 0, flags = 0, and provides = PROVIDES. See the Dependencies guide.


XENON_PLUGIN_INFO_DEPS#

Declares a plugin with dependencies on library services.

XENON_PLUGIN_INFO_DEPS(NAME, DISPLAY, AUTHOR, DESC, VERSION, HERO_ID, FLAGS, DEPS)
Parameter Type Description
NAME string literal Internal name
DISPLAY string literal Display name
AUTHOR string literal Author name
DESC string literal Short description
VERSION string literal Version string
HERO_ID uint64_t Target hero ID
FLAGS uint32_t PluginFlags
DEPS string literal Null-separated, double-null terminated dependency list
XENON_PLUGIN_INFO_DEPS(
    "my_plugin",
    "My Plugin",
    "Author",
    "Uses math helpers",
    "1.0",
    0,
    PluginFlags::HasOverlay | PluginFlags::HasMenu,
    "math_helpers\0"
)

Dependency string format

Dependencies are listed as a single string with null-byte separators. The final \0 in the string literal provides the double-null terminator.

// Single dependency:
"math_helpers\0"

// Multiple dependencies:
"math_helpers\0ui_widgets\0"

PluginInfo Struct#

All macros fill this struct:

struct PluginInfo
{
    const char* name;          // Internal name
    const char* author;        // Author
    const char* description;   // Description
    const char* version;       // Version string
    uint64_t targetHeroId;     // 0 = universal
    uint32_t flags;            // PluginFlags
    const char* dependencies;  // Null-separated deps (or nullptr)
    const char* provides;      // Service name (or nullptr)
};

You can also implement on_get_info manually if the macros don't fit your needs:

extern "C" void on_get_info(xenon::PluginInfo* info)
{
    info->name = "custom";
    info->author = "Me";
    info->description = "Hand-crafted info";
    info->version = "2.0";
    info->targetHeroId = 0;
    info->flags = xenon::PluginFlags::HasOverlay;
    info->dependencies = nullptr;
    info->provides = nullptr;
}