Might anyone be able to assist with this? I had at one time had a pinned together bit that was working properly to achieve this "invited to group triggers at 100% master volume" I am currently after, but I can't make heads or tails of this here in the lua I tried to alter with it below after the Dragonflight expansion drop to get it functional once again.
Lua Code:
local entries={
[139828]=1 -- UIPartySyncReadyCheck
}
local pool,f={},CreateFrame('frame') f.handles={} f.lastchan={} f.nodupeids={} f.nodupehandles={}
function f.pool(t,i)
if i then pool[i]:SetScript('OnUpdate',nil) pool[i].t=nil return end
for i=1,#pool do
if pool[i] and not pool[i].t then pool[i].t={i=i,t=t} return i end
end
tinsert(pool,CreateFrame('frame')) i=#pool pool[i].t={i=i,t=t} return i
end
f:SetScript('OnEvent',function(_,_,handle)
if f.nodupehandles[handle] then
f.nodupeids[f.nodupehandles[handle]]=nil
f.nodupehandles[handle]=nil
end
if f.handles[handle] then
if f[f.handles[handle]] and f.lastchan[f.handles[handle]]==handle then
SetCVar(f.handles[handle],f[f.handles[handle]])
f[f.handles[handle]]=nil
end
f.handles[handle]=nil
end
end)
f:RegisterEvent('SOUNDKIT_FINISHED')
hooksecurefunc('PlaySound',function(id,channel,nodupe,_,_,_,_,own)
if not own and not f.nodupeids[id] and entries[id] then
local _,handle=PlaySound(64,'Master',false)
if handle then
StopSound(handle) StopSound(handle-1)
channel=(not channel and 'Master') or (strlower(channel)=='sfx' and 'SFX') or strlower(channel):gsub('^%a',strupper)
local cvar='Sound_'..channel..'Volume'
pool[f.pool({id,channel,nodupe,cvar})]:SetScript('OnUpdate',function(self)
local handle=nil
if type(entries[self.t.t[1]])=="string" then
_,handle=PlaySoundFile(entries[self.t.t[1]],self.t.t[2],self.t.t[3])
else
_,handle=PlaySound(self.t.t[1],self.t.t[2],self.t.t[3],true,nil,nil,nil,true)
end
if type(entries[self.t.t[1]])=="number" and handle then
if self.t.t[3]~=false then
f.nodupeids[self.t.t[1]]=handle
f.nodupehandles[handle]=self.t.t[1]
end
f.lastchan[self.t.t[4]]=handle
f.handles[handle]=self.t.t[4]
if not f[self.t.t[4]] then
f[self.t.t[4]]=GetCVar(self.t.t[4])
if f[self.t.t[4]] then SetCVar(self.t.t[4],entries[self.t.t[1]]) end
end
end
f.pool('',self.t.i)
end)
end
end
end)