DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
DayZAnimEventMaps.c
См. документацию.
1//individual sound table consisting of map of parameter hashes as keys and soundbuilder array as values
3{
8
9 void InitTable(string tableCategoryName, string parameterName)
10 {
11 m_tableCategoryName = tableCategoryName;
12 m_parameterName = parameterName;
13 }
14
15 void LoadTable(string soundLookupTableName)
16 {
17 string path = "CfgSoundTables " + m_tableCategoryName + " " + soundLookupTableName;
18
19 //load all classes names
20 int soundCount = GetGame().ConfigGetChildrenCount(path);
21
22 for(int i = 0; i < soundCount; i++)
23 {
24 string soundClassName;
25 GetGame().ConfigGetChildName(path, i, soundClassName);
26 string soundClassPath = path + " " + soundClassName + " ";
27
28 string parameter;
29 GetGame().ConfigGetText(soundClassPath + m_parameterName, parameter);
30
31 array<string> soundSetNames = new array<string>;
32 GetGame().ConfigGetTextArray(soundClassPath + "soundSets", soundSetNames);
33
34 //TODO create SoundObject for every entry, save in Game?
36 for(int j = 0; j < soundSetNames.Count(); j++)
37 {
39 SoundObjectBuilder soundObjectBuilder = bank.GetBuilder(soundSetNames.Get(j));
40
41 if(soundObjectBuilder != NULL)
42 soundObjectBuilders.Insert(soundObjectBuilder);
43 }
44
45 if(soundObjectBuilders.Count() > 0)
46 {
47 //Print("SoundLookupTable::LoadTable: path: " + path + " param:" + parameter + " param#:" + parameter.Hash() + " objBuildersCount: " + soundObjectBuilders.Count());
48 m_soundBuilders.Insert(parameter.Hash(), soundObjectBuilders);
49 }
50 }
51 }
52
54 {
55 array<SoundObjectBuilder> soundObjects = m_soundBuilders.Get(parameterHash);
56
57 if(soundObjects == NULL || soundObjects.Count() == 0)
58 {
59 return NULL;
60 }
61 else if (soundObjects.Count() == 1)
62 {
63 return soundObjects.Get(0);
64 }
65 else
66 {
67 int index = Math.RandomInt(0, soundObjects.Count());
68 return soundObjects.Get(index);
69 }
70 }
71
72
73 private string m_tableCategoryName;
74 private string m_parameterName;
76}
77
78
80{
82 {
83 InitTable("CfgStepSoundTables", "surface");
84 }
85}
86
87class AttachmentSoundLookupTable extends SoundLookupTable
88{
90 {
91 InitTable("CfgAttachmentSoundTables", "category");
92 }
94
96{
98
100 {
101 InitTable("CfgVoiceSoundTables", "category");
102 }
103
105 {
106 m_NoiseParams = param;
107 }
108
110 {
111 return m_NoiseParams;
112 }
113}
114
115
117{
119 {
120 InitTable("CfgImpactSoundTables", "surface");
121 }
122}
123
125{
128 InitTable("CfgActionsSoundTables", "category");
129 }
130}
132
134{
139
140
142 {
143 if(m_instance == NULL)
145
146 return m_instance;
147 }
148
149
150 SoundObjectBuilder GetBuilder(string soundSetName)
152 int soundSetNameHash = soundSetName.Hash();
154 SoundObjectBuilder builder = m_pBuilders.Get(soundSetNameHash);
155 if(builder == NULL)
156 {
157 SoundParams params = new SoundParams(soundSetName);
158 if(params.IsValid())
159 {
160 builder = new SoundObjectBuilder(params);
161 m_pBuilders.Insert(soundSetNameHash, builder);
162 }
163 else
164 {
165 Print("AnimSoundObjectBuilderBank: Invalid sound set \"" + soundSetName + "\".");
166 return NULL;
167 }
168 }
169 return builder;
170 }
171
174}
175
176
178{
184
187 if(m_instance == NULL)
189
190 return m_instance;
191 }
192
193
196 int tableNameHash = tableName.Hash();
197
198 SoundLookupTable table = m_pTables.Get(tableNameHash);
199 if(table == NULL)
200 {
201 table = new StepSoundLookupTable();
202 table.LoadTable(tableName);
203 m_pTables.Insert(tableNameHash, table);
204 }
205 return table;
206 }
207
209 {
210 int tableNameHash = tableName.Hash();
211
212 SoundLookupTable table = m_pTables.Get(tableNameHash);
213 if(table == NULL)
214 {
215 table = new ImpactSoundLookupTable();
216 table.LoadTable(tableName);
217 m_pTables.Insert(tableNameHash, table);
219 return table;
220 }
221
223 {
224 int tableNameHash = tableName.Hash();
225
226 SoundLookupTable table = m_pTables.Get(tableNameHash);
227 if(table == NULL)
228 {
229 table = new ActionSoundLookupTable();
230 table.LoadTable(tableName);
231 m_pTables.Insert(tableNameHash, table);
232 }
233 return table;
234 }
235
236 private static ref AnimSoundLookupTableBank m_instance;
238}
map
Определения ControlsXboxNew.c:4
void PlayerVoiceLookupTable()
Определения DayZAnimEventMaps.c:99
SoundLookupTable GetImpactTable(string tableName)
Определения DayZAnimEventMaps.c:208
void SetNoiseParam(NoiseParams param)
Определения DayZAnimEventMaps.c:104
autoptr map< int, ref SoundObjectBuilder > m_pBuilders
Определения DayZAnimEventMaps.c:218
class AnimSoundObjectBuilderBank AnimSoundLookupTableBank()
Определения DayZAnimEventMaps.c:179
static AnimSoundObjectBuilderBank GetInstance()
Определения DayZAnimEventMaps.c:186
SoundLookupTable GetStepTable(string tableName)
Определения DayZAnimEventMaps.c:194
SoundLookupTable GetActionTable(string tableName)
Определения DayZAnimEventMaps.c:222
static ref AnimSoundObjectBuilderBank m_instance
Определения DayZAnimEventMaps.c:217
class AttachmentSoundLookupTable extends SoundLookupTable m_NoiseParams
class ImpactSoundLookupTable extends SoundLookupTable ActionSoundLookupTable()
Определения DayZAnimEventMaps.c:126
autoptr map< int, ref SoundLookupTable > m_pTables
Определения DayZAnimEventMaps.c:237
class SoundLookupTable StepSoundLookupTable()
Определения DayZAnimEventMaps.c:81
NoiseParams GetNoiseParam()
Определения DayZAnimEventMaps.c:109
void ImpactSoundLookupTable()
Определения DayZAnimEventMaps.c:127
class NoiseSystem NoiseParams()
Определения Noise.c:15
string path
Определения OptionSelectorMultistate.c:142
static AnimSoundObjectBuilderBank GetInstance()
Определения DayZAnimEventMaps.c:141
static ref AnimSoundObjectBuilderBank m_instance
Определения DayZAnimEventMaps.c:172
SoundObjectBuilder GetBuilder(string soundSetName)
Определения DayZAnimEventMaps.c:150
autoptr map< int, ref SoundObjectBuilder > m_pBuilders
Определения DayZAnimEventMaps.c:173
void AnimSoundObjectBuilderBank()
Определения DayZAnimEventMaps.c:135
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
Определения EnMath.c:7
void AttachmentSoundLookupTable()
Определения DayZAnimEventMaps.c:89
void LoadTable(string soundLookupTableName)
Определения DayZAnimEventMaps.c:15
ref map< int, ref array< SoundObjectBuilder > > m_soundBuilders
Определения DayZAnimEventMaps.c:75
string m_parameterName
Определения DayZAnimEventMaps.c:74
SoundObjectBuilder GetSoundBuilder(int parameterHash)
Определения DayZAnimEventMaps.c:53
string m_tableCategoryName
Определения DayZAnimEventMaps.c:73
void ImpactSoundLookupTable()
Определения DayZAnimEventMaps.c:118
void InitTable(string tableCategoryName, string parameterName)
Определения DayZAnimEventMaps.c:9
void SoundLookupTable()
Определения DayZAnimEventMaps.c:4
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
class SoundObject SoundParams(string name)
proto native int Hash()
Returns hash of string.