From d51987e009920d5ea1a99a24488b5efa88727c50 Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Sat, 19 Dec 2009 21:23:01 +0000 Subject: [PATCH] - added sound parameter to Spell function & so git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@170 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleCompile.lua | 4 ++-- OvaleFrame.lua | 8 ++++---- OvaleIcone.lua | 8 +++++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/OvaleCompile.lua b/OvaleCompile.lua index ac9639a..38717dc 100644 --- a/OvaleCompile.lua +++ b/OvaleCompile.lua @@ -11,7 +11,7 @@ end local function ParseParameters(params) local paramList = {} - for k,v in string.gmatch(params, "(%w+)=([-%w]+)") do + for k,v in string.gmatch(params, "(%w+)=([-%w\\_%.]+)") do if (string.match(v,"^%-?%d+%.?%d*$")) then v = tonumber(v) end @@ -22,7 +22,7 @@ local function ParseParameters(params) end params = string.gsub(params,"%w+=%w+","") local n=0 - for w in string.gmatch(params, "[%w_]+") do + for w in string.gmatch(params, "[%w_\\%.]+") do if (string.match(w,"^%-?%d+%.?%d*$")) then w = tonumber(w) end diff --git a/OvaleFrame.lua b/OvaleFrame.lua index cba471e..b687f71 100644 --- a/OvaleFrame.lua +++ b/OvaleFrame.lua @@ -157,9 +157,9 @@ do end if (node.params.nocd and node.params.nocd == 1 and start~=nil and start>Ovale.maintenant+1.5) then - action.icons[1]:Update(nil) + action.icons[1]:Update(element, nil) else - action.icons[1]:Update(start, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, + action.icons[1]:Update(element, start, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, actionTarget) end @@ -207,9 +207,9 @@ do end Ovale:AddSpellToStack(spellName, start, start + castTime, nextCast) start, ending, priorite, element = Ovale:CalculerMeilleureAction(node) - action.icons[2]:Update(start, Ovale:GetActionInfo(element)) + action.icons[2]:Update(element, start, Ovale:GetActionInfo(element)) else - action.icons[2]:Update(nil) + action.icons[2]:Update(element, nil) end end end diff --git a/OvaleIcone.lua b/OvaleIcone.lua index c4c2c38..2945ccb 100644 --- a/OvaleIcone.lua +++ b/OvaleIcone.lua @@ -1,7 +1,7 @@ local LBF = LibStub("LibButtonFacade", true) local L = LibStub("AceLocale-3.0"):GetLocale("Ovale") -local function Update(self, minAttente, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, +local function Update(self, element, minAttente, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellName, actionTarget) @@ -19,6 +19,7 @@ local function Update(self, minAttente, actionTexture, actionInRange, actionCool if (minAttente == Ovale.maintenant) then self.cd:Hide() else + self.lastSound = nil self.cd:Show() self.cd:SetCooldown(self.debutAction, self.finAction - self.debutAction); end @@ -47,6 +48,11 @@ local function Update(self, minAttente, actionTexture, actionInRange, actionCool if (minAttente==Ovale.maintenant) then self.cd:Hide() + if element.params.sound and not self.lastSound then + self.lastSound = element.params.sound + print("Play" .. self.lastSound) + PlaySoundFile(self.lastSound) + end end -- La latence -- 1.7.9.5