Merge pull request #320 from argonui/soundcubeapi

SoundCubeApi: fixed scoping
This commit is contained in:
Chr1Z 2023-06-22 00:57:18 +02:00 committed by GitHub
commit d5863c5b3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
do
local SoundCubeApi = {}
local internal = {}
-- this table links the name of a trigger effect to its index
local soundIndices = {
@ -8,14 +9,14 @@ do
["Dark Souls"] = 2
}
function playTriggerEffect(index)
internal.playTriggerEffect = function(index)
getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(index)
end
-- plays the by name requested sound
---@param soundName String Name of the sound to play
SoundCubeApi.playSoundByName = function(soundName)
playTriggerEffect(soundIndices[soundName])
internal.playTriggerEffect(soundIndices[soundName])
end
return SoundCubeApi