From 8eb28b28b0971bfa8ac9baecc4003434a425df1b Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Wed, 1 Jul 2020 18:03:51 +0300 Subject: [PATCH] StopSound not support --- WeakAuras/RegionTypes/RegionPrototype.lua | 26 +++-------------------- WeakAuras/WeakAuras.lua | 6 ------ WeakAurasOptions/ActionOptions.lua | 6 ------ 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/WeakAuras/RegionTypes/RegionPrototype.lua b/WeakAuras/RegionTypes/RegionPrototype.lua index bcd0273..0884c59 100644 --- a/WeakAuras/RegionTypes/RegionPrototype.lua +++ b/WeakAuras/RegionTypes/RegionPrototype.lua @@ -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; diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 9e0c28e..9537b5f 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -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); diff --git a/WeakAurasOptions/ActionOptions.lua b/WeakAurasOptions/ActionOptions.lua index 1b211a2..f7c9abd 100644 --- a/WeakAurasOptions/ActionOptions.lua +++ b/WeakAurasOptions/ActionOptions.lua @@ -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,