DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ReplaceSoundEventHandler.c
См. документацию.
2{
3 SOUND_COMMON = 0 // "Sound"
4 SOUND_WEAPON, // "SoundWeapon"
5 SOUND_ATTACHMENT, // "SoundAttachment"
6 SOUND_VOICE // "SoundVoice"
7}
8
9enum EReplaceSoundEventID
10{
16 EAT_FRUIT
17}
18
19// Main purpose is to intercept animation system based sound event calls and replace them with different ones based on context
21{
23
25 protected ref Timer m_UpdateTimer;
26
38
39 // Inserts sound replace event to array of event maps, creates new event map if first sound of an event type is being registered
40 protected void RegisterEvent(ReplaceSoundEventBase soundEvent)
41 {
42 int sType = soundEvent.GetSoundEventType();
43
44 if (!m_MainReplaceMap.Contains(sType))
45 {
47 m_MainReplaceMap.Set(sType, replaceMap);
48 }
49
50 m_MainReplaceMap[sType].Insert(soundEvent.GetSoundAnimEventClassID(), soundEvent);
51 }
52
53 int GetSoundEventID(int anim_id, ESoundEventType soundType)
54 {
55 if (!m_MainReplaceMap.Contains(soundType))
56 return 0;
57
58 ReplaceSoundEventBase soundEvent = m_MainReplaceMap[soundType].Get(anim_id);
59 if (!soundEvent)
60 return 0;
61
62 return soundEvent.GetSoundEventID();
63 }
64
66 {
67 if (!m_MainReplaceMap.Contains(soundType))
68 return null;
69
70 foreach (int animID, ReplaceSoundEventBase soundEvent : m_MainReplaceMap[soundType])
71 {
72 if (soundEvent.GetSoundEventID() == id)
73 return soundEvent;
74 }
75
76 return null;
77 }
78
79 bool PlayReplaceSound(int soundEventID, ESoundEventType soundType, int flags)
80 {
81 ReplaceSoundEventBase soundEvent = GetSoundEventByID(soundEventID, soundType);
82 if (!soundEvent)
83 return false;
84
85 ReplaceSoundEventBase soundEventObj = ReplaceSoundEventBase.Cast(soundEvent.ClassName().ToType().Spawn());
86 soundEventObj.Init(m_Player);
87
88 return soundEventObj.Play();
89 }
90
91 //DEPRECATED
94}
void EatingVoiceOverrideDefault()
Определения ActionEatEvents.c:13
EatingVoiceOverrideDefault EatingVoiceOverrideBase EatingVoiceOverrideFruit()
Определения ActionEatEvents.c:12
class DigSoundEventBase extends ReplaceSoundEventBase DigSecondarySoundEvent
Определения ActionSurfaceEvents.c:15
void DigPrimarySoundEvent()
Определения ActionSurfaceEvents.c:16
class CleanHandsSoundEventBase extends ReplaceSoundEventBase CleanHandsSecondarySoundEvent
Определения ActionSurfaceEvents.c:53
void CleanHandsPrimarySoundEvent()
Определения ActionSurfaceEvents.c:54
map m_Player
map
Определения ControlsXboxNew.c:4
ref Timer m_UpdateTimer
Определения RadialMenu.c:20
enum ESoundEventType EAT_DEFAULT
enum ESoundEventType CLEANHANDS_SECONDARY
static ref array< ref map< int, ref ReplaceSoundEventBase > > m_SoundEventReplaceMaps
leaving this here for compatibility's sake
Определения ReplaceSoundEventHandler.c:93
enum ESoundEventType CLEANHANDS_PRIMARY
void ReplaceSoundEventHandler(PlayerBase player)
Определения ReplaceSoundEventHandler.c:27
enum ESoundEventType DIG_PRIMARY
enum ESoundEventType DIG_SECONDARY
ESoundEventType
Определения ReplaceSoundEventHandler.c:2
@ SOUND_COMMON
Определения ReplaceSoundEventHandler.c:3
@ SOUND_ATTACHMENT
Определения ReplaceSoundEventHandler.c:5
@ SOUND_VOICE
Определения ReplaceSoundEventHandler.c:6
ReplaceSoundEventBase GetSoundEventByID(int id, ESoundEventType soundType)
Определения ReplaceSoundEventHandler.c:65
bool PlayReplaceSound(int soundEventID, ESoundEventType soundType, int flags)
Определения ReplaceSoundEventHandler.c:79
enum ESoundEventType m_MainReplaceMap
int GetSoundEventID()
Определения SoundEvents.c:150
Определения PlayerBaseClient.c:2
int GetSoundAnimEventClassID()
Определения ReplaceSoundEventBase.c:20
void Init(PlayerBase player)
Определения ReplaceSoundEventBase.c:25
EReplaceSoundEventID GetSoundEventID()
Определения ReplaceSoundEventBase.c:15
ESoundEventType GetSoundEventType()
Определения ReplaceSoundEventBase.c:10
Определения DayZPlayerImplement.c:39
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения CachedEquipmentStorage.c:4
proto native void RegisterEvent(string pName, int pId)
register events