ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Search/Requests (https://www.esoui.com/forums/forumdisplay.php?f=165)
-   -   Addons that removes synergy sound? (and maybe Blade of Woe) (https://www.esoui.com/forums/showthread.php?t=6495)

goshu1 09/02/16 02:34 AM

Addons that removes synergy sound? (and maybe Blade of Woe)
 
It's really annoying to me the constant ding-ding-ding-ding-ding-ding you hear sometimes when 2 or more synergies are available and the game keeps switching indicator between them, I wasn't able to find an option or addon to do that.

I don't know anything about making addons but it seems simple to make :)

Baertram 09/02/16 05:24 AM

The sounds are stored in a global array ingame, called SOUNDS.
The synergy ready sound is stored in this filename SOUNDS["ABILITY_SYNERGY_READY"].
You can exchange this sound or set it to ["NONE"] if you don't want any sound.

Try this script in your chat after you logged in:
Code:

/script SOUNDS["ABILITY_SYNERGY_READY"] = SOUNDS["NONE"]
If this works you only need to copy&paste it to the chat after each login (maybe after a reloadui as well, I don't know).

goshu1 09/02/16 06:06 AM

Quote:

Originally Posted by Baertram (Post 28239)
If this works you only need to copy&paste it to the chat after each login.

It does, thank you.

identico 04/12/22 05:33 AM

Quote:

Originally Posted by Baertram (Post 28239)
The sounds are stored in a global array ingame, called SOUNDS.
The synergy ready sound is stored in this filename SOUNDS["ABILITY_SYNERGY_READY"].
You can exchange this sound or set it to ["NONE"] if you don't want any sound.

Try this script in your chat after you logged in:
Code:

/script SOUNDS["ABILITY_SYNERGY_READY"] = SOUNDS["NONE"]
If this works you only need to copy&paste it to the chat after each login (maybe after a reloadui as well, I don't know).

Thats great, but what about addon that will do this automatically? Only a few lines, but a huge benefit.

Baertram 04/12/22 09:03 AM

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)

identico 04/13/22 05:25 AM

Quote:

Originally Posted by Baertram (Post 45695)
Based on the skelleton code of the exampple/turial addon above:

Thank you :D


All times are GMT -6. The time now is 03:15 PM.

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