core: add option to disable addon errors

This commit is contained in:
shagu
2020-07-23 18:40:05 +02:00
parent 73c81ae0fd
commit 82c2107f42
3 changed files with 7 additions and 1 deletions
+1
View File
@@ -43,6 +43,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("global", nil, "font_combat", "Interface\\AddOns\\pfUI\\fonts\\Continuum.ttf")
pfUI:UpdateConfig("global", nil, "force_region", "1")
pfUI:UpdateConfig("global", nil, "errors", "1")
pfUI:UpdateConfig("global", nil, "errors_limit", "1")
pfUI:UpdateConfig("global", nil, "errors_hide", "0")
pfUI:UpdateConfig("global", nil, "hidebuff", "0")
+1
View File
@@ -1404,6 +1404,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, T["Scrolling Combat Text Font"], C.global, "font_combat", "dropdown", pfUI.gui.dropdowns.fonts)
CreateConfig(U["pixelperfect"], T["Enable UI-Scale"], C.global, "pixelperfect", "dropdown", pfUI.gui.dropdowns.scaling)
CreateConfig(nil, T["Enable Offscreen Frame Positions"], C.global, "offscreen", "checkbox")
CreateConfig(nil, T["Display Addon Errors In Chat"], C.global, "errors", "checkbox")
CreateConfig(nil, T["Enable Single Line UIErrors"], C.global, "errors_limit", "checkbox")
CreateConfig(nil, T["Disable All UIErrors"], C.global, "errors_hide", "checkbox")
CreateConfig(nil, T["Highlight Settings That Require Reload"], C.gui, "reloadmarker", "checkbox")
+5 -1
View File
@@ -330,7 +330,11 @@ print = message
error = function(msg)
if PF_DEBUG_MODE then message(debugstack()) end
DEFAULT_CHAT_FRAME:AddMessage("|cffcc3333ERROR: |cffff5555".. (msg or "nil" ))
if string.find(msg, "AddOns\\pfUI") then
DEFAULT_CHAT_FRAME:AddMessage("|cffcc3333ERROR: |cffff5555".. (msg or "nil" ))
elseif not pfUI_config or (pfUI_config.global and pfUI_config.global.errors == "1") then
DEFAULT_CHAT_FRAME:AddMessage("|cffcc3333ERROR: |cffff5555".. (msg or "nil" ))
end
end
seterrorhandler(error)