improved and fixed stuff

This commit is contained in:
2026-09-28 21:55:40 +02:00
parent 2486c3cb63
commit 8d1346986b
3 changed files with 90 additions and 4 deletions
+18 -1
View File
@@ -43,7 +43,7 @@ function createHarness() {
context.adTest.showAnimationDefinitionReviewDialog(group, analysis);
return dialogs.at(-1);
}
return { open, exports, errors, project };
return { open, exports, errors, project, analysis };
}
function defaults(form) {
@@ -52,6 +52,23 @@ function defaults(form) {
.map(([key, field]) => [key, field.value]));
}
test('metadata-only playback stages remain editable and survive definition export', () => {
const h = createHarness();
h.analysis.stages = h.analysis.stages.slice(0, 1);
h.project.animationdirector_animdef_definitions = JSON.stringify({ test_animation: {
actors: [{ label: 'player', entity_types: ['minecraft:player'] }, { label: 'wolf', entity_types: ['minecraft:wolf'] }],
stages: [{ stage: 1, loop: true }, { stage: 2, use_stage: 1, speed: 0.8, non_peak: true, escapable: false }],
} });
const dialog = h.open();
assert.equal(dialog.form.stub_stage_2_use_stage.value, '1');
dialog.onConfirm(defaults(dialog.form));
assert.deepEqual(h.errors, []);
assert.equal(h.exports[0].stages.length, 2);
assert.equal(h.exports[0].stages[1].use_stage, 1);
assert.equal(h.exports[0].stages[1].speed, 0.8);
assert.equal(h.analysis.stages.length, 1);
});
test('generates extended animdef fields and restores them on reopen', () => {
const harness = createHarness();
const dialog = harness.open();