Quantcast

Add option to show hidden scripts, e.g., includes and reference scripts.

Johnny C. Lam [05-21-14 - 13:08]
Add option to show hidden scripts, e.g., includes and reference scripts.

Be explicit about files that contain full scripts.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1480 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleOptions.lua
OvaleScripts.lua
scripts/leafkiller_druid.lua
scripts/ovale_deathknight.lua
scripts/ovale_druid.lua
scripts/ovale_hunter.lua
scripts/ovale_mage.lua
scripts/ovale_monk.lua
scripts/ovale_paladin.lua
scripts/ovale_priest.lua
scripts/ovale_rogue.lua
scripts/ovale_shaman.lua
scripts/ovale_warlock.lua
scripts/ovale_warrior.lua
scripts/wiljo_mage.lua
diff --git a/OvaleOptions.lua b/OvaleOptions.lua
index 2608cc0..665bc85 100644
--- a/OvaleOptions.lua
+++ b/OvaleOptions.lua
@@ -350,7 +350,8 @@ local self_options =
 					name = L["Script"],
 					width = "double",
 					values = function(info)
-						return OvaleScripts:GetDescriptions()
+						local scriptType = not OvaleOptions.db.profile.showHiddenScripts and "script"
+						return OvaleScripts:GetDescriptions(scriptType)
 					end,
 					get = function(info)
 						return OvaleOptions.db.profile.source
@@ -384,7 +385,7 @@ local self_options =
 						return strgsub(code, "\t", "    ")
 					end,
 					set = function(info, v)
-						OvaleScripts:RegisterScript(self_class, "custom", L["Script personnalisé"], v)
+						OvaleScripts:RegisterScript(self_class, "custom", L["Script personnalisé"], v, "script")
 						OvaleOptions.db.profile.code = v
 						OvaleOptions:SendMessage("Ovale_ScriptChanged")
 					end,
@@ -414,6 +415,13 @@ local self_options =
 						OvaleOptions:SendMessage("Ovale_ScriptChanged")
 					end,
 				},
+				showHiddenScripts = {
+					order = 40,
+					type = "toggle",
+					name = L["Show hidden"],
+					get = function(info) return OvaleOptions.db.profile.showHiddenScripts end,
+					set = function(info, value) OvaleOptions.db.profile.showHiddenScripts = value end
+				},
 			},
 		},
 		debug =
@@ -688,6 +696,7 @@ function OvaleOptions:OnInitialize()
 		profile =
 		{
 			display = true,
+			showHiddenScripts = false,
 			source = "Ovale",
 			code = "",
 			left = 500,
diff --git a/OvaleScripts.lua b/OvaleScripts.lua
index 66aa8f8..fce49db 100644
--- a/OvaleScripts.lua
+++ b/OvaleScripts.lua
@@ -30,10 +30,9 @@ OvaleScripts.script = {}
 --<public-static-methods>
 -- Return a table of script descriptions indexed by name.
 function OvaleScripts:GetDescriptions(scriptType)
-	scriptType = scriptType or "script"
 	local descriptionsTable = {}
 	for name, script in pairs(self.script) do
-		if script.type == scriptType then
+		if not scriptType or script.type == scriptType then
 			descriptionsTable[name] = script.desc
 		end
 	end
diff --git a/scripts/leafkiller_druid.lua b/scripts/leafkiller_druid.lua
index ab3f2c4..de05641 100644
--- a/scripts/leafkiller_druid.lua
+++ b/scripts/leafkiller_druid.lua
@@ -1596,5 +1596,5 @@ AddIcon size=small mastery=3 checkboxon=cooldownsR {
 }
 ]]

-	OvaleScripts:RegisterScript("DRUID", name, desc, code)
+	OvaleScripts:RegisterScript("DRUID", name, desc, code, "script")
 end
diff --git a/scripts/ovale_deathknight.lua b/scripts/ovale_deathknight.lua
index eb03cea..53825d7 100644
--- a/scripts/ovale_deathknight.lua
+++ b/scripts/ovale_deathknight.lua
@@ -783,5 +783,5 @@ AddIcon mastery=unholy size=small checkboxon=opt_icons_right
 	UseItemActions()
 }
 ]]
-	OvaleScripts:RegisterScript("DEATHKNIGHT", name, desc, code)
+	OvaleScripts:RegisterScript("DEATHKNIGHT", name, desc, code, "script")
 end
diff --git a/scripts/ovale_druid.lua b/scripts/ovale_druid.lua
index 362effe..cbd7170 100644
--- a/scripts/ovale_druid.lua
+++ b/scripts/ovale_druid.lua
@@ -879,5 +879,5 @@ AddIcon mastery=restoration size=small checkboxon=opt_icons_right
 }
 ]]

-	OvaleScripts:RegisterScript("DRUID", name, desc, code)
+	OvaleScripts:RegisterScript("DRUID", name, desc, code, "script")
 end
diff --git a/scripts/ovale_hunter.lua b/scripts/ovale_hunter.lua
index ddf63fd..4b7a59a 100644
--- a/scripts/ovale_hunter.lua
+++ b/scripts/ovale_hunter.lua
@@ -608,5 +608,5 @@ AddIcon mastery=survival size=small checkboxon=opt_icons_right
 }
 ]]

