2
2
using System . Collections . Generic ;
3
3
using System . Globalization ;
4
4
using NitroxClient . Communication . Abstract ;
5
+ using NitroxClient . Properties ;
5
6
using NitroxModel . DataStructures ;
6
7
using NitroxModel . DataStructures . GameLogic ;
7
8
using NitroxModel . Logger ;
@@ -11,19 +12,16 @@ namespace NitroxClient.GameLogic.FMOD
11
12
{
12
13
public class FMODSystem
13
14
{
14
- private readonly Dictionary < string , SoundData > assetWhitelist = new Dictionary < string , SoundData > ( ) ;
15
-
15
+ private readonly Dictionary < string , SoundData > assetWhitelist = new ( ) ;
16
16
private readonly IPacketSender packetSender ;
17
17
18
18
public FMODSystem ( IPacketSender packetSender )
19
19
{
20
20
this . packetSender = packetSender ;
21
-
22
- string soundsWhitelist = Properties . Resources . soundsWhitelist ;
23
-
21
+ string soundsWhitelist = Resources . soundsWhitelist ;
24
22
if ( string . IsNullOrWhiteSpace ( soundsWhitelist ) )
25
23
{
26
- Log . Error ( new NullReferenceException ( ) , "[FMODSystem]: soundsWhitelist.csv is null or whitespace" ) ;
24
+ Log . Error ( "[FMODSystem]: soundsWhitelist.csv is null or whitespace" ) ;
27
25
}
28
26
29
27
foreach ( string entry in soundsWhitelist . Split ( '\n ' ) )
@@ -47,6 +45,11 @@ public FMODSystem(IPacketSender packetSender)
47
45
}
48
46
}
49
47
48
+ public static FMODSuppressor SuppressSounds ( )
49
+ {
50
+ return new ( ) ;
51
+ }
52
+
50
53
public bool IsWhitelisted ( string path )
51
54
{
52
55
return assetWhitelist . TryGetValue ( path , out SoundData soundData ) && soundData . IsWhitelisted ;
@@ -66,7 +69,6 @@ public bool IsWhitelisted(string path, out bool isGlobal, out float radius)
66
69
return false ;
67
70
}
68
71
69
-
70
72
public void PlayAsset ( string path , NitroxVector3 position , float volume , float radius , bool isGlobal )
71
73
{
72
74
packetSender . Send ( new PlayFMODAsset ( path , position , volume , radius , isGlobal ) ) ;
@@ -87,11 +89,6 @@ public void PlayStudioEmitter(NitroxId id, string assetPath, bool play, bool all
87
89
packetSender . Send ( new PlayFMODStudioEmitter ( id , assetPath , play , allowFadeout ) ) ;
88
90
}
89
91
90
- public Dictionary < string , SoundData > GetSoundDataList ( ) => assetWhitelist ;
91
-
92
- public static FMODSuppressor SuppressSounds ( )
93
- {
94
- return new FMODSuppressor ( ) ;
95
- }
92
+ public Dictionary < string , SoundData > SoundDataList => assetWhitelist ;
96
93
}
97
94
}
0 commit comments