# HG changeset patch # User Chris Mellon # Date 1293806190 21600 # Node ID 15b9e97ab2d268256e351e836a783919de5b831e # Parent 758987dad08ca7bbf31e14288f632198a4a7408b hacked in very, very basic consolidated buff support. Needs *much* clean up, get side effects out of functions that don't want them, get the hide/show anchor logic into a secure state thingy diff -r 758987dad08c -r 15b9e97ab2d2 KBF.lua --- a/KBF.lua Wed Dec 29 06:13:13 2010 -0600 +++ b/KBF.lua Fri Dec 31 08:36:30 2010 -0600 @@ -82,6 +82,26 @@ self:OnEnter(frame) end end + + -- consolidated buffs + if self.consolidateProxy:IsShown() then + self.consolidateHeader:Show() -- *** STATE DRIVEN + for idx=1,99 do + local frame = self.consolidateHeader:GetAttribute("child"..idx) + if not (frame and frame:IsShown()) then break end + if self.dirty then + if self:BindBarToBuff(frame, unit) then break end + end + self:UpdateBarExpirationTime(frame) + -- Don't forget to refresh shown tooltips + if ( GameTooltip:IsOwned(frame) ) then + self:OnEnter(frame) + end + end + else + self.consolidateHeader:Hide() -- *** STATE DRIVEN + end + -- temporary enchants local tempEnchant = self.secureFrame:GetAttribute("tempEnchant1") if tempEnchant and tempEnchant:IsShown() then @@ -367,14 +387,38 @@ anchor:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", 0, 0) anchor:Hide() - local frame = CreateFrame("FRAME", "KBFBuffFrame", UIParent, "SecureAuraHeaderTemplate") - --local frame = anchor + self.secureFrame = self:CreateSecureHeaderFrame("KBFBuffFrame", "SecureAuraHeaderTemplate") + self.secureFrame:SetPoint("TOP", anchor, "TOP", 0, 0) + self.secureFrame:SetAttribute("consolidateTo", 1) + -- pre-create the consolidated proxy & headers so I can decide what they look like + -- lazy - just make it a regular bar for now + self.consolidateProxy = self:ConstructBar() + self.secureFrame:SetAttribute("consolidateProxy", self.consolidateProxy) + self.secureFrame:SetAttribute("frameref-proxy", GetFrameHandle(self.consolidateProxy)) + -- pre-create the consolidated header + self.consolidateHeader = self:CreateSecureHeaderFrame("KBFConsolidatedAnchorFrame") + self.secureFrame:SetAttribute("consolidateHeader", self.consolidateHeader) + self.consolidateHeader:SetPoint("RIGHT", self.consolidateProxy, "LEFT", 0, 0) + self.consolidateHeader:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", + edgeFile = "Interface/Tooltips/UI-Tooltip-Border", + tile = true, tileSize = 16, edgeSize = 12, + insets = { left = 4, right = 4, top = 4, bottom = 4 }, + }) + self.consolidateHeader:SetWidth(200 +16) + self.consolidateHeader:SetHeight(16) + self.consolidateHeader:Show() + self.consolidateProxy:SetAttribute("header", self.consolidateHeader); + self.consolidateProxy:SetAttribute("frameref-header", GetFrameHandle(self.consolidateHeader)) + return anchor +end + +function kbf:CreateSecureHeaderFrame(name, template) + local frame = CreateFrame("FRAME", name, UIParent, template) frame:SetAttribute("filter", "HELPFUL") frame:SetAttribute("toggleForVehicle", true) -- this doesn't actually work right now, but maybe it eventually will frame:SetAttribute("template", "KBFSecureUnitAuraTemplate") frame:SetAttribute("point", "TOP") frame:SetAttribute("wrapAfter", 100) -- required due to bugs in secure header - frame:SetAttribute("consolidateTo", nil) frame:SetAttribute("xOffset", 0) frame:SetAttribute("yOffset", -16) frame:SetAttribute("minWidth", 216) @@ -385,10 +429,8 @@ -- TODO: SecureAuraHeader doesn't correcltly implement the temp enchants frame:SetAttribute("weaponTemplate", "KBFSecureUnitAuraTemplate") frame:SetAttribute("includeWeapons", 1) - frame:SetPoint("TOP", anchor, "TOP", 0, 0) frame:Show() -- has to be shown, otherwise the child frames don't show - self.secureFrame = frame - return anchor + return frame end function kbf:ShowAnchor() diff -r 758987dad08c -r 15b9e97ab2d2 KBF.xml --- a/KBF.xml Wed Dec 29 06:13:13 2010 -0600 +++ b/KBF.xml Fri Dec 31 08:36:30 2010 -0600 @@ -19,4 +19,28 @@ + + + + + + +