Struct AddonApi

Source
#[repr(C)]
pub struct AddonApi {
Show 42 fields pub swap_chain: IDXGISwapChain, pub imgui_context: *mut ImGuiContext, pub imgui_malloc: Option<ImguiMalloc>, pub imgui_free: Option<ImguiFree>, pub register_render: RawGuiAddRender, pub deregister_render: RawGuiRemRender, pub get_game_dir: RawGetGameDir, pub get_addon_dir: RawGetAddonDir, pub get_common_dir: RawGetCommonDir, pub hook_create: RawHookCreate, pub hook_remove: RawHookRemove, pub hook_enable: RawHookEnable, pub hook_disable: RawHookDisable, pub log: RawLog, pub event_raise: RawEventRaise, pub event_raise_notification: RawEventRaiseNotification, pub event_subscribe: RawEventSubscribe, pub event_unsubscribe: RawEventSubscribe, pub register_wnd_proc: RawWndProcAddRem, pub deregister_wnd_proc: RawWndProcAddRem, pub send_wnd_proc_to_game_only: RawWndProcSendToGame, pub keybind_register_with_string: RawKeybindRegisterWithStringOld, pub keybind_register_with_struct: RawKeybindRegisterWithStructOld, pub keybind_deregister: RawKeybindDeregister, pub get_resource: RawDataGetResource, pub share_resource: RawDataShareResource, pub get_texture: RawTextureGet, pub get_texture_or_create_from_file: RawTextureGetOrCreateFromFile, pub get_texture_or_create_from_resource: RawTextureGetOrCreateFromResource, pub get_texture_or_create_from_url: RawTextureGetOrCreateFromUrl, pub get_texture_or_create_from_memory: RawTextureGetOrCreateFromMemory, pub load_texture_from_file: RawTextureLoadFromFile, pub load_texture_from_resource: RawTextureLoadFromResource, pub load_texture_from_url: RawTextureLoadFromUrl, pub load_texture_from_memory: RawTextureLoadFromMemory, pub add_shortcut: RawQuickAccessAddShortcut, pub remove_shortcut: RawQuickAccessGeneric, pub notify_shortcut: RawQuickAccessGeneric, pub add_simple_shortcut: RawQuickAccessAddContextMenu, pub remove_simple_shortcut: RawQuickAccessGeneric, pub translate: RawLocalizationTranslate, pub translate_to: RawLocalizationTranslateTo,
}
Expand description

Nexus addon API (version 2).

Fields§

§swap_chain: IDXGISwapChain

DirectX swap chain.

§imgui_context: *mut ImGuiContext

ImGui context.

§imgui_malloc: Option<ImguiMalloc>

ImGui malloc function.

§imgui_free: Option<ImguiFree>

ImGui free function.

§register_render: RawGuiAddRender

Registers a new render callback.

§deregister_render: RawGuiRemRender

Removes a registered render callback.

§get_game_dir: RawGetGameDir

Returns the path to the game directory.

For example "C:\Program Files\Guild Wars 2\".

§get_addon_dir: RawGetAddonDir

Returns a path to "\addons\{name}".

Passing null or "" returns "\addons" without trailing slash.

§get_common_dir: RawGetCommonDir

Returns the path to the common addon folder.

Alias for get_addon_dir("common").

§hook_create: RawHookCreate

MinHook create.

§hook_remove: RawHookRemove

MinHook remove.

§hook_enable: RawHookEnable

MinHook enable.

§hook_disable: RawHookDisable

MinHook disable.

§log: RawLog

Logs a message to the log window and log file.

Supports custom coloring for addon window messages, for example <c=#FF0000>this text is red</c>.

§event_raise: RawEventRaise

Raises an event to all subscribing addons.

§event_raise_notification: RawEventRaiseNotification

Raises an event without a payload.

Alias event_raise("EV_FOO", null).

§event_subscribe: RawEventSubscribe

Registers a new event callback.

§event_unsubscribe: RawEventSubscribe

Removes a registered event callback.

§register_wnd_proc: RawWndProcAddRem

Registers a new WNDPROC callback.

§deregister_wnd_proc: RawWndProcAddRem

Removes a registered WNDPROC callback.

§send_wnd_proc_to_game_only: RawWndProcSendToGame

Sends a WNDPROC directly to the game, bypassing other hooks.

§keybind_register_with_string: RawKeybindRegisterWithStringOld

Registers a new keybind handler for a given named keybind.

Keybind is a string like "ALT+SHIFT+T.

§keybind_register_with_struct: RawKeybindRegisterWithStructOld

Registers a new keybind handler for a given named keybind.

Keybind is a Keybind struct.

§keybind_deregister: RawKeybindDeregister

Removes a registered keybind.

§get_resource: RawDataGetResource

Returns a pointer to the requested resource of null if it does not exist.

§share_resource: RawDataShareResource

Allocates a shared resource of the given size and returns a pointer to it for writing.

§get_texture: RawTextureGet

Returns a pointer to the Texture or null if it does not exist.

§get_texture_or_create_from_file: RawTextureGetOrCreateFromFile

Returns a pointer to the Texture or creates it from the file if it does not exist.

§get_texture_or_create_from_resource: RawTextureGetOrCreateFromResource

Returns a pointer to the Texture or creates it from the resource if it does not exist.

§get_texture_or_create_from_url: RawTextureGetOrCreateFromUrl

Returns a pointer to the Texture or creates it from the URL if it does not exist.

§get_texture_or_create_from_memory: RawTextureGetOrCreateFromMemory

Returns a pointer to the Texture or creates it from the memory if it does not exist.

§load_texture_from_file: RawTextureLoadFromFile

Creates a texture from the file and passes it to the callback when finished.

§load_texture_from_resource: RawTextureLoadFromResource

Creates a texture from the resource and passes it to the callback when finished.

§load_texture_from_url: RawTextureLoadFromUrl

Creates a texture from the URL and passes it to the callback when finished.

§load_texture_from_memory: RawTextureLoadFromMemory

Creates a texture from the memory and passes it to the callback when finished.

§add_shortcut: RawQuickAccessAddShortcut

Adds a new shortcut icon to the quick access with the given texture identifiers. When clicked the given keybind identifier will be called.

§remove_shortcut: RawQuickAccessGeneric

Removes a shortcut with the given identifier from quick access.

§notify_shortcut: RawQuickAccessGeneric

Sends a notification icon to the given shortcut.

§add_simple_shortcut: RawQuickAccessAddContextMenu

Adds a new ImGui callback fired when right-clicking the Nexus icon.

§remove_simple_shortcut: RawQuickAccessGeneric

Removes a registered simple shortcut callback.

§translate: RawLocalizationTranslate

Translates the identifier into the current active language. Returns the same identifier if unavailable.

§translate_to: RawLocalizationTranslateTo

Translates the identifier into the given language. Returns the same identifier if unavailable.

Implementations§

Source§

impl AddonApi

Source

pub const VERSION: i32 = 2i32

Nexus Addon API version.

Source

pub fn get_d3d11_device(&self) -> Option<ID3D11Device>

Retrieves the DirectX 11 device associated with the swap chain.

Trait Implementations§

Source§

impl Clone for AddonApi

Source§

fn clone(&self) -> AddonApi

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AddonApi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Send for AddonApi

Source§

impl Sync for AddonApi

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.