Files
benilla-octo/crates/benilla-formats/examples/dump_anim_names.rs
T
SamandClaude Fable 5 2ad0043523 benilla: initial public release
A from-scratch World of Warcraft 1.12.1 client in Rust + Bevy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 14:27:01 +07:00

26 lines
1.0 KiB
Rust

//! Session probe: print AnimationData.dbc rows (id, name, weapon flags, fallback) —
//! `cargo run -p benilla-formats --example dump_anim_names <Data-dir> [id ...]`. Without ids,
//! prints all 208 rows. Built for the bowstring round (which sequences do bow M2s carry).
fn main() {
let mut args = std::env::args().skip(1);
let data = args
.next()
.expect("usage: dump_anim_names <Data-dir> [id ...]");
let ids: Vec<u16> = args.map(|a| a.parse().expect("id u16")).collect();
let mut chain = benilla_formats::Chain::open(std::path::Path::new(&data)).expect("chain");
let cat = benilla_formats::load_anim_data_catalog(&mut chain).expect("catalog");
for id in 0..u16::try_from(cat.len() + 64).unwrap() {
if !ids.is_empty() && !ids.contains(&id) {
continue;
}
if let Some(name) = cat.name(id) {
println!(
"{id:3} {name:24} wflags {:#04x} fallback {:?}",
cat.weapon_flags(id),
cat.fallback(id)
);
}
}
}