Jump to content

fix party trinkets addon for raid-style party?


  • Please log in to reply
No replies to this topic

#1 qweek

qweek
  • Members
  • Posts: 7

Posted 30 March 2013 - 01:07 PM

Does anyone in here have a party trinket addon that works with the raid-style party frames? If not, can anyone in here help me fix this addon so it attaches to the raid-style party frames?
local trinkets = {}
local events = CreateFrame("Frame")
local partyFrame, trinket
for i = 1, MAX_PARTY_MEMBERS do
partyFrame = "PartyMemberFrame"..i
trinket = CreateFrame("Cooldown", partyFrame.."Trinket")
trinket:SetPoint("TOPRIGHT", partyFrame, 30, -6)
trinket:SetSize(24, 24)
trinket.icon = trinket:CreateTexture(nil, "BACKGROUND")
trinket.icon:SetAllPoints()
trinket.icon:SetTexture("Interface\\Icons\\inv_jewelry_trinketpvp_02")
trinket:Hide()
trinkets["party"..i] = trinket
end
function events:UNIT_SPELLCAST_SUCCEEDED(unitID, spell, rank, lineID, spellID)
if not trinkets[unitID] then
return
end
if spellID == 59752 or spellID == 42292 then
CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 120, 1)
elseif spellID == 7744 then
CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 45, 1)
end
end
function events:PLAYER_ENTERING_WORLD()
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
for _, trinket in pairs(trinkets) do
trinket:SetCooldown(0, 0)
trinket:Hide()
end
end
events:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end)
events:RegisterEvent("PLAYER_ENTERING_WORLD")

My guess is that it has something to do with this line:
partyFrame = "PartyMemberFrame"..i
but I can't get it to work. I've checked /fstack and tried changing it to "CompactPartyFrameMember" but it doesn't work.

Anyone who knows how to fix it?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

<