Thread Tools Display Modes
09-16-12, 04:15 PM   #1
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
Buff gaps

I have a weird issue with buffs I'm not able to track down. Sometimes a gap remains between buffs as shown here:


When a new buff is applied then, the gap is filled with that buff. If the buff is canceled, then the gap is there again.

Auras related code starts here (up to line 220).

Pre|Post functions related to auras start here (up to line 358)

Buff creation code starts here

Is this something on my side or is it ouf related?

Edit: An extremely bad vid showing how it behaves: http://www.youtube.com/watch?v=36Y6NKktCBw

Last edited by Rainrider : 09-16-12 at 04:59 PM.
  Reply With Quote
09-17-12, 05:22 PM   #2
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
The issue is that your sort function moves hidden icons into the middle of the list.

A fairly simple fix would be:
Code:
diff --git a/rain_functions.lua b/rain_functions.lua
index 34f5908..ca59646 100644
--- a/rain_functions.lua
+++ b/rain_functions.lua
@@ -179,7 +179,7 @@ local CreateAuraTimer = function(aura, elapsed)
 end
 
 local SortAuras = function(a, b)
-       if (a and b and a.timeLeft and b.timeLeft) then
+       if (a and b and a:IsShown() and b:IsShown() and a.timeLeft and b.timeLeft) then
                return a.timeLeft > b.timeLeft
        end
 end
The default :SetPosition function doesn't make a difference about hidden and shown icons anymore. In 1.6 you don't have "holes" in the table. So there's no need to re-anchor all the icons every time.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-17-12, 06:51 PM   #3
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
Thanks a lot for the reply. Tried both IsShown() and IsVisible() and I am still able to reproduce the issue.
  Reply With Quote
09-18-12, 11:42 AM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
This should be a more stable sort function. I'm at least not able to re-create the issue with this.
Code:
diff --git a/rain_functions.lua b/rain_functions.lua
index 34f5908..501b12d 100644
--- a/rain_functions.lua
+++ b/rain_functions.lua
@@ -179,8 +179,10 @@ local CreateAuraTimer = function(aura, elapsed)
 end
 
 local SortAuras = function(a, b)
-       if (a and b and a.timeLeft and b.timeLeft) then
+       if(a:IsShown() and b:IsShown()) then
                return a.timeLeft > b.timeLeft
+       elseif(a:IsShown()) then
+               return true
        end
 end
Note that I have to use the following code to even be able to re-create it:
Code:
local _UnitAura = _G.UnitAura

local override = {
   {"Violet Proto-Drake", "", "Interface\\Icons\\Ability_Mount_Drake_Proto", 0, nil, 0, 0, "player",nil, nil, 60024, true, nil, 249, true},
   {"Inner Will", "", "INTERFACE\\ICONS\\priest_icon_innewill", 0, nil, 0, 0, "player", nil, nil, 73413, true, nil, -15, 10, true},
   {"Guild Champion", "", "Interface\\Icons\\inv_epicguildtabard", 0, nil, 0, 0, "player", nil, nil, 97341, false, nil, true},
   {"Champion of the Dragonmaw Clan", "", "INTERFACE\\ICONS\\inv_misc_tabard_dragonmawclan", 0, nil, 0, 0, "player", nil, nil, 94158, false, nil, true},
}

_G.UnitAura = function(unit, id, ...)
   if(unit == 'player') then
      if(id < 5 and _UnitAura(unit, id, ...)) then
         return unpack(override[id])
      end
   end
   return _UnitAura(unit, id, ...)
end
__________________
「貴方は1人じゃないよ」
  Reply With Quote
09-18-12, 07:05 PM   #5
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
This one works! Thanks a lot, haste
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Buff gaps


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off