Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
inventoryitemtype.c
Go to the documentation of this file.
2{
3 private ref map<int, ref AnimSoundEvent> m_AnimSoundEvents;
4
5 private void InventoryItemType()
6 {
7 LoadSoundEvents();
8 }
9
10 private void ~InventoryItemType();
11
12 void LoadSoundEvents()
13 {
14 string cfgPath = "CfgVehicles " + GetName() + " AnimEvents SoundWeapon";
15
16 m_AnimSoundEvents = new map<int, ref AnimSoundEvent>();
17
18 int soundCount = GetGame().ConfigGetChildrenCount(cfgPath);
19
20 if (soundCount <= 0)//try other path
21 {
22 cfgPath = "CfgWeapons " + GetName() + " AnimEvents SoundWeapon";
23 soundCount = GetGame().ConfigGetChildrenCount(cfgPath);
24 }
25
26 if (soundCount <= 0)//try other path
27 {
28 cfgPath = "CfgMagazines " + GetName() + " AnimEvents SoundWeapon";
29 soundCount = GetGame().ConfigGetChildrenCount(cfgPath);
30 }
31
32 if (soundCount <= 0)//try other path
33 {
34 cfgPath = "CfgAmmo " + GetName() + " AnimEvents SoundWeapon";
35 soundCount = GetGame().ConfigGetChildrenCount(cfgPath);
36 }
37
38 for (int i = 0; i < soundCount; i++)
39 {
40 string soundName;
41 GetGame().ConfigGetChildName(cfgPath, i, soundName);
42 string soundPath = cfgPath + " " + soundName + " ";
43 AnimSoundEvent soundEvent = new AnimSoundEvent(soundPath);
44 if (soundEvent.IsValid())
45 m_AnimSoundEvents.Set(soundEvent.m_iID, soundEvent);
46 }
47 }
48
49
50 AnimSoundEvent GetSoundEvent(int event_id)
51 {
52 return m_AnimSoundEvents.Get(event_id);
53 }
54
55 proto native owned string GetName();
56
58 ref array<ref AnimSoundEvent> m_animSoundEvents;
59}
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()