File size: 2,041 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class HiddenSelectionsData
{
	ref array<string> m_HiddenSelections = new array<string>;
	ref array<string> m_HiddenSelectionsTextures = new array<string>;
	ref array<string> m_HiddenSelectionsMaterials = new array<string>;
	
	ref map<string, int> m_HiddenSelectionNameToIndex = new map<string, int>;
	
	void HiddenSelectionsData(string type)
	{
		GetGame().ConfigGetTextArray( string.Format("CfgVehicles %1 hiddenSelections", 			type), m_HiddenSelections );
		GetGame().ConfigGetTextArray( string.Format("CfgVehicles %1 hiddenSelectionsTextures", 	type), m_HiddenSelectionsTextures );
		GetGame().ConfigGetTextArray( string.Format("CfgVehicles %1 hiddenSelectionsMaterials", type), m_HiddenSelectionsMaterials );
		
		for (int i = 0; i < m_HiddenSelections.Count(); ++i)
			m_HiddenSelectionNameToIndex.Insert(m_HiddenSelections[i], i);
	}
	
	int GetHiddenSelectionIndex(string selection)
	{
		int index;
		if (m_HiddenSelectionNameToIndex.Find(selection, index))
			return index;
		
		return -1;
	}
	
	TStringArray GetHiddenSelectionsTextures()
	{
		return m_HiddenSelectionsTextures;
	}
	
	TStringArray GetHiddenSelectionsMaterials()
	{
		return m_HiddenSelectionsMaterials;
	}
	
	static array<string> GetHiddenSelectionsConfig(string type)
	{
		array<string> hiddenSelections = new array<string>;
		GetGame().ConfigGetTextArray( string.Format("CfgVehicles %1 hiddenSelections", type), hiddenSelections );
		return hiddenSelections;
	}
	
	static array<string> GetHiddenSelectionsTexturesConfig(string type)
	{
		array<string> hiddenSelectionsTextures = new array<string>;
		GetGame().ConfigGetTextArray( string.Format("CfgVehicles %1 hiddenSelectionsTextures", type), hiddenSelectionsTextures );
		return hiddenSelectionsTextures;
	}
	
	static array<string> GetHiddenSelectionsMaterialsConfig(string type)
	{
		array<string> hiddenSelectionsMaterials = new array<string>;
		GetGame().ConfigGetTextArray( string.Format("CfgVehicles %1 hiddenSelectionsMaterials", type), hiddenSelectionsMaterials );
		return hiddenSelectionsMaterials;
	}
}