Expand description
Event system.
use nexus::{
event::{ADDON_LOADED, event_consume},
log::{log, LogLevel}
};
use std::ptr::NonNull;
let callback = event_consume!(|payload: Option<&i32>| {
if let Some(signature) = payload {
log(LogLevel::Info, "My Addon", format!("Addon {signature} loaded"));
}
});
ADDON_LOADED.subscribe(callback);Modules§
- arc
- ArcDPS EVTC bridge events.
- extras
- Unofficial Extras bridge events.
- rtapi
Macros§
- event_
consume - Macro to wrap an event callback.
- event_
subscribe - Macro to subscribe to an event with a wrapped callback.
Structs§
- Event
- An event identifier & payload type pair.
- Mumble
Identity Update - Mumble identity.
Constants§
- ADDON_
LOADED - Nexus addon loaded event.
- ADDON_
UNLOADED - Nexus addon unloaded event.
- MUMBLE_
IDENTITY_ UPDATED - Mumble identity updated event.
- VOLATILE_
ADDON_ DISABLED - Nexus volatile addon disabled event.
- WINDOW_
RESIZED - Window resized event.
Functions§
- event_
raise ⚠ - Raises an event to all subscribing addons.
- event_
raise_ notification - Raises an event without payload to all subscribing addons.
- event_
raise_ notification_ targeted - Raises an event without payload for a specific subscribing addon.
- event_
raise_ ⚠targeted - Raises an event for a specific subscribing addon.
- event_
subscribe_ ⚠typed - Subscribes to an event with a raw callback using a typed payload.
- event_
subscribe_ unknown - Subscribes to an event with a raw callback using an unknown payload.
- event_
unsubscribe - Unsubscribes a previously registered raw event callback.