WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Buff gaps (https://www.wowinterface.com/forums/showthread.php?t=44394)

Rainrider 09-16-12 04:15 PM

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

haste 09-17-12 05:22 PM

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.

Rainrider 09-17-12 06:51 PM

Thanks a lot for the reply. Tried both IsShown() and IsVisible() and I am still able to reproduce the issue.

haste 09-18-12 11:42 AM

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


Rainrider 09-18-12 07:05 PM

This one works! Thanks a lot, haste


All times are GMT -6. The time now is 08:13 PM.

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