-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Overlays are not removed properly when only using "return", + Wiki/Docs: How to clear Overlay. #1803
Comments
This isn't the right forum to ask questions, this is for tracking bugs or feature requests to the addon. As to your question, returning nothing works, as does returning a essential empty overlay. |
@InfusOnWoW Thanks for replying so quickly! :-) It's not just a question. I said that https://github.com/WeakAuras/WeakAuras2/wiki/Dynamic-Information#relative documentation needs fixing as mentioned in the first post.
I tried that but it doesn't turn off the overlay that I had created by previously (in other calls) returning
What does that mean? You mean |
@InfusOnWoW Just tried the "returning nothing" method again, and yeah it does not work. function()
local e = aura_env
local c = e.config
if c.immoPred and e.immototal > 0 then
print('go value')
return "forward", e.immototal
else
print('go empty')
return -- fails
--return "forward", 0 -- works
end
end The screen prints "go value" and I see the overlay... and then finally it prints "go empty" but never turns off the overlay. If I comment out |
That's a bug then. |
@InfusOnWoW I can make a separate ticket for the "return nothing" bug, and keep this one just for the documentation issue, if you want? |
Actually assuming we're using the same DH power bar aura here, returning nothing does in fact wipe the overlay. Tested on 2.15.5 just then. |
@1ps3 I'm on WeakAuras 2.15.4, let's see if .5 fixes it. |
@1ps3 No, it doesn't. And no we're not talking about the same aura. I'm gonna try making and exporting a small bar which is just meant for testing this bug. |
I'm currently running this and it's working as expected. That is to not display the overlay when e.immototal is less than 40.
|
@1ps3 Yes but that's due to how that aura is written. Your aura doesn't trigger the bug in WeakAuras. @InfusOnWoW Here is an aura to reproduce the bug, in the latest WeakAuras.
This will import an aura with two overlays that constantly blink on/off every second. Go into Trigger 1: Overlay 1, and edit its code. Set
PS: It seems like the |
This is strange to be honest. I don't know what's wrong with the aura you linked but for some reason it doesn't want to hide the overlay, but using the same code in another aura that I recently created makes it work perfectly fine. Tested with 1 overlay and 2 overlays it's all the same. |
@1ps3 Not sure, I created this aura from a blank default Bar template now, but I've seen this bug in multiple other auras, so it's something in WeakAuras itself. It simply doesn't hide overlays when you always use |
Ah okay I think I see the problem now. It seems like the overlay isn't updated until the bar is updated. So if you use a static number as your progress the overlay never gets removed. |
@1ps3 Ah, yeah that's a good theory. Although it doesn't explain why Either way, perhaps WeakAuras needs some code to say: "Redraw Bar if Duration Info changed, or if [Any Overlay has changed since last time]" Many auras can have static bar numbers (like power/energy bars, where the power stays static), which would break due to this bug... PS: I'm not in WoW now, taking a break, but if you want to check your theory, make the Duration Info function return a random number between 0-100 as its first return value, to make it always update the Duration Info. |
FYI our wiki is public, anyone can edit it. |
@emptyrivers Ah okay, well if someone can suggest the best ways to turn off overlays, I could edit the wiki. The 2nd question of the 1st post above asked about the best way, and hasn't been answered: Is
Turns out your theory had something to do with it. Import my aura and edit the Trigger 1 Duration Info script to this, and the overlays will seemingly work even with function()
return random(0, 100), 100, true
end I also tried deleting Overlay 2, to just try a single overlay (Overlay 1 is hardcoded to always use
|
I don't think there should be any measurable difference between those. |
@InfusOnWoW Ah, yeah I can see what WeakAuras overlay code does now via the code in your patch... InfusOnWoW@cc89b7f#diff-bd574ccbd8e51c13ccfac8ccc83bcb9fL329-R362 If there's no return value, it instantly sets all properties to As for your bugfix: I haven't tested it, but reading it seems to indicate it's not a fix. Look at the code link I gave above, to see the whole highlighted section. Here's what the code does:
I think I can see the actual bug though, by reading the code. It's here: local ok, a, b, c = xpcall(overlayFunc, geterrorhandler(), event.trigger, state);
if (not ok) then
additionalProgress.min = nil;
additionalProgress.max = nil;
additionalProgress.direction = nil;
additionalProgress.width = nil;
additionalProgress.offset = nil; The problem is right there... When the Overlay callback returns nothing, we just instantly set the properties to nil without flagging local ok, a, b, c = xpcall(overlayFunc, geterrorhandler(), event.trigger, state);
if (not ok) then
if (additionalProgress.min ~= nil or additionalProgress.max ~= nil or
additionalProgress.direction ~= nil or additionalProgress.width ~= nil or
additionalProgress.offset ~= nil) then
changed = true;
end
additionalProgress.min = nil;
additionalProgress.max = nil;
additionalProgress.direction = nil;
additionalProgress.width = nil;
additionalProgress.offset = nil; That should fix this bug / ticket. |
As for both of the elseif/else blocks (whenever the callback did return something)... those blocks could probably benefit too by introducing the same kind of "if not nil then changed = true" checks above all of the spots where they hard-code certain variables to nil. That way they'll detect changes in those values too. |
You didn't correctly understand the code. Please, test it, before running into a dead-end. |
https://github.com/WeakAuras/WeakAuras2/wiki/Dynamic-Information#relative
The documentation has two issues:
It says "Three values are expected", but then it shows two values being used (
return "forward", 100000
). The docs should note that the third value (offset) is optional.Both this and the "absolute overlay" say nothing about how to HIDE the overlay. I am guessing that my function should
return "forward", 0
on every call? This works, because it tells WeakAuras to calculate an offset that's at the same spot, so you can't see the overlay. But is there a better way to remove the overlay? And is it "harmful/wasteful" that I return"forward", 0
on every function call?///////
Edit: Direct link to a demo aura to show the
return
bug: #1803 (comment)The text was updated successfully, but these errors were encountered: