Skip to content

Commit 87fe191

Browse files
committed
feat(client/main): add a way to update default volume
- uses weird string -> 'number' (float) conversion since theres no way to do this with convars.
1 parent bc34023 commit 87fe191

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ The ints are used like a boolean to 0 would be false, 1 true.
5454
| voice_defaultCycle | F11 | The default key to cycle the players proximity | string |
5555
| voice_defaultRadio | LALT | The default key to use the radio | string |
5656
| voice_externalAddress | none | The external address to use to connect to the mumble server | string |
57+
| voice_defaultVolume | 0.3 | The default volume to set the radio to (has to be between 0.0 and 1.0) *NOTE: Won't update during runtime, new joins will have the new value, players that already joined will not.* | string |
5758
| voice_externalPort | 0 | The external port to use | int |
5859
| voice_debugMode | 0 | 1 for basic logs, 4 for verbose logs | int |
5960

client/main.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local Cfg = Cfg
22
local currentGrid = 0
3-
local volume = 0.3
3+
-- we can't use GetConvarInt because its not a integer, and theres no way to get a float... so use a hacky way it is!
4+
local volume = tonumber(GetConvar('voice_defaultVolume', '0.3'))
45
local micClicks = true
56
playerServerId = GetPlayerServerId(PlayerId())
67
radioEnabled, radioPressed, mode, radioChannel, callChannel = false, false, 2, 0, 0

0 commit comments

Comments
 (0)