From 15fd594537da2dfda2fcd572a047f22eee9f4b78 Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Sat, 10 Oct 2009 19:55:15 +0000 Subject: [PATCH] - added multidotting with OtherDebuffExpires() (see shadow priest example) - fixed a bug in prediction - added mind flay 2 ticks support (not quite complete) - "focus" is displayed on the icons if it is a spell to cast on the focus git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@117 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Condition.lua | 26 +++++++++++++++ Locale-enUS.lua | 3 +- Locale-frFR.lua | 3 +- Ovale.lua | 96 +++++++++++++++++++++++++++++++++++++++++++++-------- OvaleCompile.lua | 2 +- OvaleFrame.lua | 4 +-- OvaleIcone.lua | 15 ++++++++- OvaleIcone.xml | 1 - defaut/Pretre.lua | 6 +++- 9 files changed, 134 insertions(+), 22 deletions(-) diff --git a/Condition.lua b/Condition.lua index 5fb706e..d5c8157 100644 --- a/Condition.lua +++ b/Condition.lua @@ -434,6 +434,32 @@ Ovale.conditions= ManaPercent = function(condition) return compare(UnitPower("player")/UnitPowerMax("player"), condition[1], condition[2]/100) end, + OtherDebuffExpires = function(condition) + Ovale:EnableOtherDebuffs() + local otherDebuff = Ovale.otherDebuffs[GetSpellInfo(condition[1])] + if otherDebuff then + local timeBefore = condition[2] or 0 + local maxTime = condition[3] or 10 + local minTime + for k,v in pairs(otherDebuff) do + local diff = v - Ovale.maintenant + if diff<-maxTime then + -- Ovale:Print("enlève obsolète sur "..k) + otherDebuff[k] = nil + elseif k~=UnitGUID("target") and (not minTime or diff=0 then if newSpell.info then @@ -774,12 +810,12 @@ function Ovale:InitCalculerMeilleureAction() -- On attend que le sort courant soit fini local spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitCastingInfo("player") if (spell) then - self:AddSpellToStack(spell, startTime - Ovale.maintenant, endTime/1000 - Ovale.maintenant, endTime/1000 - Ovale.maintenant) + self:AddSpellToStack(spell, startTime/1000 - Ovale.maintenant, endTime/1000 - Ovale.maintenant, endTime/1000 - Ovale.maintenant) end local spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitChannelInfo("player") if (spell) then - self:AddSpellToStack(spell, startTime - Ovale.maintenant, endTime/1000 - Ovale.maintenant, endTime/1000 - Ovale.maintenant) + self:AddSpellToStack(spell, startTime/1000 - Ovale.maintenant, endTime/1000 - Ovale.maintenant, endTime/1000 - Ovale.maintenant) end end @@ -890,6 +926,12 @@ function Ovale:GetActionInfo(element) actionShortcut = nil actionIsCurrent = nil end + elseif element.func=="Texture" then + actionTexture = "Interface\\Icons\\"..element.params[1] + actionCooldownStart = Ovale.maintenant + actionCooldownDuration = 0 + actionEnable = 1 + actionUsable = true end if (action and not actionTexture) then @@ -910,7 +952,7 @@ function Ovale:GetActionInfo(element) end return actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, - actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName + actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, target end function Ovale:CalculerMeilleureAction(element) @@ -924,7 +966,7 @@ function Ovale:CalculerMeilleureAction(element) --TODO: créer un objet par type au lieu de ce if else if tout moche if (element.type=="function")then - if (element.func == "Spell" or element.func=="Macro" or element.func=="Item") then + if (element.func == "Spell" or element.func=="Macro" or element.func=="Item" or element.func=="Texture") then local action local actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName = self:GetActionInfo(element) @@ -954,9 +996,28 @@ function Ovale:CalculerMeilleureAction(element) else restant = actionCooldownDuration - (self.maintenant - actionCooldownStart); end - if restant1.5) then action.icons[1]:Update(nil) else action.icons[1]:Update(minAttente, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, - actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName) + actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, actionTarget) end action.spellName = spellName diff --git a/OvaleIcone.lua b/OvaleIcone.lua index 4853a17..0b4e62e 100644 --- a/OvaleIcone.lua +++ b/OvaleIcone.lua @@ -1,7 +1,8 @@ local LBF = LibStub("LibButtonFacade", true) +local L = LibStub("AceLocale-3.0"):GetLocale("Ovale") local function Update(self, minAttente, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, - actionUsable, actionShortcut) + actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, actionTarget) if (not Ovale.bug) then Ovale.traced = false @@ -85,11 +86,17 @@ local function Update(self, minAttente, actionTexture, actionInRange, actionCool else self.aPortee:Hide() end + if actionTarget=="focus" then + self.focusText:Show() + else + self.focusText:Hide() + end else self.icone:Hide() self.aPortee:Hide() self.shortcut:Hide() self.remains:Hide() + self.focusText:Hide() end return minAttente,element end @@ -125,6 +132,12 @@ function OvaleIcone_OnLoad(self) self.cd = _G[name.."Cooldown"] self.normalTexture = _G[name.."NormalTexture"] + self.focusText = self:CreateFontString(nil, "OVERLAY"); + self.focusText:SetFontObject("GameFontNormal"); + self.focusText:SetAllPoints(self); + self.focusText:SetTextColor(1,1,1); + self.focusText:SetText(L["Focus"]) + self:RegisterForClicks("LeftButtonUp") self.SetSkinGroup = SetSkinGroup self.Update = Update diff --git a/OvaleIcone.xml b/OvaleIcone.xml index 3bbeb3f..d12bc7b 100644 --- a/OvaleIcone.xml +++ b/OvaleIcone.xml @@ -2,7 +2,6 @@ - OvaleIcone_OnLoad(self); OvaleIcone_OnClick(self) diff --git a/defaut/Pretre.lua b/defaut/Pretre.lua index 6d18a4a..8b8facf 100644 --- a/defaut/Pretre.lua +++ b/defaut/Pretre.lua @@ -16,10 +16,11 @@ Define(Shadowfiend 34433) # Spells with cast time that add buff or debuff SpellAddTargetDebuff(SWP SWP=18) +SpellInfo(SWP duration=18) SpellAddBuff(SWP SW=15) SpellAddTargetDebuff(VT VT=15) SpellAddBuff(VT SW=15) -SpellInfo(MF canStopChannelling=1) +SpellInfo(MF canStopChannelling=3) SpellAddBuff(MF SW=15) SpellInfo(MB cd=5.5) SpellAddBuff(MB SW=15) @@ -63,6 +64,9 @@ Spell(MB) if TargetDebuffExpires(DP 0 mine=1) Spell(DP) +if OtherDebuffExpires(SWP) + Texture(INV_Misc_Coin_01) + #cast Mind flay if nothing else can be done Spell(MF priority=2) -- 1.7.9.5