트위치 방송을 보다 이런소스를 찾았는데 흠 어떻게 사용을 해야될지 모르겠습니다.. 공격대 프레임에다 본인의 버프를 띄울수 있게하는 매크로 같습니다. 매크로 고수님들 도와 주십쇼 ㅠㅠ..
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)