improved and fixed stuff
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user