Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bufficons = {
- '|TInterface\\Icons\\spell_nature_regeneration:22:22:0:0:22:22:2:20:2:20|t', --stats
- '|TInterface\\Icons\\spell_holy_wordfortitude:22:22:0:0:22:22:2:20:2:20|t', --stamina
- '|TInterface\\Icons\\ability_warrior_battleshout:22:22:0:0:22:22:2:20:2:20|t', --attack power
- '|TInterface\\Icons\\ability_rogue_disembowel:22:22:0:0:22:22:2:20:2:20|t', --haste
- '|TInterface\\Icons\\spell_holy_magicalsentry:22:22:0:0:22:22:2:20:2:20|t', --spell power
- '|TInterface\\Icons\\spell_nature_unyeildingstamina:22:22:0:0:22:22:2:20:2:20|t', --crit
- '|TInterface\\Icons\\spell_holy_greaterblessingofkings:22:22:0:0:22:22:2:20:2:20|t',--mastery
- '|TInterface\\Icons\\inv_elemental_mote_air01:22:22:0:0:22:22:2:20:2:20|t', --multistrike
- '|TInterface\\Icons\\spell_holy_mindvision:22:22:0:0:22:22:2:20:2:20|t', --versatility
- '|TInterface\\Icons\\trade_alchemy_dpotion_c12:22:22:0:0:22:22:2:20:2:20|t', --flask
- '|TInterface\\Icons\\spell_misc_food:22:22:0:0:22:22:2:20:2:20|t', --well fed
- }
- local MMCBFrame = CreateFrame("Frame", nil, UIParent) --parent it to uiparent so whenever the minimap hides (pet battles) this hides too, even if we're in a group
- MMCBFrame:SetWidth(22) --should always be 2 + the size of the icon in spellicons table to keep 1 px border
- MMCBFrame:SetPoint("TOPRIGHT", Minimap, "TOPLEFT", -1, 1) --account for the 1px backdrop around minimap
- MMCBFrame:SetPoint("BOTTOMRIGHT", Minimap, "BOTTOMLEFT", 1, -1) --account for the 1px backdrop around minimap
- MMCBFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
- MMCBFrame:RegisterEvent("GROUP_ROSTER_UPDATE") --register these two events to match blizz functionality for the consolidated buffsrame
- MMCBFrame:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
- for i = 1, 9 do --9 is number of buff categories
- MMCBFrame.i = CreateFrame("Button", "MMCBButton..i", MMCBFrame) --make 9 buttons on the mmcbframe
- if i == 1 then
- MMCBFrame.i:SetPoint("TOP", MMCBFrame, "TOP", 0, -1) --start with the first one 1 pixel down to keep the 1 px border
- else
- MMCBFrame.i:SetPoint("TOP", MMCBFrame[i-1], "BOTTOM") --possibly need to add a spacer in between each one
- end
- MMCBFrame.i.fs = MMCBFrame.i:CreateFontString(nil, "OVERLAY") --create a texture on each individual button
- MMCBFrame.i.fs:SetAllPoints()
- MMCBFrame.i.fs:SetFont('Fonts\\MORPHEUS.ttf', 10)
- MMCBFrame.i.fs:SetText(bufficons.i) --assign the respective texture to each button
- end
- MMCBFrame:SetScript('OnEvent', function(self, event)
- if event == "UNIT_AURA" then --should only be registered when we are in a group (aka the consolidated buff frame should be shown)
- for i = 1, 9 do --parse over the 9 possible classes of buffs
- local spellName = GetRaidBuffTrayAuraInfo(i) --assign this variable to the first value this Get returns (spellName)
- if spellName then --indicative that we have this buff, therefore, we want to make the icon not bright
- MMCBFrame.i.fs:SetAlpha(0.3)
- else
- MMCBFrame.i.fs:SetAlpha(1) --indicative that we are missing the buff, make the icon bright, alerting us to request buff
- end
- end
- else --should fire when our comp changes or i switch specs? I don't get why blizzard registered the spec swap in the check for their conoslidatedbuffs:show/hide code
- if ShouldShowConsolidatedBuffFrame() then --we're in a group want to start looking at buffs
- MMCBFrame:RegisterUnitEvent("UNIT_AURA", "player") --unit register unitaura for the player only
- MMCBFrame:Show() --show the frame, cause you know, we dont code 40 lines for nothing
- else
- MMCBFrame:UnregisterEvent("UNIT_AURA") --we either left the group or the group disbanded, no senseless polling of cpu resources
- MMCBFrame:Hide() --hide the frame, cause, it doesn't help us visually during solo
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement