sylpheed-port refuted the untested reading I recorded yesterday with a count, and I reproduced it: 26 of 65 adjacent GP_DIALOG pairs differ in BUTTON COUNT, which two languages of one dialog cannot. The names agree once read rather than counted -- ranking_NEXT against ranking_JUMP, py_ranking against pzeff, pzstg10 against pzstg02. So adjacent entries are unrelated dialogs, the 63 never needed the language reading, the 2 matching pairs need no special account, and the 140:70 ratio is a counting coincidence -- the same fact my halves-pairing zero was showing from the other side. Preserving their caution: this does not establish that 0/1 and 2/3 ARE language pairs. Identical element sets is equally consistent with a duplicate, and for the 37 pairs differing without a button-count mismatch the language reading is unsupported rather than refuted. Withdraws a delivered claim: I called entries 2/3 'an EN/JP pair' in HANDOFF. The DIFFICULTY identification does not rest on it -- unique geometry plus the capture does -- but it was stated as fact and was not one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
46 lines
1.8 KiB
Rust
46 lines
1.8 KiB
Rust
//! Do adjacent `GP_DIALOG` entries differ in BUTTON COUNT?
|
|
//!
|
|
//! I offered an untested reading for why 63 of 65 adjacent pairs have different
|
|
//! element sets: dialog text baked into language-specific sprites, so EN/JP
|
|
//! entries differ by construction. `sylpheed-port` refuted it with a count — two
|
|
//! languages of one dialog cannot differ in how many buttons they have. This
|
|
//! re-derives that with my own reader before I record the refutation.
|
|
//!
|
|
//! cargo run -p sylpheed-formats --example dialog_pair_button_counts
|
|
use sylpheed_formats::{pak::PakArchive, ui_layout};
|
|
use std::path::PathBuf;
|
|
|
|
fn btns(ar: &PakArchive, i: usize) -> Option<usize> {
|
|
let by = ar.read(&ar.entries()[i]).ok()?;
|
|
let b = ui_layout::parse_build(&by)?;
|
|
Some(b.elements.iter().filter(|e| e.name.contains("btn")).count())
|
|
}
|
|
|
|
fn main() {
|
|
let root = PathBuf::from(std::env::var("SYLPHEED_DISC").expect("SYLPHEED_DISC"));
|
|
let ar = PakArchive::open(root.join("dat/GP_DIALOG.pak")).expect("GP_DIALOG");
|
|
let n = ar.entries().len();
|
|
let (mut diff, mut same, mut skip) = (0, 0, 0);
|
|
let mut show = 0;
|
|
for k in (0..n).step_by(2) {
|
|
match (btns(&ar, k), btns(&ar, k + 1)) {
|
|
(Some(a), Some(b)) => {
|
|
if a != b {
|
|
diff += 1;
|
|
if show < 6 {
|
|
println!(" entries {k:3}/{:<3} button counts {a} vs {b}", k + 1);
|
|
show += 1;
|
|
}
|
|
} else {
|
|
same += 1
|
|
}
|
|
}
|
|
_ => skip += 1,
|
|
}
|
|
}
|
|
println!("\nadjacent pairs differing in BUTTON COUNT: {diff}");
|
|
println!("adjacent pairs with equal button counts : {same}");
|
|
println!("unreadable : {skip}");
|
|
println!("\ntwo languages of one dialog cannot differ in button count.");
|
|
}
|