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

◆ InitDamageZoneDisplayNameMapping()

void Entity::InitDamageZoneDisplayNameMapping ( )
inlineprivate

Initialize map of damage zone display names for more optimized retrieval.

См. определение в файле 3_Game/DayZ/Entities/EntityAI.c строка 406

407 {
408 string path_base;
409 string path;
410 string component_name;
411
412 if ( IsWeapon() )
413 {
414 path_base = CFG_WEAPONSPATH;
415 }
416 else if ( IsMagazine() )
417 {
418 path_base = CFG_MAGAZINESPATH;
419 }
420 else
421 {
422 path_base = CFG_VEHICLESPATH;
423 }
424
425 path_base = string.Format( "%1 %2 DamageSystem DamageZones", path_base, GetType() );
426
427 if ( !g_Game.ConfigIsExisting(path_base) )
428 {
429 component_name = GetDisplayName();
430 g_Game.FormatRawConfigStringKeys(component_name);
431 m_DamageDisplayNameMap.Insert( "".Hash(), component_name );
432 }
433 else
434 {
435 TStringArray zone_names = new TStringArray;
436 GetDamageZones( zone_names );
437
438 for ( int i = 0; i < zone_names.Count(); i++ )
439 {
440 path = string.Format( "%1 %2 displayName", path_base, zone_names[i] );
441
442 if (g_Game.ConfigIsExisting(path) && g_Game.ConfigGetTextRaw(path,component_name))
443 {
444 g_Game.FormatRawConfigStringKeys(component_name);
445 m_DamageDisplayNameMap.Insert( zone_names[i].Hash(), component_name );
446 }
447 }
448 }
449 }
eBleedingSourceType GetType()
DayZGame g_Game
Определения DayZGame.c:3942
static string GetDisplayName(int liquid_type)
Определения Liquid.c:382
string path
Определения OptionSelectorMultistate.c:142
ref map< int, string > m_DamageDisplayNameMap
array< string > TStringArray
Определения EnScript.c:712
const string CFG_VEHICLESPATH
Определения 3_Game/DayZ/constants.c:220
const string CFG_WEAPONSPATH
Определения 3_Game/DayZ/constants.c:221
const string CFG_MAGAZINESPATH
Определения 3_Game/DayZ/constants.c:222
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.

Перекрестные ссылки CFG_MAGAZINESPATH, CFG_VEHICLESPATH, CFG_WEAPONSPATH, string::Format(), g_Game, GetDisplayName(), GetType(), m_DamageDisplayNameMap и path.

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