Quantcast

Fixed options not updating

Scott Sibley [08-05-10 - 20:27]
Fixed options not updating
Filename
Modules/Text.lua
StarTip.lua
diff --git a/Modules/Text.lua b/Modules/Text.lua
index 0d81afe..2594387 100644
--- a/Modules/Text.lua
+++ b/Modules/Text.lua
@@ -433,6 +433,7 @@ function mod:RebuildOpts()
 				if v == "" then return end
 				tinsert(self.db.profile.lines, {name = v, left = "", right = "", updating = false})
 				self:RebuildOpts()
+				StarTip:RebuildOpts()
 				self:CreateLines()
 			end,
 			order = 5
@@ -487,6 +488,7 @@ function mod:RebuildOpts()
                         self.db.profile.lines[i - 1] = v
                         self.db.profile.lines[i] = tmp
                         self:RebuildOpts()
+						StarTip:RebuildOpts()
 						self:CreateLines()
                     end,
                     order = 4
@@ -501,6 +503,7 @@ function mod:RebuildOpts()
                         self.db.profile.lines[i + 1] = v
                         self.db.profile.lines[i] = tmp
                         self:RebuildOpts()
+						StarTip:RebuildOpts()
 						self:CreateLines()
                     end,
                     order = 5
diff --git a/StarTip.lua b/StarTip.lua
index 0d71cce..f942b22 100644
--- a/StarTip.lua
+++ b/StarTip.lua
@@ -56,6 +56,18 @@ function StarTip:OnEnable()
 		end
 	end

+	self:RebuildOpts()
+end
+
+function StarTip:OnDisable()
+	self:Unhook(GameTooltip, "OnTooltipSetUnit")
+	self:Unhook(GameTooltip, "OnTooltipSetItem")
+	self:Unhook(GameTooltip, "OnTooltipSetSpell")
+	self:Unhook(GameTooltip, "OnHide")
+	self:Unhook(GameTooltip, "OnShow")
+end
+
+function StarTip:RebuildOpts()
 	for k, v in self:IterateModules() do
 		options.args.modules.args[v:GetName()] = {
 			name = v.name,
@@ -100,14 +112,6 @@ function StarTip:OnEnable()
 	end
 end

-function StarTip:OnDisable()
-	self:Unhook(GameTooltip, "OnTooltipSetUnit")
-	self:Unhook(GameTooltip, "OnTooltipSetItem")
-	self:Unhook(GameTooltip, "OnTooltipSetSpell")
-	self:Unhook(GameTooltip, "OnHide")
-	self:Unhook(GameTooltip, "OnShow")
-end
-
 function StarTip:OpenConfig()
 	AceConfigDialog:SetDefaultSize("StarTip", 800, 450)
 	AceConfigDialog:Open("StarTip")