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

◆ RegisterParticleByFullPath()

static int ParticleList::RegisterParticleByFullPath ( string fullPath)
inlinestaticprivate

Splits the full path into name of particle and it's directory path, then registers the particle with the name and returns its ID Called by C++

Silently fail on retail, game already takes too long to boot, lets not make it longer

TODO(kumarjac): bake in this error

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

422 {
424#ifdef DIAG_DEVELOPER
425 if (fullPath.Replace("\\", "/") > 0)
426 {
427 ErrorEx(string.Format("Using wrong path delimiter for particle registering! Use '/' instead of '\\'. fullPath=%1", fullPath), ErrorExSeverity.WARNING);
428 }
429#endif
430
431 int lastIndex = fullPath.LastIndexOf("/");
432 if (lastIndex < 0)
433 {
435#ifdef WAITING_FOR_PBOS_TO_BE_UPDATED
436 ErrorEx(string.Format("No root path found! fullPath=%1", fullPath), ErrorExSeverity.ERROR);
437 return ParticleList.INVALID;
438#else
440#endif
441 }
442
443 // 'graphics/particles/vehicle_wheel_snow' becomes 'graphics/particles/' and 'vehicle_wheel_snow'
444
445 string rootPath = fullPath.Substring(0, lastIndex + 1);
446 string fileName = fullPath.Substring(lastIndex + 1, fullPath.Length() - (lastIndex + 1));
447
448 return RegisterParticle(rootPath, fileName);
449 }
static string GetPathToParticles()
Returns BASE path to all particles.
Определения ParticleList.c:563
static int RegisterParticle(string file_name)
Определения ParticleList.c:414
static int RegisterParticleByFullPath(string fullPath)
Определения ParticleList.c:421
ErrorExSeverity
Определения EnDebug.c:62
enum ShapeType ErrorEx
proto native int Length()
Returns length of string.
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
proto native int LastIndexOf(string sample)
Finds last 'sample' in 'str'. Returns -1 when not found.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.

Перекрестные ссылки ErrorEx, GetPathToParticles(), INVALID, string::LastIndexOf(), string::Length(), RegisterParticle(), RegisterParticleByFullPath(), string::Replace() и string::Substring().

Используется в ConstructionPartEffectsData::InitDestroyParticle(), DustKickupEffects::LoadDustEffectPaths() и RegisterParticleByFullPath().