Quantcast

- added show/hide command

Sidoine De Wispelaere [06-11-09 - 18:16]
- added show/hide command

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@66 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Condition.lua
Locale-enUS.lua
Locale-frFR.lua
Ovale.lua
Ovale.toc
defaut/Chasseur.lua
diff --git a/Condition.lua b/Condition.lua
index c22022c..b88854c 100644
--- a/Condition.lua
+++ b/Condition.lua
@@ -317,7 +317,7 @@ Ovale.conditions=
 	end,
 	IsRooted = function(condition)
 		buildRootSpellList()
-		return testbool(not HasFullControl() and isDebuffInList(rootSpellList), condition[1])
+		return testbool(isDebuffInList(rootSpellList), condition[1])
 	end,
 	IsStunned = function(condition)
 		buildStunSpellList()
@@ -416,7 +416,8 @@ Ovale.conditions=
 		return compare(Ovale.pointsTalent[condition[1]], condition[2], condition[3])
 	end,
 	TargetClass = function(condition)
-		return testbool(UnitClass("target") == condition[1], condition[2])
+		local loc, noloc = UnitClass("target")
+		return testbool(noloc == condition[1], condition[2])
 	end,
 	-- Test the target classification
 	-- 1 : normal, elite, or worldboss
diff --git a/Locale-enUS.lua b/Locale-enUS.lua
index a45ea89..aab5d5f 100644
--- a/Locale-enUS.lua
+++ b/Locale-enUS.lua
@@ -11,8 +11,8 @@ L["Hauteur des petites icônes"] = "Small icon height"
 L["La hauteur des petites icônes"] = "The small icons height"
 L["En combat uniquement"] = "Show in combat only"
 L["Code"] = "Code"
-L["Compiler"] = "Compile"
-L["BUGTEXT"] = "Sometimes the button won't highlight when you try to confirm changes and the text will scroll if you click. Please, put the cursor at the bottom of the text before accepting the changes."
+L["Afficher la fenêtre"] = "Show Ovale"
+L["Cacher la fenêtre"] = "Hide Ovale"
 L["AOE"] = "AOE"
 L["None"] = "None"
 L["Blood"] = true
diff --git a/Locale-frFR.lua b/Locale-frFR.lua
index b5c4b91..0eaa86a 100644
--- a/Locale-frFR.lua
+++ b/Locale-frFR.lua
@@ -11,8 +11,8 @@ L["Hauteur des petites icônes"] = true
 L["La hauteur des petites icônes"] = true
 L["En combat uniquement"] = true
 L["Code"] = true
-L["Compiler"] = true
-L["BUGTEXT"] = "Parfois passer la souris sur le bouton de confirmation en bas de la fenêtre ne l'éclairera pas et cliquer sélectionnera du texte. Placez d'abord le curseur en bas du texte avant de confirmer les changements."
+L["Afficher la fenêtre"] = true
+L["Cacher la fenêtre"] = true
 L["AOE"] = "Multicible"
 L["None"] = "Aucun"
 L["Blood"] = "Saignement"
diff --git a/Ovale.lua b/Ovale.lua
index 26bb7ea..953fb5a 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -160,30 +160,43 @@ local options =
 			{
 				code =
 				{
-					order = 2,
+					order = 1,
 					type = "input",
 					multiline = 15,
 					name = L["Code"],
-					desc = L["BUGTEXT"],
 					get = function(info)
 						return Ovale.db.profile.code
 					end,
 					set = function(info,v)
 						Ovale.db.profile.code = v
+						Ovale.masterNodes = Ovale:Compile(Ovale.db.profile.code)
+						Ovale:UpdateFrame()
 						-- Ovale:Print("code change")
 					end,
 					width = "full"
 				},
-				compiler =
+				show =
 				{
-					order = 1,
+					order = -1,
 					type = "execute",
-					name = L["Compiler"],
+					name = L["Afficher la fenêtre"],
+					guiHidden = true,
 					func = function()
-						Ovale.masterNodes = Ovale:Compile(Ovale.db.profile.code)
-						Ovale:UpdateFrame()
+						Ovale.db.profile.display = true
+						Ovale.frame:Show()
 					end
-				}
+				},
+				hide =
+				{
+					order = -2,
+					type = "execute",
+					name = L["Cacher la fenêtre"],
+					guiHidden = true,
+					func = function()
+						Ovale.db.profile.display = false
+						Ovale.frame:Hide()
+					end
+				},
 			}
 		}
 	}
@@ -365,6 +378,9 @@ function Ovale:FirstInit()
 		self.masterNodes = self:Compile(self.db.profile.code)
 	end
 	self:UpdateFrame()
+	if (not Ovale.db.profile.display) then
+		self.frame:Hide()
+	end
 end

 function Ovale:OnEnable()
@@ -384,6 +400,7 @@ function Ovale:OnEnable()
 		self:FirstInit()
 	end
 	self:UNIT_AURA("","player")
+	self.frame:Show()
 end

 function Ovale:PLAYER_REGEN_ENABLED()
@@ -843,6 +860,7 @@ function Ovale:ChargerDefaut()
 	{
 		profile =
 		{
+			display = true,
 			code = Ovale.defaut[englishClass],
 			left = 500,
 			top = 500,
diff --git a/Ovale.toc b/Ovale.toc
index 83d8c9a..c15611e 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.11
+## Version: 3.1.12
 ## OptionalDeps: Ace3
 ## SavedVariables: OvaleDB
 ## SavedVariablesPerCharacter: OvaleDBPC
diff --git a/defaut/Chasseur.lua b/defaut/Chasseur.lua
index 1f83954..dff00cc 100644
--- a/defaut/Chasseur.lua
+++ b/defaut/Chasseur.lua
@@ -11,7 +11,7 @@ Define(RAPIDFIRE 3045)
 Define(KILLCOMMAND 34026)
 Define(BESTIALWRATH 19574)
 Define(HUNTERSMARK 53338)
-Define(BLACKARROW 63668)
+Define(BLACKARROW 3674)
 Define(LOCKANDLOAD 56453)
 Define(TALENTEXPLOSIVESHOT 2145)