fix missing pause/play button for some animations
We do animation detection during the preload now, but this wasn't always working correctly: some movies don't actually fully mount the children onto the stage until we start playing. This caused the play/pause button to be missing on the outfit page and the item page, but the animations would still play, depending on the user's saved play/pause state in localStorage.
This commit is contained in:
parent
652d3cff7d
commit
a5bfadf126
1 changed files with 6 additions and 0 deletions
|
@ -356,6 +356,12 @@ export function usePreloadLayers(layers) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some movie clips require you to tick to the first frame of the movie
|
||||||
|
// before the children mount onto the stage. If we detect animations
|
||||||
|
// without doing this, we'll say no, because we see no children!
|
||||||
|
// Example: http://images.neopets.com/cp/items/data/000/000/235/235877_6d273e217c/235877.js
|
||||||
|
movieClips.forEach((mc) => mc.advance());
|
||||||
|
|
||||||
setLayersHaveAnimations(movieClips.some(hasAnimations));
|
setLayersHaveAnimations(movieClips.some(hasAnimations));
|
||||||
setLoadedLayers(layers);
|
setLoadedLayers(layers);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue