View Single Post
06/04/14, 10:21 AM   #14
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
Made a quick edit just to test in BugEater. It worked with several addons, though not Zolan's Anchors Away. Zolan does a
Code:
local d = d
. If it loads before BugEater/whatever addon, then it can't be blocked in this method.

First -- have a variable that indicates ignore output for first 2 seconds.
(Could probably tune it down)
Lua Code:
  1. BugEater.initIgnore          = true
  2. zo_callLater(function() BugEater.initIgnore = false end, 2000)

Now in BugEater, thelegendaryof overwrites the d() function, which lets him parse out, buffer, and save messages. Adding this to the new d() function allows ignoring:

Lua Code:
  1. -- function d(...)
  2. d = function(...)
  3.     if BugEater.initIgnore then do return end end
  4.         -- rest of code (needed so it'll actually call after 2sec
  5. end

For a standalone, you could probably do something like:
Lua Code:
  1. local d_old = d
  2. d = function(...) end
  3. zo_callLater(function() d = d_old end, 2000)
This replaces the global debug function with a no-op for the first 2 seconds after load/reloadUI. The actual chat messages go through different handlers, so it won't kill those.

(Of course, this would render some of BugEater's functionality invalid, so should probably add an OptionalDependsOn in order to play nice with that addon.)

Last edited by Sasky : 06/04/14 at 10:23 AM.
  Reply With Quote