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

@@ -12,6 +12,7 @@ local Dictionary = require(Plugin.Dictionary)
local ServeSession = require(Plugin.ServeSession)
local ApiContext = require(Plugin.ApiContext)
local preloadAssets = require(Plugin.preloadAssets)
local soundPlayer = require(Plugin.soundPlayer)
local Theme = require(script.Theme)
local PluginSettings = require(script.PluginSettings)
@@ -272,6 +273,7 @@ function App:render()
Padding = UDim.new(0, 5),
}),
notifs = e(Notifications, {
soundPlayer = self.props.soundPlayer,
notifications = self.state.notifications,
onClose = function(index)
self:closeNotification(index)
@@ -347,10 +349,11 @@ return function(props)
plugin = props.plugin,
}, {
App = PluginSettings.with(function(settings)
local settingsProps = Dictionary.merge(props, {
local mergedProps = Dictionary.merge(props, {
settings = settings,
soundPlayer = soundPlayer.new(settings),
})
return e(App, settingsProps)
return e(App, mergedProps)
end),
})
end