mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-27 01:46:03 +00:00
libunitscan: disable target sounds during scan
This commit is contained in:
@@ -140,15 +140,26 @@ end)
|
||||
-- since TargetByName can only be triggered within vanilla,
|
||||
-- we can't auto-scan targets on further expansions.
|
||||
if pfUI.client <= 11200 then
|
||||
-- setup sound function switches
|
||||
local SoundOn = PlaySound
|
||||
local SoundOff = function() return end
|
||||
|
||||
libunitscan:SetScript("OnUpdate", function()
|
||||
-- don't scan when another unit is in target
|
||||
if UnitExists("target") or UnitName("target") then return end
|
||||
|
||||
local name = next(queue)
|
||||
if name then
|
||||
-- disable sound
|
||||
_G.PlaySound = SoundOff
|
||||
|
||||
-- try to target the unknown unit
|
||||
TargetByName(name, true)
|
||||
ClearTarget()
|
||||
|
||||
-- enable sound again
|
||||
_G.PlaySound = SoundOn
|
||||
|
||||
queue[name] = nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user