Commit d3ed3e65 authored by nevcairiel's avatar nevcairiel
Browse files

AceGUI-3.0: Added Blizzard sounds to widgets (patch by Borlox - Ticket 120)

git-svn-id: https://repos.wowace.com/wow/ace3/trunk@916 5debad98-a965-4143-8383-f471b3509dcf
parent 33055198
......@@ -2,6 +2,7 @@ local AceGUI = LibStub("AceGUI-3.0")
-- WoW APIs
local _G = _G
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
--------------------------
......@@ -9,7 +10,7 @@ local CreateFrame, UIParent = CreateFrame, UIParent
--------------------------
do
local Type = "Button"
local Version = 12
local Version = 13
local function OnAcquire(self)
-- restore default values
......@@ -24,6 +25,7 @@ do
end
local function Button_OnClick(this, ...)
PlaySound("igMainMenuOption")
this.obj:Fire("OnClick", ...)
AceGUI:ClearFocus()
end
......
......@@ -4,6 +4,7 @@ local AceGUI = LibStub("AceGUI-3.0")
local select = select
-- WoW APIs
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
......@@ -20,7 +21,7 @@ local CreateFrame, UIParent = CreateFrame, UIParent
]]
do
local Type = "CheckBox"
local Version = 14
local Version = 15
local function OnAcquire(self)
self:SetValue(false)
......@@ -58,6 +59,13 @@ do
local self = this.obj
if not self.disabled then
self:ToggleChecked()
if self.checked then
PlaySound("igMainMenuOptionCheckBoxOn")
else -- for both nil and false (tristate)
PlaySound("igMainMenuOptionCheckBoxOff")
end
self:Fire("OnValueChanged",self.checked)
self.text:SetPoint("LEFT",self.check,"RIGHT",0,0)
end
......
......@@ -6,6 +6,7 @@ local AceGUI = LibStub("AceGUI-3.0")
local select, assert = select, assert
-- WoW APIs
local PlaySound = PlaySound
local CreateFrame = CreateFrame
local function fixlevels(parent,...)
......@@ -316,7 +317,7 @@ end
-- Does not close the pullout on click.
do
local widgetType = "Dropdown-Item-Toggle"
local widgetVersion = 2
local widgetVersion = 3
local function UpdateToggle(self)
if self.value then
......@@ -335,6 +336,11 @@ do
local self = this.obj
if self.disabled then return end
self.value = not self.value
if self.value then
PlaySound("igMainMenuOptionCheckBoxOn")
else
PlaySound("igMainMenuOptionCheckBoxOff")
end
UpdateToggle(self)
self:Fire("OnValueChanged", self.value)
end
......
......@@ -7,6 +7,7 @@ local select, pairs, ipairs = select, pairs, ipairs
local tsort = table.sort
-- WoW APIs
local PlaySound = PlaySound
local UIParent, CreateFrame = UIParent, CreateFrame
local _G = _G
......@@ -355,7 +356,7 @@ end
do
local widgetType = "Dropdown"
local widgetVersion = 21
local widgetVersion = 22
--[[ Static data ]]--
......@@ -378,6 +379,7 @@ do
local function Dropdown_TogglePullout(this)
local self = this.obj
PlaySound("igMainMenuOptionCheckBoxOn") -- missleading name, but the Blizzard code uses this sound
if self.open then
self.open = nil
self.pullout:Close()
......
......@@ -4,6 +4,7 @@ local AceGUI = LibStub("AceGUI-3.0")
local tostring = tostring
-- WoW APIs
local PlaySound = PlaySound
local GetCursorInfo, ClearCursor, GetSpellName = GetCursorInfo, ClearCursor, GetSpellName
local CreateFrame, UIParent = CreateFrame, UIParent
local _G = _G
......@@ -13,7 +14,7 @@ local _G = _G
-- GLOBALS: AceGUIEditBoxInsertLink, ChatFontNormal, OKAY
local Type = "EditBox"
local Version = 13
local Version = 14
if not AceGUIEditBoxInsertLink then
-- upgradeable hook
......@@ -85,6 +86,7 @@ do
local value = this:GetText()
local cancel = self:Fire("OnEnterPressed",value)
if not cancel then
PlaySound("igMainMenuOptionCheckBoxOn")
HideButton(self)
end
end
......
......@@ -4,6 +4,7 @@ local AceGUI = LibStub("AceGUI-3.0")
local pairs, assert, type = pairs, assert, type
-- WoW APIs
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
......@@ -20,7 +21,7 @@ local CreateFrame, UIParent = CreateFrame, UIParent
]]
do
local Type = "Frame"
local Version = 10
local Version = 11
local FrameBackdrop = {
bgFile="Interface\\DialogFrame\\UI-DialogBox-Background",
......@@ -41,6 +42,7 @@ do
end
local function closeOnClick(this)
PlaySound("gsTitleOptionExit")
this.obj:Hide()
end
......
......@@ -5,6 +5,7 @@ local min, max, floor = math.min, math.max, math.floor
local tonumber = tonumber
-- WoW APIs
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
......@@ -16,7 +17,7 @@ local CreateFrame, UIParent = CreateFrame, UIParent
--------------------------
do
local Type = "Slider"
local Version = 9
local Version = 10
local function OnAcquire(self)
self:SetWidth(200)
......@@ -160,6 +161,7 @@ do
end
if value then
PlaySound("igMainMenuOptionCheckBoxOn")
self:Fire("OnMouseUp",value)
end
end
......
......@@ -4,6 +4,7 @@ local AceGUI = LibStub("AceGUI-3.0")
local pairs, ipairs, assert, type = pairs, ipairs, assert, type
-- WoW APIs
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
local _G = _G
......@@ -41,7 +42,7 @@ local _G = _G
do
local Type = "TabGroup"
local Version = 24
local Version = 25
local PaneBackdrop = {
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
......@@ -91,6 +92,7 @@ do
local function Tab_OnClick(self)
if not (self.selected or self.disabled) then
PlaySound("igCharacterInfoTab")
self.obj:SelectTab(self.value)
end
end
......
......@@ -4,6 +4,7 @@ local AceGUI = LibStub("AceGUI-3.0")
local pairs, assert, type = pairs, assert, type
-- WoW APIs
local PlaySound = PlaySound
local CreateFrame, UIParent = CreateFrame, UIParent
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
......@@ -20,13 +21,14 @@ local CreateFrame, UIParent = CreateFrame, UIParent
]]
do
local Type = "Window"
local Version = 3
local Version = 4
local function frameOnClose(this)
this.obj:Fire("OnClose")
end
local function closeOnClick(this)
PlaySound("gsTitleOptionExit")
this.obj:Hide()
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment