mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-22 04:00:49 +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,
|
-- since TargetByName can only be triggered within vanilla,
|
||||||
-- we can't auto-scan targets on further expansions.
|
-- we can't auto-scan targets on further expansions.
|
||||||
if pfUI.client <= 11200 then
|
if pfUI.client <= 11200 then
|
||||||
|
-- setup sound function switches
|
||||||
|
local SoundOn = PlaySound
|
||||||
|
local SoundOff = function() return end
|
||||||
|
|
||||||
libunitscan:SetScript("OnUpdate", function()
|
libunitscan:SetScript("OnUpdate", function()
|
||||||
-- don't scan when another unit is in target
|
-- don't scan when another unit is in target
|
||||||
if UnitExists("target") or UnitName("target") then return end
|
if UnitExists("target") or UnitName("target") then return end
|
||||||
|
|
||||||
local name = next(queue)
|
local name = next(queue)
|
||||||
if name then
|
if name then
|
||||||
|
-- disable sound
|
||||||
|
_G.PlaySound = SoundOff
|
||||||
|
|
||||||
-- try to target the unknown unit
|
-- try to target the unknown unit
|
||||||
TargetByName(name, true)
|
TargetByName(name, true)
|
||||||
ClearTarget()
|
ClearTarget()
|
||||||
|
|
||||||
|
-- enable sound again
|
||||||
|
_G.PlaySound = SoundOn
|
||||||
|
|
||||||
queue[name] = nil
|
queue[name] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user