PHP код:
do
local function GetUnitIDByGUID(g)
if UnitGUID("player") == g then return "player" end
local num,u; if nraid > 0 then num,u=nraid,"raid" else num,u=GetNumPartyMembers(),"party" end
for i=1,num do if UnitGUID(u..i) == g then return u..i elseif UnitGUID(u.."pet"..i) then return u.."pet"..i end end
end
function HealBot_Panel_GetBlackList()
for g in pairs(HealBot_Panel_BlackList) do
local u = GetUnitIDByGUID(g)
if u then
local name
if u:find("pet") then
local n,c,h = u:gsub("pet","")
local c = RAID_CLASS_COLORS[(select(2,UnitClass(n)))]
local h = string.format("|cff%02x%02x%02x",c.r*255,c.g*255,c.b*255)
name = UnitName(u) .." <"..h.. UnitName(n).."|cffcc99ff>"
else
local c,h = RAID_CLASS_COLORS[(select(2,UnitClass(u)))]
h = string.format("|cff%02x%02x%02x",c.r*255,c.g*255,c.b*255)
name = h..UnitName(u).."|cffcc99ff"
end
print("|cffcc99ff|HHealBot:"..g.."|h["..name.." "..u.."]|h|r")
end
end
end
local o = ItemRefTooltip.SetHyperlink;
function ItemRefTooltip:SetHyperlink(link)
if link:sub(1,7) == "HealBot" then HealBot_Panel_BlackList[link:sub(9)]=nil
if Delay_RecalcParty<2 then Delay_RecalcParty=2 end
else o(self, link)
end
end
local b = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate")
b:RegisterEvent("VARIABLES_LOADED")
b:SetScript("OnEvent",function(b) b:SetParent(HealBot_Options_Panel1) b:SetPoint("BOTTOMLEFT", HealBot_Options_CommandsButton,"TOPLEFT") end)
b:SetSize(85,22)
b:SetText("Black list")
b:SetScript("OnClick",HealBot_Panel_GetBlackList)
end