WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Duration text disappeared for some random aura buttons (https://www.wowinterface.com/forums/showthread.php?t=55580)

Layback_ 07-19-17 08:16 PM

Duration text disappeared for some random aura buttons
 
Hi,

This thread is somewhat related to a thread here.

I've been implementing auras element to my UI and found some strange bug(?) which also happens on my other addon as it is shown a thread above.

Basically I haven't touched anything apart from buffs and debuffs frame creation, and am using default aura button creation provided by oUF.

Lua Code:
  1. function GenerateBuffs(frame, unit)
  2.     local buffs = CreateFrame("Frame", "$parentBuffs", frame);
  3.     buffs:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 0, 25);
  4.     buffs:SetSize((ICON_SIZE + 1) * (ICON_PER_ROW - 1) + ICON_SIZE, (ICON_SIZE + 1) * (ICON_PER_COL - 1) + ICON_SIZE);
  5.  
  6.     buffs.size = ICON_SIZE;
  7.     buffs.spacing = 1;
  8.     buffs.num = ICON_PER_ROW * ICON_PER_COL;
  9.  
  10.     return buffs;
  11. end
  12.  
  13. function GenerateDebuffs(frame, unit)
  14.     local debuffs = CreateFrame("Frame", "$parentDebuffs", frame);
  15.     debuffs:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", 0, 25);
  16.     debuffs:SetSize((ICON_SIZE + 1) * (ICON_PER_ROW - 1) + ICON_SIZE, (ICON_SIZE + 1) * (ICON_PER_COL - 1) + ICON_SIZE);
  17.  
  18.     debuffs.size = ICON_SIZE;
  19.     debuffs.spacing = 1;
  20.     debuffs.num = ICON_PER_ROW * ICON_PER_COL;
  21.     debuffs["growth-x"] = "LEFT";
  22.     debuffs.initialAnchor = "BOTTOMRIGHT";
  23.  
  24.     return debuffs;
  25. end

However, for some random aura buttons, it starts to not show duration (cooldown text, cd:GetRegions()) as it is shown below.



At least I tested it on Rogue, Druid and Death Hunter, but they all had a same issue.

Unfortunately, this is sooooooooooooo random and I can't really think of the process to re-produce this issue.

I'm currently thinking that this would be an internal Lua bug with Blizzard's code, but who knows :(

lightspark 07-19-17 11:05 PM

It's indeed a Blizz bug.

It happens to bag item buttons quite regularly.


Layback_ 07-19-17 11:15 PM

Quote:

Originally Posted by lightspark (Post 324241)
It's indeed a Blizz bug.

It happens to bag item buttons quite regularly.


Glad it's not an error of mine :banana:
(Trying to figure out where my codes are going wrong was pain in the...)

Guess it started to happen to me since 7.2 or 7.2.5 maybe...

Hope they are aware of this and fix it on 7.3

lightspark 07-19-17 11:19 PM

Quote:

Originally Posted by Layback_ (Post 324242)
Glad it's not an error of mine :banana:

Guess it started to happen to me since 7.2 or 7.2.5 maybe...

Hope they are aware of this and fix this on 7.3

Nah, it's been happening since WoD at least :p

You're just unlucky because it happens to your aura CDs :D

-- edit #1

K, I was right. Try adding this line to your CD-related code, after you set it for instance, you might need to use PostUpdateIcon callback.

Lua Code:
  1. cooldown:SetHideCountdownNumbers(false)

Something sets this flag to true internally (from C, not from Lua). I'll report this bug today w/ this info. It's been awhile since this bug appeared, I guess it's time to finally report it :D

Layback_ 07-19-17 11:49 PM

Quote:

Originally Posted by lightspark (Post 324243)
Nah, it's been happening since WoD at least :p

You're just unlucky because it happens to your aura CDs :D

-- edit #1

K, I was right. Try adding this line to your CD-related code, after you set it for instance, you might need to use PostUpdateIcon callback.

Lua Code:
  1. cooldown:SetHideCountdownNumbers(false)

Something sets this flag to true internally (from C, not from Lua). I'll report this bug today w/ this info. It's been awhile since this bug appeared, I guess it's time to finally report it :D

Yeay!

Quick question.

Does that function has to be called every single update (like PostUpdateIcon as you said)? or could it be done once via button creation (such as PostCreateIcon)?

Great to see that there is at least a temporary solution :banana:

lightspark 07-19-17 11:55 PM

Quote:

Originally Posted by Layback_ (Post 324244)
Yeay!

Quick question.

Does that function has to be called every single update (like PostUpdateIcon as you said)? or could it be done once via button creation (such as PostCreateIcon)?

Great to see that there is at least a temporary solution :banana:

I can't answer this question because I dunno why and when this flag is set. It might be reset repeatedly, it might a one time thingy.

Try adding this line to CreateIcon override if you use one, otherwise add it to PostCreateIcon, if it doesn't help, then PostUpdateIcon is your only hope :p

Layback_ 07-19-17 11:58 PM

Quote:

Originally Posted by lightspark (Post 324245)
I can't answer this question because I dunno why and when this flag is set. It might be reset repeatedly, it might a one time thingy.

Try adding this line to CreateIcon override if you use one, otherwise add it to PostCreateIcon, if it doesn't help, then PostUpdateIcon is your only hope :p

All good!

Thanks for your help :banana:!!!

lightspark 07-19-17 11:59 PM

Quote:

Originally Posted by Layback_ (Post 324246)
All good!

Thanks for your help :banana:!!!

You're welcome :D

Layback_ 07-20-17 01:51 AM

Just have done some play test with :SetHideCountdownNumbers(false).

Basically it seems like you only need to call that function once per button creation.

So, if you are suffering with same issue, just call :SetHideCountdownNumbers(false) on your overrided CreateIcon function or via callback function, PostCreateIcon.

Lua Code:
  1. local cd = CreateFrame("Cooldown", "$parentCooldown", button, "CooldownFrameTemplate");
  2. cd:SetAllPoints();
  3. cd:SetReverse(true);
  4. cd:SetDrawEdge(true);
  5. cd:SetHideCountdownNumbers(false);

Sythral 07-30-17 09:38 AM

Really appreciate you both sharing this useful information. I too was having this issue with a few of my addons.


All times are GMT -6. The time now is 01:54 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI