GoldpawsStuff / AzeriteUI5

Custom user interface suite for World of Warcraft. Design and code by Lars Norberg and Daniel Troconis.
https://www.patreon.com/GoldpawsStuff
Other
22 stars 7 forks source link

Components: Fix Lua errors when world quests are added to objectives #83

Closed PatTheMav closed 1 month ago

PatTheMav commented 2 months ago

ObjectiveTrackerBonusBannerFrame has been renamed to ObjectiveTrackerTopBannerFrame in War Within. This PR adds it as a possible frame to position to ensure this happens before any animations might have occurred.

Explanation of the Bug:

If the custom position of this frame is not set up directly (and is instead attempted during its animation flow) a Lua error is triggered in the game:

The observed error points out that the return value of this call is a nil value. The most probable way this can happen is if self.module itself is a nil value, which will be the case if OnSlideAnimFinished was called, which in turn calls Finish and sets self.module to nil.

My hunch is that when AzeriteUI's TopBannerManager_Show function is called via the secure hook, StopBanner will be called prematurely, which will also lead to a call to Finish and thus the module is set to nil and once AzeriteUI calls PlayBanner again, OnPopAnimFinished will not have a valid module value to call GetContainerForModule with.

[!NOTE] It is probable that the entire pattern (stopping the animation, relocating the banner, then starting the animation again) is currently potentially broken in War Within insofar as if an animation is stopped its internal state (set up by ObjectiveTrackerTopBannerMixin:DisplayForQuest) is broken and not usable for a second trigger to play the animation.

wangyf0611 commented 2 months ago

this works! [thumb up]