Mercurial > wow > kbf
diff KBF.lua @ 64:e5c07fdfb70b
remove the old hacked weapon enchant stuff since SAH properly supports it now, but turn it off because due to bugs either in KBF or SAH (both?), you get overlapping messed up displays whenever you have extra, non-buff frames
author | Chris Mellon <arkanes@gmail.com> |
---|---|
date | Fri, 02 Dec 2011 06:15:35 -0600 |
parents | 31eac67dd283 |
children | e19d0380b9f3 |
line wrap: on
line diff
--- a/KBF.lua Mon Nov 28 06:00:03 2011 -0600 +++ b/KBF.lua Fri Dec 02 06:15:35 2011 -0600 @@ -98,6 +98,7 @@ for idx=1,99 do local frame = self.secureHeader:GetAttribute("child"..idx) if not (frame and frame:IsShown()) then break end + local hasbuff = UnitAura(unit, frame:GetAttribute("index")) buffCount = buffCount + 1 if self.dirty then if self:BindBarToBuff(frame, unit) then break end @@ -108,7 +109,6 @@ self:OnEnter(frame) end end - -- consolidated buffs if self.consolidateProxy:IsShown() then for idx=1,99 do @@ -125,73 +125,22 @@ end buffCount = buffCount+1 end + -- SAH correctly binds the weapon enchant templates now, but when temp enchants + -- are present and used, it seems that it doesn't correctly hide un-bound + -- buff frames, which breaks all the layout and so forth. + for weapon=3,1,-1 do + local tempEnchant = self.secureHeader:GetAttribute("tempEnchant"..weapon) + if tempEnchant and tempEnchant:IsShown() then + self:BindBarToWeaponEnchant(tempEnchant) + self:UpdateBarExpirationTime(tempEnchant) + buffCount = buffCount + 1 + end + end - -- temporary enchants - -- TODO: So much copy/paste here. I really need to clean this up. - local tempEnchant = self.secureHeader:GetAttribute("tempEnchant1") - if tempEnchant and tempEnchant:IsShown() then - self:BindBarToWeaponEnchant(tempEnchant, 16) - self:UpdateBarExpirationTime(tempEnchant) - buffCount = buffCount + 1 - end - if ( tempEnchant and GameTooltip:IsOwned(tempEnchant) ) then - self:OnEnter(tempEnchant) - end - tempEnchant = self.secureHeader:GetAttribute("tempEnchant2") - if tempEnchant and tempEnchant:IsShown() then - self:BindBarToWeaponEnchant(tempEnchant, 17) - self:UpdateBarExpirationTime(tempEnchant) - buffCount = buffCount + 1 - -- SAH binds the offhand enchant to the main hand for removal purposes. - -- fix it up if we're out of combat - -- TODO: maybe this should only happen if we're dirty - self:QueueForOOC(function() self.secureHeader:GetAttribute("tempEnchant2"):SetAttribute('target-slot', 17) end) - end - if ( tempEnchant and GameTooltip:IsOwned(tempEnchant) ) then - self:OnEnter(tempEnchant) - end - -- make a fake third buff bar. It can't be used to cancel the buff, but - -- at least you can see it. - local thirdWeaponInfo = select(7, GetWeaponEnchantInfo()) - if thirdWeaponInfo then - if not self.tempEnchant3 then - -- largely copy/pasted code from SAH to bind to third weapon - self.tempEnchant3 = CreateFrame("Button", nil, self.secureHeader); - self.tempEnchant3.unit = "player" - self.tempEnchant3:SetWidth(200+16) - self.tempEnchant3:SetHeight(16) - self.tempEnchant3:Show() - self.tempEnchant3:SetScript("OnEnter", function() kbf:OnEnter(self.tempEnchant3) end) - self.tempEnchant3:SetScript("OnLeave", function() GameTooltip:Hide() end) - self.tempEnchant3:EnableMouse(true) - --TODO: queue up for setting when leaving combat - self:QueueForOOC(function() self.tempEnchant3:SetAttribute('target-slot', 18) end) - -- set up the tooltip - end - -- most likely: it stays visible but stops moving. - -- in this case, maybe parent it to the OH enchant also - -- so it vanishes and gets out of the way. - - self.tempEnchant3:Show() - end - if self.tempEnchant3 and not thirdWeaponInfo then - self.tempEnchant3:Hide() - end - tempEnchant = self.tempEnchant3 - if tempEnchant and tempEnchant:IsShown() then - self.tempEnchant3:ClearAllPoints() - self.tempEnchant3:SetPoint("TOP", self.secureHeader, "TOP", 0, (buffCount * -16)) - self:BindBarToWeaponEnchant(tempEnchant, 18) - self:UpdateBarExpirationTime(tempEnchant) - buffCount = buffCount + 1 - end - if ( tempEnchant and GameTooltip:IsOwned(tempEnchant) ) then - self:OnEnter(tempEnchant) - end - -- debuffs - -- Since debuffs aren't cancellable, don't need to use the secure header - -- for them. This could be rewritten to support useful features like - -- sorting & scaling and stuff. Honestly, should at least be alphabetical. + -- debuffs + -- Since debuffs aren't cancellable, don't need to use the secure header + -- for them. This could be rewritten to support useful features like + -- sorting & scaling and stuff. Honestly, should at least be alphabetical. for idx=1,99 do local frame = self.debuffFrames[idx] if self.dirty then @@ -550,9 +499,10 @@ frame:SetAttribute("unit", "player") frame:SetAttribute("sortMethod", "NAME") frame:SetAttribute("sortOrder", "-") - -- TODO: SecureAuraHeader doesn't correctly implement the temp enchants + frame:SetAttribute("weaponTemplate", "KBFSecureUnitAuraTemplate") - frame:SetAttribute("includeWeapons", 100) + -- TODO: Enabling temp enchant support breaks layout for regular buffs + frame:SetAttribute("includeWeapons", nil) frame:Show() -- has to be shown, otherwise the child frames don't show return frame end