Skip to content

Commit

Permalink
Fix PlaySound usage for patch 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
funkydude committed Jun 29, 2017
1 parent b268612 commit 8986b6d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions libs/LibDialog-1.0/LibDialog-1.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ local function _Dialog_OnShow(dialog)
return
end

_G.PlaySound("igMainMenuOpen")
_G.PlaySound(PlaySoundKitID and "igMainMenuOpen" or 850) -- SOUNDKIT.IG_MAINMENU_OPEN

if delegate.on_show then
delegate.on_show(dialog, dialog.data)
Expand All @@ -247,7 +247,7 @@ end
local function _Dialog_OnHide(dialog)
local delegate = dialog.delegate

_G.PlaySound("igMainMenuClose")
_G.PlaySound(PlaySoundKitID and "igMainMenuClose" or 851) -- SOUNDKIT.IG_MAINMENU_CLOSE

-- Required so lib:ActiveDialog() will return false if called from code which is called from the delegate's on_hide
_RecycleWidget(dialog, active_dialogs, dialog_heap)
Expand Down
14 changes: 7 additions & 7 deletions modules/Tanks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ local function topScrollDeleteClick(self)
end
sessionTanks[value] = nil
deletedTanks[value] = true
PlaySound("igMainMenuOptionCheckBoxOff")
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOff" or 857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF
-- update
module:OnGroupChanged("OnGroupChanged", nil, oRA:GetGroupMembers())
module:OnTanksChanged("OnTanksChanged", oRA:GetBlizzardTanks())
Expand All @@ -250,10 +250,10 @@ local function topScrollHiddenClick(self)
local value = self:GetParent().unitName
if namedHidden[value] then
namedHidden[value] = nil
PlaySound("igMainMenuOptionCheckBoxOn")
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
else
namedHidden[value] = true
PlaySound("igMainMenuOptionCheckBoxOff")
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOff" or 857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF
end
module:OnTanksChanged("OnTanksChanged", oRA:GetBlizzardTanks(), true)
end
Expand All @@ -262,11 +262,11 @@ local function topScrollSaveClick(self)
local value = self:GetParent().unitName
local k = util.inTable(module.db.persistentTanks, value)
if k then
PlaySound("igMainMenuOptionCheckBoxOff")
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOff" or 857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF
table.remove(module.db.persistentTanks, k)
namedPersistent[value] = nil
else
PlaySound("igMainMenuOptionCheckBoxOn")
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
namedPersistent[value] = true
wipe(module.db.persistentTanks)
for _, v in next, allIndexedTanks do
Expand Down Expand Up @@ -295,7 +295,7 @@ local function topScrollUpClick(self)
module.db.persistentTanks[#module.db.persistentTanks + 1] = v
end
end
PlaySound("UChatScrollButton")
PlaySound(PlaySoundKitID and "UChatScrollButton" or 1115) -- SOUNDKIT.U_CHAT_SCROLL_BUTTON
module:OnTanksChanged("OnTanksChanged", oRA:GetBlizzardTanks(), true)
end

Expand All @@ -306,7 +306,7 @@ local function bottomScrollClick(self)
sessionTanks[value] = true
namedTanks[value] = true
deletedTanks[value]= nil
PlaySound("igMainMenuOptionCheckBoxOn")
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
module:OnTanksChanged("OnTanksChanged", oRA:GetBlizzardTanks(), true)
module:UpdateScrolls()
end
Expand Down
10 changes: 5 additions & 5 deletions oRA3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ local function setupGUI()
end)

local function selectPanel(self)
PlaySound("igCharacterInfoTab")
PlaySound(PlaySoundKitID and "igCharacterInfoTab" or 841) -- SOUNDKIT.IG_CHARACTER_INFO_TAB
addon:SelectPanel(self:GetText())
end
for i, tab in ipairs(panels) do
Expand Down Expand Up @@ -838,15 +838,15 @@ local function setupGUI()
barmiddle:SetTexCoord(0.29296875, 1, 0, 0.25)

frame:SetScript("OnShow", function(self)
PlaySound("igCharacterInfoTab")
PlaySound(PlaySoundKitID and "igCharacterInfoTab" or 841) -- SOUNDKIT.IG_CHARACTER_INFO_TAB
local w = (contentFrame:GetWidth() - 10) / #lists
for i, list in next, lists do
list.button:SetWidth(w)
end
addon:SelectPanel()
end)
frame:SetScript("OnHide", function()
PlaySound("igMainMenuClose")
PlaySound(PlaySoundKitID and "igMainMenuClose" or 851) -- SOUNDKIT.IG_MAINMENU_CLOSE
for i, tab in next, panels do
if type(tab.hide) == "function" then
tab.hide()
Expand All @@ -855,7 +855,7 @@ local function setupGUI()
end)

local function listButtonClick(self)
PlaySound("igMainMenuOptionCheckBoxOn")
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
addon:SelectList(self.listIndex)
end
for i, list in next, lists do
Expand Down Expand Up @@ -1140,7 +1140,7 @@ local function toggleColumn(header)
else
table.sort(list.contents, sortDesc)
end
PlaySound("igMainMenuOptionCheckBoxOn")
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
addon:UpdateScroll()
end

Expand Down

0 comments on commit 8986b6d

Please sign in to comment.