This branch predates CI on `main`. `cargo fmt --all` only; no behaviour. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
33 lines
1.2 KiB
Rust
33 lines
1.2 KiB
Rust
//! Every button record in `GP_TITLE.pak`, per entry.
|
|
//!
|
|
//! Testing half of the count-match in boot-config-and-gamepart-registry.md:
|
|
//! "four menu items load an external archive, EXTRAS stays inside GP_TITLE".
|
|
//! If DIFFICULTY (NEW GAME's destination, EASY/NORMAL/HARD/BACK) is also inside
|
|
//! GP_TITLE, then NEW GAME loads nothing external and that reading is wrong.
|
|
//!
|
|
//! cargo run -p sylpheed-formats --example gp_title_buttons
|
|
use std::path::PathBuf;
|
|
use sylpheed_formats::{pak::PakArchive, ui_layout};
|
|
|
|
fn main() {
|
|
let root = PathBuf::from(std::env::var("SYLPHEED_DISC").expect("SYLPHEED_DISC"));
|
|
let ar = PakArchive::open(root.join("dat/GP_TITLE.pak")).expect("GP_TITLE.pak");
|
|
for (i, e) in ar.entries().iter().enumerate() {
|
|
let Ok(by) = ar.read(e) else { continue };
|
|
let Some(b) = ui_layout::parse_build(&by) else {
|
|
continue;
|
|
};
|
|
let mut btns: Vec<String> = b
|
|
.records
|
|
.keys()
|
|
.filter(|n| n.starts_with("ptbtn"))
|
|
.cloned()
|
|
.collect();
|
|
btns.sort();
|
|
if btns.is_empty() {
|
|
continue;
|
|
}
|
|
println!("entry {i:2} {:2} button records {:?}", btns.len(), btns);
|
|
}
|
|
}
|