# HG changeset patch # User Chris Mellon # Date 1286921788 18000 # Node ID bb1143608eb4e03476a4e69ec37532896c6c6cea # Parent cf6e612a1c7e6b48ce9684f8730294a9086bb6db Correctly pull the index from the secure attribute in order to bind the right buff to the right frame diff -r cf6e612a1c7e -r bb1143608eb4 KBF.lua --- a/KBF.lua Tue Oct 12 16:52:47 2010 -0500 +++ b/KBF.lua Tue Oct 12 17:16:28 2010 -0500 @@ -24,13 +24,15 @@ for idx=1,99 do local frame = self.secureFrame:GetAttribute("child"..idx) if not frame then break end - self:BindBarToBuff(idx, frame, unit, "HELPFUL") + self:BindBarToBuff(frame, unit) end end -function kbf:BindBarToBuff(idx, parentFrame, unit, filter) +function kbf:BindBarToBuff(parentFrame, unit) + local index = parentFrame:GetAttribute("index") + local filter = parentFrame:GetAttribute("filter") local name, rank, icon, count, debuffType, duration, expirationTime, - unitCaster, isStealable, shouldConsolidate, spellId = UnitAura(unit, idx, "HELPFUL") + unitCaster, isStealable, shouldConsolidate, spellId = UnitAura(unit, index, filter) -- This shouldn't be neccesary as the bar is parented to the frame, which is -- hidden by the group handler if not parentFrame.icon then @@ -145,17 +147,19 @@ --local frame = anchor frame:SetAttribute("filter", "HELPFUL") frame:SetAttribute("template", "KBFSecureUnitAuraTemplate") - frame:SetAttribute("point", "CENTER") + frame:SetAttribute("point", "TOP") frame:SetAttribute("wrapAfter", 100) -- required due to bugs in secure header frame:SetAttribute("consolidateTo", nil) --frame:SetAttribute("wrapXOffset", 0) --frame:SetAttribute("wrapYOffset", -34) frame:SetAttribute("xOffset", 0) - frame:SetAttribute("yOffset", 16) - frame:SetAttribute("minWidth", 32) - frame:SetAttribute("minHeight", 32) + frame:SetAttribute("yOffset", -16) + frame:SetAttribute("minWidth", 216) + frame:SetAttribute("minHeight", 16) frame:SetAttribute("unit", "player") -- TODO: figure out the vehicle swapping stuff - frame:SetPoint("BOTTOM", anchor, "TOP", 0, 0) + frame:SetAttribute("sortMethod", "NAME") + frame:SetAttribute("sortOrder", "-") + frame:SetPoint("TOP", anchor, "BOTTOM", 0, 0) frame:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", edgeFile = "Interface/Tooltips/UI-Tooltip-Border", tile = true, tileSize = 16, edgeSize = 16,