Thread Tools Display Modes
05/09/14, 12:05 PM   #1
Khorrhxe
Join Date: Mar 2014
Posts: 5
[Request] Clear Screen on Load / Reload UI

Hi,

Would be great to have a VERY simple addon that simply clears the screen whenever addons are loaded (at the end?).

The purpose of this addon would be to erase the startup text notices from other addons (spambayes and a lot of others) who always show on load and have NO options for the disabling of those notices I.e the notices that say XYZ has loaded.. or whichever.

Just an idea!

I always have to use /clear manually to clear those (that /clear option is from another addon though..).
  Reply With Quote
05/09/14, 12:39 PM   #2
Stormknight
 
Stormknight's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 128
Much easier to ask the authors of those addons to make their "Hey - you logged in and this addon is doing things! Yay!" messages an option.
  Reply With Quote
05/09/14, 01:07 PM   #3
Khorrhxe
Join Date: Mar 2014
Posts: 5
I don't know, there's like 6-7 addons that I have that generate load text.. a simple 'on load, clear text' addon would be cool and perhaps easier to implement..
  Reply With Quote
05/09/14, 01:24 PM   #4
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Or just grab a text editor, find the line with the output and remove it.
  Reply With Quote
05/09/14, 02:46 PM   #5
stjobe
 
stjobe's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 60
Originally Posted by Iyanga View Post
Or just grab a text editor, find the line with the output and remove it.
And then do it again, for every addon that does it, every time those addons are updated.

Not an ideal solution, much better that us addon authors realize our users aren't as interested in knowing our addon has started as we are
  Reply With Quote
05/09/14, 03:31 PM   #6
Khorrhxe
Join Date: Mar 2014
Posts: 5
Originally Posted by stjobe View Post
And then do it again, for every addon that does it, every time those addons are updated.

Not an ideal solution, much better that us addon authors realize our users aren't as interested in knowing our addon has started as we are
Yes, preach it brother!
  Reply With Quote
05/09/14, 03:36 PM   #7
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Originally Posted by stjobe View Post
And then do it again, for every addon that does it, every time those addons are updated.
Why bother updating if it works?
  Reply With Quote
05/09/14, 05:13 PM   #8
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
Feature additions, code optimizations, bugs you didn't know you had (or hadn't run into yet)...
  Reply With Quote
05/31/14, 09:48 AM   #9
Khorrhxe
Join Date: Mar 2014
Posts: 5
bump.. not sure if it's possible to create this.. cheers!
  Reply With Quote
05/31/14, 09:55 AM   #10
thelegendaryof
 
thelegendaryof's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 161
1. Download my BugEater (formerly LibDebug)

2. Goto Settings -> Debug Settings

3. Fill out Custom Addon-Output Filters with the Messages you would like to Hide as shown here:



BEWARE! It has partial match so just entering "Loot" will hide
every Addon-Message that has the word Loot in it!

Correct Example:
^My example Addon loaded.$

The above will make sure there 's no partial matching but just disables the exact messaage
(^ equals the start or the message and $ the ending of the message).

However if you want to hide all Message of an Addon and if it
identifies itself correctly with a Name or Tag in the Message:

LibAntiSpam

Will hide any Message containing the Word LibAntiSpam (Sorry wilson! Its just an example. )

It also has Wildcard support so:

Lib(.*)Spam

Will hide LibEVERYCHARACTERSpam or Lib09281Spam or just LibSpam.

See here:

http://www.lua.org/pil/20.2.html

(press ENTER for every new Filter - the Editfield is just to small so
automatic Linebreaks aren't cosindered as a new Entry)


4. Tada. Done.

DO NOT TURN ON "Suppress Addon-Output in Chat". THIS WILL HIDE EVERY ADDON OUTPUT!

Last edited by thelegendaryof : 05/31/14 at 12:12 PM.
  Reply With Quote
06/01/14, 03:34 PM   #11
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
thelegendaryof indicates in BugEater he has a way that suppresses all addon output, so it should be possible to do that for the first second or two after load, then re-enable addon output after that.
  Reply With Quote
06/01/14, 04:29 PM   #12
thelegendaryof
 
thelegendaryof's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 161
Or like that. Doing that automatically isn't possible as there is no even that is loaded after every Addon. The only possibility would be to place a 2-5s timer in PLAYER_ACTIVATED and reactivate it thereafter. Hm.
  Reply With Quote
06/02/14, 06:44 AM   #13
Fathis Ules
Thief Guild Master
 
Fathis Ules's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
added a disable startup text option in spambayes, but only for spambayes notice of course

If you need to do this for all the chat buffer, you need to attach the for loop below to a correct event, this is a sample of /clear command in spambayes, clears all the chat tabs, but dangerous to do on startup because you will also clear chat messages received while loading

best is to do as said Seerah, message addon authors to include a hide the notice option

Lua Code:
  1. SLASH_COMMANDS["/clear"] = function()
  2.     for i = 1, #ZO_ChatWindow.container.windows do
  3.         if _G["ZO_ChatWindowTemplate"..i.."Buffer"] then _G["ZO_ChatWindowTemplate"..i.."Buffer"]:Clear() end
  4.     end
  5. end

Last edited by Fathis Ules : 06/02/14 at 06:49 AM.
  Reply With Quote
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
06/04/14, 10:51 AM   #15
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Sasky View Post
Lua Code:
  1. local d_old = d
  2. d = function(...) end
  3. zo_callLater(function() d = d_old end, 2000)
It is not a good idea to restore function from backup, because you never know if any other addon hooks the same function after your addon is loaded.
Method used by thelegendaryof's BugEater is better.
Lua Code:
  1. local ignore = true
  2. ZO_PreHook("d", function() return ignore end)
  3.  
  4. EVENT_MANAGER:RegisterForEvent("Debug_Hook", EVENT_PLAYER_ACTIVATED,
  5.    function(event)
  6.       zo_callLater(function() ignore = false end, 250)
  7.       EVENT_MANAGER:UnregisterForEvent("Debug_Hook", event)
  8.    end)

EDIT:
I have to say that instead of hooking d(), it is better to use code provided by Fathis Ules. It works even if addon uses different method of displaying of chat "spam":
Lua Code:
  1. EVENT_MANAGER:RegisterForEvent("Clear_Chat", EVENT_PLAYER_ACTIVATED,
  2.    function(event)
  3.       zo_callLater(
  4.          function()      
  5.             for i = 1, #ZO_ChatWindow.container.windows do
  6.                if _G["ZO_ChatWindowTemplate"..i.."Buffer"] then _G["ZO_ChatWindowTemplate"..i.."Buffer"]:Clear() end
  7.              end
  8.          end, 250)
  9.       EVENT_MANAGER:UnregisterForEvent("Clear_Chat", event)
  10.     end)

Last edited by Garkin : 06/04/14 at 11:06 AM.
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » [Request] Clear Screen on Load / Reload UI


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off