When you gain/lose/shift target you'll normally hear a sound. After I installed PitBull it's no longer there. I posted the "bug" on the wish list and was told that PitBull had nothing to with sound. So I'm wondering; Am I the only one with the problem?
I've checked with and without PitBull enabled on the same character. With PB the target sound is gone, without it's there. I also checked Sound Options, but couldn't find an option that specifically turns target sound on/off.
I don't believe I've ever gotten a sound when switching targets... I've used default UFs, CT, X-Perl, ag_UF, and PitBull with no audible alert when my target gets changed. It was probably a different addon.
Now that it is mentioned, I do myself recall a sound with the default UF, but as you say, Seerah, I don't remember getting it with any other UF. And it wasn't another addon.
I posted a link to this thread from the PB wish list - hopefully it'll be implemented soon. However, if anyone can do a quick fix (paste the code somewhere clever) I'll be eternally grateful.
Also, there must be a function called TargetFrame_OnShow() and maybe even an _OnShift() ?
function PitBull:PLAYER_TARGET_CHANGED()
if ( UnitExists("target") ) then
if ( UnitIsEnemy("target", "player") ) then
PlaySound("igCreatureAggroSelect");
elseif ( UnitIsFriend("player", "target") ) then
PlaySound("igCharacterNPCSelect");
else
PlaySound("igCreatureNeutralSelect");
end
end
for frame in self:IterateUnitFramesForUnit("target") do
if configMode or UnitExists('target') then
if frame:IsShown() then
self:PopulateUnitFrame(frame, true)
end
elseif frames[frame] then
PlaySound("INTERFACESOUND_LOSTTARGETUNIT");
self:ClearUnitFrame(frame)
end
end
end
Just switched to PitBull after using Discord forever, and I really miss the default targeting sounds. As a tank I find the little sound cue when tab-targeting hard to live without. I've updated my personal copy as suggested above, but having to do this whenever I update with WAU is not fun. I attempted to create a PitBull module to do this by copying an existing module, but seem to be missing some key element, as the module did not show up. If someone could point me to where I can find instructions for creating a PitBull module, that would be appreciated.
Create a new folder in your AddOns directory and name it TargetSound. Put the following files into the TargetSound folder:
TargetSound.toc
## Interface: 20300
## Title: TargetSound
## Notes: Plays a sound upon gaining or losing a target.
TargetSound.lua
TargetSound.lua
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
f:SetScript("OnEvent", function()
if UnitExists("target") then
if UnitIsEnemy("target", "player") then
PlaySound("igCreatureAggroSelect")
elseif UnitIsFriend("player", "target") then
PlaySound("igCharacterNPCSelect")
else
PlaySound("igCreatureNeutralSelect")
end
else
PlaySound("INTERFACESOUND_LOSTTARGETUNIT")
end
end)
Will work with any unitframe addon (or even with no unit frames at all), and won't require you to edit addon files every time the addon is updated.
## Interface: 20300
## Title: TargetSound
## Notes: Plays a sound upon gaining or losing target.
TargetSound.lua
TargetSound.lua
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
f:SetScript("OnEvent", function()
if UnitExists("target") then
if UnitIsEnemy("target", "player") then
PlaySound("igCreatureAggroSelect")
elseif UnitIsFriend("player", "target") then
PlaySound("igCharacterNPCSelect")
else
PlaySound("igCreatureNeutralSelect")
end
else
PlaySound("INTERFACESOUND_LOSTTARGETUNIT")
end
end)
Will work with any and all unitframe addons (or even with no unit frames at all), and won't require you to edit addon files every time the addon is updated.
Where would I put these 2 Files once created? I dropped them right insde the Pitbull folder, but I still dont have any sounds while switching targets. Thanks for the help!
Create a folder named TargetSound in your AddOns directory. Put TargetSound.toc and TargetSound.lua into the TargetSound folder.
Edit: To elaborate, WoW recognizes addons by scanning the AddOns directory. Any folder containing a .toc file of the same name indicates an addon. The .toc file is the Table Of Contents; it tells WoW what files actually contain the addon. In this case, TargetSound.toc tells WoW to look in the TargetSound.lua file for the addon, although the .lua file could actually be named anything, as long as the .toc file referenced it. Addons can be contained in a single file, like this one, or spread over multiple files, like PitBull. Addon files can either be Lua script files (*.lua) or XML files (*.xml). The scripts contained in the Lua or XML files can reference additional media files, such as images (*.tga or *.blp) or sounds (at least *.wav and *.mp3, and I'm not sure if WoW recognizes any others). At a bare minimum, in order for WoW to recognize an addon, it needs a folder containing a .toc file with the same name as the folder (case sensitive) and at least one Lua or XML file.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I've checked with and without PitBull enabled on the same character. With PB the target sound is gone, without it's there. I also checked Sound Options, but couldn't find an option that specifically turns target sound on/off.
There is indeed a sound that plays when the default target frame disappears.
I posted a link to this thread from the PB wish list - hopefully it'll be implemented soon. However, if anyone can do a quick fix (paste the code somewhere clever) I'll be eternally grateful.
Also, there must be a function called TargetFrame_OnShow() and maybe even an _OnShift() ?
After looking at Blizzard's code (http://wdn.wowinterface.com/code/live/FrameXML/TargetFrame.lua), I did this change to my local PitBull.lua (Revision 42443) at line 2750:
*is eternally grateful*
Also bumping hoping it'll be added to the addon ;)
TargetSound.toc
TargetSound.lua
Will work with any unitframe addon (or even with no unit frames at all), and won't require you to edit addon files every time the addon is updated.
Added to my "TazTweaks" own custom addon, works pretty well ^^
Where would I put these 2 Files once created? I dropped them right insde the Pitbull folder, but I still dont have any sounds while switching targets. Thanks for the help!
Edit: To elaborate, WoW recognizes addons by scanning the AddOns directory. Any folder containing a .toc file of the same name indicates an addon. The .toc file is the Table Of Contents; it tells WoW what files actually contain the addon. In this case, TargetSound.toc tells WoW to look in the TargetSound.lua file for the addon, although the .lua file could actually be named anything, as long as the .toc file referenced it. Addons can be contained in a single file, like this one, or spread over multiple files, like PitBull. Addon files can either be Lua script files (*.lua) or XML files (*.xml). The scripts contained in the Lua or XML files can reference additional media files, such as images (*.tga or *.blp) or sounds (at least *.wav and *.mp3, and I'm not sure if WoW recognizes any others). At a bare minimum, in order for WoW to recognize an addon, it needs a folder containing a .toc file with the same name as the folder (case sensitive) and at least one Lua or XML file.