Quantcast

compile error with glyphs

Sidoine De Wispelaere [02-14-12 - 21:07]
compile error with glyphs

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@475 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Ovale.lua
OvaleCompile.lua
OvaleFrame.lua
diff --git a/Ovale.lua b/Ovale.lua
index 245f9bc..7d93535 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -721,7 +721,7 @@ function Ovale:CompileAll()
 end

 function Ovale:HandleProfileChanges()
-	if (self.firstInit) then
+	if self.firstInit then
 		if (self.db.profile.code) then
 			self.needCompile = true
 		end
@@ -767,16 +767,20 @@ function Ovale:FirstInit()
 	self.db.RegisterCallback( self, "OnProfileCopied", "HandleProfileChanges" )


-	if (self.db.profile.code) then
+	if self.db.profile.code then
 		self.needCompile = true
 	end
 	self:UpdateFrame()
-	if (not Ovale.db.profile.display) then
+	if not Ovale.db.profile.display then
 		self.frame:Hide()
 	end
 end

 function Ovale:OnEnable()
+	if not self.firstInit then
+		self:FirstInit()
+	end
+
     -- Called when the addon is enabled
 	RegisterAddonMessagePrefix("Ovale")
     self:RegisterEvent("PLAYER_REGEN_ENABLED");
@@ -800,9 +804,6 @@ function Ovale:OnEnable()
 	self:RegisterEvent("GLYPH_ADDED")
 	self:RegisterEvent("UNIT_INVENTORY_CHANGED")

-	if (not self.firstInit) then
-		self:FirstInit()
-	end
 	self:UNIT_AURA("","player")

 	self:UpdateVisibility()
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 289e908..68eaa4d 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -37,6 +37,32 @@ local function ParseParameters(params)
 end


+local function HasGlyph(spellId)
+	for i = 1, GetNumGlyphSockets() do
+		local enalbled, glypType, glyphSpellID = GetGlyphSocketInfo(i)
+		if (glyphSpellID == spellId) then
+			return true
+		end
+	end
+	return false
+end
+
+local function HasTalent(talentId)
+	if not Ovale.listeTalentsRemplie then
+		Ovale:RemplirListeTalents()
+	end
+	if Ovale.listeTalentsRemplie then
+		if Ovale.pointsTalent[talentId]~=nil then
+			return Ovale.pointsTalent[talentId]>0
+		else
+			Ovale:Print("Unknown talent "..talentId)
+			return false
+		end
+	else
+		return false
+	end
+end
+
 local function TestConditions(paramList)
 	if paramList.glyph and not HasGlyph(paramList.glyph) then
 		return false
@@ -154,31 +180,6 @@ local function ParseSpellAddTargetDebuff(params)
 	return ""
 end

-local function HasGlyph(spellId)
-	for i = 1, GetNumGlyphSockets() do
-		local enalbled, glypType, glyphSpellID = GetGlyphSocketInfo(i)
-		if (glyphSpellID == spellId) then
-			return true
-		end
-	end
-	return false
-end
-
-local function HasTalent(talentId)
-	if not Ovale.listeTalentsRemplie then
-		Ovale:RemplirListeTalents()
-	end
-	if Ovale.listeTalentsRemplie then
-		if Ovale.pointsTalent[talentId]~=nil then
-			return Ovale.pointsTalent[talentId]>0
-		else
-			Ovale:Print("Unknown talent "..talentId)
-			return false
-		end
-	else
-		return false
-	end
-end

 local function ParseSpellInfo(params)
 	local paramList = ParseParameters(params)
diff --git a/OvaleFrame.lua b/OvaleFrame.lua
index 0a11845..6e45dff 100644
--- a/OvaleFrame.lua
+++ b/OvaleFrame.lua
@@ -144,11 +144,7 @@ do
 		end

 		local now = GetTime()
-
-		if not Ovale.masterNodes then
-			return
-		end
-
+
 		if not Ovale.refreshNeeded and self.lastUpdate and now < self.lastUpdate + Ovale.db.profile.apparence.updateInterval then
 			return
 		end