diff --git a/js/animations/animation.js b/js/animations/animation.js index ada8dd19..bc952f74 100644 --- a/js/animations/animation.js +++ b/js/animations/animation.js @@ -959,8 +959,8 @@ const Animator = { Canvas.outlines.children.empty() Canvas.updateAllPositions() } - if (Animation.all.length && !Animation.all.includes(Animation.selected)) { - Animation.all[0].select(); + if (AnimationItem.all.length && !AnimationItem.all.includes(Animation.selected)) { + AnimationItem.all[0].select(); } else if (!Animation.all.length) { Timeline.selected.empty(); } diff --git a/js/animations/animation_controllers.js b/js/animations/animation_controllers.js index 1854f10f..2733d39e 100644 --- a/js/animations/animation_controllers.js +++ b/js/animations/animation_controllers.js @@ -104,7 +104,7 @@ class AnimationControllerState { // From Bedrock if (data.particle_effects instanceof Array) { this.particles.empty(); - data.particles.forEach(effect => { + data.particle_effects.forEach(effect => { let particle = { uuid: guid(), effect: effect.effect || '', @@ -118,7 +118,7 @@ class AnimationControllerState { } if (data.sound_effects instanceof Array) { this.sounds.empty(); - data.sounds.forEach(effect => { + data.sound_effects.forEach(effect => { let sound = { uuid: guid(), effect: effect.effect || '', @@ -1064,7 +1064,8 @@ Interface.definePanels(() => { let menu = new Menu('controller_state_transitions', list, {searchable: list.length > 9}); menu.open(event.target); }, - openParticleMenu(state, particle) { + openParticleMenu(state, particle, event) { + if (getFocusedTextInput()) return; new Menu('controller_state_particle', [ { name: 'generic.remove', @@ -1075,9 +1076,11 @@ Interface.definePanels(() => { Undo.finishEdit('Remove particle from controller state'); } } - ]) + ]).open(event); + event.stopPropagation(); }, - openSoundMenu(state, sound) { + openSoundMenu(state, sound, event) { + if (getFocusedTextInput()) return; new Menu('controller_state_sound', [ { name: 'generic.remove', @@ -1088,7 +1091,8 @@ Interface.definePanels(() => { Undo.finishEdit('Remove sound from controller state'); } } - ]) + ]).open(event); + event.stopPropagation(); }, addAnimationButton(state, event) { state.select(); @@ -1568,7 +1572,7 @@ Interface.definePanels(() => {