38 g_Game.ConfigGetTextArray(
m_CfgPath +
" attachSoundSlot", cfgSlotArray);
40 int soundSetCount = cfgSoundsetArray.Count();
41 if (soundSetCount > 0 && soundSetCount == cfgSlotArray.Count())
45 for (
int i = 0; i < soundSetCount; ++i)
47 string soundSet = cfgSoundsetArray[i];
50 ErrorEx(
string.Format(
"[%1] Try to register attach sound set with empty string not allowed! Please check attachSoundSet configuration for item %2", i,
m_Name));
57 ErrorEx(
string.Format(
"[%1] Try to register attach sound set %2 with empty slot name. Please check attachSoundSlot configuration for item %3", i, soundSet,
m_Name));
61 int slotId = InventorySlots.GetSlotIdFromString(
slotName);
62 if (slotId == InventorySlots.INVALID)
64 ErrorEx(
string.Format(
"[%1] Try to register attach sound set %2 with invalid slot ID %3 (slot name: %4). Please check attachSoundSlot configuration for item %5", i, soundSet, slotId,
slotName,
m_Name));
71 #ifdef ITEM_SOUND_EVENTS_DEBUG
77 #ifdef ITEM_SOUND_EVENTS_DEBUG
92 g_Game.ConfigGetTextArray(
m_CfgPath +
" detachSoundSet", cfgSoundsetArray);
93 g_Game.ConfigGetTextArray(
m_CfgPath +
" detachSoundSlot", cfgSlotArray);
95 if (cfgSoundsetArray.Count() > 0 && cfgSoundsetArray.Count() == cfgSlotArray.Count())
99 for (
int i = 0; i < cfgSoundsetArray.Count(); ++i)
101 string soundSet = cfgSoundsetArray[i];
104 ErrorEx(
string.Format(
"[%1] Try to register detach sound set %2 but sting is empty! Please check detachSoundSet configuration for item %3", i, soundSet,
m_Name));
111 ErrorEx(
string.Format(
"[%1] Try to register detach sound set %2 with invalid slot name %3. Please check detachSoundSlot configuration for item %4", i, soundSet,
slotName,
m_Name));
118 ErrorEx(
string.Format(
"[%1] Try to register detach sound set %2 with invalid slot ID %3 (slot name: %4). Please check detachSoundSlot configuration for item %5", i, soundSet, slotId,
slotName,
m_Name));
125 #ifdef ITEM_SOUND_EVENTS_DEBUG
131 #ifdef ITEM_SOUND_EVENTS_DEBUG
162 int soundCount =
g_Game.ConfigGetChildrenCount(cfgPath);
167 soundCount =
g_Game.ConfigGetChildrenCount(cfgPath);
173 soundCount =
g_Game.ConfigGetChildrenCount(cfgPath);
178 cfgPath =
CFG_AMMO +
" " +
name +
" AnimEvents SoundWeapon";
179 soundCount =
g_Game.ConfigGetChildrenCount(cfgPath);
182 for (
int i = 0; i < soundCount; ++i)
185 g_Game.ConfigGetChildName(cfgPath, i, soundName);
186 string soundPath = cfgPath +
" " + soundName +
" ";
187 AnimSoundEvent soundEvent =
new AnimSoundEvent(soundPath);
188 if (soundEvent.IsValid())
191 #ifdef ITEM_SOUND_EVENTS_DEBUG
192 ErrorEx(
string.Format(
"[%1] Registered animation sound event for item %2. Sound name= %3 | Sound path= %4", i,
name, soundName, soundPath),
ErrorExSeverity.INFO);
195 #ifdef ITEM_SOUND_EVENTS_DEBUG
198 ErrorEx(
string.Format(
"[%1] Skipped registration of animation sound event for item %2. Sound event invalid in configuration class! Sound name= %3 | Sound path= %4", i,
name, soundName, soundPath),
ErrorExSeverity.INFO);
213 string soundPath = cfgPath +
" detachSoundSet";
214 g_Game.ConfigGetTextArray(soundPath, cfgDetachSoundsetArray);
215 int soundCount = cfgDetachSoundsetArray.Count();
220 soundPath = cfgPath +
" detachSoundSet";
221 g_Game.ConfigGetTextArray(soundPath, cfgDetachSoundsetArray);
222 soundCount = cfgDetachSoundsetArray.Count();
228 soundPath = cfgPath +
" detachSoundSet";
229 g_Game.ConfigGetTextArray(soundPath, cfgDetachSoundsetArray);
230 soundCount = cfgDetachSoundsetArray.Count();
236 soundPath = cfgPath +
" detachSoundSet";
237 g_Game.ConfigGetTextArray(soundPath, cfgDetachSoundsetArray);
238 soundCount = cfgDetachSoundsetArray.Count();
244 #ifdef ITEM_SOUND_EVENTS_DEBUG
249 #ifdef ITEM_SOUND_EVENTS_DEBUG
252 ErrorEx(
string.Format(
"Skipped creation of detach sound event instance for item %1. No detach sound in configuration class!",
GetName()),
ErrorExSeverity.INFO);
265 string soundPath = cfgPath +
" attachSoundSet";
266 g_Game.ConfigGetTextArray(soundPath, cfgAttachSoundsetArray);
267 int soundCount = cfgAttachSoundsetArray.Count();
272 soundPath = cfgPath +
" attachSoundSet";
273 g_Game.ConfigGetTextArray(soundPath, cfgAttachSoundsetArray);
274 soundCount = cfgAttachSoundsetArray.Count();
280 soundPath = cfgPath +
" attachSoundSet";
281 g_Game.ConfigGetTextArray(soundPath, cfgAttachSoundsetArray);
282 soundCount = cfgAttachSoundsetArray.Count();
288 soundPath = cfgPath +
" attachSoundSet";
289 g_Game.ConfigGetTextArray(soundPath, cfgAttachSoundsetArray);
290 soundCount = cfgAttachSoundsetArray.Count();
296 #ifdef ITEM_SOUND_EVENTS_DEBUG
301 #ifdef ITEM_SOUND_EVENTS_DEBUG
304 ErrorEx(
string.Format(
"Skipped creation of attach sound event instance for item %1. No attach sound in configuration class!",
name),
ErrorExSeverity.INFO);
331 #ifdef ITEM_SOUND_EVENTS_DEBUG
339 if (soundSets && soundSets.Count() > 0)
343 soundSets.Find(slotId, soundSet);
347 soundSet = soundSets.GetElement(0);
358 #ifdef ITEM_SOUND_EVENTS_DEBUG
366 if (soundSets && soundSets.Count() > 0)
370 soundSets.Find(slotId, soundSet);
374 soundSet = soundSets.GetElement(0);
bool SetAttachSoundEvent()
void ~InventoryItemType()
class InventoryItemSoundBase LoadSoundEvents()
ref map< int, ref InventoryItemSoundBase > m_ActionSoundEvents
string GetSlotDetachSoundSet(int slotId=InventorySlots.INVALID)
ref array< ref AnimSoundEvent > m_animSoundEvents
DEPRECATED.
InventoryItemSoundDetach m_AnimSoundEvents
InventoryItemSoundAttach GetAttachSoundEvent()
ref map< int, string > m_AttachSoundSets
InventoryItemSoundDetach GetDetachSoundEvent()
bool SetDetachSoundEvent()
string GetSlotAttachSoundSet(int slotId=InventorySlots.INVALID)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
ref map< int, string > m_DetachSoundSets
ref map< int, string > m_AttachSoundSets
ref map< int, string > GetAttachSoundSets()
ref map< int, string > GetDetachSoundSets()
void InventoryItemSoundBase(string name, string cfgPath)
override void LoadSoundEvents()
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
const int INVALID
Invalid slot (-1).
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
class DayZPlayerTypeAttachmentSoundLookupTable GetSoundEvent(int event_id)
array< string > TStringArray