레이블이 Auras인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Auras인 게시물을 표시합니다. 모든 게시물 표시

2018년 6월 13일 수요일

기본 레이드 프레임에 특정 버프 표시

원본 출처 : https://eu.battle.net/forums/en/wow/topic/17613434222

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를 가지고 우측 위에 표시

2018년 6월 5일 화요일

캐릭터 버프 디버프 역순정렬

기본의 우측->좌측 대신 반대 방향인 좌->우로 배열
(Invert BuffFrame growth direction - Left to Right)

Buff
-- 버프 역순정렬/위치이동
hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", function()
    for i = 1, BUFF_ACTUAL_DISPLAY do
        _G["BuffButton"..i]:SetScale(1)
        _G["BuffButton"..i]:ClearAllPoints()

        if i > 1 and mod(i, BUFFS_PER_ROW) == 1 then
            _G["BuffButton"..i]:SetPoint("TOP", _G["BuffButton"..(i-BUFFS_PER_ROW)], "BOTTOM", 0, -BUFF_ROW_SPACING)
        elseif i == 1 then
            _G["BuffButton"..i]:SetPoint("TOPLEFT", UIParent, 40, -125)
        else
            _G["BuffButton"..i]:SetPoint("TOPLEFT", _G["BuffButton"..i-1], 35, 0)
        end
    end
end)


Debuff
-- 디버프 역순정렬/위치이동
hooksecurefunc("DebuffButton_UpdateAnchors", function (buttonName, index)
    local buff = _G[buttonName..index]
    local numBuffRows = math.floor(BUFF_ACTUAL_DISPLAY/9) + 1
    buff:SetScale(1)
    buff:ClearAllPoints()
    if index > 1 and mod(index, BUFFS_PER_ROW) == 1 then
        buff:SetPoint("TOP", _G[buttonName..(index-BUFFS_PER_ROW)], "BOTTOM", 0, -BUFF_ROW_SPACING)
    elseif index == 1 then
        buff:SetPoint("TOPLEFT", _G["BuffButton1"], 0, (-55 + (numBuffRows * -45)))
    else
        buff:SetPoint("TOPLEFT", _G[buttonName..(index-1)], 35, 0)
    end
end)

유닛프레임 오라크기

버프 크기(Buff)
/run hooksecurefunc("TargetFrame_UpdateBuffAnchor", function(s,bn,i,_,_,z,...)local B,S=_G[bn..i],z*1.3;B:SetWidth(S);B:SetHeight(S);end)


디버프 크기(Debuff)
/run hooksecurefunc("TargetFrame_UpdateDebuffAnchor", function(s,dn,i,_,_,z,...)local D,S=_G[dn..i],z*1.3 D:SetWidth(S);D:SetHeight(S);end)




1.3 대신 다른 숫자를 넣어서 조절하면 됨

기본 레이드 프레임 설정


1. 기본프레임 사각형 크기조절
/run local n="CompactUnitFrameProfilesGeneralOptionsFrame"_G[n.."HeightSlider"]:SetMinMaxValues(100,200);_G[n.."WidthSlider"]:SetMinMaxValues(50,200)
 - 설정범위를 각각 가로 100~200/ 세로 50~200으로 만들어 준다

2. 기본프레임 오라 크기
버프 아이콘
/run hooksecurefunc("CompactUnitFrame_UpdateBuffs", function(frame)for i=1,frame.maxBuffs do local buffFrame=frame.buffFrames[i];buffFrame:SetSize(20,20)end;end)
디버프 아이콘
/run hooksecurefunc("CompactUnitFrame_UpdateDebuffs", function(frame)for i=1,frame.maxDebuffs do local dbuff=frame.debuffFrames[i];dbuff:SetSize(20,20)end;end)
 - 20,20 저게 아이콘 크기다

3. 레이드프레임 프로필 스위칭
/run if GetCVar("activeCUFProfile")=="주 설정"then CompactUnitFrameProfiles_ActivateRaidProfile("투박장")else CompactUnitFrameProfiles_ActivateRaidProfile("주 설정")end
- "주 설정"과 "투박장" 대신 기본프레임 프로필에서 설정된 이름을 넣으면 됨

4. 평소 주 설정을 이용하다가 투기장 입장시 "투박장" 프로필로 자동 교체
Lua

--레이드 프로필 변경
local CRFP = CreateFrame("FRAME")

CRFP:RegisterEvent("PLAYER_ENTERING_WORLD")
CRFP:Setscript("OnEvent", function()
if IsActiveBattlefieldArena() then
    CompactUnitFrameProfiles_ActivateRaidProfile("투박장")
else
    CompactUnitFrameProfiles_ActivateRaidProfile("주 설정")
end
end)
저장할때 인코딩이 UTF-8로 되어 있는지 확인

5. 디버프 아이콘 표시 갯수 늘리기 twitch.tv/cdewx

6. 기본프레임 파티숫자 숨기기+파티별 프레임 붙이기
-- 기본프레임 파티숫자 숨기기+프레임 붙이기
hooksecurefunc("CompactRaidGroup_UpdateLayout",function(f)
f.title:SetHeight(0);f.title:SetWidth(0);f.title:SetText(nil)
local f1 = _G[f:GetName().."Member1"]
f1:ClearAllPoints()
    if (CUF_HORIZONTAL_GROUPS)then
        f1:SetPoint("TOPLEFT")
        f:SetHeight(f1:GetHeight())
    else
        f1:SetPoint("TOP")
        f:SetWidth(f1:GetWidth())
    end
end)