WoWInterface SVN LFGStatusIcon

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

LFGStatusIcon/indicator.tga Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes : Added: svn:mime-type + application/octet-stream
LFGStatusIcon/core.lua New file
0,0 → 1,55
if not GetLFGQueueStats then return end -- 3.3 only
 
local NUM_DAMAGERS, update = 3, nil -- NUM_DAMAGERS is a private variable to Blizz :(
update = function()
local hasData, leaderNeeds, tankNeeds, healerNeeds, dpsNeeds, _, _, _, _, _, _, _ = GetLFGQueueStats()
 
if not MiniMapLFGFrame.lfgindicators then -- setup indicators
MiniMapLFGFrame.lfgindicators = CreateFrame("Frame", nil, MiniMapLFGFrame)
MiniMapLFGFrame.lfgindicators:SetScript("OnUpdate", function(this, a1)
this.elap = (this.elap or 0) + a1
if this.elap < 1.5 then return end
this.elap = 0
update()
end)
local temp = 180 / math.pi / (NUM_DAMAGERS + 2)
for i = 1, NUM_DAMAGERS + 2, 1 do
local t = MiniMapLFGFrame.lfgindicators:CreateTexture(nil, "OVERLAY")
t:SetTexture("Interface\\AddOns\\LFGStatusIcon\\indicator.tga")
t:SetWidth(5)
t:SetHeight(5)
t:SetPoint("CENTER", MiniMapLFGFrame, "CENTER", 11 * math.cos((i - 1) * temp - 0.32), 11 * math.sin((i - 1) * temp - 0.32))
MiniMapLFGFrame.lfgindicators[i] = t
end
end
if not hasData or not dpsNeeds then -- hide indicators if no data available
for i = 1, NUM_DAMAGERS + 2, 1 do
MiniMapLFGFrame.lfgindicators[i]:SetVertexColor(1, 1, 1, 0)
end
return
end
 
for i = 1, NUM_DAMAGERS, 1 do
if i <= (NUM_DAMAGERS - dpsNeeds) then
MiniMapLFGFrame.lfgindicators[i]:SetVertexColor(1, 0, 0, 0.9)
else
MiniMapLFGFrame.lfgindicators[i]:SetVertexColor(1, 0.9, 0.9, 0.5)
end
end
if healerNeeds == 0 then
MiniMapLFGFrame.lfgindicators[NUM_DAMAGERS + 1]:SetVertexColor(0, 1, 0, 0.9)
else
MiniMapLFGFrame.lfgindicators[NUM_DAMAGERS + 1]:SetVertexColor(0.9, 1, 0.9, 0.5)
end
if tankNeeds == 0 then
MiniMapLFGFrame.lfgindicators[NUM_DAMAGERS + 2]:SetVertexColor(0, 0, 1, 0.9)
else
MiniMapLFGFrame.lfgindicators[NUM_DAMAGERS + 2]:SetVertexColor(0.9, 0.9, 1, 0.5)
end
end
 
hooksecurefunc("LFDSearchStatus_Update", update)
MiniMapLFGFrame:HookScript("OnShow", update)
if MiniMapLFGFrame:IsShown() then
update()
end
LFGStatusIcon/LFGStatusIcon.toc New file
0,0 → 1,11
## Interface: 30300
## Title: LFGStatusIcon
## Notes: Adds queue status indicators to LFG minimap icon
## Author: TotalPackage
## X-Category: Interface Enhancements
## Version: 3.3.001
 
## LoadManagers: AddonLoader
## X-LoadOn-Always: delayed
 
core.lua