View Single Post
09/26/14, 05:56 AM   #3
Wykkyd
Are you Wykkyd Gaming?
 
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 107
I ended up going to bed, but I did get some of the work completed on my desktop's copy of my addons.

Code:
	LWF3.data.GameSounds = {
		["ABILITY_CASTER_BUSY"] = { name = "Ability_CasterBusy", parm = SOUNDS.ABILITY_CASTER_BUSY },
		["ABILITY_CASTER_DEAD"] = { name = "Ability_CasterDead", parm = SOUNDS.ABILITY_CASTER_DEAD },
		...
	}
	LWF3.data.GameSoundsByIndex = {}
	local ix = 0
	for k,t in ipairs( LWF3.data.GameSounds ) do
		ix = ix+1
		LWF3.data.GameSoundsByIndex[ ix ] = k
	end
That's going into LibWykkydFactory3 with the next update. Along with a new set of methods for playing sounds from that list (ignore the names/syntax, they'll improve before publishing):

Code:
local delay = 0
local onDelay = function( func, adj )
	if adj == nil then adj = 0 end
	zo_callLater( func, delay )
	delay = delay + 150 + adj
end
ts = function( ix, reps )
	delay = 0
	if reps == nil then reps = 1 end
	local before = GetSetting( SETTING_TYPE_AUDIO, AUDIO_SETTING_UI_VOLUME )
	onDelay( function() SetSetting( SETTING_TYPE_AUDIO, AUDIO_SETTING_UI_VOLUME, "100", 1 ) end )
	for ii = 1, reps, 1 do onDelay( function() PlaySound( FW3.data.GameSounds[ FW3.data.GameSoundsByIndex[ ix ] ].parm ) end, 200 ) end
	onDelay( function() SetSetting( SETTING_TYPE_AUDIO, AUDIO_SETTING_UI_VOLUME, before, 1 ) end )
end
That also contains an example of setting game sound up and back down after the sound plays. I just used Notepad++ RegEx find/replace to build the first list off of what you posted. I haven't tested every single sound yet to see if they all actually make noise. Wykkyd's Sound Preview should be ready this evening after my day job & family dinner, etc. If not, then it'll be at some point this weekend.
  Reply With Quote