From 34fd025992a0d93999e2c84a86ba93265e28fcec Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Wed, 21 Jun 2023 22:11:53 +0200 Subject: [PATCH 1/2] fixed scoping --- src/core/SoundCubeApi.ttslua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/SoundCubeApi.ttslua b/src/core/SoundCubeApi.ttslua index dfe8e149..0776db16 100644 --- a/src/core/SoundCubeApi.ttslua +++ b/src/core/SoundCubeApi.ttslua @@ -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) + function internal.playTriggerEffect(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 From 0263924ce788b8a9bf65eb72cb03ab261ee599e6 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Wed, 21 Jun 2023 23:47:26 +0200 Subject: [PATCH 2/2] changed internal notation --- src/core/SoundCubeApi.ttslua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/SoundCubeApi.ttslua b/src/core/SoundCubeApi.ttslua index 0776db16..89222f3e 100644 --- a/src/core/SoundCubeApi.ttslua +++ b/src/core/SoundCubeApi.ttslua @@ -9,7 +9,7 @@ do ["Dark Souls"] = 2 } - function internal.playTriggerEffect(index) + internal.playTriggerEffect = function(index) getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(index) end