Lua (BfA)
local indicators = {}
local buffs = {}
local_, class = UnitClass("player");
if (class == "PRIEST" ) then
buffs = {
[17] = true, --보막(Power Word: Shield)
[1706] = true --공중 부양
}
end
if (class == "MONK" ) then
buffs = {
[115151] = true --소생의 안개(Renewing Mist)
}
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(1)
indicators[frame:GetName()] = indicator
end
return indicator
end
local function updateBuffs(frame)
if not frame:IsVisible() then return end
local indicator = getIndicator(frame)
local sID = nil
for i = 1, 40 do
local buffName, _, _, _, _, _, ut, _, _, sID = UnitBuff(frame.displayedUnit, i);
if not sID then break end
if buffs[sID] 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)
BuffName은 언어별로 다르기 때문에 spell ID를 가지고 우측 위에 표시
댓글 없음:
댓글 쓰기