@@ -302,11 +302,17 @@ private void StartScan(string topNodeName = null, string selectedNodeName = null
302
302
nodes = treeView1 . Nodes . Find ( selectedNodeName , true ) ;
303
303
if ( nodes . Length > 0 )
304
304
{
305
- treeView1 . SelectedNode = nodes [ 0 ] ;
305
+ if ( treeView1 . Nodes . Count > 0 )
306
+ {
307
+ treeView1 . SelectedNode = nodes [ 0 ] ;
308
+ }
306
309
}
307
310
else
308
311
{
309
- treeView1 . SelectedNode = treeView1 . Nodes [ 0 ] ;
312
+ if ( treeView1 . Nodes . Count > 0 )
313
+ {
314
+ treeView1 . SelectedNode = treeView1 . Nodes [ 0 ] ;
315
+ }
310
316
}
311
317
}
312
318
@@ -355,7 +361,7 @@ private void StartObjectRedirectorScan(string nodeNameToSelect = null)
355
361
private void StartBio2DAScan ( string nodeNameToSelect = null )
356
362
{
357
363
Random random = new Random ( ) ;
358
- string [ ] stringRefColumns = { "StringRef" , "SaveGameStringRef" , "Title" , "LabelRef" , "Name" , "ActiveWorld" , "Description" , "ButtonLabel" } ;
364
+ string [ ] stringRefColumns = { "StringRef" , "SaveGameStringRef" , "Title" , "LabelRef" , "Name" , "ActiveWorld" , "Description" , "Description1" , "Description1" , "Description1" , " ButtonLabel" , "UnlockName" , "UnlockBlurb" , "DisplayName" , "DisplayDescription" , "PriAbiDesc" , "SecAbiDesc " } ;
359
365
360
366
resetPropEditingControls ( ) ;
361
367
treeView1 . BeginUpdate ( ) ;
@@ -375,7 +381,8 @@ private void StartBio2DAScan(string nodeNameToSelect = null)
375
381
{
376
382
rowNames . Add ( n . ToString ( ) ) ;
377
383
}
378
- } else
384
+ }
385
+ else
379
386
{
380
387
return ;
381
388
}
@@ -390,7 +397,8 @@ private void StartBio2DAScan(string nodeNameToSelect = null)
390
397
{
391
398
rowNames . Add ( n . Value . ToString ( ) ) ;
392
399
}
393
- } else
400
+ }
401
+ else
394
402
{
395
403
return ;
396
404
}
@@ -402,7 +410,7 @@ private void StartBio2DAScan(string nodeNameToSelect = null)
402
410
403
411
//Get Columns
404
412
List < string > columnNames = new List < string > ( ) ;
405
- int colcount = BitConverter . ToInt32 ( data , data . Length - 4 ) ;
413
+ int colcount = BitConverter . ToInt32 ( data , data . Length - 4 ) ; //this is actually index of last column, but it works the same
406
414
int currentcoloffset = 0 ;
407
415
Console . WriteLine ( "Number of columns: " + colcount ) ;
408
416
TreeNode columnsnode = new TreeNode ( "Columns" ) ;
@@ -421,7 +429,7 @@ private void StartBio2DAScan(string nodeNameToSelect = null)
421
429
columnNames . Insert ( 0 , name ) ;
422
430
colcount -- ;
423
431
}
424
- currentcoloffset += 4 ; //column count.
432
+ currentcoloffset += 4 ; //real column count
425
433
int infilecolcount = BitConverter . ToInt32 ( data , data . Length - currentcoloffset ) ;
426
434
columnsnode . Text = infilecolcount + " columns" ;
427
435
columnsnode . Name = ( data . Length - currentcoloffset ) . ToString ( ) ;
@@ -463,7 +471,7 @@ private void StartBio2DAScan(string nodeNameToSelect = null)
463
471
//int
464
472
int ival = BitConverter . ToInt32 ( data , curroffset ) ;
465
473
valueStr = ival . ToString ( ) ;
466
- if ( stringRefColumns . Contains ( columnNames [ colindex ] ) )
474
+ // if (stringRefColumns.Contains(columnNames[colindex]))
467
475
{
468
476
string tlkVal ;
469
477
if ( ME1_TLK_DICT != null && ME1_TLK_DICT . TryGetValue ( valueStr , out tlkVal ) )
@@ -478,22 +486,12 @@ private void StartBio2DAScan(string nodeNameToSelect = null)
478
486
//name
479
487
int nval = BitConverter . ToInt32 ( data , curroffset ) ;
480
488
valueStr = pcc . getNameEntry ( nval ) ;
489
+ valueStr += "_" + BitConverter . ToInt32 ( data , curroffset + 4 ) ;
481
490
curroffset += 8 ;
482
491
tag = nodeType . StructLeafName ;
483
492
break ;
484
493
case 2 :
485
494
//float
486
- float f = NextFloat ( random ) ;
487
- while ( f < 0 )
488
- {
489
- f = NextFloat ( random ) ;
490
- }
491
- byte [ ] buff2 = BitConverter . GetBytes ( f ) ;
492
- for ( int o = 0 ; o < 4 ; o ++ )
493
- {
494
- data [ curroffset + o ] = buff2 [ o ] ;
495
- }
496
-
497
495
float fval = BitConverter . ToSingle ( data , curroffset ) ;
498
496
valueStr = fval . ToString ( ) ;
499
497
curroffset += 4 ;
@@ -537,7 +535,8 @@ private void StartBio2DAScan(string nodeNameToSelect = null)
537
535
byte dataType = data [ curroffset ] ;
538
536
int dataSize = dataType == Bio2DACell . TYPE_NAME ? 8 : 4 ;
539
537
curroffset ++ ;
540
- byte [ ] celldata = data . Skip ( curroffset ) . Take ( dataSize ) . ToArray ( ) ;
538
+ byte [ ] celldata = new byte [ dataSize ] ;
539
+ Buffer . BlockCopy ( data , curroffset , celldata , 0 , dataSize ) ;
541
540
Bio2DACell cell = new Bio2DACell ( pcc , curroffset , dataType , celldata ) ;
542
541
//Console.WriteLine(columnNames[col] + ": " + cell.GetDisplayableValue());
543
542
bio2da [ row , col ] = cell ;
@@ -558,11 +557,12 @@ private void StartBio2DAScan(string nodeNameToSelect = null)
558
557
if ( cell != null )
559
558
{
560
559
columnNode = new TreeNode ( columnname + ": " + cell . GetDisplayableValue ( ) ) ;
561
- if ( stringRefColumns . Contains ( columnname ) )
560
+ if ( cell . Type == Bio2DACell . TYPE_INT )
562
561
{
563
- string tlkVal ;
564
- if ( ME1_TLK_DICT != null && ME1_TLK_DICT . TryGetValue ( cell . GetDisplayableValue ( ) , out tlkVal ) )
562
+ string tlkVal = " " ;
563
+ if ( ME1_TLK_DICT != null && ME1_TLK_DICT . TryGetValue ( BitConverter . ToInt32 ( cell . Data , 0 ) . ToString ( ) , out tlkVal ) )
565
564
{
565
+ tlkVal = tlkVal . Replace ( "\n " , "[NL]" ) ;
566
566
columnNode . Text += " " + tlkVal ;
567
567
}
568
568
}
@@ -613,7 +613,7 @@ private void StartBio2DAScan(string nodeNameToSelect = null)
613
613
614
614
treeView1 . EndUpdate ( ) ;
615
615
memory = data ;
616
- export . Data = data ;
616
+ // export.Data = data;
617
617
memsize = memory . Length ;
618
618
}
619
619
0 commit comments