StopSound not support

This commit is contained in:
Bunny67
2020-07-01 18:03:51 +03:00
parent e13b36973d
commit 8eb28b28b0
3 changed files with 3 additions and 35 deletions
+3 -23
View File
@@ -210,18 +210,9 @@ local function SoundRepeatStop(self)
WeakAuras.StopProfileSystem("sound");
end
local function SoundStop(self)
WeakAuras.StartProfileSystem("sound");
if (self.soundHandle) then
StopSound(self.soundHandle);
end
WeakAuras.StopProfileSystem("sound");
end
local function SoundPlayHelper(self)
WeakAuras.StartProfileSystem("sound");
local options = self.soundOptions;
self.soundHandle = nil;
if (not options or options.sound_type == "Stop") then
WeakAuras.StopProfileSystem("sound");
return;
@@ -234,23 +225,14 @@ local function SoundPlayHelper(self)
if (options.sound == " custom") then
if (options.sound_path) then
local ok, _, handle = pcall(PlaySoundFile, options.sound_path, options.sound_channel or "Master");
if ok then
self.soundHandle = handle;
end
PlaySoundFile(options.sound_path, options.sound_channel or "Master");
end
elseif (options.sound == " KitID") then
if (options.sound_kit_id) then
local ok, _, handle = pcall(PlaySound,options.sound_kit_id, options.sound_channel or "Master");
if ok then
self.soundHandle = handle;
end
PlaySound(options.sound_kit_id, options.sound_channel or "Master");
end
else
local ok, _, handle = pcall(PlaySoundFile, options.sound, options.sound_channel or "Master");
if ok then
self.soundHandle = handle;
end
PlaySoundFile(options.sound, options.sound_channel or "Master");
end
WeakAuras.StopProfileSystem("sound");
end
@@ -260,7 +242,6 @@ local function SoundPlay(self, options)
return
end
WeakAuras.StartProfileSystem("sound");
self:SoundStop();
self:SoundRepeatStop();
self.soundOptions = options;
@@ -459,7 +440,6 @@ end
function WeakAuras.regionPrototype.create(region)
region.SoundPlay = SoundPlay;
region.SoundStop = SoundStop;
region.SoundRepeatStop = SoundRepeatStop;
region.SendChat = SendChat;
region.RunCode = RunCode;
-6
View File
@@ -4586,12 +4586,6 @@ function WeakAuras.PerformActions(data, when, region)
WeakAuras.HandleChatAction(actions.message_type, actions.message, actions.message_dest, actions.message_channel, actions.r, actions.g, actions.b, region, customFunc, when);
end
if (actions.stop_sound) then
if (region.SoundStop) then
region:SoundStop();
end
end
if(actions.do_sound and actions.sound) then
if (region.SoundPlay) then
region:SoundPlay(actions);
-6
View File
@@ -557,12 +557,6 @@ function WeakAuras.AddActionOption(id, data)
hidden = function() return data.actions.finish.sound ~= " KitID" end,
disabled = function() return not data.actions.finish.do_sound end
},
finish_stop_sound = {
type = "toggle",
width = WeakAuras.doubleWidth,
name = L["Stop Sound"],
order = 29.1,
},
finish_do_glow = {
type = "toggle",
width = WeakAuras.normalWidth,