DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ProcessVoiceEvent()

AbstractWave DayZPlayer::ProcessVoiceEvent ( string pEventType,
string pUserString,
int pUserInt )
inlineprotected

См. определение в файле DayZPlayerImplement.c строка 3529

3530 {
3531 #ifdef SERVER//none of this code needs to run on server, ifdef put here rather than before the method call to maintain mod compatibility
3532 return null;
3533 #endif
3535 DayZPlayerTypeVoiceSoundLookupTable table = type.GetVoiceSoundLookupTable();
3536 if (!table)
3537 return null;
3538 AbstractWave wave;
3539 EntityAI mask = GetInventory().FindAttachment(InventorySlots.MASK);
3540 EntityAI head_gear = GetInventory().FindAttachment(InventorySlots.HEADGEAR);
3541
3542 string category;
3543 if (mask || head_gear)
3544 {
3545 string category_mask;
3546 string category_headgear;
3547
3548 int priority_mask;
3549 int priority_headgear;
3550
3551 if (mask)
3552 {
3553 category_mask = mask.ConfigGetString("soundVoiceType");
3554 priority_mask = mask.ConfigGetInt("soundVoicePriority");
3555 }
3556 if (head_gear)
3557 {
3558 category_headgear = head_gear.ConfigGetString("soundVoiceType");
3559 priority_headgear = head_gear.ConfigGetInt("soundVoicePriority");
3560 }
3561
3562 if (priority_headgear >= priority_mask && category_headgear != "")
3563 {
3564 category = category_headgear;
3565 }
3566 else
3567 {
3568 category = category_mask;
3569 }
3570 }
3571
3572 if (category == "")
3573 {
3574 category = "none";
3575 }
3576
3577 SoundObjectBuilder soundBuilder = table.GetSoundBuilder(pUserInt, category.Hash());
3578
3579 if (soundBuilder)
3580 {
3581 PlayerBase player = PlayerBase.Cast(this);
3582 //this code block looks super shady, but it's the only way the sounds play correctly, god knows what's going on on c++ side
3583 int maleVoiceType = 0;
3584 int femaleVoiceType = 0;
3585 if (player.IsMale())
3586 {
3587 maleVoiceType = player.GetVoiceType();
3588 }
3589 else
3590 {
3591 femaleVoiceType = player.GetVoiceType();
3592 }
3593
3594 soundBuilder.AddVariable("male", maleVoiceType);
3595 soundBuilder.AddVariable("female", femaleVoiceType);
3596
3597 // end of weirdness
3598 SoundObject soundObject = soundBuilder.BuildSoundObject();
3599 if (soundObject != NULL)
3600 {
3601 AttenuateSoundIfNecessary(soundObject);
3602 wave = PlaySound(soundObject, soundBuilder);
3603 }
3604
3605 }
3606
3607 return wave;
3608 }
class LogManager EntityAI
void PlaySound()
Определения HungerSoundHandler.c:38
void AttenuateSoundIfNecessary(SoundObject soundObject)
Определения DayZPlayerImplement.c:3783
override SoundObjectBuilder GetSoundBuilder(int eventId, int parameterHash)
Определения DayZPlayerCfgSounds.c:211
void DayZPlayerType()
Определения dayzplayer.c:512
proto native DayZPlayerType GetDayZPlayerType()
returns appropriate DayZPlayerType
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
void SoundObject(SoundParams soundParams)
void AbstractWave()
Определения Sound.c:167
proto native int Hash()
Returns hash of string.

Перекрестные ссылки AbstractWave(), AttenuateSoundIfNecessary(), DayZPlayerType(), GetDayZPlayerType(), DayZPlayerTypeVoiceSoundLookupTable::GetSoundBuilder(), string::Hash(), PlaySound() и SoundObjectBuilder().

Используется в OnSoundEvent().