WoWInterface SVN PowerAurasClassic

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 24 to Rev 23
    Reverse comparison

Rev 24 → Rev 23

trunk/PowerAuras/localisation_koKR.lua File deleted \ No newline at end of file
trunk/PowerAuras/PowerBlizzOptions.xml File deleted
trunk/PowerAuras/localisation.lua
155,7 → 155,6
nomOwnTex = "Use own Texture",
aideOwnTex = "Use the De/Buff or Ability Texture instead.",
nomStacks = "Stacks",
nomUpdateSpeed = "Update speed",
nomSpeed = "Animation speed",
nomBegin = "Begin Animation",
nomEnd = "End Animation",
167,7 → 166,7
nomGCD = "Global Cooldown",
nomThreshold = "Threshold",
nomStance = "Stance",
aideThreshInv = "Check this to invert the threshold logic. Unchecked = Low Warning / Checked = High Warning.",
aideThreshInv = "Check this to invert the threshold logic. Health/Mana: default = Low Warning / checked = High Warning. Energy/Rage/Power: default = High Warning / checked = Low Warning",
nomThreshInv = "</>",
nomMine = "Cast by me",
nomDispellable = "I can dispell",
217,8 → 216,6
aideSelectTimer = "Select which timer will show the duration",
aideSelectTimerBuff = "Select which timer will show the duration (this one is reserved for player's buffs)",
aideSelectTimerDebuff = "Select which timer will show the duration (this one is reserved for player's debuffs)",
 
nomCheckShowStacks = "Show",
 
