Skip to content

Latest commit

 

History

History

arcdps

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

arcdps

Rust bindings for ArcDPS plugins. ArcDPS is an addon for Guild Wars 2.

Documentation can be found at zerthox.github.io/arcdps-rs/arcdps/. There is also an example plugin in this repository.

This project is originally a fork of greaka/arcdps_bindings.

Features

  • Rust abstractions for ArcDPS callbacks, types and exports
  • ImGui interfacing via imgui-rs
  • Versioning via Cargo.toml
  • Optional Unofficial Extras support
  • Optional logging via log
  • Optional serde and strum integration
  • Optional access to raw C interface of ArcDPS

Usage

[dependencies]
arcdps = { git = "https://github.com/zerthox/arcdps-rs" }
use std::error::Error;
use arcdps::{Agent, Event, StateChange};

arcdps::export! {
    name: "Example Plugin",
    sig: 0x12345678, // change this to a random number
    init,
    combat: custom_combat_name,
}

fn init() -> Result<(), Box<dyn Error>> {
    // may return an error to indicate load failure
    Ok(())
}

fn custom_combat_name(
    event: Option<&Event>,
    src: Option<&Agent>,
    dst: Option<&Agent>,
    skill_name: Option<&str>,
    id: u64,
    revision: u64,
) {
    if let Some(event) = event {
        if let StateChange::EnterCombat = event.get_statechange() {
            // source agent has entered combat
        }
    }
}

Unofficial Extras

Unofficial Extras support is hidden behind the extras feature flag.

[dependencies.arcdps]
git = "https://github.com/zerthox/arcdps-rs"
features = ["extras"]
use arcdps::extras::{UserInfoIter, UserRole};

arcdps::export! {
    name: "Example Plugin",
    sig: 0x12354678,
    extras_squad_update,
}

fn extras_squad_update(users: UserInfoIter) {
    for user in users {
        if let UserRole::SquadLeader | UserRole::Lieutenant = user.role {
            // user can place markers
        }
    }
}