Quantcast

- bug fix: border were still visible when icons should be hidden

Sidoine De Wispelaere [06-29-09 - 18:31]
- bug fix: border were still visible when icons should be hidden

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@76 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Ovale.lua
Ovale.toc
OvaleIcone.lua
diff --git a/Ovale.lua b/Ovale.lua
index 5a51815..a6644be 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -58,6 +58,7 @@ local options =
 					end,
 					set = function(info, v)
 						Ovale.db.profile.apparence.enCombat = v
+						Ovale:UpdateVisibility()
 					end,
 					width = full
 				},
@@ -71,6 +72,7 @@ local options =
 					end,
 					set = function(info, v)
 						Ovale.db.profile.apparence.avecCible = v
+						Ovale:UpdateVisibility()
 					end,
 					width = full
 				},
@@ -288,6 +290,16 @@ function Ovale:PLAYER_TARGET_CHANGED()
 end
 ]]

+function Ovale:PLAYER_TARGET_CHANGED()
+	if (Ovale.db.profile.apparence.avecCible) then
+		if not UnitExists("target") then
+			self.frame:Hide()
+		else
+			self.frame:Show()
+		end
+	end
+end
+

 function Ovale:UNIT_AURA(event, unit)
 	if (unit == "player") then
@@ -426,7 +438,7 @@ function Ovale:OnEnable()
     self:RegisterEvent("UNIT_AURA");
     self:RegisterEvent("ACTIONBAR_PAGE_CHANGED")

-    -- self:RegisterEvent("PLAYER_TARGET_CHANGED")
+    self:RegisterEvent("PLAYER_TARGET_CHANGED")
     -- self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")

 	if (not self.firstInit) then
@@ -438,10 +450,18 @@ end

 function Ovale:PLAYER_REGEN_ENABLED()
 	self.enCombat = false
+	if (Ovale.db.profile.apparence.enCombat and not Ovale.enCombat) then
+		self.frame:Hide()
+	end
 end

 function Ovale:PLAYER_REGEN_DISABLED()
 	self.enCombat = true
+
+	if (Ovale.db.profile.apparence.enCombat and not Ovale.enCombat) then
+		self.frame:Show()
+	end
+
 end

 function Ovale:OnDisable()
@@ -455,7 +475,7 @@ function Ovale:OnDisable()
     self:UnregisterEvent("CHARACTER_POINTS_CHANGED")
     self:UnregisterEvent("UPDATE_BINDINGS")
     self:UnregisterEvent("UNIT_AURA")
-    -- self:UnregisterEvent("PLAYER_TARGET_CHANGED")
+    self:UnregisterEvent("PLAYER_TARGET_CHANGED")
     -- self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
     self.frame:Hide()
 end
@@ -891,11 +911,25 @@ function Ovale:ToggleOptions()
 	self.frame:ToggleOptions()
 end

+function Ovale:UpdateVisibility()
+	self.frame:Show()
+
+	if (Ovale.db.profile.apparence.avecCible and not UnitExists("target")) then
+		self.frame:Hide()
+	end
+
+	if (Ovale.db.profile.apparence.enCombat and not Ovale.enCombat) then
+		self.frame:Hide()
+	end
+end
+
 function Ovale:UpdateFrame()
 	self.frame:ReleaseChildren()

 	self.frame:UpdateIcons()

+	self:UpdateVisibility()
+
 	self.checkBoxes = {}

 	for k,v in pairs(self.casesACocher) do
diff --git a/Ovale.toc b/Ovale.toc
index e2b2037..efb85d3 100644
--- a/Ovale.toc
+++ b/Ovale.toc
@@ -3,7 +3,7 @@
 ## Notes: Show the icon of the next spell to cast
 ## Notes-frFR: Affiche l'icône du prochain sort à lancer
 ## Author: Sidoine
-## Version: 3.1.14
+## Version: 3.1.15
 ## OptionalDeps: Ace3, ButtonFacade
 ## SavedVariables: OvaleDB
 ## SavedVariablesPerCharacter: OvaleDBPC
diff --git a/OvaleIcone.lua b/OvaleIcone.lua
index c04b0b8..6fe7796 100644
--- a/OvaleIcone.lua
+++ b/OvaleIcone.lua
@@ -18,13 +18,6 @@
 		Ovale.trace = true
 	end

-	if (Ovale.db.profile.apparence.avecCible and not UnitExists("target")) then
-		minAttente = nil
-	end
-
-	if (Ovale.db.profile.apparence.enCombat and not Ovale.enCombat) then
-		minAttente = nil
-	end

 	if (self.masterNode.params.nocd and
 		self.masterNode.params.nocd == 1 and minAttente~=nil and minAttente>1.5) then