424 {
425 if (!Directory.Exists(Application.StartupPath + "/MovesetData"))
426 {
427 Directory.CreateDirectory(Application.StartupPath + "/MovesetData");
428 }
429
431
436 {
438 }
439
441 {
443 }
444
445 bool go = true;
446 string airground = Application.StartupPath + "/MovesetData/AirGroundStats.txt";
447 string collision = Application.StartupPath + "/MovesetData/CollisionStats.txt";
448 string gfx = Application.StartupPath + "/MovesetData/GFXFiles.txt";
449 string enums = Application.StartupPath + "/MovesetData/Enums.txt";
450
451 if (File.Exists(airground))
452 {
453 if (MessageBox.Show("Do you want to overwrite AirGroundStats.txt in the MovesetData folder?",
454 "Overwrite Permission", MessageBoxButtons.YesNo) == DialogResult.Yes)
455 {
456 go = true;
457 }
458 else
459 {
460 go = false;
461 }
462 }
463 else
464 {
465 go = true;
466 }
467
468 if (go)
469 {
470 using (StreamWriter file = new StreamWriter(airground))
471 {
473 {
474 file.WriteLine(i);
475 }
476 }
477 }
478
479 if (File.Exists(collision))
480 {
481 if (MessageBox.Show("Do you want to overwrite CollisionStats.txt in the MovesetData folder?",
482 "Overwrite Permission", MessageBoxButtons.YesNo) == DialogResult.Yes)
483 {
484 go = true;
485 }
486 else
487 {
488 go = false;
489 }
490 }
491 else
492 {
493 go = true;
494 }
495
496 if (go)
497 {
498 using (StreamWriter file = new StreamWriter(collision))
499 {
501 {
502 file.WriteLine(i);
503 }
504 }
505 }
506
507 if (File.Exists(gfx))
508 {
509 if (MessageBox.Show("Do you want to overwrite GFXFiles.txt in the MovesetData folder?",
510 "Overwrite Permission", MessageBoxButtons.YesNo) == DialogResult.Yes)
511 {
512 go = true;
513 }
514 else
515 {
516 go = false;
517 }
518 }
519 else
520 {
521 go = true;
522 }
523
524 if (go)
525 {
526 using (StreamWriter file = new StreamWriter(gfx))
527 {
529 {
530 file.WriteLine(i);
531 }
532 }
533 }
534
535 if (File.Exists(enums))
536 {
537 if (MessageBox.Show("Do you want to overwrite Enums.txt in the MovesetData folder?",
538 "Overwrite Permission", MessageBoxButtons.YesNo) == DialogResult.Yes)
539 {
540 go = true;
541 }
542 else
543 {
544 go = false;
545 }
546 }
547 else
548 {
549 go = true;
550 }
551
552 if (go)
553 {
554
555 List<Dictionary<int, List<string>>> EnumList = new List<Dictionary<int, List<string>>>();
556
557 Dictionary<int, Dictionary<long, List<int>>> EnumIds =
558 new Dictionary<int, Dictionary<long, List<int>>>();
559
561 {
562 if (info.
Enums !=
null && info.
Enums.Count > 0)
563 {
564 List<int> p = new List<int>();
565
566 bool has = false;
567 int index = -1;
568 foreach (Dictionary<int, List<string>> t in EnumList)
569 {
570 bool match = true;
571 index++;
572 foreach (
int g
in info.
Enums.Keys)
573 {
574 if (t.ContainsKey(g))
575 {
576 int r = 0;
577 foreach (string s in t[g])
578 {
579 if (s != info.
Enums[g][r++])
580 {
581 match = false;
582 break;
583 }
584 }
585 }
586 else
587 {
588 match = false;
589 }
590 }
591
592 if (match)
593 {
594 has = true;
595 break;
596 }
597
598 continue;
599 }
600
601 if (!has)
602 {
603 EnumList.Add(info.
Enums);
604 index = EnumList.Count - 1;
605 }
606
607 if (!EnumIds.ContainsKey(index))
608 {
609 EnumIds.Add(index, new Dictionary<long, List<int>>());
610 }
611
612 foreach (
int i
in info.
Enums.Keys)
613 {
614 p.Add(i);
615 }
616
617 EnumIds[index].Add(info.
idNumber, p);
618 }
619 }
620
621 using (StreamWriter file = new StreamWriter(enums))
622 {
623 int i = 0;
624 foreach (Dictionary<int, List<string>> d in EnumList)
625 {
626 Dictionary<long, List<int>> events = EnumIds[i];
627 foreach (KeyValuePair<long, List<int>> ev in events)
628 {
630 foreach (int v in ev.Value)
631 {
632 file.WriteLine(v);
633 }
634
635 file.WriteLine();
636 }
637
638 file.WriteLine();
639 foreach (int x in d.Keys)
640 {
641 if (d[x] != null && d[x].Count > 0)
642 {
643 foreach (string value in d[x])
644 {
645 file.WriteLine(value);
646 }
647 }
648 }
649
650 file.WriteLine();
651 i++;
652 }
653 }
654 }
655 }
Definition: ActionEventInfo.cs:7
long idNumber
Definition: ActionEventInfo.cs:80
Dictionary< int, List< string > > Enums
Definition: ActionEventInfo.cs:90
static string Hex8(int val)
Definition: Helpers.cs:33
string[] iGFXFiles
Definition: MoveDefNode.cs:3441
static SortedDictionary< long, ActionEventInfo > EventDictionary
Definition: MoveDefNode.cs:305
static void LoadEventDictionary()
Definition: MoveDefNode.cs:312