mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 22:11:38 +00:00
- Changed all instances of "Rojo" to "Atlas" in error messages, UI titles, and connection actions for consistent branding. - Updated the sound player widget and patch history recording to reflect the new name. - Enhanced logging in the hydration process to provide better diagnostics for missing virtual instances.
38 lines
880 B
Lua
38 lines
880 B
Lua
-- Sounds only play in Edit mode when parented to a plugin widget, for some reason
|
|
local plugin = plugin or script:FindFirstAncestorWhichIsA("Plugin")
|
|
local widget = nil
|
|
if plugin then
|
|
widget = plugin:CreateDockWidgetPluginGui(
|
|
"Atlas_soundPlayer",
|
|
DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, false, true, 10, 10, 10, 10)
|
|
)
|
|
widget.Name = "Atlas_soundPlayer"
|
|
widget.Title = "Atlas Sound Player"
|
|
end
|
|
|
|
local SoundPlayer = {}
|
|
SoundPlayer.__index = SoundPlayer
|
|
|
|
function SoundPlayer.new(settings)
|
|
return setmetatable({
|
|
settings = settings,
|
|
}, SoundPlayer)
|
|
end
|
|
|
|
function SoundPlayer:play(soundId)
|
|
if self.settings and self.settings:get("playSounds") == false then
|
|
return
|
|
end
|
|
|
|
local sound = Instance.new("Sound")
|
|
sound.SoundId = soundId
|
|
sound.Parent = widget
|
|
|
|
sound.Ended:Connect(function()
|
|
sound:Destroy()
|
|
end)
|
|
|
|
sound:Play()
|
|
end
|
|
|
|
return SoundPlayer
|