tweaks and improvements
This commit is contained in:
@@ -135,6 +135,45 @@ test('mapping retains cue IDs and manual previews, updates managed files and han
|
||||
assert.equal(points[0].file, '');
|
||||
});
|
||||
|
||||
test('reactive impact uses saved peak-stage metadata separately for each animation stage', (t) => {
|
||||
const h = harness();
|
||||
h.storage.set(h.SOUND_SOURCE_KEY, assets(t, { impactdry01: { sounds: ['needsofnature:dry'] },
|
||||
shot_in01: { sounds: ['needsofnature:peak'] } }, { dry: 'dry', peak: 'peak' }));
|
||||
const library = h.loadSoundLibrary();
|
||||
h.context.Project = { animationdirector_animdef_definitions: JSON.stringify({ test: {
|
||||
stages: [{ stage: 1 }, { stage: 2, non_peak: true }],
|
||||
} }) };
|
||||
const normal = { name: 'test.p1', animators: { effects: { sound: [{ data_points: [{ effect: 'reactiveimpact' }] }] } } };
|
||||
const peaked = { name: 'test.p2', animators: { effects: { sound: [{ data_points: [{ effect: 'reactiveimpact' },
|
||||
{ effect: 'reactiveimpact', file: 'manual.ogg' }, { effect: 'reactiveimpact_silent' }] }] } } };
|
||||
h.mapAnimationSounds([normal, peaked]);
|
||||
assert.equal(normal.animators.effects.sound[0].data_points[0].file, h.resolveSoundAudio('impactdry01'));
|
||||
assert.equal(peaked.animators.effects.sound[0].data_points[0].file, h.resolveSoundAudio('shot_in01'));
|
||||
assert.equal(peaked.animators.effects.sound[0].data_points[1].file, 'manual.ogg');
|
||||
assert.equal(peaked.animators.effects.sound[0].data_points[2].file, '');
|
||||
h.context.Animation.selected = peaked;
|
||||
h.showSoundLibrary();
|
||||
h.context.dialog.component.methods.preview.call({ selected: 'reactiveimpact', error: '' });
|
||||
assert.equal(h.context.played[0].file, h.resolveSoundAudio('shot_in01'));
|
||||
h.context.Project.animationdirector_animdef_definitions = JSON.stringify({ test: { stages: [{ stage: 2, non_peak: false }] } });
|
||||
h.mapAnimationSounds([peaked]);
|
||||
assert.equal(peaked.animators.effects.sound[0].data_points[0].file, h.resolveSoundAudio('impactdry01'));
|
||||
assert.equal(h.resolveSoundAudio('random(needsofnature:reactiveimpact)', library, new Set(), normal), h.resolveSoundAudio('impactdry01'));
|
||||
});
|
||||
|
||||
test('missing stage metadata defaults to a normal impact; reused peak stages do not change the source stage', (t) => {
|
||||
const h = harness();
|
||||
h.storage.set(h.SOUND_SOURCE_KEY, assets(t, { impactdry01: { sounds: ['needsofnature:dry'] },
|
||||
shot_in01: { sounds: ['needsofnature:peak'] } }, { dry: 'dry', peak: 'peak' }));
|
||||
const library = h.loadSoundLibrary();
|
||||
h.context.Project = { animationdirector_animdef_definitions: JSON.stringify({ test: {
|
||||
stages: [{ stage: 1 }, { stage: 2, use_stage: 1, non_peak: true }],
|
||||
} }) };
|
||||
assert.equal(h.resolveSoundAudio('reactiveimpact', library, new Set(), { name: 'test.p1' }), h.resolveSoundAudio('impactdry01'));
|
||||
assert.equal(h.resolveSoundAudio('reactiveimpact', library, new Set(), { name: 'test.p2' }), h.resolveSoundAudio('shot_in01'));
|
||||
assert.equal(h.resolveSoundAudio('reactiveimpact', library, new Set(), { name: 'other.p3' }), h.resolveSoundAudio('impactdry01'));
|
||||
});
|
||||
|
||||
test('insertion is undoable and preserves existing cues at the same time; Apply edits selection', (t) => {
|
||||
const h = harness();
|
||||
h.storage.set(h.SOUND_SOURCE_KEY, assets(t, { one: { sounds: ['needsofnature:one'] } }, { one: 'one' }));
|
||||
|
||||
Reference in New Issue
Block a user