From ddbf5b6223c22e3574a58249b22e538cc3222a91 Mon Sep 17 00:00:00 2001 From: Scott Sibley Date: Sat, 9 Jul 2011 18:53:30 +0000 Subject: [PATCH] When catching an error give some feedback regarding which line and segment was disabled. --- Localization/enUS.lua | 1 + StarTip.lua | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Localization/enUS.lua b/Localization/enUS.lua index ad4c988..24874e9 100644 --- a/Localization/enUS.lua +++ b/Localization/enUS.lua @@ -4,6 +4,7 @@ if not L then return end L["Welcome to "] = true L[" Type /startip to open config. Alternatively you could press escape and choose the addons menu. Or you can choose to show a minimap icon. You can turn off this message under Settings."] = true +L["StarTip disabled a tooltip line named %s due to an error in the line's %s segment."] = true L["None"] = true L["Ctrl"] = true L["Alt"] = true diff --git a/StarTip.lua b/StarTip.lua index 519b3bd..b1845f4 100644 --- a/StarTip.lua +++ b/StarTip.lua @@ -33,12 +33,13 @@ environment.L = L local BugGrabber = BugGrabber -local function disableUT(name) +local function disableUT(name, side) local UT = StarTip:GetModule("UnitTooltip") for k, v in pairs(UT.db.profile.lines) do if(v.name == name) then UT.db.profile.lines[k].enabled = false UT:CreateLines() + StarTip:Print(format(L["StarTip disabled a tooltip line named %s due to an error in the line's %s segment."], v.name, side)) end end end @@ -50,10 +51,10 @@ do for k, v in pairs(addon:GetErrors(BugGrabber:GetSessionId())) do if type(v.message) == "string" then v.message:gsub('t.*StarTip\.UnitTooltip:(.*):left:.*', function(name) - disableUT(name) + disableUT(name, "left") end) v.message:gsub('t.*StarTip\.UnitTooltip:(.*):right:.*', function(name) - disableUT(name) + disableUT(name, "right") end) end end -- 1.7.9.5