Both agents left the language reading standing for the 37 pairs that differ without a button-count mismatch, and both observed that nothing rewarded closing it. Two scans closed it, against my own reading. All 39 equal-button-count pairs share button names and rows exactly, which does not settle it -- two dialogs sharing a button template look identical by that test. What differs does settle it: pzstg10 against pzstg02, pzstg11 against pzstg03, pzstg12 against pzstg13. These are the DLG_STAGE_TITLE01..16 dialogs and an adjacent pair carries two different stages, with different sprite counts, which is a different amount of text rather than a translation of the same text. So the whole 63 is explained by one fact -- adjacent entries are unrelated dialogs -- with no residue. The 2 identical pairs remain unexplained but are no longer anomalous against a hypothesis, because the hypothesis is gone. Recorded about process rather than the disc: a bound nobody is incentivised to test is exactly where a convenient claim survives, and the next reader cannot tell whether a bound was respected or merely never revisited. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
44 lines
1.7 KiB
Rust
44 lines
1.7 KiB
Rust
//! What differs between equal-button-count `GP_DIALOG` adjacent pairs?
|
|
//!
|
|
//! All 39 share button names and rows. That is consistent with a LANGUAGE PAIR and
|
|
//! equally with TWO DIALOGS SHARING A BUTTON TEMPLATE (two yes/no boxes differing
|
|
//! only in their message sprite). The difference is in what else differs: a
|
|
//! language pair should differ in the SAME slots with locale-marked names.
|
|
//!
|
|
//! cargo run -p sylpheed-formats --example dialog_pair_diffs
|
|
use sylpheed_formats::{pak::PakArchive, ui_layout};
|
|
use std::collections::BTreeSet;
|
|
use std::path::PathBuf;
|
|
|
|
fn names(ar: &PakArchive, i: usize) -> Option<BTreeSet<String>> {
|
|
let by = ar.read(&ar.entries()[i]).ok()?;
|
|
let b = ui_layout::parse_build(&by)?;
|
|
Some(b.elements.iter().map(|e| e.name.clone()).collect())
|
|
}
|
|
|
|
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 shown = 0;
|
|
for k in (0..n).step_by(2) {
|
|
let (Some(a), Some(b)) = (names(&ar, k), names(&ar, k + 1)) else { continue };
|
|
if a == b {
|
|
continue;
|
|
}
|
|
let oa: Vec<&String> = a.difference(&b).collect();
|
|
let ob: Vec<&String> = b.difference(&a).collect();
|
|
// only the equal-button-count ones
|
|
let ba = a.iter().filter(|x| x.contains("btn")).count();
|
|
let bb = b.iter().filter(|x| x.contains("btn")).count();
|
|
if ba != bb {
|
|
continue;
|
|
}
|
|
if shown < 6 {
|
|
println!("entries {k:3}/{:<3} shared {} only-in-{k}: {:?} only-in-{}: {:?}",
|
|
k + 1, a.intersection(&b).count(), oa, k + 1, ob);
|
|
shown += 1;
|
|
}
|
|
}
|
|
}
|