Quantcast

- fix for canStopChannelling

Sidoine De Wispelaere [02-06-10 - 10:51]
- fix for canStopChannelling
- do not cast horn of winter if strength of earth totem
- latency correction is an option (disabled by default)

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@222 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Locale-enUS.lua
Locale-frFR.lua
Ovale.lua
OvaleFrame.lua
defaut/Chevalier.lua
diff --git a/Locale-enUS.lua b/Locale-enUS.lua
index 3905f5b..8705657 100644
--- a/Locale-enUS.lua
+++ b/Locale-enUS.lua
@@ -44,4 +44,5 @@ L["Les icônes se déplacent"] = "Scroll the icons"
 L["multidot"] = "Damage Over Time on multiple targets"
 L["buff"] = "Buffs"
 L["Inverser la boîte à cocher "] = "Toggle check box"
-L["Ignorer les clics souris"] = "Ignore mouse clicks"
\ No newline at end of file
+L["Ignorer les clics souris"] = "Ignore mouse clicks"
+L["Correction de la latence"] = "Latency correction"
\ No newline at end of file
diff --git a/Locale-frFR.lua b/Locale-frFR.lua
index a1bdcbd..6a5e5a3 100644
--- a/Locale-frFR.lua
+++ b/Locale-frFR.lua
@@ -44,4 +44,5 @@ L["Les icônes se déplacent"] = true
 L["multidot"] = "Multicible pour DoTs"
 L["buff"] = "Améliorations"
 L["Inverser la boîte à cocher "] = true
-L["Ignorer les clics souris"] = true
\ No newline at end of file
+L["Ignorer les clics souris"] = true
+L["Correction de la latence"] = true
\ No newline at end of file
diff --git a/Ovale.lua b/Ovale.lua
index 7d56400..6e8567c 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -223,6 +223,14 @@ local options =
 					name = L["Ignorer les clics souris"],
 					get = function(info) return Ovale.db.profile.apparence.clickThru end,
 					set = function(info, value) Ovale.db.profile.apparence.clickThru = value; Ovale:UpdateFrame() end
+				},
+				latencyCorrection =
+				{
+					order = 16,
+					type = "toggle",
+					name = L["Correction de la latence"],
+					get = function(info) return Ovale.db.profile.apparence.latencyCorrection end,
+					set = function(info, value) Ovale.db.profile.apparence.latencyCorrection = value end
 				}
 			}
 		},
@@ -1128,10 +1136,12 @@ function Ovale:InitCalculerMeilleureAction()
 		v.toggled = nil
 	end

-	for i,v in ipairs(self.lastSpell) do
-		if not self.spellInfo[v.name] or not self.spellInfo[v.name].toggle then
-			if self.maintenant - v.time<1 then
-				self:AddSpellToStack(v.name, v.time, v.time, v.time, v.nocd)
+	if (Ovale.db.profile.apparence.latencyCorrection) then
+		for i,v in ipairs(self.lastSpell) do
+			if not self.spellInfo[v.name] or not self.spellInfo[v.name].toggle then
+				if self.maintenant - v.time<1 then
+					self:AddSpellToStack(v.name, v.time, v.time, v.time, v.nocd)
+				end
 			end
 		end
 	end
@@ -1359,7 +1369,8 @@ function Ovale:CalculerMeilleureAction(element)
 				end

 				if restant<self.attenteFinCast then
-					if spellName==self.currentSpellName or not self.spellInfo[self.currentSpellName] or
+					if -- spellName==self.currentSpellName or
+						not self.spellInfo[self.currentSpellName] or
 							not self.spellInfo[self.currentSpellName].canStopChannelling then
 						restant = self.attenteFinCast
 					else
@@ -1632,7 +1643,7 @@ function Ovale:ChargerDefaut()
 			list = {},
 			apparence = {enCombat=false, iconWidth = 64, iconHeight = 64, margin = 4,
 				smallIconWidth=28, smallIconHeight=28, raccourcis=true, numeric=false, avecCible = false,
-				verrouille = false, vertical = false, predictif=false, highlightIcon = true, clickThru = false},
+				verrouille = false, vertical = false, predictif=false, highlightIcon = true, clickThru = false, latencyCorrection=false},
 			skin = {SkinID="Blizzard", Backdrop = true, Gloss = false, Colors = {}}
 		}
 	})
diff --git a/OvaleFrame.lua b/OvaleFrame.lua
index 71c47e9..f1b52b3 100644
--- a/OvaleFrame.lua
+++ b/OvaleFrame.lua
@@ -156,6 +156,11 @@ do
 				start = actionCooldownStart + actionCooldownDuration
 			end

+			-- Dans le cas de canStopChannelling, on risque de demander d'interrompre le channelling courant, ce qui est stupide
+			if start and Ovale.currentSpellName and Ovale.attenteFinCast and spellName == Ovale.currentSpellName and start<Ovale.attenteFinCast then
+				start = Ovale.attenteFinCast
+			end
+
 			if (node.params.nocd and start~=nil and Ovale.maintenant<start-node.params.nocd) then
 				action.icons[1]:Update(element, nil)
 			else
diff --git a/defaut/Chevalier.lua b/defaut/Chevalier.lua
index 85b272c..5f1439b 100644
--- a/defaut/Chevalier.lua
+++ b/defaut/Chevalier.lua
@@ -53,6 +53,7 @@ SpellInfo(RUNESTRIKE toggle=1)
 SpellAddBuff(BONESHIELD BONESHIELD=300)
 SpellAddBuff(UNBREAKABLEARMOR UNBREAKABLEARMOR=20)
 SpellAddBuff(ICEBOUNDFORTITUDE ICEBOUNDFORTITUDE=18)
+SpellInfo(HORNOFWINTER cd=20)
 SpellInfo(HYSTERIA cd=300)
 SpellInfo(SUMMONGARGOYLE cd=180)
 SpellInfo(ARMYOFTHEDEAD cd=600)