mirror of
https://github.com/OldManAlpha/Puppeteer.git
synced 2025-11-28 23:48:35 +00:00
Checkbox now makes sound
This commit is contained in:
parent
87d27f4cc9
commit
c00be9fd64
@ -23,4 +23,21 @@ function PTGuiCheckbox:OnDispose()
|
||||
self:SetChecked(false)
|
||||
end
|
||||
|
||||
function PTGuiCheckbox:SetScript(scriptName, script, noSelf)
|
||||
if scriptName ~= "OnClick" then
|
||||
return self.super.SetScript(self, scriptName, script, noSelf)
|
||||
end
|
||||
self:GetHandle():SetScript(scriptName, function()
|
||||
if self:GetChecked() then
|
||||
PlaySound("igMainMenuOptionCheckBoxOn")
|
||||
else
|
||||
PlaySound("igMainMenuOptionCheckBoxOff")
|
||||
end
|
||||
if script then
|
||||
script(self)
|
||||
end
|
||||
end)
|
||||
return self
|
||||
end
|
||||
|
||||
PTGuiLib.RegisterComponent(PTGuiCheckbox)
|
||||
Loading…
Reference in New Issue
Block a user