WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Could it be a bug with aura element? (https://www.wowinterface.com/forums/showthread.php?t=54137)

Layback_ 08-06-16 01:54 AM

Could it be a bug with aura element?
 
Hi all,

I have noticed this issue(?) about 2 days ago, tried to figure it out by myself and failed...

The current bug is about the cooldown display of aura element.

Let's say I have these 5 different buffs.



As I get them, cooldowns of each buffs will be displayed properly.

However, when I log-out and re-enter the toon, this strange thing will happen.



The cooldown is increased by '1h'.
(Yeah, I know that '1h' does not actually mean a whole hour in this case, but it is still increased :(...)

I've set some prints within L#201~L#208 to see what is going wrong.

Lua Code:
  1. if(cd and not icons.disableCooldown) then
  2.     if(duration and duration > 0) then
  3.         print(icon:GetName() .. ": " .. timeLeft)
  4.         print(icon:GetName() .. ": " .. timeLeft - duration .. ", " .. duration)
  5.  
  6.         cd:SetCooldown(timeLeft - duration, duration)
  7.         cd:Show()
  8.     else
  9.         cd:Hide()
  10.     end
  11. end

And here's the result that I got when I re-entered a toon 3 times.



If my understanding is correct, "timeLeft" variable should remain still, but it is actually (slightly...) increased by certain amount.

The cooldown text '2h' does not seem to be changing until it's expiration as well.

I thought my custom CreateIcon constructor was the one that caused this issue, but it seems to be acting same with default constructor.

Lua Code:
  1. A.CreateAura = function(f, unit)
  2.     A.CreateBuffs(f, unit);
  3.     A.CreateDebuffs(f, unit);
  4. end
  5.  
  6. A.CreateBuffs = function(f, unit)
  7.     local Buffs = CreateFrame("Frame", "$parentBuffs", f);
  8.     Buffs:SetPoint("BOTTOMLEFT", f, "TOPLEFT", 0, 20);
  9.     Buffs:SetSize(G["buff"]["frameSize"], G["buff"]["frameSize"] * 2 - G["buff"]["spacing"]);
  10.  
  11.     Buffs.size = G["buff"]["size"];
  12.     Buffs.spacing = G["buff"]["spacing"];
  13.     Buffs.num = 32;
  14.  
  15.     f.Buffs = Buffs;
  16. end
  17.  
  18. A.CreateDebuffs = function(f, unit)
  19.     local Debuffs = CreateFrame("Frame", "$parentDebuffs", f);
  20.     Debuffs:SetPoint("BOTTOMRIGHT", f, "TOPRIGHT", 0, 20);
  21.     Debuffs:SetSize(G["buff"]["frameSize"], G["buff"]["frameSize"] * 2 - G["buff"]["spacing"]);
  22.  
  23.     Debuffs.size = G["buff"]["size"];
  24.     Debuffs.spacing = G["buff"]["spacing"];
  25.     Debuffs['growth-x'] = "LEFT";
  26.     Debuffs.initialAnchor = "BOTTOMRIGHT";
  27.     Debuffs.num = 32;
  28.  
  29.     f.Debuffs = Debuffs;
  30. end

EDIT: For 30 minutes buff, the cooldown text displays '31m' even if it acutally expires after 25 minutes.

EDIT1: As long as the toon is logged in, it works fine. However, once I log off and re-enter the toon, this strange thing happens :(

lightspark 08-06-16 03:27 AM

That's just how things work on blizz side. oUF doesn't create these values, it gets them via API.

Layback_ 08-06-16 03:52 AM

Quote:

Originally Posted by lightspark (Post 317530)
That's just how things work on blizz side. oUF doesn't create these values, it gets them via API.

Yeah, it looks like i missed L#139 where it gets data from UnitAura(unit, index, filter) jeez... :(

really sorry about that...

I'm so stupid D:

But, I still don't get why and how it is resulting in such error(?)...

lightspark 08-06-16 03:59 AM

Quote:

Originally Posted by Layback_ (Post 317531)
Yeah, it looks like i missed L#139 where it gets data from UnitAura(unit, index, filter) jeez... :(

really sorry about that...

I'm so stupid D:

But, I still don't get why and how it is resulting in such error(?)...

Even default CDs have same behaviour. No one knows why and how, as I said, that's just how things are on blizz side, deal w/ it.

Layback_ 08-06-16 04:28 AM

Quote:

Originally Posted by lightspark (Post 317532)
Even default CDs have same behaviour. No one knows why and how, as I said, that's just how things are on blizz side, deal w/ it.

oh... I thought you meant by that weird variation on timeLeft variable.

If that's how the default CD ones behave, I should deal with it then.

Thank you for letting me know!

EDIT: nvm... I guess the value of timeLeft variable should vary as the expiration time changes on new session...

Sorry about confusion...


All times are GMT -6. The time now is 03:26 AM.

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