Skip to content

Commit

Permalink
Mute spellbook noises on login
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim committed Jul 26, 2024
1 parent af43462 commit 16630ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ read_globals = {
'Item',
'ItemLocation',
'PaperDollFrameItemFlyoutButtons', -- classic
'SOUNDKIT', -- retail

-- FrameXML functions
'AutoCastShine_AutoCastStart', -- classic
Expand Down Expand Up @@ -81,6 +82,8 @@ read_globals = {
'IsControlKeyDown',
'IsPlayerSpell',
'IsShiftKeyDown',
'MuteSoundFile', -- retail
'UnitHasVehicleUI',
'UnitLevel',
'UnmuteSoundFile', -- retail
}
10 changes: 9 additions & 1 deletion hack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

-- in case other addons copies this, make sure it never loads multiple times unless there is a
-- newer version of it, in which case we disable it and load anyways
local version = 3
local version = 4
if _G['ForceLoadTradeSkillData'] then
if _G['ForceLoadTradeSkillData'].version < version then
_G['ForceLoadTradeSkillData']:UnregisterAllEvents()
Expand Down Expand Up @@ -47,6 +47,10 @@ hack:SetScript('OnEvent', function(self, event)
C_TradeSkillUI.CloseTradeSkill()
self:UnregisterEvent(event)
UIParent:RegisterEvent(event)

-- unmute sounds
UnmuteSoundFile(SOUNDKIT.UI_PROFESSIONS_WINDOW_OPEN)
UnmuteSoundFile(SOUNDKIT.UI_PROFESSIONS_WINDOW_CLOSE)
end
end
end)
Expand All @@ -55,6 +59,10 @@ function hack:OnKeyDown()
-- unregister ourselves first to avoid duplicate queries
self:SetScript('OnKeyDown', nil)

-- be silent
MuteSoundFile(SOUNDKIT.UI_PROFESSIONS_WINDOW_OPEN)
MuteSoundFile(SOUNDKIT.UI_PROFESSIONS_WINDOW_CLOSE)

-- listen for tradeskill UI opening then query it
UIParent:UnregisterEvent('TRADE_SKILL_SHOW')
self:RegisterEvent('TRADE_SKILL_SHOW')
Expand Down

0 comments on commit 16630ed

Please sign in to comment.