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

◆ InitDamageZoneDisplayNameMapping()

void Entity::InitDamageZoneDisplayNameMapping ( )
inlineprivate

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

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

395 {
396 string path_base;
397 string path;
398 string component_name;
399
400 if ( IsWeapon() )
401 {
402 path_base = CFG_WEAPONSPATH;
403 }
404 else if ( IsMagazine() )
405 {
406 path_base = CFG_MAGAZINESPATH;
407 }
408 else
409 {
410 path_base = CFG_VEHICLESPATH;
411 }
412
413 path_base = string.Format( "%1 %2 DamageSystem DamageZones", path_base, GetType() );
414
415 if ( !GetGame().ConfigIsExisting(path_base) )
416 {
417 component_name = GetDisplayName();
418 GetGame().FormatRawConfigStringKeys(component_name);
419 m_DamageDisplayNameMap.Insert( "".Hash(), component_name );
420 }
421 else
422 {
423 TStringArray zone_names = new TStringArray;
424 GetDamageZones( zone_names );
425
426 for ( int i = 0; i < zone_names.Count(); i++ )
427 {
428 path = string.Format( "%1 %2 displayName", path_base, zone_names[i] );
429
430 if (GetGame().ConfigIsExisting(path) && GetGame().ConfigGetTextRaw(path,component_name))
431 {
432 GetGame().FormatRawConfigStringKeys(component_name);
433 m_DamageDisplayNameMap.Insert( zone_names[i].Hash(), component_name );
434 }
435 }
436 }
437 }
eBleedingSourceType GetType()
Определения BleedingSource.c:63
static string GetDisplayName(int liquid_type)
Определения Liquid.c:382
string path
Определения OptionSelectorMultistate.c:142
bool FormatRawConfigStringKeys(inout string value)
Changes localization key format to script-friendly format.
Определения Game.c:475
ref map< int, string > m_DamageDisplayNameMap
Определения EntityAI.c:124
proto native CGame GetGame()
array< string > TStringArray
Определения EnScript.c:685
const string CFG_VEHICLESPATH
Определения constants.c:220
const string CFG_WEAPONSPATH
Определения constants.c:221
const string CFG_MAGAZINESPATH
Определения 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(), CGame::FormatRawConfigStringKeys(), GetDisplayName(), GetGame(), GetType(), m_DamageDisplayNameMap и path.

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