@@ -358,8 +358,9 @@ public unsafe ParsedInstance[] ParseObjects()
358
358
359
359
var objects = new Dictionary < nint , ParsedInstance > ( ) ;
360
360
var mounts = new Dictionary < nint , ParsedCharacterInstance > ( ) ;
361
- foreach ( var objectPtr in gameObjectManager ->Objects . GameObjectIdSorted )
361
+ for ( var idx = 0 ; idx < gameObjectManager ->Objects . GameObjectIdSorted . Length ; idx ++ )
362
362
{
363
+ var objectPtr = gameObjectManager ->Objects . GameObjectIdSorted [ idx ] ;
363
364
if ( objectPtr == null || objectPtr . Value == null )
364
365
continue ;
365
366
@@ -371,10 +372,10 @@ public unsafe ParsedInstance[] ParseObjects()
371
372
var drawObject = obj ->DrawObject ;
372
373
if ( drawObject == null )
373
374
continue ;
374
-
375
+
375
376
if ( IsObjectPlaceHolder ( drawObject ) )
376
377
continue ;
377
-
378
+
378
379
var anyVisible = drawObject ->IsVisible ;
379
380
380
381
void AddObject ( ParsedCharacterInstance instance )
@@ -388,11 +389,12 @@ void AddObject(ParsedCharacterInstance instance)
388
389
objects . TryAdd ( instance . Id , instance ) ;
389
390
}
390
391
}
391
-
392
+
392
393
var transform = new Transform ( drawObject ->Position , drawObject ->Rotation , drawObject ->Scale ) ;
393
- var instance = new ParsedCharacterInstance ( ( nint ) obj , obj ->NameString , type , transform , anyVisible ) ;
394
+ var name = obj ->NameString . GetCharacterName ( config , type , idx . ToString ( ) ) ;
395
+ var instance = new ParsedCharacterInstance ( ( nint ) obj , name , type , transform , anyVisible ) ;
394
396
AddObject ( instance ) ;
395
-
397
+
396
398
if ( drawObject ->IsVisible == false )
397
399
{
398
400
// want to list children which are visible even if the parent is not.
@@ -406,25 +408,25 @@ void HandleRecursiveVisibility(Object* childObject)
406
408
{
407
409
if ( IsCharacterPlaceholder ( cBase ) )
408
410
return ;
409
-
411
+
410
412
var cTransform = new Transform ( cBase ->DrawObject . Position , cBase ->DrawObject . Rotation , cBase ->DrawObject . Scale ) ;
411
- var cInstance = new ParsedCharacterInstance ( ( nint ) childObject , $ "Child of { obj -> NameString } ", type , cTransform , true ,
412
- ParsedCharacterInstance . ParsedCharacterInstanceIdType . CharacterBase )
413
+ var cInstance = new ParsedCharacterInstance ( ( nint ) childObject , $ "Child of { name } ", type , cTransform , true ,
414
+ ParsedCharacterInstance . ParsedCharacterInstanceIdType . CharacterBase )
413
415
{
414
416
Parent = instance
415
417
} ;
416
418
AddObject ( cInstance ) ;
417
419
return ; // skip parsing if visible as item should be covered under attaches to parent
418
420
}
419
421
}
420
-
422
+
421
423
foreach ( var childOfChild in childObject ->ChildObjects )
422
424
{
423
425
if ( childOfChild == null ) continue ;
424
426
HandleRecursiveVisibility ( childOfChild ) ;
425
427
}
426
428
}
427
-
429
+
428
430
foreach ( var childObject in drawObject ->ChildObjects . GetEnumerator ( ) )
429
431
{
430
432
HandleRecursiveVisibility ( childObject ) ;
0 commit comments