From 7034ed7c4481e9e8d246dfe7dca005574a43ad55 Mon Sep 17 00:00:00 2001 From: Nathan <59280607+nathan-commits@users.noreply.github.com> Date: Fri, 26 Aug 2022 21:11:36 +0200 Subject: [PATCH 1/2] Update radio or call volume while talking --- client/init/main.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/init/main.lua b/client/init/main.lua index 7cc2942..a354425 100644 --- a/client/init/main.lua +++ b/client/init/main.lua @@ -24,6 +24,17 @@ function setVolume(volume, volumeType) if volumeTbl then LocalPlayer.state:set(volumeType, volume, true) volumes[volumeType] = volume + local typeData = {} + + if volumeType == "radio" then + typeData = radioData + elseif volumeType == "call" then + typeData = callData + end + + for plySource, talking in pairs(typeData) + MumbleSetVolumeOverrideByServerId(plySource, volume) + end else error(('setVolume got a invalid volume type %s'):format(volumeType)) end From fba53b4d42e790f515e7a44ef97c2540b18d5041 Mon Sep 17 00:00:00 2001 From: Nathan <59280607+nathan-commits@users.noreply.github.com> Date: Fri, 26 Aug 2022 21:16:06 +0200 Subject: [PATCH 2/2] Update volume while talking on radio or phone --- client/init/main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/init/main.lua b/client/init/main.lua index a354425..030d807 100644 --- a/client/init/main.lua +++ b/client/init/main.lua @@ -33,7 +33,9 @@ function setVolume(volume, volumeType) end for plySource, talking in pairs(typeData) - MumbleSetVolumeOverrideByServerId(plySource, volume) + if talking then + MumbleSetVolumeOverrideByServerId(plySource, volume) + end end else error(('setVolume got a invalid volume type %s'):format(volumeType))