Play a sound when cycling through professions, and silence the opening of the tradeskill UI if it's hidden.
James D. Callahan III [06-30-10 - 23:38]
Play a sound when cycling through professions, and silence the opening of the tradeskill UI if it's hidden.
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)