Total-RP / Storyline

A World of Warcraft add-on that improves the questing experience by replacing the default dialog frame by a more immersive frame with 3D models.
https://www.curseforge.com/wow/addons/storyline
14 stars 6 forks source link

First animations in a dialog are not played when model isn't loaded yet #18

Closed Ellypse closed 6 years ago

Ellypse commented 6 years ago

For some dialogs, the models are not loaded when we play the first animations of the dialog. This is because the OnAnimFinished script is executed instantly when the model is not here to play the animations (so the animations are played but instantly).

To fix this, I should change how we handle the OnModelLoaded event (we have one callback for now) to instead use promises (from Ellyb) to make sure any code in the add-on that needs the model to be loaded can use the promise to execute the code then.

Ellypse commented 6 years ago

Note: Promises are not in the master branch of Ellyb yet, so I will need to finalize those before doing this ticket.