nomCheckInverse = "Invert",
aideInverse = "Invert the logic to show this effect only when buff/debuff is not active.",
241,7 → 238,6
nomTabActiv = "Activation",
nomTabSound = "Sound",
nomTabTimer = "Timer",
nomTabStacks = "Stacks",
nomWowTextures = "WoW Textures",
nomCustomTextures = "Custom Textures",
nomTextAura = "Text Aura",
trunk/PowerAuras/PowerAuras.lua
129,14 → 129,7
--- drag it to an actionbar (doesn't have to be a visible one)
 
-- Exposed for Saving
PowaMisc =
{
disabled = false,
debug = false,
OnUpdateLimit = 0,
AnimationLimit = 0,
};
 
PowaMisc = {};
PowaSet = {};
PowaTimer = {};
 
160,14 → 153,14
PowaAuras_Frame:Show(); -- Show Main Options Frame
self:RegisterEvents(PowaAuras_Frame);
end
PowaMisc.disabled = false;
self.Misc.disabled = false;
else
if PowaAuras_Frame and PowaAuras_Frame:IsShown() then
PowaAuras_Frame:UnregisterAllEvents();
PowaAuras_Frame:Hide();
end
self:OptionHideAll(true);
PowaMisc.disabled = true;
self.Misc.disabled = true;
end
end
 
176,7 → 169,7
--- Setting up the Import/Export static popups
self:SetupStaticPopups();
 
if (not PowaMisc.disabled) then
if (not self.Misc.disabled) then
self:RegisterEvents(frame);
end
 
291,13 → 284,11
function PowaAuras:VARIABLES_LOADED(...)
DEFAULT_CHAT_FRAME:AddMessage("|cffB0A0ff<Power Auras Classic>|r |cffffff00"..self.Version.."|r - "..self.Text.welcome);
 
PowaMisc.OnUpdateLimit = PowaMisc.OnUpdateLimit or 0;
PowaMisc.AnimationLimit = PowaMisc.AnimationLimit or 0;
 
if (TestPA==nil) then
PowaState = {};
end
 
self.Misc = PowaMisc;
_, self.playerclass = UnitClass("player");
 
self:LoadAuras();
319,11 → 310,12
getglobal("PowaBarAuraTextureSlider"):SetMinMaxValues(1, self.maxtextures);
getglobal("PowaBarAuraTextureSliderHigh"):SetText(self.maxtextures);
 
self.Initialising = false;
self:CreateEffectLists();
end
 
function PowaAuras:PLAYER_ENTERING_WORLD(...)
if (PowaMisc.disabled == true) then
if (self.Misc.disabled == true) then
self:Toggle(false);
return;
end
340,6 → 332,10
end
end
 
for key in pairs(self.DoCheck) do
self.DoCheck[key] = true;
end
 
if UnitIsDeadOrGhost("player") then
self.WeAreAlive = false;
end
356,10 → 352,6
self:GetStances();
 
self:MemorizeActions();
 
self.Initialising = false;
 
self.DoCheck.All = true;
end
 
function PowaAuras:GetStances()
747,14 → 739,14
 
function PowaAuras:SPELL_UPDATE_COOLDOWN(...)
if (self.ModTest == false) then
self.DoCheck.OwnSpells = true;
self.DoCheck.OwnSpell = true;
--self:Message("SPELL_UPDATE_COOLDOWN", ...);
end
end
 
function PowaAuras:SPELL_UPDATE_USABLE(...)
if (self.ModTest == false) then
self.DoCheck.OwnSpells = true;
self.DoCheck.OwnSpell = true;
--self:Message("SPELL_UPDATE_USABLE", ...);
end
end
767,30 → 759,6
end
end
 
function PowaAuras:UNIT_THREAT_SITUATION_UPDATE(...)
local unit = ...;
if (self.ModTest == false) then
--self:Message("UNIT_THREAT_SITUATION_UPDATE ", unit);
if unit == "player" then
self.DoCheck.Aggro = true;
return;
end
 
for i=1,GetNumPartyMembers() do
if unit == "party"..i then
self.DoCheck.PartyAggro = true;
break;
end
end
for i=1, GetNumRaidMembers() do
if unit == "raid"..i then
self.DoCheck.RaidAggro = true;
break;
end
end
end
end
 
function PowaAuras:CustomTexPath(customname)
local texpath;
if string.find(customname,".", 1, true) then
833,31 → 801,10
return self.TimerFrame[auraId][1], self.TimerFrame[auraId][2];
end
 
function PowaAuras:CreateStacksFrameIfMissing(auraId)
if (not self.StacksFrames[auraId]) then
--self:Message("Creating missing StacksFrame for aura "..tostring(auraId));
local frame = CreateFrame("Frame", "StacksFrame"..auraId);
self.StacksFrames[auraId] = frame;
 
frame:SetFrameStrata("LOW");
frame:Hide();
 
frame.texture = frame:CreateTexture(nil,"BACKGROUND");
frame.texture:SetBlendMode("ADD");
frame.texture:SetAllPoints(frame);
if (self.Auras[auraId].Stacks.Transparent) then
frame.texture:SetTexture("Interface\\Addons\\PowerAuras\\timersTransparent.tga");
else
frame.texture:SetTexture("Interface\\Addons\\PowerAuras\\timers.tga");
end
end
self:UpdateOptionsStacks(auraId);
return self.StacksFrames[auraId];
end
 
--- ----------------------------------------------------------------------------------------------- CREE LA LISTE DES CHECKS
 
function PowaAuras:CreateEffectLists()
if (self.Initialising) then return; end
 
for k in pairs(self.AurasByType) do
self.AurasByType[k] = {};
870,7 → 817,7
end
end
 
if (PowaMisc.debug == true) then
if (self.Misc.debug == true) then
for k in pairs(self.AurasByType) do
self:Message(k .. " : " .. #self.AurasByType[k]); --OK
end
989,7 → 936,7
end
 
if shouldShow then
if (not aura.Showing or aura.HideRequest) then
if (not aura.Showing) then
--self:Message("ShowAura ", aura.buffname, " (",auraId,") ", reason);
self:DisplayAura(auraId);
end
1028,7 → 975,6
--- -----------------------------------------------------------------------------------------------------------
function PowaAuras:ShowAuraForFirstTime(aura)
self:UnitTestInfo("ShowAuraForFirstTime", aura.id);
--self:Message("ShowAuraForFirstTime ", aura.id);
local auraId = aura.id;
 
if (self.ModTest == false) then
1110,7 → 1056,6
frame.statut = 0;
 
aura.TimeShown = 0;
aura.DurationExpired = false;
if (aura.Timer and aura.timerduration) then
aura.Timer.CustomDuration = aura.timerduration;
end
1133,10 → 1078,6
frame:Show(); -- Show Aura Frame
 
aura.Showing = true;
if (aura.Timer) then
aura.Timer.HideRequest = false;
end
if (aura.Stacks) then aura.Stacks.HideRequest = false; end
aura.HideRequest = false;
self:ShowSecondaryAuraForFirstTime(aura);
end
1252,149 → 1193,361
 
--self:Message("DisplayAura aura ", aura);
 
if (not aura.Showing or aura.HideRequest) then
if (not aura.Showing) then --- si pas en cours
self:ShowAuraForFirstTime(aura);
end
end
 
--- ------------------------------------------------------------------------------------------------- ON UPDATE
function PowaAuras:AnimateAura(aura, elapsed)
self:UnitTestInfo("AnimateAura", aura.id, elapased);
 
 
local frame = aura:GetFrame();
 
function PowaAuras:UpdateAura(aura, elapsed)
--self:Message("UpdateAura ", aura.id, " ", elapsed);
if (aura == nil) then
self:UnitTestInfo("UpdateAura: Don't show, aura missing");
--self:Message("UpdateAura: Don't show, aura missing");
return;
end
if (aura.off) then
if (not aura.Showing and not aura:TimerShowing() and not aura:StacksShowing()) then
self:UnitTestInfo("UpdateAura: Don't show, off=", aura.off);
--self:Message("UpdateAura: Don't show, off=", aura.off);
return;
end
aura.HideRequest = true;
if (aura.Timer) then aura.Timer.HideRequest = true; end
end
--if (not aura.Showing and not aura:TimerShowing() and not aura:StacksShowing()) then
--self:UnitTestInfo("UpdateAura: Nothing Showing");
--self:Message("UpdateAura: Nothing Showing");
--return;
--end
self.curScale.w=frame.baseL;
self.curScale.h=frame.baseH;
 
--self:Message("aura.Showing ", aura.Showing);
if (aura.Showing) then
local frame = aura:GetFrame();
if (frame == nil) then
self:UnitTestInfo("UpdateAura: Don't show, frame missing");
--self:Message("UpdateAura: Don't show, frame missing");
return;
 
--- Animations ----------------------------------------------------------------------
self:UnitTestInfo("Animation type", aura.anim1);
 
--- Animation 1 : aucune
if (aura.anim1 == 1) then
 
--- Animation 2 : max alpha <-> mi-alpha
elseif (aura.anim1 == 2) then
 
self.minScale.a = aura.alpha * 0.5 * aura.speed;
self.maxScale.a = aura.alpha;
 
if (frame.statut == 0) then
self.curScale.a = frame:GetAlpha() - (elapsed / 2);
frame:SetAlpha( self.curScale.a )
if (frame:GetAlpha() < self.minScale.a) then
frame:SetAlpha(self.minScale.a);
frame.statut = 1;
end
else
self.curScale.a = frame:GetAlpha() + (elapsed / 2);
if (self.curScale.a > 1.0) then self.curScale.a = 1.0; end --- pas trop haut non plus
frame:SetAlpha( self.curScale.a )
if (frame:GetAlpha() >= self.maxScale.a) then
frame:SetAlpha(self.maxScale.a);
frame.statut = 0;
end
end
--self:Message("UpdateAura ", aura, " ", elapsed);
 
if (not aura.HideRequest and not aura.isSecondary and not self.ModTest and not aura.DurationExpired and aura.duration > 0) then
aura.TimeShown = aura.TimeShown + elapsed;
if (aura.TimeShown > aura.duration) then --- If duration has expired then hide this aura
self:UnitTestInfo("UpdateAura: Hide, duration expired");
--self:Message("UpdateAura: Hide, duration expired");
aura.HideRequest = true;
aura.DurationExpired = true;
--- Animation 3 : mini-zoom in repetitif + fading
elseif (aura.anim1 == 3) then
self.minScale.w = self.curScale.w * 0.90;
self.minScale.h = self.curScale.h * 0.90;
self.maxScale.w = self.curScale.w * 1.20;
self.maxScale.h = self.curScale.h * 1.20;
local speedScale = (25 * aura.speed) * aura.size;
 
if (frame.statut == 1) then --- decale anim 2
frame:SetWidth(self.curScale.w * 1.15);
frame:SetHeight(self.curScale.h * 1.15);
frame.statut = 0;
end
 
frame:SetWidth( frame:GetWidth() + (elapsed * speedScale) )
frame:SetHeight( frame:GetHeight() + (elapsed * speedScale) )
 
frame:SetAlpha( ((self.maxScale.w - frame:GetWidth()) / (self.maxScale.w - self.minScale.w)) * aura.alpha );
 
if (frame:GetWidth() > self.maxScale.w) then
frame:SetWidth(self.minScale.w);
frame:SetHeight(self.minScale.h);
end
--- Animation 4 : mini-zoom in/out
elseif (aura.anim1 == 4) then
self.minScale.w = self.curScale.w * 0.95;
self.minScale.h = self.curScale.h * 0.95;
self.maxScale.w = self.curScale.w * 1.05;
self.maxScale.h = self.curScale.h * 1.05;
local speedScale = (50 * aura.speed) * aura.size;
 
if (frame.statut == 0) then
frame:SetWidth( frame:GetWidth() + (elapsed * speedScale * aura.torsion) )
frame:SetHeight( frame:GetHeight() + (elapsed * speedScale * (2-aura.torsion) ) )
if (frame:GetWidth() > self.maxScale.w) then
frame:SetWidth(self.maxScale.w);
frame:SetHeight(self.maxScale.h);
frame.statut = 1;
end
else
frame:SetWidth( frame:GetWidth() - (elapsed * speedScale * aura.torsion) )
frame:SetHeight( frame:GetHeight() - (elapsed * speedScale * (2-aura.torsion) ) )
if (frame:GetWidth() < self.minScale.w) then
frame:SetWidth(self.minScale.w);
frame:SetHeight(self.minScale.h);
frame.statut = 0;
end
end
--- Animation 5 : effet bulle
elseif (aura.anim1 == 5) then
self.minScale.w = self.curScale.w * 0.95;
self.minScale.h = self.curScale.h * 0.95;
self.maxScale.w = self.curScale.w * 1.05;
self.maxScale.h = self.curScale.h * 1.05;
local speedScale = (50 * aura.speed) * aura.size;
 
if (frame.statut == 0) then
frame:SetWidth( frame:GetWidth() + (elapsed * speedScale * aura.torsion) )
frame:SetHeight( frame:GetHeight() - (elapsed * speedScale * (2-aura.torsion) ) )
if (frame:GetWidth() > self.maxScale.w) then
frame:SetWidth(self.maxScale.w);
frame:SetHeight(self.minScale.h);
frame.statut = 1;
end
else
frame:SetWidth( frame:GetWidth() - (elapsed * speedScale * aura.torsion) )
frame:SetHeight( frame:GetHeight() + (elapsed * speedScale * (2-aura.torsion) ) )
if (frame:GetHeight() > self.maxScale.h) then
frame:SetWidth(self.minScale.w);
frame:SetHeight(self.maxScale.h);
frame.statut = 0;
end
end
--- position au hasard + zoom in + fade (water-drop)
elseif (aura.anim1 == 6) then
if (frame:GetAlpha() > 0) then
self.curScale.a = frame:GetAlpha() - (elapsed * aura.alpha * 0.5 * aura.speed);
if (self.curScale.a < 0) then frame:SetAlpha(0.0);
else frame:SetAlpha(self.curScale.a); end
self.maxScale.w = frame:GetWidth() + (elapsed * 100 * aura.speed * aura.size);
self.maxScale.h = frame:GetHeight() + (elapsed * 100 * aura.speed * aura.size);
if ( (self.maxScale.w * 1.5) > frame:GetWidth()) then --- evite les lags
frame:SetWidth(self.maxScale.w)
frame:SetHeight(self.maxScale.h)
end
else
self.maxScale.w = (random(0,20) - 10) * aura.speed;
self.maxScale.h = (random(0,20) - 10) * aura.speed;
frame:SetAlpha(aura.alpha);
frame:SetWidth(self.curScale.w * 0.85);
frame:SetHeight(self.curScale.h * 0.85);
frame:SetPoint("Center",aura.x + self.maxScale.w, aura.y + self.maxScale.h);
end
--- static sauf parfois ou la texture est decalee + opaque (type electrique)
elseif (aura.anim1 == 7) then
if (frame.statut < 2) then
frame:SetAlpha(aura.alpha / 2); --- mi-alpha
if (random( 210-(aura.speed*100) ) == 1) then
frame.statut = 2;
self.maxScale.w = random(0,10) - 5;
self.maxScale.h = random(0,10) - 5;
frame:SetPoint("Center",aura.x + self.maxScale.w, aura.y + self.maxScale.h);
frame:SetAlpha(aura.alpha);
end
else
frame:SetPoint("Center",aura.x, aura.y);
frame.statut = 0;
end
--- zoom out + stop + fade
elseif (aura.anim1 == 8) then
self.minScale.w = self.curScale.w;
self.minScale.h = self.curScale.h;
self.maxScale.w = self.curScale.w * 1.30;
self.maxScale.h = self.curScale.h * 1.30;
local speedScale = (50 * aura.speed) * aura.size;
 
if (aura.HideRequest) then
if (aura.Timer and self.ModTest) then
aura.Timer.HideRequest = true;
if (frame.statut == 0) then --- demarre le zoom out (max size)
frame:SetWidth(self.maxScale.w);
frame:SetHeight(self.maxScale.h);
frame:SetAlpha(0.0);
frame.statut = 2;
elseif (frame.statut == 2) then --- zoom out + fade in
frame:SetWidth( frame:GetWidth() - (elapsed * speedScale * aura.torsion) )
frame:SetHeight( frame:GetHeight() - (elapsed * speedScale * (2-aura.torsion) ) )
 
frame:SetAlpha( ((self.maxScale.w - frame:GetWidth()) / (self.maxScale.w - self.minScale.w)) * aura.alpha );
 
if (frame:GetWidth() < self.curScale.w) then
frame:SetWidth(self.curScale.w);
frame:SetHeight(self.curScale.h);
frame.statut = 1;
end
elseif (frame.statut == 1) then --- demarre le fade-out
frame:SetWidth(self.curScale.w);
frame:SetHeight(self.curScale.h);
frame:SetAlpha(aura.alpha);
frame.statut = 3;
 
if (aura.Stacks) then
aura.Stacks.HideRequest = true;
aura.Stacks:Hide();
elseif (frame.statut == 3) then --- fade-out
self.curScale.a = frame:GetAlpha() - (elapsed / random(1,2));
 
if (self.curScale.a < 0.0) then
frame:SetAlpha(0.0);
frame.statut = 0;
else
frame:SetAlpha(self.curScale.a);
end
--self:Message("Hide Requested for ",aura.id);
aura.animation = self:AnimationEndFactory(aura.finish, aura, frame);
if (not aura.animation) then
aura:Hide();
end
end
--- deplacement vers le haut + fade-out + reduction
elseif (aura.anim1 == 9) then
local speedScale = (50 * aura.speed) * aura.size;
 
if (frame.statut < 2) then --- debut
frame:SetWidth(self.curScale.w);
frame:SetHeight(self.curScale.h);
frame:SetPoint("Center",aura.x, aura.y);
frame:SetAlpha(aura.alpha);
frame.statut = 2;
else
_,_,_,xOfs,yOfs = frame:GetPoint();
frame:SetPoint("Center",xOfs + (random(1,3)-2), yOfs + (elapsed * random(10,20)));
self.curScale.a = frame:GetAlpha() - ( (elapsed / random(2,4)) * aura.alpha);
 
self:UpdateAuraAnimation(aura, elapsed);
frame:SetWidth( frame:GetWidth() - (elapsed * speedScale * aura.torsion) )
frame:SetHeight( frame:GetHeight() - (elapsed * speedScale * (2-aura.torsion) ) )
 
if (aura.Stacks and not aura.Stacks.HideRequest) then
aura.Stacks:Update();
if (self.curScale.a < 0.0) then
frame:SetAlpha(0.0);
frame.statut = 1;
else
frame:SetAlpha(self.curScale.a);
end
end
end
 
if (aura.isSecondary) then return; end
 
if (aura.Timer) then
if (aura.Timer.HideRequest) then
aura.Timer:Hide();
--- rotation autour du centre
elseif (aura.anim1 == 10) then
self.maxScale.w = math.max(aura.x, -aura.x, 5) * 1.0;
self.maxScale.h = self.maxScale.w * (1.6 - aura.torsion);
local speedScale = elapsed * 75 * aura.speed;
 
if (aura.isSecondary and (self.Frames[aura.id].anim1 == 10)) then
if (aura.symetrie < 2) then
frame.statut = self.Frames[aura.id].statut + 180;
if (frame.statut > 360) then frame.statut = frame.statut - 360; end
else
frame.statut = 180-self.Frames[aura.id].statut;
if (frame.statut < 0) then frame.statut = frame.statut + 360; end
end
elseif (aura.symetrie == 1 or aura.symetrie == 3) then
frame.statut = frame.statut - speedScale;
if (frame.statut < 0) then frame.statut = 360; end
else
aura.Timer:Update(elapsed);
frame.statut = frame.statut + speedScale;
if (frame.statut > 360) then frame.statut = 0; end
end
 
--- annule la torsion
frame:SetWidth(self.curScale.w / aura.torsion);
frame:SetHeight(self.curScale.h / (2-aura.torsion));
--- annule la symetrie
if not aura.textaura == true then
local texture = aura:GetTexture();
if (texture) then
texture:SetTexCoord(0, 1, 0, 1);
end
end
 
--- transparence
if (frame.statut < 180) then --- zone de transparence
if (frame.statut < 90) then
frame:SetAlpha( (1-(frame.statut / 90)) * aura.alpha );
else
frame:SetAlpha( ((frame.statut-90) / 90) * aura.alpha );
end
else
frame:SetAlpha(aura.alpha);
end
 
frame:SetPoint("Center",self.maxScale.w * cos(frame.statut), (self.maxScale.h * sin(frame.statut)) + aura.y);
end
 
aura.HideRequest = false;
 
 
end
 
function PowaAuras:UpdateAuraAnimation(aura, elapsed)
if (not aura.Showing) then return; end
if (not aura.animation or elapsed==0) then return; end
 
local finished = aura.animation:Update(math.min(elapsed, 0.03));
function PowaAuras:UpdateAura(aura, elapsed)
--self:Message("UpdateAura ", aura, " ", elapsed);
if (aura == nil) then
self:UnitTestInfo("UpdateAura: Don't show, aura missing");
return;
end
if (aura.off or not aura.Showing) then
self:UnitTestInfo("UpdateAura: Don't show, ", aura.off, aura.Showing);
return;
end
local frame = aura:GetFrame();
if (frame == nil) then
self:UnitTestInfo("UpdateAura: Don't show, frame missing");
return;
end
--self:Message("UpdateAura ", aura, " ", elapsed);
 
if (not finished) then return end
if (aura.HideRequest) then
--self:Message("Hide Requested for ",aura.id);
aura.HideRequest = false;
aura.animation = self:AnimationEndFactory(aura.finish, aura, frame);
if (not aura.animation) then
aura:Hide();
return;
end
end
 
if (aura.animation.IsBegin) then
aura.animation = self:AnimationMainFactory(aura.anim1, aura, frame);
local secondaryAura = self.SecondaryAuras[aura.id];
if (secondaryAura) then
local secondaryAuraFrame = self.SecondaryFrames[aura.id];
if (secondaryAuraFrame) then
secondaryAura.animation = self:AnimationMainFactory(aura.anim2, secondaryAura, secondaryAuraFrame);
if (not aura.isSecondary) then
if (self.ModTest == false) then
if (aura.duration > 0) then
aura.TimeShown = aura.TimeShown + elapsed;
if (aura.TimeShown > aura.duration) then --- If duration has expired then hide this aura
self:UnitTestInfo("UpdateAura: Hide, duration expired");
aura.HideRequest = true;
return;
end
end
end
aura.Timer:Update(elapsed);
end
 
if (aura.animation) then
local finished = aura.animation:Update(elapsed);
if (finished) then
if (aura.animation.IsBegin) then
aura.animation = self:AnimationMainFactory(aura.anim1, aura, frame);
local secondaryAura = self.SecondaryAuras[aura.id];
if (secondaryAura) then
local secondaryAuraFrame = self.SecondaryFrames[aura.id];
if (secondaryAuraFrame) then
secondaryAura.animation = self:AnimationMainFactory(aura.anim2, secondaryAura, secondaryAuraFrame);
end
end
elseif (aura.animation.IsEnd) then
aura:Hide();
end
end
return;
else
self:AnimateAura(aura, elapsed);
end
 
if (aura.animation.IsEnd) then
aura:Hide();
end
 
end
 
function PowaAuras:OnUpdate(elapsed)
--- lance les checks de la cible
self:UnitTestInfo("OnUpdate", elapsed);
 
if (self.Initialising) then return; end
 
self.DebugTimer = self.DebugTimer + elapsed;
self.ChecksTimer = self.ChecksTimer + elapsed;
self.AnimationThrottleTimer = self.AnimationThrottleTimer + elapsed;
self.ThrottleTimer = self.ThrottleTimer + elapsed;
if (self.Initialising) then return; end --- Addon Disabled
 
local checkAura = false;
if (PowaMisc.OnUpdateLimit == 0 or self.ThrottleTimer >= PowaMisc.OnUpdateLimit) then
checkAura = true;
self.ThrottleTimer = 0;
end
 
if (not self.ModTest and checkAura) then
if (self.ModTest == false) then
 
--self:Message("OnUpdate ",elapsedCheck, " ", self.ChecksTimer);
--self:Message("OnUpdate ",elapsed, " ", self.ChecksTimer);
self.ChecksTimer = self.ChecksTimer + elapsed;
self:UnitTestInfo("ChecksTimer", self.ChecksTimer, self.NextCheck);
if (self.ChecksTimer > (self.NextCheck + PowaMisc.OnUpdateLimit)) then
if (self.ChecksTimer > self.NextCheck) then
self.ChecksTimer = 0;
local isMountedNow = (IsMounted()~=nil);
if (isMountedNow ~= self.WeAreMounted) then
self.DoCheck.All = true;
self.WeAreMounted = isMountedNow;
end
self.DoCheck.Enchants = true;
self.DoCheck.OwnSpells = true;
if (self.ModTest == false) then
local isMountedNow = (IsMounted()~=nil);
if (isMountedNow ~= self.WeAreMounted) then
self.DoCheck.All = true;
self.WeAreMounted = isMountedNow;
end
self.DoCheck.Enchants = true;
end
end
 
self.DebugTimer = self.DebugTimer + elapsed;
 
 
--- Usable pending Checks
if self.UsablePending then
self:UnitTestInfo("UsablePending");
1411,6 → 1564,7
end
end
 
--- lance les checks normaux
self:UnitTestInfo("DoCheck update");
for k ,v in pairs(self.DoCheck) do
self:Debug("DoCheck "..k.." = " .. tostring(v) );
1421,14 → 1575,8
end
end
 
if (PowaMisc.AnimationLimit > 0 and self.AnimationThrottleTimer < PowaMisc.AnimationLimit) then
return;
end
elapsed = self.AnimationThrottleTimer;
self.AnimationThrottleTimer = 0;
 
-- Update each aura (timers and animations)
self:UnitTestInfo("Aura updates");
-- Check each aura
self:UnitTestInfo("Aura checks");
for _, aura in pairs(self.Auras) do
self:UpdateAura(aura, elapsed);
end
1466,7 → 1614,6
local temptbl = {strsplit(";", aurastring)};
local importAuraSettings = {};
local importTimerSettings = {};
local hasTimerSettings = false;
 
for i, val in ipairs(temptbl) do
--self:Message(i, " ", val);
1474,10 → 1621,9
local varpref = string.sub(var,1,2);
var = string.sub(var,3);
if (string.sub(key,1,6) == "timer.") then
importTimerSettings[key] = self:ExtractImportValue(varpref, var);
hasTimerSettings = true;
importTimerSettings[key] = self:ExtractImportValue(varpref, var)
else
importAuraSettings[key] = self:ExtractImportValue(varpref, var);
importAuraSettings[key] = self:ExtractImportValue(varpref, var)
end
end
 
1502,9 → 1648,8
if (importAuraSettings.timer) then --backwards compatability
aura.Timer = cPowaTimer(aura.id);
end
 
--self:Message("hasTimerSettings=", hasTimerSettings);
if (hasTimerSettings) then
 
if (#importTimerSettings>0) then
--self:CreateTimerFrameIfMissing(aura.id)
if (aura.Timer==nil) then
aura.Timer = cPowaTimer(aura.id);
1630,17 → 1775,37
end
end
 
function PowaAuras:HideTimerFrame(auraId, i)
if (self.TimerFrame[auraId] and self.TimerFrame[auraId][i]) then
--self:Message("Hide Timer Frame 1 for ", auraId);
self.TimerFrame[auraId][i]:Hide();
end
end
 
function PowaAuras:OptionHideAll(now) --- Hide all auras
--self:Message("Hide All Frames now=", now);
for id, aura in pairs(self.Auras) do
function PowaAuras:HideTimerFrames(auraId)
if self.TimerFrame[auraId] then
self:HideTimerFrame(auraId, 1);
self:HideTimerFrame(auraId, 2);
end
end
 
function PowaAuras:DeleteTimerFrames(auraId)
self:HideTimerFrames(auraId);
if self.TimerFrame[auraId] then
self.TimerFrame[auraId][1] = nil;
self.TimerFrame[auraId][2] = nil;
self.TimerFrame[auraId] = nil;
end
end
 
function PowaAuras:OptionHideAll(now) --- cache tous les effets
--- force Hide on mod shutdown
for _, aura in pairs(self.Auras) do
if now then
--self:Message("Hide aura id=", id);
aura:Hide();
self:HideTimerFrames(aura.id);
else
aura.HideRequest = true;
if (aura.Timer) then aura.Timer.HideRequest = true; end
if (aura.Stacks) then aura.Stacks.HideRequest = true; end
end
end
 
trunk/PowerAuras/PowerAuras.toc
1,7 → 1,7
## Interface: 30200
## Title: Power Auras Classic |cff7f7fffv.2.6.2V|r
## Title: Power Auras Classic |cff7f7fffv.2.6.2Q|r
## Author: Smacker 'lolcat',Driizt 'classic',Garstiger 'continued',Sinsthar 'base'
## Version: 2.6.2V
## Version: 2.6.2Q
## Notes: Cool Effects around the player for ingame events. Authors: |cff7f7fff-Sinsthar-, -Garstiger-, -Driizt-, and -Smacker-|r
## Notes-frFR: Affiche des effets visuels autour du personnage.
## Notes-zhCN: 多功能条件触发式超酷特效音效
17,7 → 17,6
localisation_ruRU.lua
localisation_zhCN.lua
localisation_zhTW.lua
localisation_koKR.lua
PowerAurasDump.lua
PowerAurasClasses.lua
PowerAurasAnimations.lua
25,4 → 24,3
PowerOptions.lua
PowerAuras.xml
PowerOptions.xml
PowerBlizzOptions.xml
\ No newline at end of file
trunk/PowerAuras/localisation_zhTW.lua
183,7 → 183,6
nomOwnTex = "Use own Texture", -- untranslated
aideOwnTex = "Use the De/Buff or Ability Texture instead.", -- untranslated
nomStacks = "Stacks", -- untranslated
nomUpdateSpeed = "Update speed",
nomSpeed = "運動速度",
nomBegin = "進場效果",
nomEnd = "結束效果",
trunk/PowerAuras/localisation_ruRU.lua
158,7 → 158,6
nomOwnTex = "Своя текстуру",
aideOwnTex = "Используйте Де/Бафф или способность вместо текстур.",
nomStacks = "Сумма",
nomUpdateSpeed = "Update speed",
nomSpeed = "Скорость анимации",
nomBegin = "Начало анимации",
nomEnd = "Конец анимации",
trunk/PowerAuras/localisation_deDE.lua
150,7 → 150,6
 
nomStacks = "Stacks",
 
nomUpdateSpeed = "Update speed",
nomSpeed = "Animations Tempo",
nomBegin = "Animations Start",
nomEnd = "Animations Ende",
trunk/PowerAuras/localisation_zhCN.lua
155,7 → 155,6
aideOwnTex = "使用buff/debuff或技能的默认图标做为材质",
nomStacks = "叠加",
 
nomUpdateSpeed = "Update speed",
nomSpeed = "运动速度",
nomBegin = "进场效果",
nomEnd = "结束效果",
trunk/PowerAuras/PowerAurasClasses.lua
76,95 → 76,9
end
end
end
stacker.Showing = false;
stacker.id = id;
end);
function cPowaStacks:Update()
PowaAuras:UnitTestInfo("Stacks.Update ",self.id);
local aura = PowaAuras.Auras[self.id];
if (aura == nil) then
PowaAuras:UnitTestInfo("Stacks aura missing");
return;
end
if (self.enabled==false) then
PowaAuras:UnitTestInfo("Stacks disabled");
return;
end
local newvalue = 0;
if (PowaAuras.ModTest) then
newvalue = random(1,12);
else
newvalue = aura.StackCount;
end
if (not newvalue or newvalue==0) then
local frame = PowaAuras.StacksFrames[self.id];
if (frame and frame:IsVisible()) then
frame:Hide();
end
self.Showing = false;
return;
end
PowaAuras:CreateStacksFrameIfMissing(self.id);
self:ShowValue(aura, newvalue);
self.Showing = true;
self.HideRequest = false;
end
 
 
function cPowaStacks:ShowValue(aura, newvalue)
local frame = PowaAuras.StacksFrames[self.id];
if (aura.texmode == 1) then
frame.texture:SetBlendMode("ADD");
else
frame.texture:SetBlendMode("DISABLE");
end
local auraTexture = PowaAuras.Textures[self.id];
if (auraTexture) then
if auraTexture:GetObjectType() == "Texture" then
frame.texture:SetVertexColor(auraTexture:GetVertexColor());
elseif auraTexture:GetObjectType() == "FontString" then
frame.texture:SetVertexColor(auraTexture:GetTextColor());
end
else
timerFrame.texture:SetVertexColor(aura.r,aura.g,aura.b);
end
 
--PowaAuras:Message("newvalue=", newvalue);
 
local deci = math.floor(newvalue / 10);
local uni = math.floor(newvalue - (deci*10));
--PowaAuras:Message("Show stacks: ",deci, " ", uni);
local tStep = PowaAuras.Tstep;
if (deci==0) then
frame.texture:SetTexCoord(tStep , tStep * 1.5, tStep * uni, tStep * (uni+1));
else
frame.texture:SetTexCoord(tStep * uni, tStep * (uni+1), tStep * deci, tStep * (deci+1));
end
if (not frame:IsVisible()) then
--PowaAuras:Message("Show Stacks Frame for ", self.id);
frame:Show();
end
end
 
function cPowaStacks:Hide()
--PowaAuras:Message("Hide Stacks Frame for ", self.id, " ", self.Showing, " ", PowaAuras.StacksFrames[self.id]);
if (not self.Showing) then return; end
if (PowaAuras.StacksFrames[self.id]) then
PowaAuras.StacksFrames[self.id]:Hide();
end
self.Showing = false;
self.HideRequest = true;
end
 
function cPowaStacks:Delete()
self:Hide();
if PowaAuras.StacksFrames[self.id] then
PowaAuras.StacksFrames[self.id] = nil;
end
end
 
------- Timer -------
 
cPowaTimer = PowaClass(function(timer, id, base)
timer.enabled = false;
timer.x = 0;
187,7 → 101,6
end
end
end
timer.Showing = false;
timer.id = id;
--for k,v in pairs (timer) do
-- PowaAuras:Message(" "..tostring(k).."="..tostring(v));
198,33 → 111,20
--- ------------------------------------------------------------------------------------------------- TIMERS
function cPowaTimer:Update(elapsed)
PowaAuras:UnitTestInfo("Timer.Update ",self.id);
--PowaAuras:Message("Timer.Update ",self.id);
local aura = PowaAuras.Auras[self.id];
if (aura == nil) then
if (aura == nil) then --- cet effet n'affiche pas de timer
PowaAuras:UnitTestInfo("Timer aura missing");
--PowaAuras:Message("Timer aura missing");
return;
end
if (self.enabled==false) then
if (self.enabled==false) then --- cet effet n'affiche pas de timer
PowaAuras:UnitTestInfo("Timer disabled");
--PowaAuras:Message("Timer disabled");
return;
end
 
--PowaAuras:Message("Showing=", aura.Showing);
--PowaAuras:Message("CanHaveTimer=", aura.CanHaveTimer);
--PowaAuras:Message("CanHaveTimerOnInverse=", aura.CanHaveTimerOnInverse);
--PowaAuras:Message("Inverse=", aura.inverse);
--PowaAuras:Message("CooldownAura=", aura.CooldownAura);
local auraShowing = aura.Showing and not aura.HideRequest;
if (not PowaAuras.ModTest and ((not auraShowing and not aura.CooldownAura) or (auraShowing and aura.CooldownAura))) then
return;
end
 
local debugCycle;
if (PowaAuras.NextDebugCheck>0 and PowaAuras.DebugTimer > PowaAuras.NextDebugCheck) then
PowaAuras.DebugTimer = 0;
--PowaAuras:Message("Update Timer #",self.id); --OK
PowaAuras:Message("Update Timer #",self.id); --OK
debugCycle = true;
end
 
249,7 → 149,6
end
 
PowaAuras:UnitTestInfo("Timer newvalue", newvalue);
--PowaAuras:Message("Timer newvalue=", newvalue);
 
if (newvalue and newvalue > 0) then --- Time has value to display
 
282,17 → 181,12
end
self:ShowValue(aura, 2, small);
end
self.Showing = true;
if (self.HideRequest) then
self.HideRequest = false;
end
 
elseif (self.Showing) then
else
if (debugCycle) then
PowaAuras:Message("HideTimerFrames"); --OK
end
--PowaAuras:Message("HideTimerFrames");
self:Hide();
PowaAuras:HideTimerFrames(self.id);
PowaAuras:TestThisEffect(self.id);
end
 
306,16 → 200,12
timerFrame.texture:SetBlendMode("DISABLE");
end
local auraTexture = PowaAuras.Textures[self.id];
if (auraTexture) then
if auraTexture:GetObjectType() == "Texture" then
timerFrame.texture:SetVertexColor(auraTexture:GetVertexColor());
elseif auraTexture:GetObjectType() == "FontString" then
timerFrame.texture:SetVertexColor(auraTexture:GetTextColor());
end
else
timerFrame.texture:SetVertexColor(aura.r,aura.g,aura.b);
if auraTexture:GetObjectType() == "Texture" then
timerFrame.texture:SetVertexColor(auraTexture:GetVertexColor());
elseif auraTexture:GetObjectType() == "FontString" then
timerFrame.texture:SetVertexColor(auraTexture:GetTextColor());
end
 
 
--PowaAuras:Message("newvalue=", newvalue);
 
local deci = math.floor(newvalue / 10);
328,7 → 218,6
timerFrame.texture:SetTexCoord(tStep * uni, tStep * (uni+1), tStep * deci, tStep * (deci+1));
end
if (not timerFrame:IsVisible()) then
--PowaAuras:Message("Show timer frame");
timerFrame:Show(); -- Timer Frame
end
--PowaAuras:Message("Show #3 ", k, " ", i, " ", j, " ", seconds);
337,33 → 226,7
end
 
 
function cPowaTimer:HideFrame(i)
if (PowaAuras.TimerFrame[self.id] and PowaAuras.TimerFrame[self.id][i]) then
--PowaAuras:Message("Hide Timer Frame ", i," for ", self.id);
PowaAuras.TimerFrame[self.id][i]:Hide();
end
end
 
function cPowaTimer:Hide()
if (not self.Showing) then return; end
if PowaAuras.TimerFrame[self.id] then
self:HideFrame(1);
self:HideFrame(2);
end
self.Showing = false;
self.HideRequest = true;
--PowaAuras:Message("Hide timer frame");
end
 
function cPowaTimer:Delete()
self:Hide();
if PowaAuras.TimerFrame[self.id] then
PowaAuras.TimerFrame[self.id][1] = nil;
PowaAuras.TimerFrame[self.id][2] = nil;
PowaAuras.TimerFrame[self.id] = nil;
end
end
 
------------cPowaAura----------------
-- cPowaAura is the base class and is not instanced directly, the other classes inherit properties and methods from it
--===========================
463,75 → 326,29
end
 
if (base.Timer) then
--if ((base.CanHaveTimerOnInverse or base.CanHaveTimer) and base.Timer) then
aura.Timer = cPowaTimer(id, base.Timer);
end
 
if (base.Stacks and not base.isSecondary) then
if (base.Stacks) then
aura.Stacks = cPowaStacks(id, base.Stacks);
end
end
 
if (not aura.Timer) then
--if ((base.CanHaveTimerOnInverse or base.CanHaveTimer) and not aura.Timer) then
aura.Timer = cPowaTimer(id);
end
 
if (base.CanHaveStacks and not aura.Stacks and not aura.isSecondary) then
if (not aura.Stacks) then
aura.Stacks = cPowaStacks(id);
end
 
if (aura.Timer) then
aura.Timer.Showing = false;
aura.Timer.HideRequest = false;
end
if (aura.Stacks) then
aura.Stacks.Showing = false;
aura.Stacks.HideRequest = false;
end
aura.Showing = false;
aura.HideRequest = false;
aura.id = id;
 
end);
 
 
function cPowaAura:TimerShowing()
if (not self.Timer) then return false; end
return self.Timer.Showing;
end
 
function cPowaAura:StacksShowing()
if (not self.Stacks) then return false; end
return self.Stacks.Showing;
end
 
function cPowaAura:HideShowTabs()
if ((self.CanHaveTimer and not self.inverse) or (self.CanHaveTimerOnInverse and self.inverse)) then
PowaEditorTab3:Show();
if (not self.Timer) then
self.Timer = cPowaTimer(self.id);
end
else
PowaEditorTab3:Hide();
if (self.Timer) then
self.Timer.enabled = false;
end
end
if (self.CanHaveStacks and not self.inverse) then
PowaEditorTab5:Show();
if (not self.Stacks) then
self.Stacks = cPowaStacks(self.id);
end
else
PowaEditorTab5:Hide();
if (self.Stacks) then
self.Stacks.enabled = false;
end
end
end
function cPowaAura:GetDuration(durationInfo)
--PowaAuras:Message("GetDuration=", durationInfo);
if (durationInfo and durationInfo > 0) then
return math.max(durationInfo - GetTime(), 0);
end
613,8 → 430,7
end
 
if (not self.isSecondary) then
if (self.Timer and PowaAuras.ModTest) then self.Timer:Hide(); end
if (self.Stacks) then self.Stacks:Hide(); end
PowaAuras:HideTimerFrames(self.id);
local frame = PowaAuras.Frames[self.id];
if (frame) then
frame:Hide();
852,32 → 668,28
pword = self:Trim(pword);
if (string.len(pword)>0) then
local textToSearch;
local textureMatch;
if string.find(pword, "_") then
_, _,textToSearch = string.find(spellTexture, "([%w_]*)$")
else
textToSearch = spellName;
pword, textureMatch = self:GetSpellNameFromMatch(pword);
pword = self:GetSpellNameFromMatch(pword);
end
PowaAuras:Debug("textureMatch=", textureMatch);
if (not textureMatch or textureMatch==spellTexture) then
if (textToSearch) then
if (self.ignoremaj) then
textToSearch = string.upper(textToSearch)
pword = string.upper(pword);
if (textToSearch) then
if (self.ignoremaj) then
textToSearch = string.upper(textToSearch)
pword = string.upper(pword);
end
PowaAuras:Debug("pword=", pword);
PowaAuras:Debug("search=", textToSearch);
if (self.exact) then
PowaAuras:Debug("exact=", (textToSearch == pword));
if (textToSearch == pword) then
return true;
end
PowaAuras:Debug("pword=", pword);
PowaAuras:Debug("search=", textToSearch);
if (self.exact) then
PowaAuras:Debug("exact=", (textToSearch == pword));
if (textToSearch == pword) then
return true;
end
else
PowaAuras:Debug("find=", string.find(textToSearch, pword, 1, true));
if (string.find(textToSearch, pword, 1, true)) then
return true;
end
else
PowaAuras:Debug("find=", string.find(textToSearch, pword, 1, true));
if (string.find(textToSearch, pword, 1, true)) then
return true;
end
end
end
919,28 → 731,16
if k == "multiids" then
v = "";
end
local varType = type(v);
varType = type(v);
if (varType == "string" or varType == "boolean" or varType == "number") then
tempstr = tempstr..k..":"..string.sub(varType,1,2)
if (varType == "string") then
tempstr = tempstr..v;
else
tempstr = tempstr..tostring(v);
end
tempstr = tempstr.."; ";
tempstr = tempstr..k..":"..string.sub(varType,1,2)..tostring(v).."; ";
end
end
if (self.Timer) then
for k, v in pairs (self.Timer) do
local varType = type(v);
varType = type(v);
if (varType == "string" or varType == "boolean" or varType == "number") then
tempstr = tempstr.."timer."..k..":"..string.sub(varType,1,2);
if (varType == "string") then
tempstr = tempstr..v;
else
tempstr = tempstr..tostring(v);
end
tempstr = tempstr.."; ";
tempstr = tempstr.."timer."..k..":"..string.sub(varType,1,2)..tostring(v).."; ";
end
end
end
1023,7 → 823,7
end
end
if (not giveReason) then return false; end
return false, unit.." "..self.NoMatchReason;
return false,self.NoMatchReason;
end
 
function cPowaAura:CheckStacks(count)
1041,7 → 841,7
or (operator == "!" and count ~= stacks));
end
 
cPowaBuffBase = PowaClass(cPowaAura, {CanHaveTimer=true, CanHaveStacks=true});
cPowaBuffBase = PowaClass(cPowaAura);
 
function cPowaBuffBase:AddEffect(i)
 
1098,9 → 898,6
if (self.Timer) then
self.Timer.DurationInfo = expirationTime;
end
if (self.Stacks) then
self.StackCount = count;
end
return true;
end
end
1284,7 → 1081,7
if (self.mine) then
removeable = 1;
end
local name, _, texture, count, typeDebuff, _, expirationTime = UnitDebuff(target, z, removeable);
local name, _, texture, _, typeDebuff, _, expirationTime = UnitDebuff(target, z, removeable);
if (not name) then
return false;
end
1313,9 → 1110,6
if (self.Timer) then
self.Timer.DurationInfo = expirationTime;
end
if (self.Stacks) then
self.StackCount = count;
end
if (self.icon == "") then
getglobal("PowaIconTexture"):SetTexture(texture);
self.icon = getglobal("PowaIconTexture"):GetTexture();
1364,23 → 1158,14
end
end
 
cPowaEnchant = PowaClass(cPowaAura, {AuraType = "Enchants", CanHaveTimer=true, CanHaveTimerOnInverse=true, CanHaveStacks=true, CooldownAura=true});
function cPowaEnchant:GetDuration(durationInfo)
if (durationInfo and durationInfo > 0) then
return durationInfo / 1000;
end
return 0;
end
function cPowaEnchant:CheckforEnchant(slot, enchantText, textToFind)
cPowaEnchant = PowaClass(cPowaAura, {AuraType = "Enchants"});
function cPowaEnchant:CheckforEnchant(slot, enchantText)
PowaAuras:Debug("Check enchant ("..enchantText..") active in slot",slot);
--PowaAuras:Message("Check enchant ("..enchantText..") active in slot",slot);
PowaAuras_Tooltip:SetOwner(UIParent, "ANCHOR_NONE");
PowaAuras_Tooltip:SetInventoryItem("player", slot);
PowaAuras:UnitTestDebug("search in tooltip for ", textToFind);
--PowaAuras:Message("search in tooltip for ", textToFind);
PowaAuras:UnitTestDebug("search in tooltip for ", self.buffname);
for z = 1, PowaAuras_Tooltip:NumLines() do
PowaAuras:UnitTestDebug("Check tooltip line ",z);
--PowaAuras:Message("Check tooltip line ",z);
local textlinel = getglobal("PowaAuras_TooltipTextLeft"..z);
local textl = textlinel:GetText();
local text = "";
1394,8 → 1179,7
end
if (text ~= "") then
PowaAuras:UnitTestDebug("| "..text.." |");
--PowaAuras:Message("| "..text.." |");
if (self:MatchText(text, textToFind)) then
if (self:MatchText(text, self.buffname)) then
PowaAuras_Tooltip:Hide();
return true;
end
1412,63 → 1196,42
getglobal("PowaIconTexture"):SetTexture( GetInventoryItemTexture("player", slot) );
self.icon = getglobal("PowaIconTexture"):GetTexture();
end
if (self.Stacks) then
self.StackCount = count;
end
return true;
end
return false;
end
 
 
function cPowaEnchant:CheckIfShouldShow(giveReason)
PowaAuras:Debug("Check weapon enchant");
local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges = GetWeaponEnchantInfo();
 
local checkMain = true;
local checkOff = true;
for pword in string.gmatch(self.buffname, "[^/]+") do
if (pword==PowaAuras.Text.mainHand) then
checkMain = true;
checkOff = false;
elseif (pword==PowaAuras.Text.offHand) then
checkOff = true;
checkMain = false;
else
if (hasMainHandEnchant and checkMain) then
if (self:CheckforEnchant(16, PowaAuras.Text.mainHand, pword)) then
if (self:SetForEnchant("MH", 16, mainHandCharges, 1)) then
if (self.Timer) then
self.Timer.DurationInfo = mainHandExpiration;
end
if (self.Stacks) then
self.StackCount = mainHandCharges;
end
if (not giveReason) then return true; end
return true, "Main Hand "..self.buffname.." enchant found";
end
end
if (hasMainHandEnchant) then
if (self:CheckforEnchant(16, PowaAuras.Text.mainHand)) then
if (self:SetForEnchant("MH", 16, mainHandCharges, 1)) then
if (self.Timer) then
self.Timer.DurationInfo = mainHandExpiration;
end
if (not giveReason) then return true; end
return true, "Main Hand "..self.buffname.." enchant found";
end
if (hasOffHandEnchant and checkOff) then
if (self:CheckforEnchant(17, PowaAuras.Text.offHand, pword)) then
if (self:SetForEnchant("OH", 17, offHandCharges, 2)) then
if (self.Timer) then
self.Timer.DurationInfo = offHandExpiration;
end
if (self.Stacks) then
self.StackCount = offHandCharges;
end
if (not giveReason) then return true; end
return true, "Off Hand "..self.buffname.." enchant found";
end
end
end
end
if (hasOffHandEnchant) then
if (self:CheckforEnchant(17, PowaAuras.Text.offHand)) then
if (self:SetForEnchant("OH", 17, offHandCharges, 2)) then
if (self.Timer) then
self.Timer.DurationInfo = offHandExpiration;
end
if (not giveReason) then return true; end
return true, "Off Hand "..self.buffname.." enchant found";
end
end
end
end
if (not giveReason) then return false; end
return false, "No enchant found on weapons";
end
 
cPowaCombo = PowaClass(cPowaAura, {AuraType = "Combo", CanHaveStacks=true});
cPowaCombo = PowaClass(cPowaAura, {AuraType = "Combo"});
function cPowaCombo:CheckIfShouldShow(giveReason)
if (not(PowaAuras.playerclass == "ROGUE" or (PowaAuras.playerclass=="DRUID" and GetShapeshiftForm()==3))) then
return nil, "You do not use combo points";
1481,9 → 1244,6
getglobal("PowaIconTexture"):SetTexture("Interface\\icons\\inv_sword_48");
self.icon = getglobal("PowaIconTexture"):GetTexture();
end
if (self.Stacks) then
self.StackCount = nCombo;
end
if (not giveReason) then return true; end
return true, "Combo points "..nCombo.." match "..self.buffname;
end
1491,7 → 1251,7
return false, "Combo points "..nCombo.." no match with "..self.buffname;
end
 
cPowaActionReady = PowaClass(cPowaAura, {AuraType = "Actions", CanHaveTimer=true, CanHaveTimerOnInverse=true, CooldownAura=true});
cPowaActionReady = PowaClass(cPowaAura, {AuraType = "Actions"});
function cPowaActionReady:CheckIfShouldShow(giveReason)
PowaAuras:Debug("Check Action / Button:", self.slot);
if (not self.slot or self.slot == 0) then
1524,11 → 1284,10
return false, "Action Not Ready, on cooldown";
end
 
cPowaOwnSpell = PowaClass(cPowaAura, {AuraType = "OwnSpells", CanHaveTimer=true, CanHaveTimerOnInverse=true, CooldownAura=true});
cPowaOwnSpell = PowaClass(cPowaAura, {AuraType = "OwnSpell"});
function cPowaOwnSpell:CheckIfShouldShow(giveReason)
PowaAuras:Debug("Check Spell:", self.buffname);
--PowaAuras:Message("Check Spell:", self.buffname);
local reason = "";
 
for pword in string.gmatch(self.buffname, "[^/]+") do
local spellName, spellIcon = self:GetSpellNameFromMatch(pword);
if (self.icon == "") then
1543,7 → 1302,6
local show = false;
local cdstart, cdduration, enabled = GetSpellCooldown(spellName);
PowaAuras:UnitTestDebug("cdstart= ",cdstart," duration= ",cdduration," enabled= ",enabled);
--PowaAuras:Message("cdstart= ",cdstart," duration= ",cdduration," enabled= ",enabled);
if (enabled) then
local isUsable = IsUsableSpell(spellName);
if (cdduration > 0.2 and cdduration < 1.7 and self.gcd == false) then
1551,29 → 1309,17
else
show = (isUsable == 1 and cdstart == 0);
end
--PowaAuras:Message("show= ",show," self.Timer= ",self.Timer);
if (show) then
--self.duration = math.max(cdstart + cdduration - GetTime(), 0)
if (not giveReason) then return true; end
return true, "Spell "..spellName.." usable";
else
if (self.Timer) then
self.Timer.DurationInfo = cdstart + cdduration;
--PowaAuras:Message("Set DurationInfo= ",self.Timer.DurationInfo);
self.Timer.DurationInfo = spellName;
end
if (giveReason) then
reason = reason..spellName.." not usable ";
end
if (not giveReason) then return true; end
return true, "Spell "..spellName.." usable";
end
elseif (giveReason) then
reason = reason..spellName.." not enabled "
end
end
if (not giveReason) then return false; end
if (reason == "") then
return false, "Spell "..self.buffname.." not found";
end
return false, reason
return false, "Spell "..self.buffname.." not found";
end
 
cPowaAuraStats = PowaClass(cPowaAura);
1676,11 → 1422,11
function cPowaAggro:AddEffect(i)
 
if not self.target
and not self.targetfriend
and not self.party
and not self.raid
and not self.focus
and not self.optunitn then --- self Aggro
and not self.targetfriend
and not self.party
and not self.raid
and not self.focus
and not self.optunitn then --- self Aggro
table.insert(PowaAuras.AurasByType.Aggro, i);
end
if self.party then --- party Aggro
1692,14 → 1438,9
end
 
function cPowaAggro:CheckUnit(unit)
--PowaAuras:Message(unit," UnitThreatSituation=", UnitThreatSituation(unit));
return (UnitThreatSituation(unit) or -1)> 0;
end
function cPowaAggro:CheckIfShouldShow(giveReason)
if (self.icon == "") then
getglobal("PowaIconTexture"):SetTexture("Interface\\icons\\Ability_Warrior_EndlessRage");
self.icon = getglobal("PowaIconTexture"):GetTexture();
end
PowaAuras:Debug("Check Aggro status");
return self:CheckAllUnits(giveReason);
end
trunk/PowerAuras/PowerAuras.xml
2,8 → 2,7
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\..\FrameXML\UI.xsd">
 
<!-- Main Frame -->
 
<Frame name="PowaAuras_Frame"
hidden="false">
<Scripts>
22,7 → 21,6
</Scripts>
</Frame>
 
<!-- Tootips -->
<GameTooltip name="PowaAuras_Tooltip"
frameStrata="TOOLTIP"
hidden="false"
53,9 → 51,6
</Anchor>
</Anchors>
</GameTooltip>
 
<!-- Templates -->
 
<!-- Copied from OptionSliderTemplate 2.4.3 because Blizzard is ......
Check to see if they use consistent fontsizes in build > 8982 and remove this template.
Revert PowaBarSliderTemplate to inherit from OptionsSliderTemplate if it's fixed as well. -->
251,7 → 246,6
</Layers>
</Frame>
 
<!-- Aura Configuration Frame -->
<Frame name="PowaBarConfigFrame"
movable="true"
parent="UIParent"
260,7 → 254,7
enableMouse="true"
enableKeyboard="true">
<Size>
<AbsDimension x="388"
<AbsDimension x="348"
y="704" />
</Size>
<Anchors>
358,11 → 352,9
<HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight"
alphaMode="ADD" />
</Button>
 
<!-- Top Panel -->
<Frame name="PowaBarConfigFrameEditor">
<Size>
<AbsDimension x="350"
<AbsDimension x="310"
y="300" />
</Size>
<Anchors>
415,7 → 407,7
<Slider name="PowaBarAuraTextureSlider"
inherits="PowaBarSliderTemplate">
<Size>
<AbsDimension x="250"
<AbsDimension x="230"
y="16" />
</Size>
<Anchors>
423,7 → 415,7
relativeTo="AuraTexture"
relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-40"
<AbsDimension x="-80"
y="-104" />
</Offset>
</Anchor>
435,35 → 427,6
<OnValueChanged>PowaAuras:BarAuraTextureSliderChanged();</OnValueChanged>
</Scripts>
</Slider>
<EditBox name="PowaBarAuraTextureEdit"
autoFocus="false"
inherits="InputBoxTemplate">
<Size>
<AbsDimension x="40"
y="16" />
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT"
relativeTo="PowaBarAuraTextureSlider"
relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0"
y="5" />
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="ChatFontNormal"
bytes="6" />
</Layer>
</Layers>
<Scripts>
<OnLoad>self:SetMaxLetters(2)</OnLoad>
<OnEnterPressed>self:ClearFocus(); PowaAuras:TextAuraTextureChanged();</OnEnterPressed>
</Scripts>
</EditBox>
 
<EditBox name="PowaBarAurasText"
autoFocus="false"
inherits="InputBoxTemplate">
695,7 → 658,7
<Slider name="PowaBarAuraAlphaSlider"
inherits="PowaBarSliderTemplate">
<Size>
<AbsDimension x="210"
<AbsDimension x="130"
y="16" />
</Size>
<Anchors>
703,7 → 666,7
relativeTo="PowaBarAuraTextureSlider"
relativePoint="BOTTOM">
<Offset>
<AbsDimension x="20"
<AbsDimension x="50"
y="-17" />
</Offset>
</Anchor>
729,7 → 692,7
relativeTo="PowaBarAuraAlphaSlider"
relativePoint="BOTTOM">
<Offset>
<AbsDimension x="40"
<AbsDimension x="0"
y="-17" />
</Offset>
</Anchor>
747,7 → 710,7
<Slider name="PowaBarAuraSizeSlider"
inherits="PowaBarSliderTemplate">
<Size>
<AbsDimension x="328"
<AbsDimension x="268"
y="16" />
</Size>
<Anchors>
773,7 → 736,7
<Slider name="PowaBarAuraCoordXSlider"
inherits="PowaBarSliderTemplate">
<Size>
<AbsDimension x="280"
<AbsDimension x="220"
y="16" />
</Size>
<Anchors>
832,7 → 795,7
<Slider name="PowaBarAuraCoordSlider"
inherits="PowaBarSliderTemplate">
<Size>
<AbsDimension x="280"
<AbsDimension x="220"
y="16" />
</Size>
<Anchors>
937,11 → 900,9
<NormalTexture name="$parentNormalTexture"
file="Interface\ChatFrame\ChatFrameColorSwatch" />
</Button>
 
<!-- First Configuration Tab Panel (Activation)-->
<Frame name="PowaBarConfigFrameEditor2">
<Size>
<AbsDimension x="350"
<AbsDimension x="310"
y="340" />
</Size>
<Anchors>
1905,11 → 1866,10
</EditBox>
</Frames>
</Frame>
<!-- Second Configuration Tab Panel (Animation)-->
<Frame name="PowaBarConfigFrameEditor3"
<Frame name="PowaBarConfigFrameEditor3"
hidden="true">
<Size>
<AbsDimension x="350"
<AbsDimension x="310"
y="130" />
</Size>
<Anchors>
2160,11 → 2120,10
</Slider>
</Frames>
</Frame>
<!-- Third Configuration Tab Panel (Sound)-->
<Frame name="PowaBarConfigFrameEditor5"
<Frame name="PowaBarConfigFrameEditor5"
hidden="true">
<Size>
<AbsDimension x="350"
<AbsDimension x="310"
y="150" />
</Size>
<Anchors>
2294,11 → 2253,10
</EditBox>
</Frames>
</Frame>
<!-- Fourth Configuration Tab Panel (Timer)-->
<Frame name="PowaBarConfigFrameEditor4"
<Frame name="PowaBarConfigFrameEditor4"
hidden="true">
<Size>
<AbsDimension x="350"
<AbsDimension x="310"
y="260" />
</Size>
<Anchors>
2585,210 → 2543,6
 
</Frames>
</Frame>
 
<!-- Fith Configuration Tab Panel (Stacks)-->
<Frame name="PowaBarConfigFrameEditor6"
hidden="true">
<Size>
<AbsDimension x="350"
y="260" />
</Size>
<Anchors>
<Anchor point="TOP"
relativeTo="PowaBarConfigFrameEditor"
relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0"
y="-25" />
</Offset>
</Anchor>
</Anchors>
<Backdrop bgFile="Dungeons\Textures\rock\BM_BRSPIRE_CUBEROCK01"
edgeFile="Interface\Tooltips\UI-Tooltip-Border"
tile="true">
<EdgeSize>
<AbsValue val="12" />
</EdgeSize>
<TileSize>
<AbsValue val="128" />
</TileSize>
<BackgroundInsets>
<AbsInset left="2"
right="2"
top="2"
bottom="2" />
</BackgroundInsets>
</Backdrop>
<Scripts>
<OnLoad>self:SetBackdropBorderColor(0.0, 0.0, 0.0); self:SetBackdropColor(0.1, 0.1, 0.1);</OnLoad>
</Scripts>
<Frames>
<CheckButton name="PowaShowStacksButton"
inherits="PowaCheckTemplate">
<Size>
<AbsDimension x="25"
y="25" />
</Size>
<Anchors>
<Anchor point="TOPLEFT"
relativeTo="PowaBarConfigFrameEditor6"
relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="10"
y="-5" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.tooltipText = PowaAuras.Text.aideShowStacks;
getglobal("PowaShowStacksButtonText"):SetText(PowaAuras.Text.nomCheckShowStacks);
getglobal("PowaShowStacksButtonText"):SetTextColor(0.2,1.0,0.2);
</OnLoad>
<OnClick>PowaAuras:ShowStacksChecked(self);</OnClick>
</Scripts>
</CheckButton>
<Slider name="PowaStacksCoordXSlider"
inherits="PowaBarSliderTemplate">
<Size>
<AbsDimension x="130"
y="16" />
</Size>
<Anchors>
<Anchor point="TOPLEFT"
relativeTo="PowaBarConfigFrameEditor6"
relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="10"
y="-42" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:SetMinMaxValues(-150,150); self:SetValue(0); self:SetValueStep(5);
getglobal("PowaStacksCoordXSliderText"):SetText(PowaAuras.Text.nomPos.." X : 0");
getglobal("PowaStacksCoordXSliderLow"):SetText("-150");
getglobal("PowaStacksCoordXSliderHigh"):SetText("150");
</OnLoad>
<OnValueChanged>PowaAuras:StacksCoordXSliderChanged();</OnValueChanged>
<OnMouseUp>
self:SetMinMaxValues(self:GetValue()-100,self:GetValue()+100);
getglobal("PowaStacksCoordXSliderLow"):SetText(self:GetValue()-100);
getglobal("PowaStacksCoordXSliderHigh"):SetText(self:GetValue()+100);
</OnMouseUp>
</Scripts>
</Slider>
<Slider name="PowaStacksCoordSlider"
inherits="PowaBarSliderTemplate">
<Size>
<AbsDimension x="130"
y="16" />
</Size>
<Anchors>
<Anchor point="LEFT"
relativeTo="PowaStacksCoordXSlider"
relativePoint="RIGHT">
<Offset>
<AbsDimension x="10"
y="0" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:SetMinMaxValues(-200,100); self:SetValue(0); self:SetValueStep(5);
getglobal("PowaStacksCoordSliderText"):SetText(PowaAuras.Text.nomPos.." Y : 0");
getglobal("PowaStacksCoordSliderLow"):SetText("-200");
getglobal("PowaStacksCoordSliderHigh"):SetText("100");
</OnLoad>
<OnValueChanged>PowaAuras:StacksCoordSliderChanged();</OnValueChanged>
<OnMouseUp>
self:SetMinMaxValues(self:GetValue()-100,self:GetValue()+100);
getglobal("PowaStacksCoordSliderLow"):SetText(self:GetValue()-100);
getglobal("PowaStacksCoordSliderHigh"):SetText(self:GetValue()+100);
</OnMouseUp>
</Scripts>
</Slider>
<Slider name="PowaStacksSizeSlider"
inherits="PowaBarSliderTemplate">
<Size>
<AbsDimension x="130"
y="16" />
</Size>
<Anchors>
<Anchor point="TOP"
relativeTo="PowaStacksCoordXSlider"
relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0"
y="-20" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:SetMinMaxValues(0.5,2.0); self:SetValue(1.0); self:SetValueStep(0.05);
getglobal("PowaStacksSizeSliderText"):SetText(PowaAuras.Text.nomTaille.." : 1.0");
getglobal("PowaStacksSizeSliderLow"):SetText("0.5");
getglobal("PowaStacksSizeSliderHigh"):SetText("2.0");
</OnLoad>
<OnValueChanged>PowaAuras:StacksSizeSliderChanged();</OnValueChanged>
</Scripts>
</Slider>
<Slider name="PowaStacksAlphaSlider"
inherits="PowaBarSliderTemplate">
<Size>
<AbsDimension x="130"
y="16" />
</Size>
<Anchors>
<Anchor point="TOP"
relativeTo="PowaStacksCoordSlider"
relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0"
y="-20" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:SetMinMaxValues(0.1,1.0); self:SetValue(1.0); self:SetValueStep(0.05);
getglobal("PowaStacksAlphaSliderText"):SetText(PowaAuras.Text.nomAlpha.." : 1.0");
getglobal("PowaStacksAlphaSliderLow"):SetText("0.1");
getglobal("PowaStacksAlphaSliderHigh"):SetText("1.0");
</OnLoad>
<OnValueChanged>PowaAuras:StacksAlphaSliderChanged();</OnValueChanged>
</Scripts>
</Slider>
 
<CheckButton name="PowaBuffStacksTransparentButton"
inherits="PowaCheckTemplate">
<Size>
<AbsDimension x="25"
y="25" />
</Size>
<Anchors>
<Anchor point="TOPLEFT"
relativeTo="PowaStacksSizeSlider"
relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0"
y="-20" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>getglobal("PowaBuffStacksTransparentButtonText"):SetText(PowaAuras.Text.nomTransparent);</OnLoad>
<OnClick>PowaAuras:StacksChecked(self, "Transparent");</OnClick>
</Scripts>
</CheckButton>
 
</Frames>
</Frame>
 
 
<Button name="PowaEditorTab2"
inherits="TabButtonTemplate">
<Anchors>
2807,12 → 2561,10
PanelTemplates_DeselectTab(PowaEditorTab1);
PanelTemplates_DeselectTab(PowaEditorTab3);
PanelTemplates_DeselectTab(PowaEditorTab4);
PanelTemplates_DeselectTab(PowaEditorTab5);
getglobal("PowaBarConfigFrameEditor2"):Show();
getglobal("PowaBarConfigFrameEditor3"):Hide();
getglobal("PowaBarConfigFrameEditor4"):Hide();
getglobal("PowaBarConfigFrameEditor5"):Hide();
getglobal("PowaBarConfigFrameEditor6"):Hide();
PlaySound("igCharacterInfoTab");
</OnClick>
<OnLoad>
2840,12 → 2592,10
PanelTemplates_DeselectTab(PowaEditorTab2);
PanelTemplates_DeselectTab(PowaEditorTab3);
PanelTemplates_DeselectTab(PowaEditorTab4);
PanelTemplates_DeselectTab(PowaEditorTab5);
getglobal("PowaBarConfigFrameEditor2"):Hide();
getglobal("PowaBarConfigFrameEditor3"):Show();
getglobal("PowaBarConfigFrameEditor4"):Hide();
getglobal("PowaBarConfigFrameEditor5"):Hide();
getglobal("PowaBarConfigFrameEditor6"):Hide();
PlaySound("igCharacterInfoTab");
</OnClick>
<OnLoad>
2874,12 → 2624,10
PanelTemplates_DeselectTab(PowaEditorTab1);
PanelTemplates_DeselectTab(PowaEditorTab2);
PanelTemplates_DeselectTab(PowaEditorTab3);
PanelTemplates_DeselectTab(PowaEditorTab5);
getglobal("PowaBarConfigFrameEditor5"):Show();
getglobal("PowaBarConfigFrameEditor2"):Hide();
getglobal("PowaBarConfigFrameEditor3"):Hide();
getglobal("PowaBarConfigFrameEditor4"):Hide();
getglobal("PowaBarConfigFrameEditor6"):Hide();
PlaySound("igCharacterInfoTab");
</OnClick>
<OnLoad>
2908,12 → 2656,10
PanelTemplates_DeselectTab(PowaEditorTab1);
PanelTemplates_DeselectTab(PowaEditorTab2);
PanelTemplates_DeselectTab(PowaEditorTab4);
PanelTemplates_DeselectTab(PowaEditorTab5);
getglobal("PowaBarConfigFrameEditor4"):Show();
getglobal("PowaBarConfigFrameEditor2"):Hide();
getglobal("PowaBarConfigFrameEditor3"):Hide();
getglobal("PowaBarConfigFrameEditor5"):Hide();
getglobal("PowaBarConfigFrameEditor6"):Hide();
PowaAuras:UpdateTimerOptions();
PlaySound("igCharacterInfoTab");
</OnClick>
2925,41 → 2671,6
</OnLoad>
</Scripts>
</Button>
<Button name="PowaEditorTab5"
inherits="TabButtonTemplate">
<Anchors>
<Anchor point="LEFT"
relativePoint="RIGHT"
relativeTo="PowaEditorTab3">
<Offset>
<AbsDimension x="0"
y="0" />
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PanelTemplates_SelectTab(self);
PanelTemplates_DeselectTab(PowaEditorTab1);
PanelTemplates_DeselectTab(PowaEditorTab2);
PanelTemplates_DeselectTab(PowaEditorTab3);
PanelTemplates_DeselectTab(PowaEditorTab4);
getglobal("PowaBarConfigFrameEditor6"):Show();
getglobal("PowaBarConfigFrameEditor2"):Hide();
getglobal("PowaBarConfigFrameEditor3"):Hide();
getglobal("PowaBarConfigFrameEditor4"):Hide();
getglobal("PowaBarConfigFrameEditor5"):Hide();
PowaAuras:UpdateStacksOptions();
PlaySound("igCharacterInfoTab");
</OnClick>
<OnLoad>
getglobal("PowaEditorTab5Text"):SetText(PowaAuras.Text.nomTabStacks);
PanelTemplates_DeselectTab(self);
PanelTemplates_TabResize(self, 0);
getglobal(self:GetName().."HighlightTexture"):SetWidth(self:GetTextWidth() + 31);
</OnLoad>
</Scripts>
</Button>
</Frames>
</Frame>
</Frames>
trunk/PowerAuras/PowerOptions.lua
12,12 → 12,12
getglobal("PowaMainTestButton"):SetText(self.Text.nomTest);
getglobal("PowaEditButton"):SetText(self.Text.nomEdit);
getglobal("PowaOptionsRename"):SetText(self.Text.nomRename);
if (PowaMisc.disabled) then
if (self.Misc.disabled) then
getglobal("PowaEnableButton"):SetChecked(false);
else
getglobal("PowaEnableButton"):SetChecked(true);
end
if (PowaMisc.debug) then
if (self.Misc.debug) then
getglobal("PowaDebugButton"):SetChecked(true);
else
getglobal("PowaDebugButton"):SetChecked(false);
106,7 → 106,6
return;
elseif (aura.Showing) then -- deja visible, on la cache
aura.HideRequest = true;
if (aura.Timer) then aura.Timer.HideRequest = true; end
getglobal("PowaIcone"..iconeID):SetAlpha(0.33);
else -- pas visible alors on affiche
self:DisplayAura(auraId);
360,23 → 359,19
 
if (not IsControlKeyDown()) then return; end
 
local aura = self.Auras[auraId];
aura:Hide();
self.Auras[auraId]:Hide();
 
if (aura.Timer) then aura.Timer:Delete(); end
if (aura.Stacks) then aura.Stacks:Delete(); end
 
self.Auras[auraId] = nil;
if (auraId > 120) then
PowaGlobalSet[auraId] = nil;
end
self:DeleteTimerFrames(auraId);
self.Frames[auraId] = nil;
self.Textures[auraId] = nil;
self.SecondaryAuras[auraId] = nil;
self.SecondaryFrames[auraId] = nil;
self.SecondaryTextures[auraId] = nil;
 
self.Auras[auraId] = nil;
if (auraId > 120) then
PowaGlobalSet[auraId] = nil;
end
 
getglobal("PowaSelected"):Hide();
 
if (getglobal("PowaBarConfigFrame"):IsVisible()) then
588,7 → 583,6
-- cache tous les effets en test
for _, aura in pairs(self.Auras) do
aura.HideRequest = true;
if (aura.Timer and aura.CooldownAura) then aura.Timer.HideRequest = false; end
end
 
self:CreateEffectLists();
596,6 → 590,23
self:NewCheckBuffs();
self:MemorizeActions();
end
 
function PowaAuras:EnableChecked()
if (getglobal("PowaEnableButton"):GetChecked()) then
self:Toggle(true);
else
self:MainOptionClose();
self:Toggle(false);
end
end
 
function PowaAuras:DebugChecked()
if (getglobal("PowaDebugButton"):GetChecked()) then
self.Misc.debug = true;
else
self.Misc.debug = false;
end
end
-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< MAIN OPTIONS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
629,32 → 640,6
end
end
 
function PowaAuras:UpdateStacksOptions()
 
local stacks = self.Auras[self.CurrentAuraId].Stacks;
if (stacks) then
 
getglobal("PowaShowStacksButton"):SetChecked(stacks.enabled);
 
getglobal("PowaStacksAlphaSlider"):SetValue(stacks.a);
getglobal("PowaStacksSizeSlider"):SetValue(stacks.h);
-- ajuste slider Y
getglobal("PowaStacksCoordSlider"):SetMinMaxValues(stacks.y-5000,stacks.y+5000);
getglobal("PowaStacksCoordSliderLow"):SetText(stacks.y-100);
getglobal("PowaStacksCoordSliderHigh"):SetText(stacks.y+100);
getglobal("PowaStacksCoordSlider"):SetValue(stacks.y);
getglobal("PowaStacksCoordSlider"):SetMinMaxValues(stacks.y-100,stacks.y+100);
-- ajuste slider X
getglobal("PowaStacksCoordXSlider"):SetMinMaxValues(stacks.x-5000,stacks.x+5000);
getglobal("PowaStacksCoordXSliderLow"):SetText(stacks.x-100);
getglobal("PowaStacksCoordXSliderHigh"):SetText(stacks.x+100);
getglobal("PowaStacksCoordXSlider"):SetValue(stacks.x);
getglobal("PowaStacksCoordXSlider"):SetMinMaxValues(stacks.x-100,stacks.x+100);
 
getglobal("PowaBuffStacksTransparentButton"):SetChecked(stacks.Transparent);
end
end
 
function PowaAuras:InitPage()
 
--self:Message("InitPage ", self.CurrentAuraId);
727,8 → 712,14
getglobal("PowaInCombatButton"):SetChecked(false);
end
 
aura:HideShowTabs();
 
-- inverse, target and timer
if ((aura.inverse) and not (aura.bufftype == self.BuffTypes.ActionReady or aura.bufftype == self.BuffTypes.OwnSpell)) then
aura.Timer.enabled = false;
PowaEditorTab3:Hide();
else
PowaEditorTab3:Show();
end
 
--self:Message("bufftype ", aura.bufftype);
 
-- Dropdown selection alias buffs type. variable self.Auras[int].bufftype
775,6 → 766,9
getglobal("PowaTimerDurationSlider"):Hide();
end
 
if (aura.inverse == false) then
PowaEditorTab3:Show();
end
getglobal("PowaTargetButtonText"):SetTextColor(1.0,0.2,0.2);
getglobal("PowaTargetFriendButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaPartyButtonText"):SetTextColor(0.2,1.0,0.2);
825,7 → 819,7
else
getglobal("PowaTimerDurationSlider"):Hide();
end
 
if (aura.inverse == false) then PowaEditorTab3:Show(); end
getglobal("PowaTargetButtonText"):SetTextColor(1.0,0.2,0.2);
getglobal("PowaTargetFriendButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaPartyButtonText"):SetTextColor(0.2,1.0,0.2);
872,6 → 866,7
else
getglobal("PowaTimerDurationSlider"):Hide();
end
if (aura.inverse == false) then PowaEditorTab3:Show(); end
getglobal("PowaTargetButtonText"):SetTextColor(1.0,0.2,0.2);
getglobal("PowaTargetFriendButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaPartyButtonText"):SetTextColor(0.2,1.0,0.2);
901,6 → 896,7
getglobal("PowaBarThresholdSlider"):Hide();
getglobal("PowaThresholdInvertButton"):Hide();
getglobal("PowaDropDownStance"):Hide();
PowaEditorTab3:Hide();
getglobal("PowaBarBuffStacks"):Hide();
self:DisableCheckBox("PowaTargetButton");
self:DisableCheckBox("PowaTargetFriendButton");
917,6 → 913,7
getglobal("PowaGroupAnyButton"):SetChecked(false);
self:DisableCheckBox("PowaGroupAnyButton");
-- -------
aura.Timer.enabled = false;
 
elseif (aura.bufftype == self.BuffTypes.Enchant) then -- ENCHANT
getglobal("PowaBarBuffName").aide = self.Text.aideBuff5;
936,7 → 933,6
self:EnableCheckBox("PowaIsInRaidButton");
self:EnableCheckBox("PowaRestingButton");
self:EnableCheckBox("PowaIsMountedButton");
self:EnableCheckBox("PowaOwntexButton");
-- disabled
getglobal("PowaBarThresholdSlider"):Hide();
getglobal("PowaThresholdInvertButton"):Hide();
951,12 → 947,15
self:DisableCheckBox("PowaGroupOrSelfButton");
self:DisableCheckBox("PowaOptunitnButton");
self:DisableCheckBox("PowaGCDButton");
self:DisableCheckBox("PowaOwntexButton");
getglobal("PowaMineButton"):SetChecked(false);
self:DisableCheckBox("PowaMineButton");
getglobal("PowaGroupAnyButton"):SetChecked(false);
self:DisableCheckBox("PowaGroupAnyButton");
-- --------
 
 
if (aura.inverse == false) then PowaEditorTab3:Show(); end
 
elseif (aura.bufftype == self.BuffTypes.Combo) then -- COMBOS
getglobal("PowaBarBuffName").aide = self.Text.aideBuff6;
getglobal("PowaExactButton").aide = self.Text.aideExact6;
977,6 → 976,7
getglobal("PowaThresholdInvertButton"):Hide();
getglobal("PowaDropDownStance"):Hide();
getglobal("PowaBarTooltipCheck"):Hide();
PowaEditorTab3:Hide();
getglobal("PowaBarBuffStacks"):Hide();
self:DisableCheckBox("PowaTargetButton");
self:DisableCheckBox("PowaTargetFriendButton");
992,7 → 992,9
self:DisableCheckBox("PowaMineButton");
getglobal("PowaGroupAnyButton"):SetChecked(false);
self:DisableCheckBox("PowaGroupAnyButton");
-- --------
-- --------
aura.Timer.enabled = false;
 
elseif (aura.bufftype == self.BuffTypes.ActionReady) then -- ACTION READY
getglobal("PowaBarBuffName").aide = self.Text.aideBuff7;
getglobal("PowaExactButton").aide = self.Text.aideExact7;
1013,6 → 1015,10
self:EnableCheckBox("PowaIsMountedButton");
self:EnableCheckBox("PowaOwntexButton");
 
if (aura.inverse == true) then
PowaEditorTab3:Show();
end
 
-- disabled
getglobal("PowaBarThresholdSlider"):Hide();
getglobal("PowaThresholdInvertButton"):Hide();
1030,7 → 1036,8
self:DisableCheckBox("PowaMineButton");
getglobal("PowaGroupAnyButton"):SetChecked(false);
self:DisableCheckBox("PowaGroupAnyButton");
-- -------
-- -------
 
elseif (aura.bufftype == self.BuffTypes.Health) then -- HEALTH
getglobal("PowaDropDownBuffTypeText"):SetText(self.Text.nomCheckHealth);
-- enabled
1050,6 → 1057,7
-- disabled
getglobal("PowaDropDownStance"):Hide();
getglobal("PowaBarTooltipCheck"):Hide();
PowaEditorTab3:Hide();
self:DisableTextfield("PowaBarBuffName");
getglobal("PowaBarBuffStacks"):Hide();
self:DisableCheckBox("PowaExactButton");
1069,6 → 1077,8
getglobal("PowaRaidButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaOptunitnButtonText"):SetTextColor(0.2,1.0,0.2);
 
aura.Timer.enabled = false;
 
elseif (aura.bufftype == self.BuffTypes.Mana) then -- Mana
getglobal("PowaDropDownBuffTypeText"):SetText(self.Text.nomCheckMana);
-- enabled
1088,6 → 1098,7
-- disabled
getglobal("PowaDropDownStance"):Hide();
getglobal("PowaBarTooltipCheck"):Hide();
PowaEditorTab3:Hide();
self:DisableTextfield("PowaBarBuffName");
getglobal("PowaBarBuffStacks"):Hide();
self:DisableCheckBox("PowaExactButton");
1106,6 → 1117,7
getglobal("PowaFocusButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaRaidButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaOptunitnButtonText"):SetTextColor(0.2,1.0,0.2);
aura.Timer.enabled = false;
 
elseif (aura.bufftype == self.BuffTypes.EnergyRagePower) then -- Rage/Energy/RunicPower
getglobal("PowaDropDownBuffTypeText"):SetText(self.Text.nomCheckRageEnergy);
1126,6 → 1138,7
-- disabled
getglobal("PowaDropDownStance"):Hide();
getglobal("PowaBarTooltipCheck"):Hide();
PowaEditorTab3:Hide();
self:DisableTextfield("PowaBarBuffName");
getglobal("PowaBarBuffStacks"):Hide();
self:DisableCheckBox("PowaExactButton");
1144,6 → 1157,7
getglobal("PowaFocusButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaRaidButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaOptunitnButtonText"):SetTextColor(0.2,1.0,0.2);
aura.Timer.enabled = false;
 
elseif (aura.bufftype == self.BuffTypes.Aggro) then -- Aggro
getglobal("PowaDropDownBuffTypeText"):SetText(self.Text.nomCheckAggro);
1161,6 → 1175,7
getglobal("PowaThresholdInvertButton"):Hide();
getglobal("PowaDropDownStance"):Hide();
getglobal("PowaBarTooltipCheck"):Hide();
PowaEditorTab3:Hide();
self:DisableTextfield("PowaBarBuffName");
getglobal("PowaBarBuffStacks"):Hide();
self:DisableCheckBox("PowaTargetButton");
1179,6 → 1194,7
getglobal("PowaPartyButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaGroupOrSelfButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaRaidButtonText"):SetTextColor(0.2,1.0,0.2);
aura.Timer.enabled = false;
 
elseif (aura.bufftype == self.BuffTypes.PvP) then -- PvP Flag
getglobal("PowaDropDownBuffTypeText"):SetText(self.Text.nomCheckPvP);
1197,6 → 1213,7
getglobal("PowaBarThresholdSlider"):Hide();
getglobal("PowaThresholdInvertButton"):Hide();
getglobal("PowaBarTooltipCheck"):Hide();
PowaEditorTab3:Hide();
self:DisableTextfield("PowaBarBuffName");
getglobal("PowaBarBuffStacks"):Hide();
self:DisableCheckBox("PowaExactButton");
1216,6 → 1233,7
getglobal("PowaPartyButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaGroupOrSelfButtonText"):SetTextColor(0.2,1.0,0.2);
getglobal("PowaRaidButtonText"):SetTextColor(0.2,1.0,0.2);
aura.Timer.enabled = false;
 
elseif (aura.bufftype == self.BuffTypes.SpellAlert) then -- SPELL ALERT
getglobal("PowaBarBuffName").aide = self.Text.aideSpells;
1249,6 → 1267,9
getglobal("PowaGroupAnyButton"):SetChecked(false);
self:DisableCheckBox("PowaGroupAnyButton");
-- --------
if (aura.inverse == false) then
PowaEditorTab3:Show();
end
getglobal("PowaTargetButtonText"):SetTextColor(1.0,0.2,0.2);
getglobal("PowaFocusButtonText"):SetTextColor(0.2,1.0,0.2);
 
1272,6 → 1293,7
getglobal("PowaBarThresholdSlider"):Hide();
getglobal("PowaThresholdInvertButton"):Hide();
getglobal("PowaBarTooltipCheck"):Hide();
PowaEditorTab3:Hide();
self:DisableTextfield("PowaBarBuffName");
getglobal("PowaBarBuffStacks"):Hide();
self:DisableCheckBox("PowaTargetButton");
1299,6 → 1321,7
getglobal("PowaGroupAnyButton"):SetChecked(false);
self:DisableCheckBox("PowaGroupAnyButton");
-- --------
aura.Timer.enabled = false;
 
elseif (aura.bufftype == self.BuffTypes.OwnSpell) then -- One of my spells
getglobal("PowaBarBuffName").aide = self.Text.aideBuff8;
1333,6 → 1356,9
-- --------
getglobal("PowaTimerDurationSlider"):Show();
 
if (aura.inverse == true) then
PowaEditorTab3:Show();
end
getglobal("PowaTargetButtonText"):SetTextColor(0.3,0.3,0.3);
getglobal("PowaTargetFriendButtonText"):SetTextColor(0.3,0.3,0.3);
getglobal("PowaPartyButtonText"):SetTextColor(0.3,0.3,0.3);
1505,20 → 1531,11
 
getglobal("PowaBarAuraTextureSliderText"):SetText(self.Text.nomTexture.." : "..SliderValue);
getglobal("AuraTexture"):SetVertexColor(self.Auras[auraId].r,self.Auras[auraId].g,self.Auras[auraId].b);
 
PowaBarAuraTextureEdit:SetText(SliderValue);
 
 
self.Auras[auraId].texture = SliderValue;
self:RedisplayAura();
end
 
function PowaAuras:TextAuraTextureChanged()
local thisText = getglobal("PowaBarAuraTextureEdit"):GetText();
local thisNumber = tonumber(thisText);
getglobal("PowaBarAuraTextureSlider"):SetValue(thisNumber or 0);
end
 
 
function PowaAuras:BarAuraAlphaSliderChanged()
if (self.Initialising) then return; end
local SliderValue = getglobal("PowaBarAuraAlphaSlider"):GetValue();
1766,10 → 1783,17
local aura = self.Auras[self.CurrentAuraId];
if (getglobal("PowaInverseButton"):GetChecked()) then
aura.inverse = true;
if (aura.bufftype == self.BuffTypes.OwnSpell or aura.bufftype == self.BuffTypes.ActionReady) then
PowaEditorTab3:Show();
end
else
aura.inverse = false;
if (aura.bufftype == self.BuffTypes.OwnSpell or aura.bufftype == self.BuffTypes.ActionReady) then
PowaEditorTab3:Hide();
aura.Timer.enabled = false;
self:DeleteTimerFrames(aura.id);
end
end
aura:HideShowTabs();
end
 
function PowaAuras:IgnoreMajChecked()
2462,8 → 2486,8
return;
end
local aura = self.Auras[self.CurrentAuraId];
if (aura) then
if (aura.Timer and aura.Timer.enabled) then
if (aura) then --- ouvre seulement si l'effet existe
if (aura.Timer.enabled) then
self:CreateTimerFrameIfMissing(aura.id);
end
self:InitPage();
2516,7 → 2540,7
 
local stackOpts = self.Auras[auraId].Stacks;
 
local frame = self.StacksFrames[auraId];
local frame1 = self.StacksFrame[auraId];
frame:SetAlpha(stackOpts.a);
frame:SetWidth(20 * stackOpts.h);
frame:SetHeight(20 * stackOpts.h);
2530,7 → 2554,8
self:CreateTimerFrameIfMissing(self.CurrentAuraId);
else
self.Auras[self.CurrentAuraId].Timer.enabled = false;
self.Auras[self.CurrentAuraId].Timer:Delete();
self:HideTimerFrames(self.CurrentAuraId);
self.TimerFrame[self.CurrentAuraId] = nil;
end
end
 
2595,7 → 2620,7
else
self.Auras[self.CurrentAuraId].Timer[setting] = false;
end
self:HideTimerFrames(self.Auras[self.CurrentAuraId]);
self:HideTimerFrames(self.CurrentAuraId);
self.TimerFrame[self.CurrentAuraId] = nil;
self:CreateTimerFrameIfMissing(self.CurrentAuraId);
end
2607,79 → 2632,11
else
self.Auras[self.CurrentAuraId].Timer.Transparent = false;
end
self.Auras[self.CurrentAuraId].Timer:Delete();
self:HideTimerFrames(self.CurrentAuraId);
self.TimerFrame[self.CurrentAuraId] = nil;
self:CreateTimerFrameIfMissing(self.CurrentAuraId);
end
 
------ Stacks ----
 
function PowaAuras:ShowStacksChecked(control)
if (self.Initialising) then return; end
if (control:GetChecked()) then
self.Auras[self.CurrentAuraId].Stacks.enabled = true;
self:CreateStacksFrameIfMissing(self.CurrentAuraId);
else
self.Auras[self.CurrentAuraId].Stacks.enabled = false;
self.Auras[self.CurrentAuraId].Stacks:Delete();
end
end
 
function PowaAuras:StacksAlphaSliderChanged()
local SliderValue = getglobal("PowaStacksAlphaSlider"):GetValue();
 
if (self.Initialising) then return; end -- desactived
 
getglobal("PowaStacksAlphaSliderText"):SetText(self.Text.nomAlpha.." : "..format("%.2f", SliderValue) );
 
self.Auras[self.CurrentAuraId].Stacks.a = SliderValue;
self:CreateStacksFrameIfMissing(self.CurrentAuraId);
end
 
function PowaAuras:StacksSizeSliderChanged()
local SliderValue = getglobal("PowaStacksSizeSlider"):GetValue();
 
if (self.Initialising) then return; end -- desactived
 
getglobal("PowaStacksSizeSliderText"):SetText(self.Text.nomTaille.." : "..format("%.2f", SliderValue) );
 
self.Auras[self.CurrentAuraId].Stacks.h = SliderValue;
self:CreateStacksFrameIfMissing(self.CurrentAuraId);
end
 
function PowaAuras:StacksCoordSliderChanged()
local SliderValue = getglobal("PowaStacksCoordSlider"):GetValue();
 
if (self.Initialising) then return; end -- desactived
 
getglobal("PowaStacksCoordSliderText"):SetText(self.Text.nomPos.." Y : "..SliderValue);
 
self.Auras[self.CurrentAuraId].Stacks.y = SliderValue;
self:CreateStacksFrameIfMissing(self.CurrentAuraId);
end
 
function PowaAuras:StacksCoordXSliderChanged()
local SliderValue = getglobal("PowaStacksCoordXSlider"):GetValue();
 
if (self.Initialising) then return; end -- desactived
 
getglobal("PowaStacksCoordXSliderText"):SetText(self.Text.nomPos.." X : "..SliderValue);
 
self.Auras[self.CurrentAuraId].Stacks.x = SliderValue;
self:CreateStacksFrameIfMissing(self.CurrentAuraId);
end
 
 
function PowaAuras:StacksChecked(control, setting)
if (self.Initialising) then return; end
if (control:GetChecked()) then
self.Auras[self.CurrentAuraId].Stacks[setting] = true;
else
self.Auras[self.CurrentAuraId].Stacks[setting] = false;
end
self.Auras[self.CurrentAuraId].Stacks:Delete();
self:CreateStacksFrameIfMissing(self.CurrentAuraId);
end
 
-- ----------------------------------------------------------- LIGNE DE COMMANDE
 
function PowaAuras_CommanLine(msg)
2730,73 → 2687,3
getglobal(checkBox):Enable();
getglobal(checkBox.."Text"):SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
end
 
---- Blizzard Addon -----
 
 
function PowaAuras:EnableChecked()
if (PowaEnableButton:GetChecked()) then
self:Toggle(true);
else
self:MainOptionClose();
self:Toggle(false);
end
end
 
function PowaAuras:DebugChecked()
if (PowaDebugButton:GetChecked()) then
PowaMisc.debug = true;
else
PowaMisc.debug = false;
end
end
 
function PowaAuras:OptionsOK()
PowaMisc.OnUpdateLimit = (100 - PowaOptionsUpdateSlider2:GetValue()) / 200;
PowaMisc.AnimationLimit = (100 - PowaOptionsAnimationsSlider2:GetValue()) / 1000;
PowaAuras:EnableChecked();
PowaAuras:DebugChecked();
end
 
function PowaAuras:OptionsCancel()
PowaOptionsCpuFrame2_OnShow();
end
 
function PowaAuras:OptionsDefault()
PowaMisc.OnUpdateLimit = 0;
PowaMisc.AnimationLimit = 0;
PowaMisc.disabled = false;
PowaMisc.debug = false;
PowaOptionsCpuFrame2_OnShow();
end
 
function PowaOptionsCpuFrame2_OnLoad(panel)
panel.name = "Power Auras Classic";
panel.okay = function (self) PowaAuras.OptionsOK(); end;
panel.cancel = function (self) PowaAuras:OptionsCancel(); end;
panel.default = function (self) PowaAuras.OptionsDefault(); end;
InterfaceOptions_AddCategory(panel);
end
 
function PowaOptionsCpuFrame2_OnShow()
if (PowaAuras.Initialising) then return; end
--PowaAuras:Message("PowaOptionsCpuFrame2_OnShow");
--PowaAuras:Message("OnUpdateLimit=", PowaMisc.OnUpdateLimit);
--PowaAuras:Message("AnimationLimit=", PowaMisc.AnimationLimit);
--PowaAuras:Message("disabled=", PowaMisc.disabled ~= false);
--PowaAuras:Message("debug=", PowaMisc.debug);
PowaOptionsUpdateSlider2:SetValue(100-200*PowaMisc.OnUpdateLimit);
PowaOptionsAnimationsSlider2:SetValue(100-1000*PowaMisc.AnimationLimit);
PowaEnableButton:SetChecked(PowaMisc.disabled ~= true);
PowaDebugButton:SetChecked(PowaMisc.debug);
end
 
function PowaAuras:PowaOptionsUpdateSliderChanged2(control)
if (self.Initialising) then return; end
getglobal("PowaOptionsUpdateSlider2Text"):SetText(self.Text.nomUpdateSpeed.." : "..control:GetValue().."%");
end
 
function PowaAuras:PowaOptionsAnimationsSliderChanged2(control)
if (self.Initialising) then return; end
getglobal("PowaOptionsAnimationsSlider2Text"):SetText(self.Text.nomSpeed.." : "..control:GetValue().."%");
end
trunk/PowerAuras/PowerAurasAnimations.lua
205,24 → 205,23
cPowaAnimationBeginBounce = PowaClass(cPowaAnimationBaseTranslate, {OffsetX=0, OffsetY=100, MinVelocity=100, Acceleration=1000});
function cPowaAnimationBeginBounce:Initialise()
self.Velocity = 0;
self.Acceleration = self.Acceleration * self.Aura.speed;
self:InitialiseBase();
--PowaAuras:Message("Bounce Init v=", self.Velocity, " Y=", self.Y);
end
function cPowaAnimationBeginBounce:Update(elapsed)
PowaAuras:UnitTestInfo("BeginBounce Update ", elapsed);
 
self.Alpha = math.max(self.TargetAlpha + elapsed * 2 * self.Aura.speed * self.TargetAlpha , self.TargetAlpha);
 
self.Velocity = math.max(math.min(self.Velocity + self.Acceleration * self.Aura.speed * elapsed, 1000), -1000);
self.Velocity = self.Velocity + self.Acceleration * elapsed;
 
self.Y = self.Y - elapsed * (self.Velocity + self.Acceleration * self.Aura.speed * elapsed / 2);
self.Y = self.Y - elapsed * (self.Velocity + self.Acceleration * elapsed / 2);
 
local result = false;
if (self.Y <= self.TargetY and self.Velocity>0) then
self.Y = self.TargetY;
self.Alpha = self.TargetAlpha;
if (self.Velocity <= self.MinVelocity) then
self.Velocity = 0;
result = true;
else
self.Velocity = -self.Velocity * 0.9;
373,55 → 372,67
self:UpdateFrame();
end
 
 
cPowaAnimationWaterDrop = PowaClass(cPowaAnimationBaseTranslate, {OffsetX=0, OffsetY=0});
--[[
cPowaAnimationWaterDrop = PowaClass(cPowaAnimationBase);
function cPowaAnimationWaterDrop:Initialise()
self.Alpha = self.Frame:GetAlpha();
self.Width = self.Frame:GetWidth();
self.Height = self.Frame:GetHeight();
self.TargetX = self.Aura.x;
self.TargetY = self.Aura.y;
self.X = self.TargetX;
self.Y = self.TargetY;
self.Status = 0;
self.Alpha = self.Frame:GetAlpha();
end
function cPowaAnimationWaterDrop:Update(elapsed)
PowaAuras:UnitTestInfo("cPowaAnimationWaterDrop Update ", elapsed);
 
self.Alpha = self.Alpha - elapsed * self.TargetAlpha * 0.5 * self.Aura.speed;
if (self.Alpha <= 0) then
 
if (self.Alpha>0) then
self.Alpha = math.max(self.Alpha - self.TargetAlpha * elapsed * 0.5 * self.Aura.speed, 0);
local newWidth = self.Width + self.Aura.size * elapsed * 100 * self.Aura.speed;
if (newWidth * 1.5 > self.Width) then
self.Width = newWidth;
self.Height = self.Height + self.Aura.size * elapsed * 100 * self.Aura.speed;
end
else
self.Alpha = self.TargetAlpha;
self.Width = self.TargetWidth * 0.85;
self.Height = self.TargetHeight * 0.85;
self.X = self.TargetX + (random(0,20) - 10) * self.Aura.speed
self.Y = self.TargetY + (random(0,20) - 10) * self.Aura.speed
else
local width = self.Width + elapsed * 100 * self.Aura.speed * self.Aura.size;
if ( (width * 1.5) > self.Width) then --- evite les lags
self.Width = width;
self.Height = self.Height + elapsed * 100 * self.Aura.speed * self.Aura.size;
end
local deltaX = (random(0,20) - 10) * self.Aura.speed;;
local deltaY = (random(0,20) - 10) * self.Aura.speed;;
frame:SetPoint("Center",self.Aura.x + deltaX, self.Aura.y + deltaY);
end
 
self:UpdateFrame();
end
 
 
if (frame:GetAlpha() > 0) then
self.curScale.a = frame:GetAlpha() - (elapsed * aura.alpha * 0.5 * aura.speed);
if (self.curScale.a < 0) then frame:SetAlpha(0.0);
else frame:SetAlpha(self.curScale.a); end
self.maxScale.w = frame:GetWidth() + (elapsed * 100 * aura.speed * aura.size);
self.maxScale.h = frame:GetHeight() + (elapsed * 100 * aura.speed * aura.size);
if ( (self.maxScale.w * 1.5) > frame:GetWidth()) then --- evite les lags
frame:SetWidth(self.maxScale.w)
frame:SetHeight(self.maxScale.h)
end
else
self.maxScale.w = (random(0,20) - 10) * aura.speed;
self.maxScale.h = (random(0,20) - 10) * aura.speed;
frame:SetAlpha(aura.alpha);
frame:SetWidth(self.curScale.w * 0.85);
frame:SetHeight(self.curScale.h * 0.85);
frame:SetPoint("Center",aura.x + self.maxScale.w, aura.y + self.maxScale.h);
end
]]
 
cPowaAnimationElectric = PowaClass(cPowaAnimationBaseTranslate, {OffsetX=0, OffsetY=0});
function cPowaAnimationElectric:Initialise()
self.Alpha = self.Frame:GetAlpha();
self.Width = self.Frame:GetWidth();
self.Height = self.Frame:GetHeight();
self.TargetX = self.Aura.x;
self.TargetY = self.Aura.y;
self.X = self.TargetX;
self.Y = self.TargetY;
self.Status = 0;
end
function cPowaAnimationElectric:Update(elapsed)
PowaAuras:UnitTestInfo("cPowaAnimationElectric Update ", elapsed);
 
if (self.Status == 0) then
if (random( 210 - self.Aura.speed * 100 ) == 1) then
if (self.Status ~=1) then
if (random( 210-(self.Aura.speed*100) ) == 1) then
self.X = self.TargetX + random(0,10) - 5;
self.Y = self.TargetY + random(0,10) - 5;
self.Alpha = self.TargetAlpha;
438,150 → 449,6
self:UpdateFrame();
end
 
 
cPowaAnimationShrinking = PowaClass(cPowaAnimationBase);
function cPowaAnimationShrinking:Initialise()
self.Alpha = self.Frame:GetAlpha();
self.Width = self.Frame:GetWidth();
self.Height = self.Frame:GetHeight();
self.MinWidth = self.TargetWidth;
self.MinHeight = self.TargetHeight;
self.MaxWidth = self.TargetWidth * 1.3;
self.MaxHeight = self.TargetHeight * 1.3;
self.Status = 0;
end
function cPowaAnimationShrinking:Update(elapsed)
PowaAuras:UnitTestInfo("cPowaAnimationShrinking Update ", elapsed);
 
if (self.Status == 0) then --- demarre le zoom out (max size)
self.Width = self.MaxWidth;
self.Height = self.MaxHeight;
self.Alpha = 0.0;
self.Status = 2;
elseif (self.Status == 2) then --- zoom out + fade in
local speedScale = 50 * self.Aura.speed * self.Aura.size;
self.Width = self.Width - elapsed * speedScale * self.Aura.torsion;
self.Height = self.Height - elapsed * speedScale * (2-self.Aura.torsion);
self.Alpha = self.TargetAlpha * (self.MaxWidth - self.Width) / (self.MaxWidth - self.MinWidth);
 
if (self.Width <= self.MinWidth) then
self.Width = self.MinWidth;
self.Height = self.MinHeight;
self.Status = 1;
end
elseif (self.Status == 1) then --- demarre le fade-out
self.Width = self.MinWidth;
self.Height = self.MinHeight;
self.Alpha = self.TargetAlpha;
self.Status = 3;
 
elseif (self.Status == 3) then --- fade-out
self.Alpha = self.Alpha - (elapsed / random(1,2));
if (self.Alpha <= 0.0) then
self.Alpha = 0;
self.Status = 0;
end
end
self:UpdateFrame();
end
 
 
 
cPowaAnimationFlame = PowaClass(cPowaAnimationBaseTranslate, {OffsetX=0, OffsetY=0});
function cPowaAnimationFlame:Initialise()
self.Alpha = self.Frame:GetAlpha();
self.Width = self.Frame:GetWidth();
self.Height = self.Frame:GetHeight();
self.TargetX = self.Aura.x;
self.TargetY = self.Aura.y;
self.X = self.TargetX;
self.Y = self.TargetY;
self.Status = 0;
end
function cPowaAnimationFlame:Update(elapsed)
PowaAuras:UnitTestInfo("cPowaAnimationFlame Update ", elapsed);
 
 
if (self.Status < 2) then --- reset to center
self.Width = self.TargetWidth;
self.Height = self.TargetHeight;
self.Alpha = self.TargetAlpha;
self.X = self.TargetX;
self.Y = self.TargetY;
self.Status = 2;
else
local speedScale = 50 * self.Aura.speed * self.Aura.size;
self.X = self.X + random(1,3) - 2;
self.Y = self.Y + elapsed * random(10,20);
self.Alpha = self.Alpha - self.TargetAlpha * elapsed / random(2,4);
self.Width = self.Width - elapsed * speedScale * self.Aura.torsion;
self.Height = self.Height - elapsed * speedScale * (2-self.Aura.torsion);
if (self.Alpha < 0.0) then
self.Alpha = 0;
self.Status = 1;
end
end
 
self:UpdateFrame();
end
 
cPowaAnimationOrbit = PowaClass(cPowaAnimationBaseTranslate, {OffsetX=0, OffsetY=0});
function cPowaAnimationOrbit:Initialise()
self.Alpha = self.Frame:GetAlpha();
self.TargetX = self.Aura.x;
self.TargetY = self.Aura.y;
self.X = self.TargetX;
self.Y = self.TargetY;
self.MaxWidth = math.max(self.TargetX, -self.TargetX, 5) * 1.0;
self.MaxHeight = self.MaxWidth * (1.6 - self.Aura.torsion);
self.Width = self.TargetWidth / self.Aura.torsion;
self.Height = self.TargetHeight / (2-self.Aura.torsion);
self.Angle = 0;
--- annule la symetrie
if self.Aura.textaura ~= true then
local texture = self.Aura:GetTexture();
if (texture) then
texture:SetTexCoord(0, 1, 0, 1);
end
end
end
function cPowaAnimationOrbit:Update(elapsed)
PowaAuras:UnitTestInfo("cPowaAnimationOrbit Update ", elapsed);
 
local speedScale = elapsed * 75 * self.Aura.speed;
 
if (self.Aura.isSecondary and (PowaAuras.Auras[self.Aura.id].anim1 == PowaAuras.AnimationTypes.Orbit)) then
if (self.Aura.symetrie < 2) then
self.Angle = PowaAuras.Auras[self.Aura.id].animation.Angle + 180;
if (self.Angle > 360) then self.Angle = self.Angle - 360; end
else
self.Angle = 180 - PowaAuras.Auras[self.Aura.id].animation.Angle;
if (self.Angle < 0) then self.Angle = self.Angle + 360; end
end
elseif (self.Aura.symetrie == 1 or self.Aura.symetrie == 3) then
self.Angle = self.Angle - speedScale;
if (self.Angle < 0) then self.Angle = 360; end
else
self.Angle = self.Angle + speedScale;
if (self.Angle > 360) then self.Angle = 0; end
end
 
--- transparence
if (self.Angle < 180) then --- zone de transparence
if (self.Angle < 90) then
self.Alpha = self.TargetAlpha * (1-self.Angle/90);
else
self.Alpha = self.TargetAlpha * (self.Angle/90-1);
end
else
self.Alpha = self.TargetAlpha;
end
self.X = self.MaxWidth * cos(self.Angle);
self.Y = self.TargetY + self.MaxHeight * sin(self.Angle);
 
self:UpdateFrame();
end
 
-- Concrete Animation Classes
PowaAuras.AnimationMainClasses = {
[PowaAuras.AnimationTypes.Static] = cPowaAnimationBase,
trunk/PowerAuras/Manual_Pics/Thumbs.db Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
trunk/PowerAuras/PowerAurasBase.lua
1,19 → 1,20
PowaAuras = {
Version = GetAddOnMetadata("PowerAuras", "Version");
Version = "v2.6.2Q";
 
CurrentAuraId = 1;
MaxAuras = 360;
ChecksTimer = 0;
NextCheck = 0.2;
Tstep = 0.09765625;
DebugTimer = 0;
NextDebugCheck = 0;
 
DebugTimer = 0;
ChecksTimer = 0;
ThrottleTimer = 0;
AnimationThrottleTimer = 0;
 
Initialising = true;
ModTest = false; --- on test les effets
 
minScale = {a=0, w=0, h=0};
maxScale = {a=0, w=0, h=0};
curScale = {a=0, w=0, h=0};
 
DoResetAoe = false;
ResetTargetTimers = false;
48,7 → 49,7
MainOptionPage = 1;
CurrentAuraPage = 1;
 
maxtextures = 58;
maxtextures = 50;
 
MoveEffect = 0; -- 1 = copie / 2 = move
 
59,7 → 60,7
Textures = {};
SecondaryTextures = {};
TimerFrame = {};
StacksFrames = {};
StacksFrame = {};
 
Sound = {};
BeginAnimDisplay = {};
69,6 → 70,13
 
DebuffCatSpells = {};
 
--- These will be saved out to SavedVariables
Misc =
{
disabled = false,
debug = false,
};
 
playerclass = "unknown",
 
Events =
106,7 → 114,6
"UNIT_SPELLCAST_CHANNEL_UPDATE",
"UNIT_SPELLCAST_CHANNEL_STOP",
"UNIT_SPELLCAST_SUCCEEDED",
"UNIT_THREAT_SITUATION_UPDATE",
"PARTY_MEMBERS_CHANGED",
"RAID_ROSTER_UPDATE",
"COMBAT_LOG_EVENT_UNFILTERED",
176,7 → 183,7
TargetSpells = false,
FocusSpells = false,
 
OwnSpells = false,
OwnSpell = false,
};
 
BuffTypes =
290,7 → 297,7
TargetSpells = {},
FocusSpells = {},
 
OwnSpells = {},
OwnSpell = {},
};
 
DebuffCatType =
548,7 → 555,7
end
 
function PowaAuras:Debug(...)
if (PowaMisc.debug == true) then
if (self.Misc.debug == true) then
self:Message(...) --OK
end
self:UnitTestDebug(...);
trunk/PowerAuras/PowerOptions.xml
67,7 → 67,7
-- ------------------------------------------------------------------------------------------------
<Frame name="PowaOptionsFrame" toplevel="true" movable="true" parent="UIParent" frameStrata="MEDIUM" hidden="true" enableMouse="true" enableKeyboard="true">
<Size>
<AbsDimension x="328" y="430" />
<AbsDimension x="328" y="470" />
</Size>
<Anchors>
<Anchor point="CENTER" relativeTo="UIParent">
169,6 → 169,49
</Anchors>
</Button>
 
-- case desactiver
<CheckButton name="PowaEnableButton" inherits="PowaCheckTemplate">
<Size>
<AbsDimension x="25" y="25"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="PowaOptionsFrame" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="20" y="-20"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.tooltipText = PowaAuras.Text.aideEnable;
getglobal("PowaEnableButtonText"):SetText(PowaAuras.Text.nomEnable);
</OnLoad>
<OnClick>
PowaAuras:EnableChecked();
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="PowaDebugButton" inherits="PowaCheckTemplate">
<Size>
<AbsDimension x="25" y="25"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="PowaOptionsFrame" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="20" y="-45"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self.tooltipText = PowaAuras.Text.aideDebug;
getglobal("PowaDebugButtonText"):SetText(PowaAuras.Text.nomDebug);
</OnLoad>
<OnClick>
PowaAuras:DebugChecked();
</OnClick>
</Scripts>
</CheckButton>
-- bouton Editer
<Button name="PowaEditButton" inherits="OptionsButtonTemplate" text="Editer">
<Anchors>
228,8 → 271,7
</OnClick>
</Scripts>
</Button>
 
-- --------------------------------------------------------------------- Fenetre icones effets
-- --------------------------------------------------------------------- Fenetre icones effets
<Frame name="PowaOptionsSelectorFrame">
<Size>
<AbsDimension x="194" y="355"/>
237,7 → 279,7
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-20" y="-30"/>
<AbsDimension x="-20" y="-70"/>
</Offset>
</Anchor>
</Anchors>
trunk/PowerAuras/localisation_frFR.lua
176,7 → 176,6
aideOwnTex = "Use the De/Buff or Ability Texture instead.", -- untranslated
nomStacks = "Stacks", -- untranslated
 
nomUpdateSpeed = "Update speed",
nomSpeed = "Vitesse d'Anim.",
nomBegin = "Animation de d\195\169part",
nomEnd = "Animation de fin",
trunk/PowerAuras/Timers2.tga Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes : Added: svn:mime-type + application/octet-stream