ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Search/Requests (https://www.esoui.com/forums/forumdisplay.php?f=165)
-   -   [Request] Clear Screen on Load / Reload UI (https://www.esoui.com/forums/showthread.php?t=1446)

Khorrhxe 05/09/14 12:05 PM

[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..).

Stormknight 05/09/14 12:39 PM

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.

Khorrhxe 05/09/14 01:07 PM

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..

Iyanga 05/09/14 01:24 PM

Or just grab a text editor, find the line with the output and remove it.

stjobe 05/09/14 02:46 PM

Quote:

Originally Posted by Iyanga (Post 7331)
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 ;)

Khorrhxe 05/09/14 03:31 PM

Quote:

Originally Posted by stjobe (Post 7333)
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!

Iyanga 05/09/14 03:36 PM

Quote:

Originally Posted by stjobe (Post 7333)
And then do it again, for every addon that does it, every time those addons are updated.

Why bother updating if it works?

Seerah 05/09/14 05:13 PM

Feature additions, code optimizations, bugs you didn't know you had (or hadn't run into yet)... :rolleyes:

Khorrhxe 05/31/14 09:48 AM

bump.. not sure if it's possible to create this.. cheers!

thelegendaryof 05/31/14 09:55 AM

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!

Sasky 06/01/14 03:34 PM

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.

thelegendaryof 06/01/14 04:29 PM

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.

Fathis Ules 06/02/14 06:44 AM

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

Sasky 06/04/14 10:21 AM

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.)

Garkin 06/04/14 10:51 AM

Quote:

Originally Posted by Sasky (Post 9075)
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)


All times are GMT -6. The time now is 08:56 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI