Media - ugly fix

- Fix stop button not working
- Fix previous track not stopping when new one played.
- Note: I had to use Sound_GameSystem_RestartSoundSystem(), which triggers a client freeze, but it's the only way i could find, since there is no StopSound() api.
I also do not undertsand what is a musicHandle local, and why it's always false?
This commit is contained in:
Sattva
2023-06-10 15:31:32 +03:00
parent 7642165563
commit b0e4e8786b
+4 -1
View File
@@ -12388,6 +12388,7 @@ function LeaPlusLC:FriendCheck(name)
stopBtn:Hide(); stopBtn:Show()
LeaPlusLC:LockItem(stopBtn, true)
stopBtn:SetScript("OnClick", function()
Sound_GameSystem_RestartSoundSystem()
if musicHandle then
StopSound(musicHandle)
musicHandle = nil
@@ -12410,7 +12411,9 @@ function LeaPlusLC:FriendCheck(name)
-- Function to play a track and show the static highlight bar
local function PlayTrack()
-- Play tracks
if musicHandle then StopSound(musicHandle) end
-- if musicHandle then StopSound(musicHandle) end
Sound_GameSystem_RestartSoundSystem()
-- Sound_GameSystem_RestartSoundSystem()
local file, soundID, trackTime
if strfind(playlist[tracknumber], "#") then
if strfind(playlist[tracknumber], ".mp3") then