From 7847cd3e74a1044c3c8c1d9eb73269b5aa457209 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Wed, 30 Jun 2010 19:38:18 -0400 Subject: [PATCH] Play a sound when cycling through professions, and silence the opening of the tradeskill UI if it's hidden. --- Frame.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Frame.lua b/Frame.lua index 1e06c68..583e290 100644 --- a/Frame.lua +++ b/Frame.lua @@ -1470,12 +1470,21 @@ ProfCycle:SetScript("OnClick", end local trade_frame = _G.GnomeWorksFrame or _G.Skillet or _G.MRTSkillFrame or _G.ATSWFrame or _G.CauldronFrame or _G.TradeSkillFrame local is_shown = trade_frame:IsVisible() + local sfx + PlaySound("igCharacterNPCSelect") + + -- If not shown, save the current sound effects setting then set it to 0. + if not is_shown then + sfx = tonumber(GetCVar("Sound_EnableSFX")) + SetCVar("Sound_EnableSFX", 0) + end CastSpellByName(ORDERED_PROFESSIONS[MainPanel.profession]) addon:Scan() if not is_shown then CloseTradeSkill() + SetCVar("Sound_EnableSFX", sfx) end end) -- 1.7.9.5