Realign pack sheets into the entities layout and fill the sheet

tools/realign_sheet.py strips the blank spacer rows from a documented
Animals/Monsters sheet, drops the dark-box preview copies and moves the
light frames into the manifest's slot columns, so a sheet pastes into the
template as one block. Both sheets are pasted; the manifest gains the
fifth foal/horse pair the Animals sheet actually has.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-20 20:46:02 +02:00
co-authored by Claude Opus 5
parent 11de9b0205
commit 4b4e779b3e
11 changed files with 220 additions and 95 deletions
+23 -11
View File
@@ -125,21 +125,33 @@ mod tests {
}
#[test]
fn manifest_names_resolve_and_bootstrap_sprites_have_idle() {
fn frames_are_read_off_the_sheet() {
let s = sprites();
for name in ["player", "hen", "fox"] {
let id = s.id(name);
let idle = s.frame(id, State::Idle, 0).unwrap();
assert_ne!(idle.mask, 0, "{name}");
// Only one idle frame so far: index 1 wraps to it. No walk yet: falls back.
assert_eq!(s.frame(id, State::Idle, 1).unwrap().px, idle.px);
assert_eq!(s.frame(id, State::Walk, 0).unwrap().px, idle.px, "{name}");
}
let hen = s.id("hen");
let idle0 = s.frame(hen, State::Idle, 0).unwrap();
let idle1 = s.frame(hen, State::Idle, 1).unwrap();
assert_ne!(idle0.mask, 0);
assert_ne!(idle0.px, idle1.px, "hen has two distinct idle frames");
assert_eq!(s.frame(hen, State::Idle, 2).unwrap().px, idle0.px, "wraps");
// The hen walks with 4 frames; index 4 wraps back to the first.
let walk0 = s.frame(hen, State::Walk, 0).unwrap();
assert_eq!(s.frame(hen, State::Walk, 4).unwrap().px, walk0.px);
assert_ne!(s.frame(hen, State::Walk, 3).unwrap().px, walk0.px);
}
#[test]
fn empty_rows_have_nothing() {
fn missing_state_falls_back_to_idle() {
let s = sprites();
assert!(s.frame(s.id("butterfly4"), State::Idle, 0).is_none());
let ghost = s.id("ghost1"); // ghosts never sit
assert_eq!(s.frame(ghost, State::Sit, 0).unwrap().px,
s.frame(ghost, State::Idle, 0).unwrap().px);
}
#[test]
fn player_row_has_only_a_bootstrap_idle() {
let s = sprites();
let p = s.id("player");
assert!(s.frame(p, State::Idle, 0).is_some());
assert_eq!(s.frame(p, State::Walk, 0).unwrap().px, s.frame(p, State::Idle, 0).unwrap().px);
}
}