View Single Post
04/12/22, 09:03 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
It exists already: FCO ChangeStuff.
It provides a list of all sounds and you can move them to the right side to mute them.


If you want your own small addon:
Just add that 1 line
Code:
SOUNDS["ABILITY_SYNERGY_READY"] = SOUNDS["NONE"]
to any of your addon's
EVENT_ADD_ON_LOADED
callback function

Means:
Search for EVENT_ADD_ON_LOADED in the lua file of a sample addon.
You can even download a sample addon like this here for that purpose:
https://www.esoui.com/downloads/info...nTemplate.html

Or read here and build your own very small sample (you only need the basci skeleton code, no XML, no saved variables etc.!)
https://wiki.esoui.com/Writing_your_..._skeleton_code

Then at the line where you find something like

EVENT_MANAGER:RegisterForEvent("MyAddonName", EVENT_ADD_ON_LOADED , <here is either a function name or a new anonymous function created via
function() .... end )

Either in that anonymous function() ... end where the ... relate to the exising code lines, just add after the exisitng code lines the 1 line from above.
Or if there is a function name specified like doOnAddonLoad
Search for that "function doOnAddonLoad" or just "doOnAddonLoad" and find where teh function is defined via doOnAddonLoad = function( or function doOnAddonLoad( and there will be code in that function.
Before the closing end of the function add the 1 line.

It should then apply at each load of the addon for you and make it shut up

Based on the skelleton code of the exampple/turial addon above:
Lua Code:
  1. -- First, we create a namespace for our addon by declaring a top-level table that will hold everything else.
  2. FooAddon = {}
  3.  
  4. -- This isn't strictly necessary, but we'll use this string later when registering events.
  5. -- Better to define it in a single place rather than retyping the same string.
  6. FooAddon.name = "FooAddon"
  7.  
  8. -- Next we create a function that will initialize our addon
  9. function FooAddon.Initialize()
  10.   -- ...but we don't have anything to initialize yet. We'll come back to this.
  11. end
  12.  
  13. -- Then we create an event handler function which will be called when the "addon loaded" event
  14. -- occurs. We'll use this to initialize our addon after all of its resources are fully loaded.
  15. function FooAddon.OnAddOnLoaded(event, addonName)
  16.   -- The event fires each time *any* addon loads - but we only care about when our own addon loads.
  17.   if addonName == FooAddon.name then
  18.     FooAddon.Initialize()
  19.  
  20.     SOUNDS["ABILITY_SYNERGY_READY"] = SOUNDS["NONE"]
  21.   end
  22. end
  23.  
  24. -- Finally, we'll register our event handler function to be called when the proper event occurs.
  25. EVENT_MANAGER:RegisterForEvent(FooAddon.name, EVENT_ADD_ON_LOADED, FooAddon.OnAddOnLoaded)

Last edited by Baertram : 04/13/22 at 09:36 AM.
  Reply With Quote