/
 |
phUnitFrame = { |
phUnitFrame = { |
create = function(parent,frame) |
local config = parent.config; |
local model = phUnitFramesModels[config.model]; |
createTooltip = function(button,unit) |
if unit and UnitExists(unit) then |
GameTooltip:SetOwner(button, "ANCHOR_BOTTOMRIGHT", 0, 0); |
if button.auraIndex and button.filter then |
if button.auraIndex and button.auraIndex > 0 and button.filter then |
GameTooltip:SetOwner(button, "ANCHOR_BOTTOMRIGHT", 0, 0); |
GameTooltip:SetUnitAura(unit,button.auraIndex,button.filter); |
else |
-- GameTooltip:AddLine(button:GetAlpha()); |
-- GameTooltip:AddLine(button:IsShown()); |
-- GameTooltip:AddLine(button.aura.icon); |
if button.tooltip and not InCombatLockdown() then |
GameTooltip:AddLine (" "); |
GameTooltip:AddLine (phLib.getLocale("Cast spells on %s",UnitName(unit)).." :",1,1,1); |
for i,msg in pairs(button.tooltip) do |
GameTooltip:AddLine (msg); |
end; |
end; |
GameTooltip:Show(); |
elseif not InCombatLockdown() then |
GameTooltip:SetOwner(button, "ANCHOR_BOTTOMRIGHT", 0, 0); |
GameTooltip:SetUnit(unit); |
end |
if button.tooltip then |
GameTooltip:AddLine (" "); |
GameTooltip:AddLine (phLib.getLocale("Cast spells on %s",UnitName(unit)).." :",1,1,1); |
for i,msg in pairs(button.tooltip) do |
GameTooltip:AddLine (msg); |
end; |
end; |
GameTooltip:Show(); |
if button.tooltip then |
GameTooltip:AddLine (" "); |
GameTooltip:AddLine (phLib.getLocale("Cast spells on %s",UnitName(unit)).." :",1,1,1); |
for i,msg in pairs(button.tooltip) do |
GameTooltip:AddLine (msg); |
end; |
end; |
GameTooltip:Show(); |
end; |
end; |
end, |
end; |
frame.ibar:SetMinMaxValues(0,UnitHealthMax(unit)); |
frame.ibar:SetValue(UnitHealth(unit)+UnitGetIncomingHeals(unit)); |
local ival = UnitHealth(unit); |
local x = UnitGetIncomingHeals(unit); |
if x then |
ival = ival + x; |
end |
frame.ibar:SetValue(ival); |
frame.bar:SetMinMaxValues(0,UnitHealthMax(unit)); |
frame.bar:SetValue(UnitHealth(unit)); |
auraCount = i; |
end; |
for i=1,table.getn(buttons) do |
local button = buttons[i]; |
if button.isSecure then |
button:SetAlpha(0); |
else |
button:Hide(); |
end; |
end; |
local b; |
for i=1,table.getn(buttons) do |
local button = buttons[i]; |
end; |
if found then |
phUnitFrame.updateAura(button,bconfig.filter,found,count); |
else |
button.auraIndex = 0; |
button:SetAlpha(0); |
end; |
end |
end; |
for i=1,table.getn(order) do |
if not buttons[b] then |
return; |
local button = buttons[b]; |
if not button then |
break; |
end; |
local count = 0; |
end; |
if found then |
phUnitFrame.updateAura(buttons[b],bconfig.filter,found,count); |
phUnitFrame.updateAura(button,bconfig.filter,found,count); |
b = b + 1; |
end; |
end; |
while true do |
local button = buttons[b]; |
if not button then |
break; |
end; |
button.auraIndex = 0; |
if button.isSecure then |
button:SetAlpha(0); |
else |
button:Hide(); |
end; |
b = b + 1; |
end; |
--[[ |
local j = 1; |
for i=1,table.getn(buttons) do |
updateAura = function(button,filter,aura,count) |
button.filter = filter; |
button.auraIndex = aura.index; |
button.aura = aura; |
if (count > 1) then |
button.count:SetText(count); |
else |
end |
if aura.duration then |
CooldownFrame_SetTimer(button.cooldown,aura.expirationTime-aura.duration,aura.duration,1); |
button.cooldown:SetAlpha(1); |
button.cooldown:Show(); |
--button.cooldown:SetAlpha(1); |
else |
buff.cooldown:SetAlpha(0); |
button.cooldown:Hide(); |
--button.cooldown:SetAlpha(0); |
end; |
button.icon:SetTexture(aura.icon); |
if button.isSecure then |
button:SetAlpha(1); |
else |
button:SetAlpha(1); |
if not button.isSecure then |
button:Show(); |
end; |
end, |
end; |
print(name,spellId,icon); |
end; |
end; |
for i=1,100 do |
local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitAura(unit,i,"HARMFUL"); |
if name == nil then |
break; |
end; |
print(name,spellId,icon); |
end; |
end; |
phMenuFrame = CreateFrame("Frame", "phMenuFrame", UIParent, "UIDropDownMenuTemplate"); |
79107, -- Ombre |
588, -- Feu Intérieur |
15286, -- Etreinte Vampirique |
73413, -- Volonté intérieure |
47788, -- Esprit Gardien |
6346, -- Gardian Peur |
77487, -- Orbre d'ombre |
139, -- Renovation |
17, -- Bouclier |
41635, -- Priere de Guérison |
15357, -- Inspiration |
70772, -- Bonus T10 |
}, |
combat = { |
47788, -- Esprit Gardian |
6346, -- Gardian Peur |
77487, -- Orbre d'ombre |
139, -- Renovation |
17, -- Bouclier |
41635, -- Priere de Guérison |
15357, -- Inspiration |
70772, -- Bonus T10 |
15357, -- Inspiration |
}, |
spells = { |
{ |