File size: 734 Bytes
24b81cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class SoundSetMap
{
	ref static map<int, string> m_SoundSetMapIDByID = new map<int, string>;
	ref static map<string, int> m_SoundSetMapIDByName = new map<string, int>;
	
	static void Init()
	{
		string path = "CfgSoundSets";
		
		int soundCount = GetGame().ConfigGetChildrenCount(path);
		
		for (int i = 1; i < soundCount; i++)
		{
			string soundClassName;
			GetGame().ConfigGetChildName(path, i, soundClassName);
			m_SoundSetMapIDByID.Insert(i,soundClassName);
			m_SoundSetMapIDByName.Insert(soundClassName,i);
			//PrintString(soundClassName);
		}
	}
	
	static string GetSoundSetName(int id)
	{
		return m_SoundSetMapIDByID.Get(id);
	}
	
	static int GetSoundSetID(string name)
	{
		return m_SoundSetMapIDByName.Get(name);
	}

}