-	OvaleScripts:RegisterScript("HUNTER", name, desc, code)
+	OvaleScripts:RegisterScript("HUNTER", name, desc, code, "script")
 end
diff --git a/scripts/ovale_mage.lua b/scripts/ovale_mage.lua
index 008c332..82d9cd2 100644
--- a/scripts/ovale_mage.lua
+++ b/scripts/ovale_mage.lua
@@ -616,5 +616,5 @@ AddIcon mastery=frost size=small checkboxon=opt_icons_right
 }
 ]]

-	OvaleScripts:RegisterScript("MAGE", name, desc, code)
+	OvaleScripts:RegisterScript("MAGE", name, desc, code, "script")
 end
diff --git a/scripts/ovale_monk.lua b/scripts/ovale_monk.lua
index 4277220..223426b 100644
--- a/scripts/ovale_monk.lua
+++ b/scripts/ovale_monk.lua
@@ -525,5 +525,5 @@ AddIcon mastery=windwalker size=small checkboxon=opt_icons_right
 }
 ]]

-	OvaleScripts:RegisterScript("MONK", name, desc, code)
+	OvaleScripts:RegisterScript("MONK", name, desc, code, "script")
 end
diff --git a/scripts/ovale_paladin.lua b/scripts/ovale_paladin.lua
index fc74696..f7d3b36 100644
--- a/scripts/ovale_paladin.lua
+++ b/scripts/ovale_paladin.lua
@@ -481,5 +481,5 @@ AddIcon mastery=retribution size=small checkboxon=opt_icons_right
 }
 ]]

-	OvaleScripts:RegisterScript("PALADIN", name, desc, code)
+	OvaleScripts:RegisterScript("PALADIN", name, desc, code, "script")
 end
diff --git a/scripts/ovale_priest.lua b/scripts/ovale_priest.lua
index 51a1cb7..b890ccb 100644
--- a/scripts/ovale_priest.lua
+++ b/scripts/ovale_priest.lua
@@ -218,5 +218,5 @@ AddIcon mastery=shadow size=small checkboxon=opt_icons_right
 }
 ]]

-	OvaleScripts:RegisterScript("PRIEST", name, desc, code)
+	OvaleScripts:RegisterScript("PRIEST", name, desc, code, "script")
 end
diff --git a/scripts/ovale_rogue.lua b/scripts/ovale_rogue.lua
index c0ad77c..5d2eb9a 100644
--- a/scripts/ovale_rogue.lua
+++ b/scripts/ovale_rogue.lua
@@ -600,5 +600,5 @@ AddIcon mastery=subtlety size=small checkboxon=opt_icons_right
 }
 ]]

-	OvaleScripts:RegisterScript("ROGUE", name, desc, code)
+	OvaleScripts:RegisterScript("ROGUE", name, desc, code, "script")
 end
diff --git a/scripts/ovale_shaman.lua b/scripts/ovale_shaman.lua
index 9323b8f..25a45cf 100644
--- a/scripts/ovale_shaman.lua
+++ b/scripts/ovale_shaman.lua
@@ -549,5 +549,5 @@ AddIcon mastery=restoration size=small checkboxon=opt_icons_right
 }
 ]]

-	OvaleScripts:RegisterScript("SHAMAN", name, desc, code)
+	OvaleScripts:RegisterScript("SHAMAN", name, desc, code, "script")
 end
diff --git a/scripts/ovale_warlock.lua b/scripts/ovale_warlock.lua
index 054a9ba..0e774c5 100644
--- a/scripts/ovale_warlock.lua
+++ b/scripts/ovale_warlock.lua
@@ -448,5 +448,5 @@ AddIcon mastery=destruction size=small checkboxon=opt_icons_right
 }
 ]]

-	OvaleScripts:RegisterScript("WARLOCK", name, desc, code)
+	OvaleScripts:RegisterScript("WARLOCK", name, desc, code, "script")
 end
diff --git a/scripts/ovale_warrior.lua b/scripts/ovale_warrior.lua
index b6b883e..f948ff5 100644
--- a/scripts/ovale_warrior.lua
+++ b/scripts/ovale_warrior.lua
@@ -204,5 +204,5 @@ AddIcon mastery=protection size=small checkboxon=opt_icons_right
 }
 ]]

-	OvaleScripts:RegisterScript("WARRIOR", name, desc, code)
+	OvaleScripts:RegisterScript("WARRIOR", name, desc, code, "script")
 end
diff --git a/scripts/wiljo_mage.lua b/scripts/wiljo_mage.lua
index 147542c..3eae5f2 100644
--- a/scripts/wiljo_mage.lua
+++ b/scripts/wiljo_mage.lua
@@ -239,5 +239,5 @@ AddIcon help=cd size=small
 }
 ]]

-	OvaleScripts:RegisterScript("MAGE", name, desc, code)
+	OvaleScripts:RegisterScript("MAGE", name, desc, code, "script")
 end