/Tukui/modules/chat/sounds.lua

http://github.com/Asphyxia/Tukui · Lua · 17 lines · 12 code · 2 blank · 3 comment · 6 complexity · cbd7787a888ce95cfaf3c3ddea7eaf05 MD5 · raw file

  1. local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
  2. if C["chat"].enable ~= true then return end
  3. ------------------------------------------------------------------------
  4. -- Play sound files system
  5. ------------------------------------------------------------------------
  6. if C.chat.whispersound then
  7. local SoundSys = CreateFrame("Frame")
  8. SoundSys:RegisterEvent("CHAT_MSG_WHISPER")
  9. SoundSys:RegisterEvent("CHAT_MSG_BN_WHISPER")
  10. SoundSys:HookScript("OnEvent", function(self, event, ...)
  11. if event == "CHAT_MSG_WHISPER" or "CHAT_MSG_BN_WHISPER" then
  12. PlaySoundFile(C["media"].whisper)
  13. end
  14. end)
  15. end