7 个不稳定版本
0.10.1 | 2024 年 6 月 6 日 |
---|---|
0.10.0 | 2024 年 5 月 20 日 |
0.9.0 | 2023 年 7 月 4 日 |
0.8.1 | 2023 年 3 月 8 日 |
0.7.0 | 2022 年 2 月 27 日 |
#888 在 游戏
每月 181 次下载
51KB
972 行
Arcdps 插件绑定 
这提供具有安全、零成本的抽象的 arcdps 插件绑定。
只需几行代码即可轻松集成到 arcdps。
功能
当前功能包括
- 通过 Cargo.toml 版本化插件
- 所有回调的简单接口
- 可选放弃安全抽象以直接访问 arcdps C 接口
- 通过
imgui-rs
进行 Imgui 接口 - 通过
log
crate 记录到 arcdps - 非官方额外 绑定
仍在开发中
- 公开 arcdps 设置
仍在探索技术边界
- 类似于 arcdps 的 Imgui 窗口吸附
如何使用
一个小示例展示了提供的许多功能中的 2 个。如果 init
返回错误,arcdps 不会将插件视为已加载,并将显示错误。除了非官方-extras 函数之外,不会调用其他任何函数。
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()),
}
}
依赖关系
~6.5MB
~123K SLoC