Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local indicators = {}
- local buffs = {}
- local_, class = UnitClass("player");
- if ( class == "DRUID" ) then
- buffs = {["Mark of the Wild"] = true}
- end
- if (class == "PRIEST" ) then
- buffs = {["Power Word: Fortitude"] = true}
- end
- if (class == "MAGE" ) then
- buffs = {["Arcane Brilliance"] = true}
- end
- if (class == "MONK" ) then
- buffs = {
- ["Legacy of the White Tiger"] = true,
- ["Legacy of the Emperor"] = true
- }
- end
- if (class == "DEATHKNIGHT" ) then
- buffs = {["Horn of Winter"] = true}
- end
- if (class == "PALADIN" ) then
- buffs = {
- ["Blessing of Kings"] = true,
- ["Blessing of Might"] = true
- }
- end
- if (class == "WARLOCK" ) then
- buffs = {["Dark Intent"] = true}
- end
- if (class == "WARRIOR" ) then
- buffs = {
- ["Battle Shout"] = true,
- ["Commanding Shout"] = true
- }
- end
- local function getIndicator(frame)
- local indicator = indicators[frame:GetName()]
- if not indicator then
- indicator = CreateFrame("Button", nil, frame, "CompactAuraTemplate")
- indicator:ClearAllPoints()
- indicator:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -3, -2)
- indicator:SetSize(22, 22)
- indicator:SetAlpha(0.6)
- indicators[frame:GetName()] = indicator
- end
- return indicator
- end
- local function updateBuffs(frame)
- if not frame:IsVisible() then return end
- local indicator = getIndicator(frame)
- local buffName = nil
- for i = 1, 40 do
- local _, _, _, _, _, d, _, ut, _, sc, s, c = UnitBuff(frame.displayedUnit, i);
- buffName = UnitBuff(frame.displayedUnit, i);
- if not buffName then break end
- if buffs[buffName] and ( ut == "player" or ut == "pet" ) then
- indicator:SetSize(frame.buffFrames[1]:GetSize()) -- scale
- CompactUnitFrame_UtilSetBuff(indicator, frame.displayedUnit, i, nil);
- return
- end
- end
- indicator:Hide()
- end
- hooksecurefunc("CompactUnitFrame_UpdateBuffs", updateBuffs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement