Closed teelolws closed 1 year ago
Actually theres more to this that I can't find. This change stops the issue happening, but doesn't seem to be the true cause.
I setup tickers that turn the filters on and off every second, but the flickering isn't happening.
Okay I got it. Its to do with watching a frame's OnUpdate. The flicker doesn't happen if I switch that whole RHT.to to a C_Timer.NewTicker.
this ticker change looks like a great improvement thanks. Later tonight I'll test this and merge :D
Quick script to demo the problem. Track a reputation then:
/run local f,a=CreateFrame("Frame"),0 f:SetScript("OnUpdate", function(_,e) if a>-1 then a=a-e return end a=0 C_ToyBox.SetCollectedShown(not C_ToyBox.GetCollectedShown()) end)
If you swap that timer based on OnUpdate out for a C_Timer, no flicker.
So I've found this addon is causing the XP and Reputation bars to flicker, while RHT is trying to initialize. During setup, RHT will clear existing toybox filters, look for hearthstones, then reset the existing toybox filters.
Every time it changes the toybox filters, the XP and Reputation bars flicker. I don't know why, I certainly don't see any connection. Probably a bug on Blizzards end.
The problem is, if any of these situations happens:
then RHT keeps trying over and over every second, checking the toybox again and again. This causes the XP and Rep bars to keep flickering every second until the toybox finally works, which probably won't happen until the player opens their toybox and resets all the filters.
The change I've made here is to not reset back to the player's original filters if a hearthstone is not found.