Add setting to toggle sound effects (#568)

* Use soundPlayer object with setting

* Style changes
This commit is contained in:
boatbomber
2022-07-02 02:12:58 -07:00
committed by GitHub
parent 0987b44e23
commit 54398d4c4b
5 changed files with 32 additions and 7 deletions

View File

@@ -11,7 +11,6 @@ local bindingUtil = require(script.Parent.bindingUtil)
local Theme = require(Plugin.App.Theme)
local Assets = require(Plugin.Assets)
local playSound = require(Plugin.playSound)
local BorderedContainer = require(Plugin.App.Components.BorderedContainer)
@@ -53,7 +52,7 @@ function Notification:didMount()
})
)
playSound(Assets.Sounds.Notification)
self.props.soundPlayer:play(Assets.Sounds.Notification)
self.timeout = task.spawn(function()
local clock = os.clock()
@@ -182,6 +181,7 @@ function Notifications:render()
for index, notif in ipairs(self.props.notifications) do
notifs[notif] = e(Notification, {
soundPlayer = self.props.soundPlayer,
text = notif.text,
timestamp = notif.timestamp,
timeout = notif.timeout,