#add-on #guild-wars-2 #framework #safe-abstraction #extra #ffi

arcdps

Rust bindings for the Guild Wars 2 dps-meter with focus on ease-of-use and performance

7 unstable releases

0.10.1 Jun 6, 2024
0.10.0 May 20, 2024
0.9.0 Jul 4, 2023
0.8.1 Mar 8, 2023
0.7.0 Feb 27, 2022

#685 in Games

Download history 4/week @ 2024-03-16 1/week @ 2024-03-23 19/week @ 2024-03-30 2/week @ 2024-04-06 6/week @ 2024-04-20 1/week @ 2024-04-27 169/week @ 2024-05-18 12/week @ 2024-05-25 125/week @ 2024-06-01 33/week @ 2024-06-08 6/week @ 2024-06-15

68 downloads per month

MIT/Apache

51KB
972 lines

Arcdps Plugin Bindings Latest Version

This provides arcdps plugin bindings featuring safe, zero-cost abstractions.

Easily integrate into arcdps with just a few lines of code.

Features

Current features include:

  • Versioning plugins via Cargo.toml
  • A simple interface for all callbacks
  • Optional opt out of safe abstractions to directly access the arcdps C interface
  • Imgui interfacing via imgui-rs
  • Logging to arcdps via the log crate
  • unofficial extras bindings

Still in development:

  • Exposing settings from arcdps

Still exploring technical boundaries:

  • Arcdps-like snapping of imgui windows

How to use

A small example showcasing 2 of the many functions provided. If init returns an error, arcdps won't consider the plugin as loaded and will display the error. No other function, except for unofficial-extras functions, will be called afterwards.

use std::error::Error;

use arcdps::UserInfoIter;

arcdps::arcdps_export! {
    name: "example addon",
    sig: 123, // change this to a random number
    unofficial_extras_squad_update: crate::squad_update,
    init: crate::init,
}

fn squad_update(users: UserInfoIter) {
    for user in users.into_iter() {
        println!("{:?}", user);
    }
}

fn init(swapchain: Option<NonNull<c_void>>) -> Result<(), Box<dyn Error>> {
    match swapchain {
        Some(swapchain) => {
            println!("init: initialized with swapchain: {:?}", swapchain);
            Ok(())
        }
        None => Err("init: swapchain is None".into()),
    }
}

Dependencies

~6.5MB
~123K SLoC