Anonymous Anonymous - 8 months ago
2424 0

No description

C#

GenerateFNISUsers

using GenerateFNISforUsers.My;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using Microsoft.VisualBasic.MyServices;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows.Forms;

namespace GenerateFNISforUsers
{
  [DesignerGenerated]
  public class GenerateFNISUsers : Form
  {
    public static GenerateFNISUsers.CustomPreCache[] CustomPreCacheSet = new GenerateFNISUsers.CustomPreCache[51];
    public static GenerateFNISUsers.PCEAgenderFileData[] PCEAgenderFile = new GenerateFNISUsers.PCEAgenderFileData[501];
    private const string FNISBehaviorVersion = "V7.0";
    private const string FNISBehaviorVersExt = "";
    private const string SkyrimMinVersion = "1.8.151";
    private string FNISVersionText;
    private string SkyrimVersion;
    private string SkyrimExe;
    private string SkyrimName;
    private string GeneratorName;
    private bool optionChanged;
    private const string FNISmodList = "FNISmodList.txt";
    private string[] FNISModList1;
    private List<string> FNISModlist2L;
    public static int iCustomPreCacheSet;
    public static string[] CPCFile;
    public static int iPCEAgenderFile;
    public static string FirstPatchLine;
    public static string PatchDefFile;
    private IContainer components;

    internal virtual TextBox TextBox1 { get; [MethodImpl(MethodImplOptions.Synchronized)] set; }

    internal virtual Button Button1
    {
      get
      {
        return this._Button1;
      }
      [MethodImpl(MethodImplOptions.Synchronized)] set
      {
        EventHandler eventHandler = new EventHandler(this.Button1_Click);
        Button button1_1 = this._Button1;
        if (button1_1 != null)
          button1_1.Click -= eventHandler;
        this._Button1 = value;
        Button button1_2 = this._Button1;
        if (button1_2 == null)
          return;
        button1_2.Click += eventHandler;
      }
    }

    internal virtual Button Button2
    {
      get
      {
        return this._Button2;
      }
      [MethodImpl(MethodImplOptions.Synchronized)] set
      {
        EventHandler eventHandler = new EventHandler(this.Button2_Click);
        Button button2_1 = this._Button2;
        if (button2_1 != null)
          button2_1.Click -= eventHandler;
        this._Button2 = value;
        Button button2_2 = this._Button2;
        if (button2_2 == null)
          return;
        button2_2.Click += eventHandler;
      }
    }

    internal virtual Button Button3
    {
      get
      {
        return this._Button3;
      }
      [MethodImpl(MethodImplOptions.Synchronized)] set
      {
        EventHandler eventHandler = new EventHandler(this.Button3_Click);
        Button button3_1 = this._Button3;
        if (button3_1 != null)
          button3_1.Click -= eventHandler;
        this._Button3 = value;
        Button button3_2 = this._Button3;
        if (button3_2 == null)
          return;
        button3_2.Click += eventHandler;
      }
    }

    internal virtual CheckedListBox Patch_ListBox
    {
      get
      {
        return this._Patch_ListBox;
      }
      [MethodImpl(MethodImplOptions.Synchronized)] set
      {
        EventHandler eventHandler = new EventHandler(this.Patch_ListBox_SelectedIndexChanged);
        CheckedListBox patchListBox1 = this._Patch_ListBox;
        if (patchListBox1 != null)
          patchListBox1.SelectedIndexChanged -= eventHandler;
        this._Patch_ListBox = value;
        CheckedListBox patchListBox2 = this._Patch_ListBox;
        if (patchListBox2 == null)
          return;
        patchListBox2.SelectedIndexChanged += eventHandler;
      }
    }

    internal virtual TextBox PatchList_Header { get; [MethodImpl(MethodImplOptions.Synchronized)] set; }

    internal virtual TextBox TextBox2 { get; [MethodImpl(MethodImplOptions.Synchronized)] set; }

    internal virtual ComboBox LanguageBox
    {
      get
      {
        return this._LanguageBox;
      }
      [MethodImpl(MethodImplOptions.Synchronized)] set
      {
        EventHandler eventHandler = new EventHandler(this.LanguageBox_SelectedIndexChanged);
        ComboBox languageBox1 = this._LanguageBox;
        if (languageBox1 != null)
          languageBox1.SelectedIndexChanged -= eventHandler;
        this._LanguageBox = value;
        ComboBox languageBox2 = this._LanguageBox;
        if (languageBox2 == null)
          return;
        languageBox2.SelectedIndexChanged += eventHandler;
      }
    }

    internal virtual Button Button5
    {
      get
      {
        return this._Button5;
      }
      [MethodImpl(MethodImplOptions.Synchronized)] set
      {
        EventHandler eventHandler = new EventHandler(this.Button5_Click);
        Button button5_1 = this._Button5;
        if (button5_1 != null)
          button5_1.Click -= eventHandler;
        this._Button5 = value;
        Button button5_2 = this._Button5;
        if (button5_2 == null)
          return;
        button5_2.Click += eventHandler;
      }
    }

    internal virtual RichTextBox RichTextBox1
    {
      get
      {
        return this._RichTextBox1;
      }
      [MethodImpl(MethodImplOptions.Synchronized)] set
      {
        LinkClickedEventHandler clickedEventHandler = new LinkClickedEventHandler(this.RichTextBox1_LinkClicked);
        RichTextBox richTextBox1_1 = this._RichTextBox1;
        if (richTextBox1_1 != null)
          richTextBox1_1.LinkClicked -= clickedEventHandler;
        this._RichTextBox1 = value;
        RichTextBox richTextBox1_2 = this._RichTextBox1;
        if (richTextBox1_2 == null)
          return;
        richTextBox1_2.LinkClicked += clickedEventHandler;
      }
    }

    internal virtual RichTextBox RichTextBox2 { get; [MethodImpl(MethodImplOptions.Synchronized)] set; }

    public GenerateFNISUsers()
    {
      this.Load += new EventHandler(this.GenerateFNISUsers_Load);
      this.FormClosing += new FormClosingEventHandler(this.Form1_FormClosing);
      this.InitializeComponent();
    }

    [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
    private void GenerateFNISUsers_Load(object sender, EventArgs e)
    {
      int num1;
      int num2;
      try
      {
        ProjectData.ClearProjectError();
        num1 = 2;
        FNIScommon1.FNIScommon.FNIS_for_Users = true;
        FNIScommon1.FNIScommon.RetCode = 1;
        FNIScommon1.FNIScommon.LogOpen = false;
        FNIScommon1.FNIScommon.called_from_Projects = false;
        FNIScommon1.FNIScommon.SkyrimEdition = 0;
        this.SkyrimVersion = "??.??.??";
        this.GeneratorName = "GenerateFNISforUsers";
        if (Operators.CompareString(Strings.LCase(Strings.Left(Environment.CurrentDirectory, 14)), "c:\\users\\haral", false) == 0)
        {
          FNIScommon1.FNIScommon.called_from_Projects = true;
          FNIScommon1.FNIScommon.SkyrimEdition = 1;
          Microsoft.VisualBasic.FileSystem.ChDir("c:\\GAMES\\Steam\\SteamApps\\common\\skyrim\\Data\\tools\\GenerateFNIS_for_Users");
        }
        else
        {
          if (Operators.CompareString(Strings.LCase(Environment.CurrentDirectory), Strings.LCase(Application.StartupPath), false) != 0)
            Microsoft.VisualBasic.FileSystem.ChDir(Application.StartupPath);
          if (MyProject.Computer.FileSystem.FileExists("PatchListSE.txt".ToUpperInvariant()))
            checked { FNIScommon1.FNIScommon.SkyrimEdition += 2; }
          if (MyProject.Computer.FileSystem.FileExists("PatchList.txt".ToUpperInvariant()))
            checked { ++FNIScommon1.FNIScommon.SkyrimEdition; }
          if (FNIScommon1.FNIScommon.SkyrimEdition == 3)
            FNIScommon1.FNIScommon.SkyrimEdition = !MyProject.Computer.FileSystem.FileExists("..\\..\\..\\SkyrimSE.exe".ToUpperInvariant()) ? 1 : 2;
        }
        if (FNIScommon1.FNIScommon.SkyrimEdition == 2)
        {
          GenerateFNISUsers.PatchDefFile = "PatchListSE.txt";
          this.SkyrimExe = "..\\..\\..\\SkyrimSE.exe";
          this.SkyrimName = "Skyrim SE 64bit";
          FNIScommon1.FNIScommon.hkxcmd_Params = "convert -v:AMD64 \"*\" \"#\"";
          this.FNISVersionText = "V7.0 (Skyrim SE 64bit)";
          // ISSUE: variable of a reference type
          string& local;
          // ISSUE: explicit reference operation
          // ISSUE: explicit reference operation
          string str = ^(local = @this.GeneratorName) + " SE";
          // ISSUE: explicit reference operation
          ^local = str;
          this.RichTextBox1.Visible = false;
          this.RichTextBox2.Visible = true;
          this.BackColor = Color.Goldenrod;
        }
        else if (FNIScommon1.FNIScommon.SkyrimEdition == 1)
        {
          GenerateFNISUsers.PatchDefFile = "PatchList.txt";
          this.SkyrimExe = "..\\..\\..\\TESV.exe";
          this.SkyrimName = "Skyrim 32bit";
          FNIScommon1.FNIScommon.hkxcmd_Params = "convert -v:WIN32 \"*\" \"#\"";
          this.FNISVersionText = "V7.0 (Skyrim 32bit)";
          this.RichTextBox2.Visible = false;
        }
        this.Text = this.Text + " " + this.FNISVersionText;
        FNIScommon1.FNIScommon.Get_LanguageFiles(this.LanguageBox);
        this.TextBox1.Text = Strings.Replace(this.TextBox1.Text, "<v>", this.FNISVersionText, 1, -1, CompareMethod.Binary);
        FNIScommon1.FNIScommon.Textbox = this.TextBox1;
        if (FNIScommon1.FNIScommon.SkyrimEdition == 0)
        {
          Information.Err().Description = "PatchList.txt/PatchListSE.txt " + FNIScommon1.FNIScommon.tErr[3] + " - " + FNIScommon1.FNIScommon.tErr[17];
          Information.Err().Raise(2001, (object) null, (object) null, (object) null, (object) null);
        }
        FNIScommon1.FNIScommon.Read_AllTemplates_File();
        this.Initialize_PatchBox();
        if (MyProject.Computer.FileSystem.FileExists("..\\GenerateFNIS_for_Users\\BehavioredObjects.txt"))
        {
          this.Button5.Enabled = true;
          goto label_24;
        }
        else
          goto label_24;
label_19:
        num2 = -1;
        switch (num1)
        {
          case 2:
            this.TextBox1.Text = "\r\n\r\nError " + Conversion.Str((object) Information.Err().Number) + "  " + Information.Err().Description;
            this.TextBox1.ForeColor = Color.Red;
            this.Button1.Enabled = false;
            goto label_24;
        }
      }
      catch (Exception ex) when (ex is Exception & (uint) num1 > 0U & num2 == 0)
      {
        ProjectData.SetProjectError(ex);
        goto label_19;
      }
      throw ProjectData.CreateProjectError(-2146828237);
label_24:
      if (num2 == 0)
        return;
      ProjectData.ClearProjectError();
    }

    private void Button1_Click(object sender, EventArgs e)
    {
      this.Button2.Enabled = false;
      this.Main();
    }

    private void Button2_Click(object sender, EventArgs e)
    {
      this.ConsistenceCheck();
    }

    private void Button3_Click(object sender, EventArgs e)
    {
      this.Store_Patches();
      FNIScommon1.FNIScommon.CreateShortCut(this.GeneratorName);
      Environment.Exit(FNIScommon1.FNIScommon.RetCode);
    }

    private void Form1_FormClosing(object sender, FormClosingEventArgs e)
    {
      this.Store_Patches();
      Environment.Exit(FNIScommon1.FNIScommon.RetCode);
    }

    private void Button5_Click(object sender, EventArgs e)
    {
      if (MessageBox.Show(FNIScommon1.FNIScommon.tMsgu[25] + "\r\n" + FNIScommon1.FNIScommon.tMsgu[26], "GenerateFNISforUsers", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) != DialogResult.Yes)
        return;
      this.DeInstall_BOs();
      FNIScommon1.FNIScommon.LogOutput("\r\n" + FNIScommon1.FNIScommon.tMsgu[27], true, true);
    }

    private void Patch_ListBox_SelectedIndexChanged(object sender, EventArgs e)
    {
      int selectedIndex = this.Patch_ListBox.SelectedIndex;
      if (selectedIndex < 0)
        return;
      FNIScommon1.FNIScommon.isPatch[selectedIndex] = this.Patch_ListBox.GetItemChecked(selectedIndex);
      if (Operators.CompareString(FNIScommon1.FNIScommon.PatchID[selectedIndex], "PCEA2", false) == 0)
        FNIScommon1.FNIScommon.isPCEA2 = FNIScommon1.FNIScommon.isPatch[selectedIndex];
      if (Operators.CompareString(FNIScommon1.FNIScommon.PatchID[selectedIndex], "PCEA", false) == 0)
        FNIScommon1.FNIScommon.isPCEA = FNIScommon1.FNIScommon.isPatch[selectedIndex];
      if (Operators.CompareString(FNIScommon1.FNIScommon.PatchID[selectedIndex], "GENDER", false) == 0)
        FNIScommon1.FNIScommon.isGENDER = FNIScommon1.FNIScommon.isPatch[selectedIndex];
      if (Operators.CompareString(FNIScommon1.FNIScommon.PatchID[selectedIndex], "SKELETON", false) == 0)
        FNIScommon1.FNIScommon.isSKELETON = FNIScommon1.FNIScommon.isPatch[selectedIndex];
      if (Operators.CompareString(FNIScommon1.FNIScommon.PatchID[selectedIndex], "HKX_COMPAT", false) == 0)
        FNIScommon1.FNIScommon.isHKX_COMPAT = FNIScommon1.FNIScommon.isPatch[selectedIndex];
      if (FNIScommon1.FNIScommon.LogOpen)
        FNIScommon1.FNIScommon.LogOutput("Patch" + Conversion.Str((object) selectedIndex) + " " + FNIScommon1.FNIScommon.PatchID[selectedIndex] + ": " + Conversion.Str((object) FNIScommon1.FNIScommon.isPatch[selectedIndex]), true, true);
      this.optionChanged = true;
    }

    private void LanguageBox_SelectedIndexChanged(object sender, EventArgs e)
    {
      FNIScommon1.FNIScommon.Read_LanguagFile(this.LanguageBox);
      int num = checked (FNIScommon1.FNIScommon.PatchCount - 1);
      int index = 0;
      while (index <= num)
      {
        if (Operators.CompareString(FNIScommon1.FNIScommon.lastLanguage, "english", false) == 0)
        {
          this.Patch_ListBox.Items[index] = (object) FNIScommon1.FNIScommon.PatchText[index];
          FNIScommon1.FNIScommon.tPatch[checked (index + 1)] = FNIScommon1.FNIScommon.PatchText[index];
        }
        else if (Strings.Len(FNIScommon1.FNIScommon.tPatch[checked (index + 1)]) > 1)
          this.Patch_ListBox.Items[index] = (object) FNIScommon1.FNIScommon.tPatch[checked (index + 1)];
        checked { ++index; }
      }
      this.Button1.Text = FNIScommon1.FNIScommon.tUIu[1];
      this.Button2.Text = FNIScommon1.FNIScommon.tUIu[2];
      this.Button3.Text = FNIScommon1.FNIScommon.tUIu[3];
      this.Button5.Text = FNIScommon1.FNIScommon.tUIu[13];
      this.PatchList_Header.Text = FNIScommon1.FNIScommon.tUIu[4];
      this.TextBox2.Text = FNIScommon1.FNIScommon.tUIu[6];
      this.TextBox1.Text = FNIScommon1.FNIScommon.tUIu[7] + "\r\n\r\n" + FNIScommon1.FNIScommon.tUIu[9] + "\r\n" + FNIScommon1.FNIScommon.tUIu[10] + "\r\n" + FNIScommon1.FNIScommon.tUIu[11] + "\r\n" + FNIScommon1.FNIScommon.tUIu[12] + "\r\n\r\n";
    }

    [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
    public void Main()
    {
      int num1;
      int num2;
      try
      {
        ProjectData.ClearProjectError();
        num1 = 2;
        string str1 = "...";
        FNIScommon1.FNIScommon.FNIS_for_Users = true;
        FNIScommon1.FNIScommon.Initialize_Globals();
        FNISaa1.FNISaa.AAInitialize();
        FNIScommon1.FNIScommon.RetCode = 0;
        FNIScommon1.FNIScommon.Anz_fuG = 0;
        FNIScommon1.FNIScommon.Anz_fu = 0;
        FNIScommon1.FNIScommon.Anz_ofa = 0;
        FNIScommon1.FNIScommon.Anz_pa = 0;
        FNIScommon1.FNIScommon.Anz_km = 0;
        FNIScommon1.FNIScommon.Anz_aa = 0;
        GenerateFNISUsers.iPCEAgenderFile = 0;
        FNIScommon1.FNIScommon.iPatchAF = 0;
        GenerateFNISUsers.iCustomPreCacheSet = 0;
        FNIScommon1.FNIScommon.AEList = new List<FNIScommon1.FNIScommon.AEcc>();
        FNIScommon1.FNIScommon.AnimFileList = new List<FNIScommon1.FNIScommon.AnimFilecc>();
        FNIScommon1.FNIScommon.MRD_DataListALL = new List<FNIScommon1.FNIScommon.MRD_Data>();
        Array.Clear((Array) FNIScommon1.FNIScommon.MRD_BO_nAnims, 0, checked (Information.UBound((Array) FNIScommon1.FNIScommon.MRD_BO_nAnims, 1) + 1));
        Array.Clear((Array) FNIScommon1.FNIScommon.MRD_BO_nMRD, 0, checked (Information.UBound((Array) FNIScommon1.FNIScommon.MRD_BO_nMRD, 1) + 1));
        Array.Clear((Array) FNIScommon1.FNIScommon.PatchAF, 0, checked (Information.UBound((Array) FNIScommon1.FNIScommon.PatchAF, 1) + 1));
        FNIScommon1.FNIScommon.MRD_LastAnim = -1;
        this.TextBox1.Text = "";
        FNIScommon1.FNIScommon.MyBO = 0;
        FNIScommon1.FNIScommon.BO_List[FNIScommon1.FNIScommon.MyBO] = "character";
        FNIScommon1.FNIScommon.BO_DefaultAnims[FNIScommon1.FNIScommon.MyBO] = 1656;
        FileSystemProxy fileSystem = MyProject.Computer.FileSystem;
        if (!fileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\animations\\"))
          fileSystem.CreateDirectory("..\\..\\meshes\\actors\\character\\animations\\");
        if (!fileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\characters\\"))
          fileSystem.CreateDirectory("..\\..\\meshes\\actors\\character\\characters\\");
        if (!fileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\characters female\\"))
          fileSystem.CreateDirectory("..\\..\\meshes\\actors\\character\\characters female\\");
        if (!fileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\behaviors\\"))
          fileSystem.CreateDirectory("..\\..\\meshes\\actors\\character\\behaviors\\");
        if (!fileSystem.DirectoryExists("temporary_logs\\"))
          fileSystem.CreateDirectory("temporary_logs\\");
        if (fileSystem.FileExists("..\\..\\Scripts\\FNISVersionGenerated.pex".ToUpperInvariant()))
          fileSystem.DeleteFile("..\\..\\Scripts\\FNISVersionGenerated.pex");
        if (fileSystem.FileExists("temporary_logs\\GenerateFNIS_LogFile.txt".ToUpperInvariant()))
          fileSystem.DeleteFile("temporary_logs\\GenerateFNIS_LogFile.txt");
        FNIScommon1.FNIScommon.LogFile = new StreamWriter("temporary_logs\\GenerateFNIS_LogFile.txt");
        FNIScommon1.FNIScommon.LogOpen = true;
        FNIScommon1.FNIScommon.WriteDebug("", 99, "Start Debug", "");
        if (FNIScommon1.FNIScommon.DebugOutput > 1)
          FNIScommon1.FNIScommon.LogFile.AutoFlush = true;
        FNIScommon1.FNIScommon.InstallDir = "";
        FNIScommon1.FNIScommon.IsSteam = false;
        FNIScommon1.FNIScommon.Get_InstallDir();
        if (!FNIScommon1.FNIScommon.IsSteam)
        {
          FNIScommon1.FNIScommon.WriteWarning(FNIScommon1.FNIScommon.tWarn[11]);
          str1 = "....";
        }
        FNIScommon1.FNIScommon.LogOutput("FNIS Behavior V7.0   " + DateAndTime.Now.ToString(), true, true);
        string upperInvariant1 = Strings.Replace(FNIScommon1.FNIScommon.InstallDir + "\\data\\tools\\GenerateFNIS_for_Users", "\\\\", "\\", 1, -1, CompareMethod.Binary).ToUpperInvariant();
        string upperInvariant2 = Strings.Replace(Application.StartupPath, "\\\\", "\\", 1, -1, CompareMethod.Binary).ToUpperInvariant();
        string Right = upperInvariant2;
        int num3 = 0;
        if (Operators.CompareString(upperInvariant1, Right, num3 != 0) != 0)
        {
          FNIScommon1.FNIScommon.LogOutput(FNIScommon1.FNIScommon.tWarn[20] + " " + Application.StartupPath + "\\GenerateFNISforUsers.exe", true, true);
          if (FNIScommon1.FNIScommon.IsSteam & Strings.InStr(Strings.LCase(upperInvariant2), "steamapps", CompareMethod.Binary) <= 0 & !FNIScommon1.FNIScommon.called_from_Projects)
            FNIScommon1.FNIScommon.WriteWarning(FNIScommon1.FNIScommon.tWarn[3]);
        }
        else if (!MyProject.Computer.FileSystem.FileExists(this.SkyrimExe.ToUpperInvariant()))
        {
          FNIScommon1.FNIScommon.WriteWarning(Strings.Replace(FNIScommon1.FNIScommon.tWarn[22], "<1>", this.SkyrimExe, 1, -1, CompareMethod.Binary));
          FNIScommon1.FNIScommon.WriteWarning(FNIScommon1.FNIScommon.tWarn[2]);
        }
        else
          this.SkyrimVersion = FileVersionInfo.GetVersionInfo(this.SkyrimExe).ProductVersion;
        string LogText = this.SkyrimName + ": " + this.SkyrimVersion + " - " + FNIScommon1.FNIScommon.InstallDir;
        if (FNIScommon1.FNIScommon.IsSteam)
          LogText += " (Steam)";
        FNIScommon1.FNIScommon.LogOutput(LogText, true, true);
        if (FNIScommon1.FNIScommon.SkyrimEdition == 1 && !this.SkyrimMinVersOK(this.SkyrimVersion, "1.8.151"))
          FNIScommon1.FNIScommon.WriteWarning(FNIScommon1.FNIScommon.tWarn[12] + " (1.8.151)");
        if (Operators.CompareString(this.SkyrimVersion, "??.??.??", false) == 0 & FNIScommon1.FNIScommon.IsSteam & !FNIScommon1.FNIScommon.called_from_Projects)
          FNIScommon1.FNIScommon.LogOutput(FNIScommon1.FNIScommon.tWarn[21] + " " + Strings.Replace(FNIScommon1.FNIScommon.InstallDir + "\\data\\tools\\GenerateFNIS_for_Users", "\\\\", "\\", 1, -1, CompareMethod.Binary), true, true);
        FNIScommon1.FNIScommon.LogOutput("", true, true);
        if (!fileSystem.DirectoryExists("temporary_logs\\"))
          Information.Err().Raise(2019, (object) null, (object) null, (object) null, (object) null);
        if (!fileSystem.FileExists("hkxcmd.exe"))
          Information.Err().Raise(2023, (object) null, (object) null, (object) null, (object) null);
        FNIScommon1.FNIScommon.Check_Template_Entry(GenerateFNISUsers.PatchDefFile, GenerateFNISUsers.FirstPatchLine);
        if (fileSystem.FileExists("FNISmodList.txt"))
        {
          this.FNISModList1 = FNIScommon1.FNIScommon.ReadAFile("FNISmodList.txt");
          fileSystem.DeleteFile("FNISmodList.txt");
        }
        else
          this.FNISModList1 = (string[]) null;
        this.FNISModlist2L = new List<string>();
        string SkelName1 = "";
        string SkelName2 = "";
        int nBones1;
        this.GetSkeletonBones("..\\..\\meshes\\actors\\character\\character assets female\\skeleton_female.hkx", ref nBones1, ref SkelName1);
        FNIScommon1.FNIScommon.Check_hkx_type("..\\..\\meshes\\actors\\character\\character assets female\\skeleton_female.hkx");
        int nBones2;
        this.GetSkeletonBones("..\\..\\meshes\\actors\\character\\character assets\\skeleton.hkx", ref nBones2, ref SkelName2);
        FNIScommon1.FNIScommon.Check_hkx_type("..\\..\\meshes\\actors\\character\\character assets\\skeleton.hkx");
        FNIScommon1.FNIScommon.LogOutput(Strings.Replace(Strings.Replace(Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[12], "<1>", SkelName1, 1, -1, CompareMethod.Binary), "<2>", Strings.Format((object) nBones1, "0"), 1, -1, CompareMethod.Binary), "<3>", SkelName2, 1, -1, CompareMethod.Binary), "<4>", Strings.Format((object) nBones2, "0"), 1, -1, CompareMethod.Binary), true, true);
        if (!FNIScommon1.FNIScommon.isSKELETON & (nBones1 != 99 | nBones2 != 99))
          FNIScommon1.FNIScommon.WriteWarning(FNIScommon1.FNIScommon.tWarn[7]);
        string[] StringArray;
        if (fileSystem.FileExists("temporary_logs\\DummyStart.txt"))
        {
          FNIScommon1.FNIScommon.FullLog = false;
        }
        else
        {
          FNIScommon1.FNIScommon.FullLog = true;
          string FileName = "temporary_logs\\DummyStart.txt";
          StringArray = new string[0];
          int Elements = 0;
          FNIScommon1.FNIScommon.WriteAFile(FileName, ref StringArray, Elements);
        }
        FNIScommon1.FNIScommon.Display_Dirs(true);
        int index1 = 0;
        do
        {
          if (FNIScommon1.FNIScommon.isPatch[index1])
          {
            int num4 = Strings.InStr(FNIScommon1.FNIScommon.PatchText[index1], "- ", CompareMethod.Binary);
            if (num4 <= 0)
              FNIScommon1.FNIScommon.LogOutput(FNIScommon1.FNIScommon.tMsgu[1] + ": " + FNIScommon1.FNIScommon.PatchText[index1], true, true);
            else
              FNIScommon1.FNIScommon.LogOutput(FNIScommon1.FNIScommon.tMsgu[1] + ": " + Strings.Left(FNIScommon1.FNIScommon.PatchText[index1], checked (num4 - 1)), true, true);
            if (Operators.CompareString(FNIScommon1.FNIScommon.PatchCheckFile[index1], "", false) != 0 && !fileSystem.FileExists(FNIScommon1.FNIScommon.PatchCheckFile[index1].ToUpperInvariant()))
              FNIScommon1.FNIScommon.WriteWarning(Strings.Left(FNIScommon1.FNIScommon.PatchText[index1], checked (num4 - 1)) + " " + FNIScommon1.FNIScommon.tWarn[4]);
            if (Operators.CompareString(FNIScommon1.FNIScommon.PatchID[index1], "PCEA", false) == 0 && fileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\animations\\FNIS_PCEA2"))
              FNIScommon1.FNIScommon.WriteWarning(FNIScommon1.FNIScommon.tWarn[16]);
          }
          checked { ++index1; }
        }
        while (index1 <= 19);
        FNIScommon1.FNIScommon.LogOutput("", true, true);
        if (fileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\animations\\FNIS_PCEA2"))
        {
          FNIScommon1.FNIScommon.LogOutput("Installing FNIS PCEA2", true, true);
          FNISaa1.FNISaa.PCEA2();
        }
        FNIScommon1.FNIScommon.PCEAList = new List<string>();
        StringArray = Directory.GetDirectories("..\\..\\meshes\\actors\\character\\animations\\");
        int index2 = 0;
        while (index2 < StringArray.Length)
        {
          string Expression = StringArray[index2];
          string[] strArray = Strings.Split(Expression, "\\", -1, CompareMethod.Binary);
          int Rank = 1;
          int index3 = Information.UBound((Array) strArray, Rank);
          string str2 = strArray[index3];
          if (Operators.CompareString(Strings.UCase(str2), "PCEA", false) == 0 | Strings.Len(str2) == 5 & Operators.CompareString(Strings.UCase(Strings.Left(str2, 4)), "PCEA", false) == 0)
          {
            FNIScommon1.FNIScommon.PCEAList.Add(str2);
          }
          else
          {
            FNIScommon1.FNIScommon.AnimListFile = Expression + "\\FNIS_" + str2 + "_List.txt";
            string str3 = "..\\..\\meshes\\actors\\character\\behaviors\\" + Strings.Replace("FNIS_*_Behavior.hkx", "*", str2, 1, -1, CompareMethod.Binary);
            if (fileSystem.FileExists(FNIScommon1.FNIScommon.AnimListFile))
            {
              if (fileSystem.FileExists(str3.ToUpperInvariant()))
              {
                int anzFuG = FNIScommon1.FNIScommon.Anz_fuG;
                int anzOfa = FNIScommon1.FNIScommon.Anz_ofa;
                int anzPa = FNIScommon1.FNIScommon.Anz_pa;
                int anzKm = FNIScommon1.FNIScommon.Anz_km;
                int anzCh = FNIScommon1.FNIScommon.Anz_ch;
                int anzAa = FNIScommon1.FNIScommon.Anz_aa;
                int anzAnim = FNIScommon1.FNIScommon.AnzAnim;
                checked { ++FNIScommon1.FNIScommon.AnzMod; }
                FNIScommon1.FNIScommon.MyMod[FNIScommon1.FNIScommon.AnzMod] = str2;
                FNIScommon1.FNIScommon.Check_hkx_type("..\\..\\meshes\\actors\\character\\behaviors\\FNIS_" + FNIScommon1.FNIScommon.MyMod[FNIScommon1.FNIScommon.AnzMod] + "_Behavior.hkx");
                FNIScommon1.FNIScommon.LogOutput(FNIScommon1.FNIScommon.tMsgu[2] + " " + str2, true, false);
                FNIScommon1.FNIScommon.ReadAnimationFile(FNIScommon1.FNIScommon.AnimListFile, FNIScommon1.FNIScommon.AnzMod, false);
                FNIScommon1.FNIScommon.LogOutput(" " + FNIScommon1.FNIScommon.MyModVers[FNIScommon1.FNIScommon.AnzMod] + " ", true, false);
                if (checked (FNIScommon1.FNIScommon.Anz_fuG + FNIScommon1.FNIScommon.Anz_ofa + FNIScommon1.FNIScommon.Anz_pa + FNIScommon1.FNIScommon.Anz_km + FNIScommon1.FNIScommon.Anz_aa + FNIScommon1.FNIScommon.Anz_ch - anzFuG - anzOfa - anzPa - anzKm - anzAa - anzCh) > 0)
                  FNIScommon1.FNIScommon.LogOutput(" " + Strings.Replace(Strings.Replace(Strings.Replace(Strings.Replace(Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[21], "<1>", Conversion.Str((object) checked (FNIScommon1.FNIScommon.Anz_fuG - anzFuG)), 1, -1, CompareMethod.Binary), "<2>", Conversion.Str((object) checked (FNIScommon1.FNIScommon.Anz_ofa - anzOfa)), 1, -1, CompareMethod.Binary), "<3>", Conversion.Str((object) checked (FNIScommon1.FNIScommon.Anz_pa - anzPa)), 1, -1, CompareMethod.Binary), "<4>", Conversion.Str((object) checked (FNIScommon1.FNIScommon.Anz_km - anzKm)), 1, -1, CompareMethod.Binary), "<5>", Conversion.Str((object) checked (FNIScommon1.FNIScommon.Anz_ch - anzCh)), 1, -1, CompareMethod.Binary), "<6>", Conversion.Str((object) checked (FNIScommon1.FNIScommon.Anz_aa - anzAa)), 1, -1, CompareMethod.Binary) + " ...", true, true);
                else
                  FNIScommon1.FNIScommon.LogOutput("...", true, true);
                FNIScommon1.FNIScommon.LogOutput("Number of animations for " + str2 + ": " + Conversions.ToString(checked (FNIScommon1.FNIScommon.AnzAnim + FNIScommon1.FNIScommon.Anz_aa - anzAnim - anzAa)) + " Total non-AA: " + Conversions.ToString(FNIScommon1.FNIScommon.AnzAnim) + " Total AA: " + Conversions.ToString(FNIScommon1.FNIScommon.Anz_aa), false, true);
                if (Operators.CompareString(Strings.UCase(str2), "FNISBASE", false) == 0 && Operators.CompareString(Strings.Mid(Strings.Split("V7.0", " ", -1, CompareMethod.Binary)[0], 2), Strings.Mid(Strings.Split(FNIScommon1.FNIScommon.MyModVers[FNIScommon1.FNIScommon.AnzMod], " ", -1, CompareMethod.Binary)[0], 2), false) != 0)
                  FNIScommon1.FNIScommon.WriteWarning(Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.tWarn[5], "<1>", "V7.0", 1, -1, CompareMethod.Binary), "<2>", FNIScommon1.FNIScommon.MyModVers[FNIScommon1.FNIScommon.AnzMod], 1, -1, CompareMethod.Binary));
              }
              else
                FNIScommon1.FNIScommon.WriteWarning(Strings.Replace(FNIScommon1.FNIScommon.tWarn[6], "<1>", " \"Animations\\" + str2 + "\"", 1, -1, CompareMethod.Binary));
            }
          }
          checked { ++index2; }
        }
        this.Read_PatchAFNames();
        FNISaa1.FNISaa.AA_PostProcessing();
        FNIScommon1.FNIScommon.DumpAnimList_Result();
        FNIScommon1.FNIScommon.LogOutput("\r\n" + FNIScommon1.FNIScommon.tMsgu[3] + str1, true, true);
        FNIScommon1.FNIScommon.TestGeneration = (short) 0;
        if (FNIScommon1.FNIScommon.called_from_Projects & !Directory.EnumerateFileSystemEntries("..\\..\\meshes\\actors\\character\\animations\\").Any<string>())
        {
          FNIScommon1.FNIScommon.TestGeneration = !FNIScommon1.FNIScommon.isPatch[0] ? (short) 2 : (short) 1;
          int num4 = (int) Interaction.MsgBox((object) ("No Animations directory found: generate without custom data.\r\nWithout patches: " + ((int) FNIScommon1.FNIScommon.TestGeneration == 2).ToString()), MsgBoxStyle.OkOnly, (object) null);
        }
        FNIScommon1.FNIScommon.LogOutput(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[4], "<1>", "defaultfemale.xml", 1, -1, CompareMethod.Binary) + " ...", false, true);
        if (fileSystem.FileExists("temporary_logs\\defaultfemale.xml"))
          fileSystem.DeleteFile("temporary_logs\\defaultfemale.xml");
        if (fileSystem.FileExists("defaultfemale.hkx"))
          fileSystem.DeleteFile("defaultfemale.hkx");
        FNIScommon1.FNIScommon.currBones = nBones1;
        FNIScommon1.FNIScommon.GenerateBehavior("templates\\defaultfemale_Template.txt", "temporary_logs\\defaultfemale.xml", 3, false, ref FNIScommon1.FNIScommon.ArrDefaultF, ref FNIScommon1.FNIScommon.iArrDefaultF);
        this.Read_AnimsInDefault(1, ref FNIScommon1.FNIScommon.ArrDefaultF, FNIScommon1.FNIScommon.iArrDefaultF, "..\\..\\meshes\\actors\\character\\animations\\", (string) null, (string) null, (string) null);
        FNIScommon1.FNIScommon.LogOutput(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[4], "<1>", "defaultmale.xml", 1, -1, CompareMethod.Binary) + " ...", false, true);
        FNIScommon1.FNIScommon.currBones = nBones2;
        if (fileSystem.FileExists("temporary_logs\\defaultmale.xml"))
          fileSystem.DeleteFile("temporary_logs\\defaultmale.xml");
        if (fileSystem.FileExists("defaultmale.hkx"))
          fileSystem.DeleteFile("defaultmale.hkx");
        FNIScommon1.FNIScommon.GenerateBehavior("templates\\defaultmale_Template.txt", "temporary_logs\\defaultmale.xml", 3, false, ref FNIScommon1.FNIScommon.ArrDefaultM, ref FNIScommon1.FNIScommon.iArrDefaultM);
        this.Read_AnimsInDefault(2, ref FNIScommon1.FNIScommon.ArrDefaultM, FNIScommon1.FNIScommon.iArrDefaultM, "..\\..\\meshes\\actors\\character\\animations\\", (string) null, (string) null, (string) null);
        if (FNIScommon1.FNIScommon.isGENDER)
        {
          FNIScommon1.FNIScommon.LogOutput(FNIScommon1.FNIScommon.tMsgu[8] + " ...", false, true);
          this.Generate_GENDER_Default(true);
          this.Generate_GENDER_Default(false);
        }
        if (FNIScommon1.FNIScommon.isPCEA)
        {
          if (!(fileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\animations\\PCEA") & fileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\animations\\PCEA\\male") & fileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\animations\\PCEA\\female")))
            Information.Err().Raise(2022, (object) null, (object) null, (object) null, (object) null);
          List<string>.Enumerator enumerator = FNIScommon1.FNIScommon.PCEAList.GetEnumerator();
          while (enumerator.MoveNext())
          {
            string current = enumerator.Current;
            FNIScommon1.FNIScommon.LogOutput(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[7], "<1>", current, 1, -1, CompareMethod.Binary) + " ...", false, true);
            this.Generate_PCEA_Default(current, true);
            this.Generate_PCEA_Default(current, false);
          }
          enumerator.Dispose();
        }
        FNIScommon1.FNIScommon.hkxcmdProcess.StartInfo.Arguments = Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.hkxcmd_Params, "*", "temporary_logs\\defaultfemale.xml", 1, -1, CompareMethod.Binary), "#", "temporary_logs\\defaultfemale.hkx", 1, -1, CompareMethod.Binary);
        FNIScommon1.FNIScommon.hkxcmdProcess.Start();
        FNIScommon1.FNIScommon.hkxcmdProcess.WaitForExit();
        FNIScommon1.FNIScommon.hkxcmdProcess.StartInfo.Arguments = Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.hkxcmd_Params, "*", "temporary_logs\\defaultmale.xml", 1, -1, CompareMethod.Binary), "#", "temporary_logs\\defaultmale.hkx", 1, -1, CompareMethod.Binary);
        FNIScommon1.FNIScommon.hkxcmdProcess.Start();
        FNIScommon1.FNIScommon.hkxcmdProcess.WaitForExit();
        if (FNIScommon1.FNIScommon.isPCEA)
        {
          List<string>.Enumerator enumerator = FNIScommon1.FNIScommon.PCEAList.GetEnumerator();
          while (enumerator.MoveNext())
          {
            string current = enumerator.Current;
            FNIScommon1.FNIScommon.hkxcmdProcess.StartInfo.Arguments = Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.hkxcmd_Params, "*", "temporary_logs\\" + current + "defaultfemale.xml", 1, -1, CompareMethod.Binary), "#", current + "defaultfemale.hkx", 1, -1, CompareMethod.Binary);
            FNIScommon1.FNIScommon.hkxcmdProcess.Start();
            FNIScommon1.FNIScommon.hkxcmdProcess.WaitForExit();
            FNIScommon1.FNIScommon.hkxcmdProcess.StartInfo.Arguments = Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.hkxcmd_Params, "*", "temporary_logs\\" + current + "defaultmale.xml", 1, -1, CompareMethod.Binary), "#", current + "defaultmale.hkx", 1, -1, CompareMethod.Binary);
            FNIScommon1.FNIScommon.hkxcmdProcess.Start();
            FNIScommon1.FNIScommon.hkxcmdProcess.WaitForExit();
          }
          enumerator.Dispose();
        }
        string[] strArray1 = Strings.Split("0_master/1hm_behavior/1hm_locomotion/bashbehavior/blockbehavior/bow_direction_behavior/crossbow_direction_behavior/horsebehavior/idlebehavior/magic_readied_direction_behavior/magicbehavior/magicmountedbehavior/mt_behavior/shout_behavior/shoutmounted_behavior/sprintbehavior/staggerbehavior/weapequip", "/", -1, CompareMethod.Binary);
        int[] numArray = new int[18]
        {
          2,
          3,
          4,
          5,
          6,
          7,
          0,
          0,
          8,
          9,
          10,
          11,
          1,
          12,
          0,
          13,
          14,
          15
        };
        FNIScommon1.FNIScommon.LogOutput("isAAbehavior " + Conversions.ToString(FNIScommon1.FNIScommon.isAAbehavior) + " / " + Conversion.Hex(FNIScommon1.FNIScommon.isAAbehavior), false, true);
        uint isAabehavior = FNIScommon1.FNIScommon.isAAbehavior;
        int num5 = checked (FNIScommon1.FNIScommon.PatchCount - 1);
        int index4 = 0;
        while (index4 <= num5)
        {
          if (FNIScommon1.FNIScommon.isPatch[index4] & (ulong) FNIScommon1.FNIScommon.PatchReqBehaviors[index4] > 0UL)
            isAabehavior |= FNIScommon1.FNIScommon.PatchReqBehaviors[index4];
          checked { ++index4; }
        }
        uint num6 = 259063;
        FNIScommon1.FNIScommon.MtBehaviorRI = 0;
        string Expression1 = "";
        int num7 = 0;
        string[] OutArray1;
        do
        {
          bool flag1 = Decimal.Compare(new Decimal((ulong) isAabehavior & 1UL), Decimal.One) == 0;
          bool flag2 = Decimal.Compare(new Decimal((ulong) num6 & 1UL), Decimal.One) == 0;
          string str2 = strArray1[checked (17 - num7)];
          FNIScommon1.FNIScommon.CurrentTemplateType = numArray[checked (17 - num7)];
          if (FNIScommon1.FNIScommon.DebugOutput > 1)
            FNIScommon1.FNIScommon.LogOutput(str2 + ": aa " + Conversions.ToString(flag1) + " supported: " + Conversions.ToString(flag2), false, true);
          if (fileSystem.FileExists(("temporary_logs\\" + str2 + ".xml").ToUpperInvariant()))
            fileSystem.DeleteFile("temporary_logs\\" + str2 + ".xml");
          if (fileSystem.FileExists(("..\\..\\meshes\\actors\\character\\behaviors\\" + str2 + ".hkx").ToUpperInvariant()))
            fileSystem.DeleteFile("..\\..\\meshes\\actors\\character\\behaviors\\" + str2 + ".hkx");
          isAabehavior >>= 1;
          num6 >>= 1;
          if ((flag1 | (int) FNIScommon1.FNIScommon.TestGeneration > 0) & flag2 | num7 == 17 | num7 == 5 & (FNIScommon1.FNIScommon.Anz_fu > 0 | FNIScommon1.FNIScommon.Anz_ofa > 0 | FNIScommon1.FNIScommon.Anz_chG > 0))
          {
            Expression1 = Expression1 + str2 + " ";
            FNIScommon1.FNIScommon.LogOutput(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[4], "<1>", str2 + ".hkx", 1, -1, CompareMethod.Binary) + " ...", false, true);
            int num4 = 4;
            if (num7 == 17)
              num4 = 2;
            if (num7 == 5)
              num4 = 1;
            FNISaa1.FNISaa.AATotalAnimCount = 0;
            string TemplateFileName = "templates\\" + str2 + "_TEMPLATE.txt";
            string BehaviorFileName = "temporary_logs\\" + str2 + ".xml";
            int BehaviorType = num4;
            int num8 = flag1 ? 1 : 0;
            OutArray1 = (string[]) null;
            int iOut = 0;
            FNIScommon1.FNIScommon.GenerateBehavior(TemplateFileName, BehaviorFileName, BehaviorType, num8 != 0, ref OutArray1, ref iOut);
            if (num7 == 17)
            {
              FNIScommon1.FNIScommon.B0_masterRI = FNIScommon1.FNIScommon.RecIndex;
              FNIScommon1.FNIScommon.B0_masterAA = FNISaa1.FNISaa.AATotalAnimCount;
            }
            if (num7 == 5)
            {
              FNIScommon1.FNIScommon.MtBehaviorRI = FNIScommon1.FNIScommon.RecIndex;
              FNIScommon1.FNIScommon.MtBehaviorAA = FNISaa1.FNISaa.AATotalAnimCount;
            }
            FNIScommon1.FNIScommon.LogOutput("Converting " + str2 + ".xml to .hkx", false, true);
            FNIScommon1.FNIScommon.hkxcmdProcess.StartInfo.Arguments = Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.hkxcmd_Params, "*", "temporary_logs\\" + str2 + ".xml", 1, -1, CompareMethod.Binary), "#", "temporary_logs\\" + str2 + ".hkx", 1, -1, CompareMethod.Binary);
            FNIScommon1.FNIScommon.hkxcmdProcess.Start();
            FNIScommon1.FNIScommon.hkxcmdProcess.WaitForExit();
          }
          else if (flag2 & (int) FNIScommon1.FNIScommon.TestGeneration == 0)
          {
            int index3 = FNIScommon1.FNIScommon.Read_Template_Entry(str2 + "_TEMPLATE.txt");
            if (index3 >= 0 && FNIScommon1.FNIScommon.AllTemplates[index3].bAutomaticPatch)
              fileSystem.CopyFile("templates\\" + str2 + "_PATCHED.hkx", "..\\..\\meshes\\actors\\character\\behaviors\\" + str2 + ".hkx");
          }
          checked { ++num7; }
        }
        while (num7 <= 17);
        FNIScommon1.FNIScommon.ErrString = "";
        if (fileSystem.FileExists("temporary_logs\\defaultfemale.hkx"))
          fileSystem.MoveFile("temporary_logs\\defaultfemale.hkx", "..\\..\\meshes\\actors\\character\\characters female\\defaultfemale.hkx", true);
        else
          FNIScommon1.FNIScommon.ErrString += "defaultfemale.hkx ";
        if (fileSystem.FileExists("temporary_logs\\defaultmale.hkx"))
          fileSystem.MoveFile("temporary_logs\\defaultmale.hkx", "..\\..\\meshes\\actors\\character\\characters\\defaultmale.hkx", true);
        else
          FNIScommon1.FNIScommon.ErrString += "defaultmale.hkx ";
        if (FNIScommon1.FNIScommon.isPCEA)
        {
          List<string>.Enumerator enumerator = FNIScommon1.FNIScommon.PCEAList.GetEnumerator();
          while (enumerator.MoveNext())
          {
            string current = enumerator.Current;
            string str2 = Strings.Len(current) != 4 ? ".hk" + Strings.Right(current, 1) : ".hkp";
            if (fileSystem.FileExists(current + "defaultfemale.hkx"))
              fileSystem.MoveFile(current + "defaultfemale.hkx", "..\\..\\meshes\\actors\\character\\characters female\\defaultfemale" + str2, true);
            else
              FNIScommon1.FNIScommon.ErrString = FNIScommon1.FNIScommon.ErrString + current + "defaultfemale.hkx ";
            if (fileSystem.FileExists(current + "defaultmale.hkx"))
              fileSystem.MoveFile(current + "defaultmale.hkx", "..\\..\\meshes\\actors\\character\\characters\\defaultmale" + str2, true);
            else
              FNIScommon1.FNIScommon.ErrString = FNIScommon1.FNIScommon.ErrString + current + "defaultmale.hkx ";
          }
          enumerator.Dispose();
        }
        OutArray1 = Strings.Split(Expression1, " ", -1, CompareMethod.Binary);
        int index5 = 0;
        while (index5 < OutArray1.Length)
        {
          string Left = OutArray1[index5];
          if (Operators.CompareString(Left, "", false) != 0)
          {
            if (fileSystem.FileExists(("temporary_logs\\" + Left + ".hkx").ToUpperInvariant()))
              fileSystem.MoveFile("temporary_logs\\" + Left + ".hkx", "..\\..\\meshes\\actors\\character\\behaviors\\" + Left + ".hkx", true);
            else
              FNIScommon1.FNIScommon.ErrString = FNIScommon1.FNIScommon.ErrString + Left + ".hkx ";
          }
          checked { ++index5; }
        }
        if (Operators.CompareString(FNIScommon1.FNIScommon.ErrString, "", false) != 0)
          Information.Err().Raise(2012, (object) null, (object) null, (object) null, (object) null);
        this.FNISModlist2L.Add(Strings.Format((object) fileSystem.GetFileInfo("..\\..\\meshes\\actors\\character\\behaviors\\0_master.hkx").Length, ""));
        if (fileSystem.FileExists("temporary_logs\\DummyStart.txt"))
          fileSystem.DeleteFile("temporary_logs\\DummyStart.txt");
        if (fileSystem.FileExists("..\\..\\meshes\\animationsetdatasinglefile.txt"))
          fileSystem.DeleteFile("..\\..\\meshes\\animationsetdatasinglefile.txt");
        this.Read_CustomPreCheckFile();
        string[] OutArray2;
        if (checked (FNIScommon1.FNIScommon.Anz_pa + FNIScommon1.FNIScommon.Anz_km) > 0 | FNIScommon1.FNIScommon.isPCEA | FNIScommon1.FNIScommon.isGENDER | GenerateFNISUsers.iCustomPreCacheSet > 0 | !Information.IsNothing((object) FNISaa1.FNISaa.AAcrcList))
        {
          FNIScommon1.FNIScommon.LogOutput(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[4], "<1>", "animationsetdatasinglefile.txt", 1, -1, CompareMethod.Binary) + " ...", false, true);
          string TemplateFileName = "templates\\animationsetdatasinglefile_TEMPLATE.txt";
          string BehaviorFileName = "..\\..\\meshes\\animationsetdatasinglefile.txt";
          int BehaviorType = 3;
          int num4 = 0;
          OutArray2 = (string[]) null;
          int iOut = 0;
          FNIScommon1.FNIScommon.GenerateBehavior(TemplateFileName, BehaviorFileName, BehaviorType, num4 != 0, ref OutArray2, ref iOut);
          if (FNIScommon1.FNIScommon.isPCEA | FNIScommon1.FNIScommon.isGENDER | GenerateFNISUsers.iCustomPreCacheSet > 0 | !Information.IsNothing((object) FNISaa1.FNISaa.AAcrcList))
            this.add_ASDSF_precache();
        }
        FNISaa1.FNISaa.Patch_FNIS_aa_pex();
        FNIScommon1.FNIScommon.Check_all_hkx_files("..\\..\\meshes\\actors\\character\\animations\\");
        FNIScommon1.FNIScommon.Check_all_hkx_files("..\\..\\meshes\\actors\\character\\animations\\female\\");
        FNIScommon1.FNIScommon.Check_all_hkx_files("..\\..\\meshes\\actors\\character\\animations\\male\\");
        if (FNIScommon1.FNIScommon.isPCEA)
        {
          FNIScommon1.FNIScommon.Check_all_hkx_files("..\\..\\meshes\\actors\\character\\animations\\PCEA\\female\\");
          FNIScommon1.FNIScommon.Check_all_hkx_files("..\\..\\meshes\\actors\\character\\animations\\PCEA\\male\\");
        }
        if (FNIScommon1.FNIScommon.MtBehaviorRI > 0)
          FNIScommon1.FNIScommon.LogOutput("mt_behavior " + FNIScommon1.FNIScommon.tMsgu[24] + ": " + Strings.Format((object) ((double) checked (100 * FNIScommon1.FNIScommon.MtBehaviorRI - 5220) / 4780.0), "0.0") + " %  " + Strings.Replace(Strings.Replace(Strings.Replace(Strings.Replace(" " + FNIScommon1.FNIScommon.tMsgu[6], "<1>", Conversion.Str((object) FNIScommon1.FNIScommon.Anz_fuG), 1, -1, CompareMethod.Binary), "<2>", Conversion.Str((object) FNIScommon1.FNIScommon.Anz_ofa), 1, -1, CompareMethod.Binary), "<3>", Conversion.Str((object) FNIScommon1.FNIScommon.Anz_ch), 1, -1, CompareMethod.Binary), "<4>", Conversion.Str((object) FNIScommon1.FNIScommon.MtBehaviorAA), 1, -1, CompareMethod.Binary), false, true);
        FNIScommon1.FNIScommon.LogOutput("0_master " + FNIScommon1.FNIScommon.tMsgu[24] + ": " + Strings.Format((object) ((double) checked (100 * FNIScommon1.FNIScommon.B0_masterRI - 2530) / 7470.0), "0.0") + " %  " + Strings.Replace(Strings.Replace(Strings.Replace(" " + FNIScommon1.FNIScommon.tMsgu[22], "<1>", Conversion.Str((object) FNIScommon1.FNIScommon.Anz_pa), 1, -1, CompareMethod.Binary), "<2>", Conversion.Str((object) FNIScommon1.FNIScommon.Anz_km), 1, -1, CompareMethod.Binary), "<3>", Conversion.Str((object) FNIScommon1.FNIScommon.B0_masterAA), 1, -1, CompareMethod.Binary), false, true);
        FNIScommon1.FNIScommon.LogOutput("Alternate Animation mods:" + Conversion.Str((object) FNISaa1.FNISaa.iAAPrefix) + " sets:" + Conversion.Str((object) FNISaa1.FNISaa.iAASet) + " total groups:" + Conversion.Str((object) FNISaa1.FNISaa.nAAgroups) + " added file slots:" + Conversion.Str((object) FNISaa1.FNISaa.nAAfilesdef) + " alternate files:" + Conversion.Str((object) FNIScommon1.FNIScommon.Anz_aa), true, true);
        FNIScommon1.FNIScommon.TotalWarnings = FNIScommon1.FNIScommon.WarningCount;
        FNIScommon1.FNIScommon.TotalAnimations = 0;
        FNIScommon1.FNIScommon.AnzModChar = FNIScommon1.FNIScommon.AnzMod;
        FNIScommon1.FNIScommon.AnzAnimChar = checked (FNIScommon1.FNIScommon.AnzAnim + FNIScommon1.FNIScommon.Anz_aa - FNIScommon1.FNIScommon.Anz_sG - FNIScommon1.FNIScommon.Anz_fuG);
        this.Execute_BehavioredObjects();
        FNIScommon1.FNIScommon.MyBO = 0;
        FNIScommon1.FNIScommon.WarningCount = 0;
        if (MyProject.Computer.FileSystem.FileExists("..\\..\\meshes\\animationdatasinglefile.txt"))
          MyProject.Computer.FileSystem.DeleteFile("..\\..\\meshes\\animationdatasinglefile.txt");
        if (FNIScommon1.FNIScommon.MRD_DataListALL.Count > 0 | FNIScommon1.FNIScommon.Anz_aa > 0 | FNIScommon1.FNIScommon.nPatchAF[2] > 0)
        {
          if (FNIScommon1.FNIScommon.DebugOutput > 0)
          {
            List<FNIScommon1.FNIScommon.MRD_Data>.Enumerator enumerator = FNIScommon1.FNIScommon.MRD_DataListALL.GetEnumerator();
            while (enumerator.MoveNext())
            {
              FNIScommon1.FNIScommon.MRD_Data current = enumerator.Current;
              string str2 = Strings.Join([email protected], " ");
              if (FNIScommon1.FNIScommon.DebugOutput > 1)
                FNIScommon1.FNIScommon.LogOutput("YYY MRDALL first " + current.firstOfBlock.ToString() + " ismd " + current.isMD.ToString() + " curranim " + current.currAnim.ToString() + " modid " + current.modId.ToString() + " BOid " + current.BOId.ToString() + " " + str2, false, true);
            }
            enumerator.Dispose();
          }
          FNIScommon1.FNIScommon.LogOutput(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[4], "<1>", "animationdatasinglefile.txt", 1, -1, CompareMethod.Binary) + " ...", false, true);
          string TemplateFileName = "templates\\animationdatasinglefile_TEMPLATE.txt";
          string BehaviorFileName = "..\\..\\meshes\\animationdatasinglefile.txt";
          int BehaviorType = 3;
          int num4 = 0;
          OutArray2 = (string[]) null;
          int iOut = 0;
          FNIScommon1.FNIScommon.GenerateBehavior(TemplateFileName, BehaviorFileName, BehaviorType, num4 != 0, ref OutArray2, ref iOut);
        }
        checked { FNIScommon1.FNIScommon.TotalWarnings += FNIScommon1.FNIScommon.WarningCount; }
        string str4 = "";
        if (FNIScommon1.FNIScommon.TotalWarnings > 0)
          str4 = ".";
        FNIScommon1.FNIScommon.LogOutput("", true, true);
        FNIScommon1.FNIScommon.LogOutput(Strings.Replace(Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[11] + str4, "<1>", Conversion.Str((object) FNIScommon1.FNIScommon.AnzAnimChar), 1, -1, CompareMethod.Binary), "<2>", Conversion.Str((object) FNIScommon1.FNIScommon.AnzModChar), 1, -1, CompareMethod.Binary), "<3>", "character", 1, -1, CompareMethod.Binary), true, true);
        if (FNIScommon1.FNIScommon.TotalAnimations > 0)
          FNIScommon1.FNIScommon.LogOutput(Strings.Replace(Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[29] + str4, "<1>", Conversion.Str((object) FNIScommon1.FNIScommon.TotalAnimations), 1, -1, CompareMethod.Binary), "<2>", Conversion.Str((object) FNIScommon1.FNIScommon.No_BOmods), 1, -1, CompareMethod.Binary), "<3>", Conversion.Str((object) FNIScommon1.FNIScommon.No_BO), 1, -1, CompareMethod.Binary), true, true);
        if (FNIScommon1.FNIScommon.TotalWarnings > 0)
        {
          FNIScommon1.FNIScommon.LogOutput(Conversion.Str((object) FNIScommon1.FNIScommon.TotalWarnings) + " " + FNIScommon1.FNIScommon.tWarn[8] + ".", true, true);
          FNIScommon1.FNIScommon.RetCode = -1;
        }
        MyProject.Computer.FileSystem.CopyFile("templates\\FNISVersionGenerated_TEMPLATE.pex", "..\\..\\Scripts\\FNISVersionGenerated.pex", true);
        string[] array = this.FNISModlist2L.ToArray();
        FNIScommon1.FNIScommon.WriteAFile("FNISmodList.txt", ref array, checked (Information.UBound((Array) array, 1) + 1));
        FNIScommon1.FNIScommon.Textbox.SelectionStart = 0;
        FNIScommon1.FNIScommon.Textbox.ScrollToCaret();
        this.Button2.Enabled = true;
        this.optionChanged = false;
label_171:
        FNIScommon1.FNIScommon.FinishSub();
        goto label_177;
label_172:
        num2 = -1;
        switch (num1)
        {
          case 2:
            FNIScommon1.FNIScommon.WriteError();
            goto label_171;
        }
      }
      catch (Exception ex) when (ex is Exception & (uint) num1 > 0U & num2 == 0)
      {
        ProjectData.SetProjectError(ex);
        goto label_172;
      }
      throw ProjectData.CreateProjectError(-2146828237);
label_177:
      if (num2 == 0)
        return;
      ProjectData.ClearProjectError();
    }

    [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
    public void Initialize_PatchBox()
    {
      if (!MyProject.Computer.FileSystem.FileExists(GenerateFNISUsers.PatchDefFile.ToUpperInvariant()))
      {
        FNIScommon1.FNIScommon.ErrString = GenerateFNISUsers.PatchDefFile;
        Information.Err().Raise(2001, (object) null, (object) null, (object) null, (object) null);
      }
      else
      {
        string[] strArray1 = FNIScommon1.FNIScommon.ReadAFile(GenerateFNISUsers.PatchDefFile);
        bool flag1 = false;
        string[] strArray2;
        if (MyProject.Computer.FileSystem.FileExists("MyPatches.txt"))
        {
          strArray2 = FNIScommon1.FNIScommon.ReadAFile("MyPatches.txt");
          flag1 = true;
          if (Information.UBound((Array) strArray2, 1) > 0)
          {
            string[] strArray3 = Strings.Split(strArray2[0], ":", -1, CompareMethod.Binary);
            if (Operators.CompareString(strArray3[0], "Language", false) == 0)
              FNIScommon1.FNIScommon.lastLanguage = Strings.LCase(Strings.RTrim(strArray3[1]));
          }
        }
        else
          strArray2 = (string[]) null;
        this.optionChanged = false;
        FNIScommon1.FNIScommon.PatchCount = 0;
        FNIScommon1.FNIScommon.SkeletonCount = 0;
        FNIScommon1.FNIScommon.isPCEA = false;
        FNIScommon1.FNIScommon.isGENDER = false;
        FNIScommon1.FNIScommon.isSKELETON = false;
        this.Patch_ListBox.BeginUpdate();
        bool flag2 = true;
        string[] strArray4 = strArray1;
        int index1 = 0;
        while (index1 < strArray4.Length)
        {
          string str = strArray4[index1];
          if (flag2)
          {
            GenerateFNISUsers.FirstPatchLine = str;
            flag2 = false;
            if (Operators.CompareString(Strings.Left(str, 18), "<!-- FNIS template", false) == 0)
              goto label_29;
          }
          string Left = Strings.Left(str, 1);
          if (FNIScommon1.FNIScommon.PatchCount < 20 & Strings.Len(str) > 0 & (uint) Operators.CompareString(Left, "'", false) > 0U & (uint) Operators.CompareString(Left, " ", false) > 0U)
          {
            string[] strArray3 = Strings.Split(str, "#", -1, CompareMethod.Binary);
            if (Information.UBound((Array) strArray3, 1) > 0)
            {
              if (Operators.CompareString(strArray3[1], "", false) == 0)
                strArray3[1] = "0";
              if (Operators.CompareString(strArray3[2], "", false) == 0)
                strArray3[2] = "0";
              if (Operators.CompareString(strArray3[3], "", false) == 0)
                strArray3[3] = "0";
              if (Conversions.ToInteger(strArray3[2]) > 0)
              {
                FNIScommon1.FNIScommon.SkeletonID[FNIScommon1.FNIScommon.SkeletonCount] = strArray3[0];
                FNIScommon1.FNIScommon.nBonesSkeleton[FNIScommon1.FNIScommon.SkeletonCount] = Conversions.ToInteger(strArray3[2]);
                FNIScommon1.FNIScommon.PatchSkeletonSize[FNIScommon1.FNIScommon.SkeletonCount] = Conversions.ToInteger(strArray3[3]);
                checked { ++FNIScommon1.FNIScommon.SkeletonCount; }
              }
              else
              {
                FNIScommon1.FNIScommon.PatchID[FNIScommon1.FNIScommon.PatchCount] = strArray3[0];
                FNIScommon1.FNIScommon.PatchAddAnims[FNIScommon1.FNIScommon.PatchCount] = Conversions.ToInteger(strArray3[1]);
                FNIScommon1.FNIScommon.PatchReqBehaviors[FNIScommon1.FNIScommon.PatchCount] = checked ((uint) Convert.ToInt32(strArray3[3], 16));
                FNIScommon1.FNIScommon.PatchText[FNIScommon1.FNIScommon.PatchCount] = Strings.Replace(Strings.Replace(strArray3[4], "\t", " ", 1, -1, CompareMethod.Binary), "\n", " ", 1, -1, CompareMethod.Binary);
                FNIScommon1.FNIScommon.PatchCheckFile[FNIScommon1.FNIScommon.PatchCount] = "";
                if (Information.UBound((Array) strArray3, 1) >= 5)
                  FNIScommon1.FNIScommon.PatchCheckFile[FNIScommon1.FNIScommon.PatchCount] = strArray3[5];
                FNIScommon1.FNIScommon.isPatch[FNIScommon1.FNIScommon.PatchCount] = false;
                this.Patch_ListBox.Enabled = true;
                this.Patch_ListBox.Items.Add((object) FNIScommon1.FNIScommon.PatchText[FNIScommon1.FNIScommon.PatchCount]);
                if (flag1)
                {
                  string[] strArray5 = strArray2;
                  int index2 = 0;
                  while (index2 < strArray5.Length)
                  {
                    if (Operators.CompareString(strArray5[index2], FNIScommon1.FNIScommon.PatchID[FNIScommon1.FNIScommon.PatchCount], false) == 0)
                      this.Patch_ListBox.SetItemChecked(FNIScommon1.FNIScommon.PatchCount, true);
                    checked { ++index2; }
                  }
                }
                this.Patch_ListBox.SetSelected(FNIScommon1.FNIScommon.PatchCount, true);
                checked { ++FNIScommon1.FNIScommon.PatchCount; }
              }
            }
          }
label_29:
          checked { ++index1; }
        }
        this.Patch_ListBox.EndUpdate();
        this.Patch_ListBox.TopIndex = 0;
      }
    }

    public void Store_Patches()
    {
      string[] StringArray = new string[11];
      if (MyProject.Computer.FileSystem.FileExists("MyPatches.txt"))
        MyProject.Computer.FileSystem.DeleteFile("MyPatches.txt");
      int Elements;
      if (Operators.CompareString(FNIScommon1.FNIScommon.lastLanguage, "english", false) == 0 | Operators.CompareString(FNIScommon1.FNIScommon.lastLanguage, "", false) == 0)
      {
        Elements = 0;
      }
      else
      {
        StringArray[0] = "Language:" + FNIScommon1.FNIScommon.lastLanguage;
        Elements = 1;
      }
      int num = checked (FNIScommon1.FNIScommon.PatchCount - 1);
      int index = 0;
      while (index <= num)
      {
        if (FNIScommon1.FNIScommon.isPatch[index] & (uint) Operators.CompareString(FNIScommon1.FNIScommon.PatchID[index], "HKX_COMPAT", false) > 0U)
        {
          StringArray[Elements] = FNIScommon1.FNIScommon.PatchID[index];
          checked { ++Elements; }
        }
        checked { ++index; }
      }
      if (Elements <= 0)
        return;
      FNIScommon1.FNIScommon.WriteAFile("MyPatches.txt", ref StringArray, Elements);
    }

    public void Generate_PCEA_Default(string PCEAdir, bool isMale)
    {
      int num1;
      int num2;
      try
      {
        ProjectData.ClearProjectError();
        num1 = 2;
        string[] strArray1 = new string[2001];
        string[] strArray2 = new string[4001];
        string[] strArray3 = new string[10001];
        string suffix = Strings.Len(PCEAdir) != 4 ? Strings.Right(PCEAdir, 1) : "t";
        string str1;
        string PathToAnimsShort;
        string str2;
        if (isMale)
        {
          str1 = "..\\..\\meshes\\actors\\character\\animations\\" + PCEAdir + "\\male\\";
          PathToAnimsShort = PCEAdir + "\\male";
          str2 = "temporary_logs\\" + PCEAdir + "defaultmale.xml";
        }
        else
        {
          str1 = "..\\..\\meshes\\actors\\character\\animations\\" + PCEAdir + "\\female\\";
          PathToAnimsShort = PCEAdir + "\\female";
          str2 = "temporary_logs\\" + PCEAdir + "defaultfemale.xml";
        }
        FileSystemProxy fileSystem = MyProject.Computer.FileSystem;
        if (!fileSystem.DirectoryExists(str1))
          fileSystem.CreateDirectory(str1);
        if (fileSystem.FileExists(str2))
          fileSystem.DeleteFile(str2);
        if (isMale)
        {
          this.Read_AnimsInDefault(7, ref FNIScommon1.FNIScommon.ArrDefaultM, FNIScommon1.FNIScommon.iArrDefaultM, str1, PathToAnimsShort, str2, suffix);
          goto label_16;
        }
        else
        {
          this.Read_AnimsInDefault(6, ref FNIScommon1.FNIScommon.ArrDefaultF, FNIScommon1.FNIScommon.iArrDefaultF, str1, PathToAnimsShort, str2, suffix);
          goto label_16;
        }
label_11:
        num2 = -1;
        switch (num1)
        {
          case 2:
            FNIScommon1.FNIScommon.WriteError();
            FNIScommon1.FNIScommon.FinishSub();
            goto label_16;
        }
      }
      catch (Exception ex) when (ex is Exception & (uint) num1 > 0U & num2 == 0)
      {
        ProjectData.SetProjectError(ex);
        goto label_11;
      }
      throw ProjectData.CreateProjectError(-2146828237);
label_16:
      if (num2 == 0)
        return;
      ProjectData.ClearProjectError();
    }

    public void Generate_GENDER_Default(bool isMale)
    {
      int num1;
      int num2;
      try
      {
        ProjectData.ClearProjectError();
        num1 = 2;
        string[] strArray1 = new string[2001];
        string[] strArray2 = new string[4001];
        string[] strArray3 = new string[10001];
        string str;
        string PathToAnimsShort;
        if (isMale)
        {
          str = "..\\..\\meshes\\actors\\character\\animations\\male\\";
          PathToAnimsShort = "male";
        }
        else
        {
          str = "..\\..\\meshes\\actors\\character\\animations\\female\\";
          PathToAnimsShort = "female";
        }
        if (!MyProject.Computer.FileSystem.DirectoryExists(str))
        {
          FNIScommon1.FNIScommon.LogOutput(FNIScommon1.FNIScommon.tMsgu[15] + " " + PathToAnimsShort, true, true);
          goto label_14;
        }
        else if (isMale)
        {
          this.Read_AnimsInDefault(5, ref FNIScommon1.FNIScommon.ArrDefaultM, FNIScommon1.FNIScommon.iArrDefaultM, str, PathToAnimsShort, "temporary_logs\\defaultmale.xml", (string) null);
          goto label_14;
        }
        else
        {
          this.Read_AnimsInDefault(4, ref FNIScommon1.FNIScommon.ArrDefaultF, FNIScommon1.FNIScommon.iArrDefaultF, str, PathToAnimsShort, "temporary_logs\\defaultfemale.xml", (string) null);
          goto label_14;
        }
label_9:
        num2 = -1;
        switch (num1)
        {
          case 2:
            FNIScommon1.FNIScommon.WriteError();
            FNIScommon1.FNIScommon.FinishSub();
            goto label_14;
        }
      }
      catch (Exception ex) when (ex is Exception & (uint) num1 > 0U & num2 == 0)
      {
        ProjectData.SetProjectError(ex);
        goto label_9;
      }
      throw ProjectData.CreateProjectError(-2146828237);
label_14:
      if (num2 == 0)
        return;
      ProjectData.ClearProjectError();
    }

    public bool SkyrimMinVersOK(string SkyrimVers, string MinVers)
    {
      string[] strArray1 = Strings.Split(SkyrimVers, ".", -1, CompareMethod.Binary);
      bool flag;
      if (Operators.CompareString(strArray1[0], "??", false) == 0)
      {
        flag = true;
      }
      else
      {
        string[] strArray2 = Strings.Split(MinVers, ".", -1, CompareMethod.Binary);
        int index = 0;
        while (index <= 2)
        {
          int num = 0;
          if (Information.UBound((Array) strArray1, 1) >= index && Versioned.IsNumeric((object) strArray1[index]))
            num = Conversions.ToInteger(strArray1[index]);
          if (num < Conversions.ToInteger(strArray2[index]))
          {
            flag = false;
            goto label_12;
          }
          else if (num > Conversions.ToInteger(strArray2[index]))
          {
            flag = true;
            goto label_12;
          }
          else
            checked { ++index; }
        }
        flag = true;
      }
label_12:
      return flag;
    }

    public void GetSkeletonBones(string Skel, ref int nBones, ref string SkelName)
    {
      nBones = 99;
      SkelName = "Default";
      FileSystemProxy fileSystem = MyProject.Computer.FileSystem;
      if (fileSystem.FileExists(Skel))
      {
        SkelName = "Unknown";
        if (fileSystem.FileExists("temporary_logs\\skeleton.hkx"))
          fileSystem.DeleteFile("temporary_logs\\skeleton.hkx");
        if (FNIScommon1.FNIScommon.SkyrimEdition == 1)
        {
          if (fileSystem.FileExists("temporary_logs\\Skeleton.xml"))
            fileSystem.DeleteFile("temporary_logs\\Skeleton.xml");
          fileSystem.CopyFile(Skel, "temporary_logs\\skeleton.hkx");
          FNIScommon1.FNIScommon.hkxcmdProcess.StartInfo.Arguments = "convert -v:xml temporary_logs\\skeleton.hkx temporary_logs\\skeleton.xml";
          FNIScommon1.FNIScommon.hkxcmdProcess.Start();
          FNIScommon1.FNIScommon.hkxcmdProcess.WaitForExit();
          if (fileSystem.FileExists("temporary_logs\\Skeleton.xml"))
          {
            string[] strArray1 = FNIScommon1.FNIScommon.ReadAFile("temporary_logs\\Skeleton.xml");
            int index = 0;
            nBones = 0;
            while (index <= Information.UBound((Array) strArray1, 1))
            {
              if (Strings.InStr(strArray1[index], "parentIndices", CompareMethod.Binary) > 0)
              {
                string[] strArray2 = Strings.Split(strArray1[index], "\"", -1, CompareMethod.Binary);
                if (Information.UBound((Array) strArray2, 1) > 3)
                {
                  nBones = Conversions.ToInteger(strArray2[3]);
                  index = Information.UBound((Array) strArray1, 1);
                }
              }
              checked { ++index; }
            }
          }
          if (nBones != 99 & (uint) nBones > 0U)
          {
            int num = checked (FNIScommon1.FNIScommon.SkeletonCount - 1);
            int index = 0;
            while (index <= num)
            {
              if (nBones == FNIScommon1.FNIScommon.nBonesSkeleton[index])
                SkelName = FNIScommon1.FNIScommon.SkeletonID[index];
              checked { ++index; }
            }
          }
        }
        else
        {
          nBones = 0;
          int length = checked ((int) fileSystem.GetFileInfo(Skel).Length);
          int num1 = checked (FNIScommon1.FNIScommon.SkeletonCount - 1);
          int index = 0;
          int num2;
          while (index <= num1)
          {
            if (length == FNIScommon1.FNIScommon.PatchSkeletonSize[index])
            {
              nBones = FNIScommon1.FNIScommon.nBonesSkeleton[index];
              SkelName = FNIScommon1.FNIScommon.SkeletonID[index];
            }
            if (index == checked (FNIScommon1.FNIScommon.SkeletonCount - 1))
              num2 = FNIScommon1.FNIScommon.nBonesSkeleton[index];
            checked { ++index; }
          }
          if (nBones == 0)
            nBones = num2;
        }
      }
    }

    [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
    public void add_ASDSF_precache()
    {
      string[] strArray = new string[1001];
      FileInfo fileInfo1 = new FileInfo("..\\..\\meshes\\animationsetdatasinglefile.txt");
      FileInfo fileInfo2 = new FileInfo("..\\..\\meshes\\animationsetdatasinglefile2.txt");
      if (!fileInfo1.Exists)
      {
        FNIScommon1.FNIScommon.ErrString = "..\\..\\meshes\\animationsetdatasinglefile.txt";
        Information.Err().Raise(2001, (object) null, (object) null, (object) null, (object) null);
      }
      int iline = 0;
      int oline = 0;
      int num1 = 0;
      bool bEOF = false;
      StreamWriter sw = new StreamWriter((Stream) fileInfo2.Open(FileMode.Create, FileAccess.Write));
      int num2 = 3;
      int num3 = 1;
      using (FileStream fileStream = fileInfo1.Open((FileMode) num2, (FileAccess) num3))
      {
        using (StreamReader sr = new StreamReader((Stream) fileStream))
        {
          while (!sr.EndOfStream)
          {
            string Left = this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, true);
            if (num1 == 0)
            {
              if (Operators.CompareString(Left, "_MTSolo.txt", false) == 0)
              {
                num1 = 1;
                if (FNIScommon1.FNIScommon.DebugOutput > 1)
                  FNIScommon1.FNIScommon.LogOutput("ASDSF pre-cache - MTsolo iline:" + Conversion.Str((object) iline) + " oline:" + Conversion.Str((object) oline), false, true);
              }
            }
            else if (num1 == 1)
            {
              if (Operators.CompareString(Left, "V3", false) == 0)
                num1 = 2;
            }
            else if (num1 == 2 | num1 == 5)
            {
              if (FNIScommon1.FNIScommon.DebugOutput > 1)
                FNIScommon1.FNIScommon.LogOutput("ASDSF pre-cache - V3 iline:" + Conversion.Str((object) iline) + " oline:" + Conversion.Str((object) oline), false, true);
              int integer1 = Conversions.ToInteger(Left);
              int num4 = 1;
              string str;
              while (num4 <= integer1)
              {
                str = this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, true);
                checked { ++num4; }
              }
              int num5 = checked (Conversions.ToInteger(this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, true)) * 3);
              int num6 = 1;
              while (num6 <= num5)
              {
                str = this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, true);
                checked { ++num6; }
              }
              int integer2 = Conversions.ToInteger(this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, true));
              int num7 = 1;
              while (num7 <= integer2)
              {
                str = this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, true);
                str = this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, true);
                int integer3 = Conversions.ToInteger(this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, true));
                int num8 = 1;
                while (num8 <= integer3)
                {
                  str = this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, true);
                  checked { ++num8; }
                }
                checked { ++num7; }
              }
              int integer4 = Conversions.ToInteger(this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, false));
              if (integer4 > 1000)
                throw new ApplicationException("Too many animations in animation block:" + Conversion.Str((object) integer4));
              int num9 = integer4;
              int num10 = checked (3 * integer4 - 1);
              int index1 = 0;
              while (index1 <= num10)
              {
                strArray[index1] = this.ASDSF_IO(sr, sw, ref iline, ref oline, ref bEOF, false);
                checked { ++index1; }
              }
              List<string> stringList = new List<string>();
              int num11 = 0;
              int num12 = checked (integer4 - 1);
              int num13 = 0;
              while (num13 <= num12)
              {
                uint uinteger1 = Conversions.ToUInteger(strArray[checked (num13 * 3)]);
                uint uinteger2 = Conversions.ToUInteger(strArray[checked (num13 * 3 + 1)]);
                int num8 = checked (GenerateFNISUsers.iPCEAgenderFile - 1);
                int index2 = 0;
                while (index2 <= num8)
                {
                  if ((int) GenerateFNISUsers.PCEAgenderFile[index2].crc == (int) uinteger2)
                  {
                    int num14 = checked (1000 * -(GenerateFNISUsers.PCEAgenderFile[index2].isGender_F ? 1 : 0) + 100 * -(GenerateFNISUsers.PCEAgenderFile[index2].isGender_M ? 1 : 0) + 10 * -(GenerateFNISUsers.PCEAgenderFile[index2].isPCEA_F ? 1 : 0) + -(GenerateFNISUsers.PCEAgenderFile[index2].isPCEA_M ? 1 : 0));
                    if (FNIScommon1.FNIScommon.DebugOutput > 1)
                      FNIScommon1.FNIScommon.LogOutput("ASDSF pre-cache - FOUND filename: " + Conversion.Str((object) checked (-num14)) + " " + GenerateFNISUsers.PCEAgenderFile[index2].name + Conversion.Str((object) uinteger2) + " " + strArray[checked (num13 * 3)], false, true);
                    if (num1 == 2)
                    {
                      if (GenerateFNISUsers.PCEAgenderFile[index2].isGender_F & (long) uinteger1 != 3729484155L)
                      {
                        stringList.Add("3729484155\r\n" + strArray[checked (num13 * 3 + 1)]);
                        checked { ++num11; }
                      }
                      if (GenerateFNISUsers.PCEAgenderFile[index2].isPCEA_F)
                      {
                        stringList.Add("1345400644\r\n" + strArray[checked (num13 * 3 + 1)]);
                        checked { ++num11; }
                      }
                    }
                    else if (num1 == 5)
                    {
                      if (GenerateFNISUsers.PCEAgenderFile[index2].isGender_M & (long) uinteger1 != 911414905L)
                      {
                        stringList.Add("911414905\r\n" + strArray[checked (num13 * 3 + 1)]);
                        checked { ++num11; }
                      }
                      if (GenerateFNISUsers.PCEAgenderFile[index2].isPCEA_M)
                      {
                        stringList.Add("4276040576\r\n" + strArray[checked (num13 * 3 + 1)]);
                        checked { ++num11; }
                      }
                    }
                    index2 = GenerateFNISUsers.iPCEAgenderFile;
                  }
                  checked { ++index2; }
                }
                List<FNISaa1.FNISaa.AAcrcInfo>.Enumerator enumerator;
                if (!Information.IsNothing((object) FNISaa1.FNISaa.AAcrcList))
                {
                  try
                  {
                    enumerator = FNISaa1.FNISaa.AAcrcList.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                      FNISaa1.FNISaa.AAcrcInfo current = enumerator.Current;
                      if ((int) current.reffile_crc == (int) uinteger2)
                      {
                        if (FNIScommon1.FNIScommon.DebugOutput > 2)
                          FNIScommon1.FNIScommon.LogOutput("AA pre-cache reference found: " + current.FileName + " ref_path: " + Conversions.ToString(uinteger1), false, true);
                        stringList.Add(Conversions.ToString(current.path_crc) + "\r\n" + Conversions.ToString(current.crc32));
                        checked { ++num11; }
                      }
                    }
                  }
                  finally
                  {
                    enumerator.Dispose();
                  }
                }
                int num15 = checked (GenerateFNISUsers.iCustomPreCacheSet - 1);
                int index3 = 0;
                while (index3 <= num15)
                {
                  GenerateFNISUsers.CustomPreCache customPreCache = GenerateFNISUsers.CustomPreCacheSet[index3];
                  if ((int) uinteger1 == (int) customPreCache.refpath_crc & (int) uinteger2 == (int) customPreCache.reffile_crc)
                  {
                    // ISSUE: variable of a reference type
                    int& local;
                    // ISSUE: explicit reference operation
                    // ISSUE: explicit reference operation
                    int num14 = checked (^(local = @GenerateFNISUsers.CustomPreCacheSet[index3].refcount) + 1);
                    // ISSUE: explicit reference operation
                    ^local = num14;
                    if (customPreCache.refnumber1 == 0 | customPreCache.refnumber1 == GenerateFNISUsers.CustomPreCacheSet[index3].refcount | customPreCache.refnumber2 == GenerateFNISUsers.CustomPreCacheSet[index3].refcount)
                    {
                      if (FNIScommon1.FNIScommon.DebugOutput > 1)
                        FNIScommon1.FNIScommon.LogOutput("ASDSF pre-cache - FOUND reference: " + Conversion.Str((object) uinteger1) + " " + Conversion.Str((object) uinteger2) + " " + Conversion.Str((object) GenerateFNISUsers.CustomPreCacheSet[index3].refcount) + "/" + Conversion.Str((object) customPreCache.refnumber1) + "/" + Conversion.Str((object) customPreCache.refnumber2), false, true);
                      int num16 = checked (customPreCache.nCustomAnims - 1);
                      int num17 = 0;
                      while (num17 <= num16)
                      {
                        stringList.Add(Strings.Format((object) customPreCache.custompath_crc, "") + "\r\n" + GenerateFNISUsers.CPCFile[checked (customPreCache.indexCustomAnims + num17)]);
                        checked { ++num11; }
                        checked { ++num17; }
                      }
                    }
                  }
                  checked { ++index3; }
                }
                checked { ++num13; }
              }
              sw.WriteLine(Strings.Format((object) checked (num9 + num11), ""));
              int num18 = checked (3 * num9 - 1);
              int index4 = 0;
              while (index4 <= num18)
              {
                sw.WriteLine(strArray[index4]);
                checked { ++index4; }
              }
              List<string>.Enumerator enumerator1;
              try
              {
                enumerator1 = stringList.GetEnumerator();
                while (enumerator1.MoveNext())
                {
                  string current = enumerator1.Current;
                  sw.WriteLine(current);
                  sw.WriteLine("7891816");
                }
              }
              finally
              {
                enumerator1.Dispose();
              }
              checked { oline += 3 * (num9 + num11) + 1; }
              checked { ++num1; }
            }
            else if (num1 == 3)
            {
              if (Operators.CompareString(Left, "V3", false) == 0)
              {
                num1 = 2;
              }
              else
              {
                num1 = 4;
                if (FNIScommon1.FNIScommon.DebugOutput > 1)
                  FNIScommon1.FNIScommon.LogOutput("ASDSF pre-cache - 2nd part iline:" + Conversion.Str((object) iline) + " oline:" + Conversion.Str((object) oline), false, true);
              }
            }
            else if (num1 == 4)
            {
              if (Operators.CompareString(Left, "V3", false) == 0)
                num1 = 5;
            }
            else if (num1 == 6)
            {
              if (Operators.CompareString(Left, "V3", false) == 0)
              {
                num1 = 5;
              }
              else
              {
                num1 = 7;
                if (FNIScommon1.FNIScommon.DebugOutput > 1)
                  FNIScommon1.FNIScommon.LogOutput("ASDSF pre-cache - remaining lines iline:" + Conversion.Str((object) iline) + " oline:" + Conversion.Str((object) oline), false, true);
              }
            }
            if (bEOF)
            {
              FNIScommon1.FNIScommon.LogOutput("ASDSF pre-cache - animationsetdatasinglefile.txt UNEXPECTED STRUCTURE iline:" + Conversion.Str((object) iline) + " oline:" + Conversion.Str((object) oline), true, true);
              throw new ApplicationException("UNEXPECTED STRUCTURE iline:" + Conversion.Str((object) iline) + " oline:" + Conversion.Str((object) oline));
            }
          }
          sr.Close();
          sw.Close();
          FileSystemProxy fileSystem = MyProject.Computer.FileSystem;
          if (fileSystem.FileExists("..\\..\\meshes\\animationsetdatasinglefile.SAVE"))
            fileSystem.DeleteFile("..\\..\\meshes\\animationsetdatasinglefile.SAVE");
          if (fileSystem.FileExists("..\\..\\meshes\\animationsetdatasinglefile.txt"))
            fileSystem.DeleteFile("..\\..\\meshes\\animationsetdatasinglefile.txt");
          fileSystem.RenameFile("..\\..\\meshes\\animationsetdatasinglefile2.txt", "animationsetdatasinglefile.txt");
        }
      }
      if (FNIScommon1.FNIScommon.DebugOutput <= 2)
        return;
      FNIScommon1.FNIScommon.LogOutput("ASDSF pre-cache - DONE iline:" + Conversion.Str((object) iline) + " oline:" + Conversion.Str((object) oline), false, true);
    }

    public string ASDSF_IO(StreamReader sr, StreamWriter sw, ref int iline, ref int oline, ref bool bEOF, bool WriteBack = true)
    {
      if (sr.EndOfStream)
        bEOF = true;
      string str = sr.ReadLine();
      iline = checked (iline + 1);
      if (WriteBack)
      {
        sw.WriteLine(str);
        oline = checked (oline + 1);
      }
      return str;
    }

    public void Read_CustomPreCheckFile()
    {
      GenerateFNISUsers.CustomPreCache customPreCache = new GenerateFNISUsers.CustomPreCache();
      GenerateFNISUsers.iCustomPreCacheSet = 0;
      GenerateFNISUsers.CPCFile = FNIScommon1.FNIScommon.ReadAFile("CustomPreCacheFiles.txt");
      int index1 = 0;
      int num1 = Information.UBound((Array) GenerateFNISUsers.CPCFile, 1);
      int index2 = 0;
      while (index2 <= num1)
      {
        if (Operators.CompareString(Strings.Left(GenerateFNISUsers.CPCFile[index2], 1), "'", false) != 0)
        {
          string Left = Strings.Replace(Strings.Replace(GenerateFNISUsers.CPCFile[index2], " ", "", 1, -1, CompareMethod.Binary), "\t", "", 1, -1, CompareMethod.Binary);
          if (Operators.CompareString(Left, "", false) != 0)
          {
            GenerateFNISUsers.CPCFile[index1] = Left;
            checked { ++index1; }
          }
        }
        checked { ++index2; }
      }
      try
      {
        int index3 = 0;
        while (index3 < index1)
        {
          string Right = Strings.LCase(GenerateFNISUsers.CPCFile[index3]);
          bool flag = false;
          int num2 = checked (FNIScommon1.FNIScommon.AnzMod - 1);
          int index4 = 0;
          while (index4 <= num2)
          {
            if (Operators.CompareString(Strings.LCase(FNIScommon1.FNIScommon.MyMod[index4]), Right, false) == 0)
            {
              flag = true;
              index4 = FNIScommon1.FNIScommon.AnzMod;
            }
            checked { ++index4; }
          }
          if (FNIScommon1.FNIScommon.DebugOutput > 1)
            FNIScommon1.FNIScommon.LogOutput("ASDSF ReadCustomPreCheckFile. Mod " + Right + " installed:" + Conversion.Str((object) flag), false, true);
          if (flag)
          {
            customPreCache.refcount = 0;
            customPreCache.refpath_crc = Conversions.ToUInteger(GenerateFNISUsers.CPCFile[checked (index3 + 1)]);
            string str = GenerateFNISUsers.CPCFile[checked (index3 + 2)];
            int num3 = Strings.InStr(GenerateFNISUsers.CPCFile[checked (index3 + 2)], "/", CompareMethod.Binary);
            if (num3 > 0)
            {
              customPreCache.reffile_crc = Conversions.ToUInteger(Strings.Left(str, checked (num3 - 1)));
              string[] strArray = Strings.Split(Strings.Mid(str, checked (num3 + 1)), ",", -1, CompareMethod.Binary);
              customPreCache.refnumber1 = Conversions.ToInteger(strArray[0]);
              customPreCache.refnumber2 = Conversions.ToInteger(strArray[1]);
            }
            else
            {
              customPreCache.reffile_crc = Conversions.ToUInteger(str);
              customPreCache.refnumber1 = 0;
            }
            customPreCache.custompath_crc = Conversions.ToUInteger(GenerateFNISUsers.CPCFile[checked (index3 + 3)]);
            customPreCache.nCustomAnims = Conversions.ToInteger(GenerateFNISUsers.CPCFile[checked (index3 + 4)]);
            if (customPreCache.nCustomAnims > 500)
              throw new ApplicationException("Too many animations in CustomPreCacheFiles.txt");
            customPreCache.indexCustomAnims = checked (index3 + 5);
            GenerateFNISUsers.CustomPreCacheSet[GenerateFNISUsers.iCustomPreCacheSet] = customPreCache;
            checked { ++GenerateFNISUsers.iCustomPreCacheSet; }
            FNIScommon1.FNIScommon.LogOutput("ASDSF ReadCustomPreCheckFile. Found entry for " + Conversion.Str((object) customPreCache.refpath_crc) + " " + Conversion.Str((object) customPreCache.reffile_crc) + " " + Conversion.Str((object) customPreCache.refnumber1) + "/" + Conversion.Str((object) customPreCache.refnumber2), false, true);
          }
          checked { index3 += 5 + Conversions.ToInteger(GenerateFNISUsers.CPCFile[index3 + 4]); }
        }
      }
      catch (Exception ex)
      {
        ProjectData.SetProjectError(ex);
        FNIScommon1.FNIScommon.LogOutput("\r\n>>Warning: wrong file structure for CustomPreCacheFiles.txt - " + ex.Message + "<<\r\n", true, true);
        checked { ++FNIScommon1.FNIScommon.WarningCount; }
        ProjectData.ClearProjectError();
      }
    }

    [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
    public void Execute_BehavioredObjects()
    {
      List<string> stringList1 = new List<string>();
      FNIScommon1.FNIScommon.No_BO = 0;
      if (!MyProject.Computer.FileSystem.FileExists("..\\GenerateFNIS_for_Users\\BehavioredObjects.txt".ToUpperInvariant()))
      {
        FNIScommon1.FNIScommon.LogOutput("\r\n" + FNIScommon1.FNIScommon.tMsgu[5], true, true);
      }
      else
      {
        FNIScommon1.FNIScommon.LogOutput("\r\n" + FNIScommon1.FNIScommon.tMsgu[28], true, true);
        List<string>.Enumerator enumerator1;
        try
        {
          enumerator1 = FNIScommon1.FNIScommon.Combined_BOlist().GetEnumerator();
          while (enumerator1.MoveNext())
          {
            string current1 = enumerator1.Current;
            FileSystemProxy fileSystem = MyProject.Computer.FileSystem;
            if (Operators.CompareString(Strings.Left(current1, 1), "'", false) != 0)
            {
              string[] strArray1 = Strings.Split(current1, ";", -1, CompareMethod.Binary);
              if (Information.UBound((Array) strArray1, 1) >= 9)
              {
                FNIScommon1.FNIScommon.Initialize_Globals();
                FNIScommon1.FNIScommon.MyBO = Conversions.ToInteger(strArray1[8]);
                FNIScommon1.FNIScommon.BO_List[FNIScommon1.FNIScommon.MyBO] = strArray1[0];
                FNIScommon1.FNIScommon.BO_DefaultAnims[FNIScommon1.FNIScommon.MyBO] = Conversions.ToInteger(strArray1[9]);
                string str1 = "..\\..\\meshes\\" + strArray1[1] + "\\";
                string Expression1 = strArray1[2];
                string Expression2 = strArray1[3];
                Strings.Replace(Strings.Replace(strArray1[4], " ", "", 1, -1, CompareMethod.Binary), "\t", "", 1, -1, CompareMethod.Binary);
                bool flag1 = (uint) Operators.CompareString(strArray1[5], "", false) > 0U;
                if (flag1)
                  flag1 = !(fileSystem.FileExists("..\\..\\Dragonborn.bsa") | fileSystem.FileExists("..\\..\\Dawnguard.bsa"));
                bool SKip_CC = (uint) Operators.CompareString(strArray1[7], "", false) > 0U;
                string[] strArray2 = Strings.Split(Expression2, "\\", -1, CompareMethod.Binary);
                FNIScommon1.FNIScommon.MyBOFolder = strArray2[0];
                string str2 = strArray2[1];
                string str3 = Strings.Left(str2, checked (Strings.Len(str2) - 4));
                string str4 = str3 + ".xml";
                string str5;
                if (flag1)
                {
                  str5 = str3 + "_noDLC_TEMPLATE.txt";
                  FNIScommon1.FNIScommon.LogOutput(FNIScommon1.FNIScommon.BO_List[FNIScommon1.FNIScommon.MyBO] + " behavior for non-DLC user", false, true);
                }
                else
                  str5 = str3 + "_TEMPLATE.txt";
                string mpath = str1 + FNIScommon1.FNIScommon.MyBOFolder + "\\";
                string Delimiter = "\\";
                int Limit = -1;
                int num1 = 0;
                string[] strArray3 = Strings.Split(Expression1, Delimiter, Limit, (CompareMethod) num1);
                string str6 = str1 + strArray3[0] + "\\";
                string str7 = strArray3[Information.UBound((Array) strArray3, 1)];
                string str8 = Strings.Left(str7, checked (Strings.Len(str7) - 4));
                string str9 = str8 + "_default_TEMPLATE.txt";
                string str10 = str8 + ".xml";
                string upperInvariant = (mpath + Strings.Left(str2, checked (Strings.Len(str2) - 4)) + "_FNIS.hkx").ToUpperInvariant();
                if (fileSystem.FileExists(upperInvariant))
                  fileSystem.DeleteFile(upperInvariant);
                if (!(!fileSystem.DirectoryExists(str1.ToUpperInvariant()) | !fileSystem.FileExists((str6 + str9).ToUpperInvariant()) | !fileSystem.FileExists((mpath + str5).ToUpperInvariant())))
                {
                  List<string> stringList2 = FNIScommon1.FNIScommon.Read_Directory(str1 + "animations", "");
                  List<string>.Enumerator enumerator2;
                  try
                  {
                    enumerator2 = stringList2.GetEnumerator();
                    while (enumerator2.MoveNext())
                    {
                      string current2 = enumerator2.Current;
                      string AnimListFile = str1 + "animations\\" + current2 + "\\FNIS_" + current2 + "_" + FNIScommon1.FNIScommon.BO_List[FNIScommon1.FNIScommon.MyBO] + "_list.txt";
                      string str11 = mpath + "FNIS_" + current2 + "_" + FNIScommon1.FNIScommon.BO_List[FNIScommon1.FNIScommon.MyBO] + "_behavior.hkx";
                      if (fileSystem.FileExists(AnimListFile.ToUpperInvariant()))
                      {
                        if (fileSystem.FileExists(str11.ToUpperInvariant()))
                        {
                          checked { ++FNIScommon1.FNIScommon.AnzMod; }
                          FNIScommon1.FNIScommon.MyMod[FNIScommon1.FNIScommon.AnzMod] = current2;
                          bool flag2 = true;
                          List<string>.Enumerator enumerator3;
                          try
                          {
                            enumerator3 = stringList1.GetEnumerator();
                            while (enumerator3.MoveNext())
                            {
                              string current3 = enumerator3.Current;
                              if (Operators.CompareString(Strings.LCase(current2), Strings.LCase(current3), false) == 0)
                                flag2 = false;
                            }
                          }
                          finally
                          {
                            enumerator3.Dispose();
                          }
                          if (flag2)
                          {
                            stringList1.Add(current2);
                            FNIScommon1.FNIScommon.LogOutput(FNIScommon1.FNIScommon.tMsgu[2] + " " + current2, true, false);
                          }
                          FNIScommon1.FNIScommon.ReadAnimationFile(AnimListFile, FNIScommon1.FNIScommon.AnzMod, SKip_CC);
                          if (flag2)
                            FNIScommon1.FNIScommon.LogOutput(" " + FNIScommon1.FNIScommon.MyModVers[FNIScommon1.FNIScommon.AnzMod] + " ...", true, true);
                        }
                        else
                          FNIScommon1.FNIScommon.WriteWarning(Strings.Replace(FNIScommon1.FNIScommon.tWarn[6], "<1>", " \"Animations\\" + current2 + "\"", 1, -1, CompareMethod.Binary) + " (" + FNIScommon1.FNIScommon.BO_List[FNIScommon1.FNIScommon.MyBO] + ")");
                      }
                    }
                  }
                  finally
                  {
                    enumerator2.Dispose();
                  }
                  if (FNIScommon1.FNIScommon.AnzAnim > 0)
                  {
                    checked { ++FNIScommon1.FNIScommon.No_BO; }
                    string[] ModList = (string[]) null;
                    FNIScommon1.FNIScommon.ErrString = "";
                    if (this.mustGenerate0master(mpath, str2, mpath + str5, false, ref ModList))
                    {
                      string TemplateFileName = mpath + str5;
                      string BehaviorFileName = "temporary_logs\\" + str4;
                      int BehaviorType = 2;
                      int num2 = 0;
                      string[] OutArray = (string[]) null;
                      int iOut = 0;
                      FNIScommon1.FNIScommon.GenerateBehavior(TemplateFileName, BehaviorFileName, BehaviorType, num2 != 0, ref OutArray, ref iOut);
                      if (fileSystem.FileExists((mpath + str2).ToUpperInvariant()))
                        fileSystem.DeleteFile(mpath + str2);
                      FNIScommon1.FNIScommon.hkxcmdProcess.StartInfo.Arguments = Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.hkxcmd_Params, "*", "temporary_logs\\" + str4, 1, -1, CompareMethod.Binary), "#", "temporary_logs\\" + str2, 1, -1, CompareMethod.Binary);
                      FNIScommon1.FNIScommon.hkxcmdProcess.Start();
                      FNIScommon1.FNIScommon.hkxcmdProcess.WaitForExit();
                      fileSystem.CopyFile("DebugData.txt", "temporary_logs\\DebugData.txt", true);
                      if (fileSystem.FileExists(("temporary_logs\\" + str2).ToUpperInvariant()))
                        fileSystem.MoveFile("temporary_logs\\" + str2, mpath + str2);
                      else
                        FNIScommon1.FNIScommon.ErrString = str2 + " ";
                    }
                    FNIScommon1.FNIScommon.GenerateBehavior(str6 + str9, "temporary_logs\\" + str10, 3, false, ref FNIScommon1.FNIScommon.ArrDefaultF, ref FNIScommon1.FNIScommon.iArrDefaultF);
                    if (!SKip_CC)
                      this.Read_AnimsInDefault(3, ref FNIScommon1.FNIScommon.ArrDefaultF, FNIScommon1.FNIScommon.iArrDefaultF, str1 + "animations\\", (string) null, (string) null, (string) null);
                    if (fileSystem.FileExists(str6 + str7.ToUpperInvariant()))
                      fileSystem.DeleteFile(str6 + str7.ToUpperInvariant());
                    FNIScommon1.FNIScommon.hkxcmdProcess.StartInfo.Arguments = Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.hkxcmd_Params, "*", "temporary_logs\\" + str10, 1, -1, CompareMethod.Binary), "#", "temporary_logs\\" + str7, 1, -1, CompareMethod.Binary);
                    FNIScommon1.FNIScommon.hkxcmdProcess.Start();
                    FNIScommon1.FNIScommon.hkxcmdProcess.WaitForExit();
                    fileSystem.CopyFile("DebugData.txt", "temporary_logs\\DebugData.txt", true);
                    if (fileSystem.FileExists(("temporary_logs\\" + str7).ToUpperInvariant()))
                      fileSystem.MoveFile("temporary_logs\\" + str7, str6 + str7);
                    else
                      FNIScommon1.FNIScommon.ErrString = FNIScommon1.FNIScommon.ErrString + str7 + " ";
                    if (Operators.CompareString(FNIScommon1.FNIScommon.ErrString, "", false) != 0)
                      Information.Err().Raise(2012, (object) null, (object) null, (object) null, (object) null);
                    this.FNISModlist2L.Add(Strings.Format((object) fileSystem.GetFileInfo(mpath + str2).Length, ""));
                    FNIScommon1.FNIScommon.LogOutput(Strings.Replace(Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[11], "<1>", Conversion.Str((object) FNIScommon1.FNIScommon.AnzAnim), 1, -1, CompareMethod.Binary), "<2>", Conversion.Str((object) FNIScommon1.FNIScommon.AnzMod), 1, -1, CompareMethod.Binary), "<3>", FNIScommon1.FNIScommon.BO_List[FNIScommon1.FNIScommon.MyBO], 1, -1, CompareMethod.Binary), false, true);
                    if (FNIScommon1.FNIScommon.WarningCount > 0)
                      FNIScommon1.FNIScommon.LogOutput(Conversion.Str((object) FNIScommon1.FNIScommon.WarningCount) + " " + FNIScommon1.FNIScommon.tWarn[8] + ".", false, true);
                  }
                  checked { FNIScommon1.FNIScommon.TotalAnimations += FNIScommon1.FNIScommon.AnzAnim; }
                  checked { FNIScommon1.FNIScommon.TotalWarnings += FNIScommon1.FNIScommon.WarningCount; }
                }
              }
            }
          }
        }
        finally
        {
          enumerator1.Dispose();
        }
        FNIScommon1.FNIScommon.No_BOmods = stringList1.Count;
      }
    }

    public void DeInstall_BOs()
    {
      FileSystemProxy fileSystem = MyProject.Computer.FileSystem;
      List<string>.Enumerator enumerator;
      try
      {
        enumerator = FNIScommon1.FNIScommon.Combined_BOlist().GetEnumerator();
        while (enumerator.MoveNext())
        {
          string current = enumerator.Current;
          string Delimiter = ";";
          int Limit = -1;
          int num1 = 0;
          string[] strArray = Strings.Split(current, Delimiter, Limit, (CompareMethod) num1);
          int Length = 1;
          if ((uint) Operators.CompareString(Strings.Left(current, Length), "'", false) > 0U & Information.UBound((Array) strArray, 1) >= 3)
          {
            string str1 = strArray[0];
            string directory = "..\\..\\meshes\\" + strArray[1];
            if (fileSystem.DirectoryExists(directory))
            {
              string str2 = directory + "\\" + strArray[2];
              string str3 = directory + "\\" + strArray[3];
              short num2 = checked ((short) (Strings.InStrRev(Strings.LCase(directory), "\\", -1, CompareMethod.Binary) + 1));
              if (fileSystem.FileExists(str3))
              {
                fileSystem.DeleteFile(str3);
                FNIScommon1.FNIScommon.LogOutput(Strings.Mid(str3, (int) num2) + " " + FNIScommon1.FNIScommon.tMsgu[31], true, true);
              }
              if (fileSystem.FileExists(str2))
              {
                fileSystem.DeleteFile(str2);
                FNIScommon1.FNIScommon.LogOutput(Strings.Mid(str2, (int) num2) + " " + FNIScommon1.FNIScommon.tMsgu[31], true, true);
              }
            }
          }
        }
      }
      finally
      {
        enumerator.Dispose();
      }
    }

    public bool mustGenerate0master(string mpath, string mfile, string tfile, bool force, ref string[] ModList)
    {
      List<string> stringList = new List<string>();
      bool flag = true;
      FileSystemProxy fileSystem = MyProject.Computer.FileSystem;
      int length1 = checked ((int) fileSystem.GetFileInfo(tfile).Length);
      int anzMod = FNIScommon1.FNIScommon.AnzMod;
      int index1 = 1;
      while (index1 <= anzMod)
      {
        stringList.Add(FNIScommon1.FNIScommon.MyMod[index1]);
        checked { ++index1; }
      }
      stringList.Sort();
      this.FNISModlist2L.Add(":" + FNIScommon1.FNIScommon.BO_List[FNIScommon1.FNIScommon.MyBO]);
      this.FNISModlist2L.AddRange((IEnumerable<string>) stringList);
      this.FNISModlist2L.Add(Strings.Format((object) length1, ""));
      ModList = stringList.ToArray();
      if (!Information.IsNothing((object) this.FNISModList1) & fileSystem.FileExists(mpath + mfile) & !force)
      {
        int num1 = -1;
        int num2 = checked (Information.UBound((Array) this.FNISModList1, 1) - 2);
        int index2 = 0;
        while (index2 <= num2)
        {
          if (Operators.CompareString(this.FNISModList1[index2], ":" + FNIScommon1.FNIScommon.BO_List[FNIScommon1.FNIScommon.MyBO], false) == 0)
          {
            num1 = index2;
            index2 = Information.UBound((Array) this.FNISModList1, 1);
          }
          checked { ++index2; }
        }
        int num3;
        if (num1 > -1)
        {
          num3 = -1;
          int num4 = checked (num1 + 1);
          int num5 = Information.UBound((Array) this.FNISModList1, 1);
          int index3 = num4;
          while (index3 <= num5)
          {
            if (Operators.CompareString(Strings.Left(this.FNISModList1[index3], 1), ":", false) == 0)
            {
              num3 = checked (index3 - num1 - 3);
              index3 = Information.UBound((Array) this.FNISModList1, 1);
            }
            checked { ++index3; }
          }
          if (num3 < 0)
            num3 = checked (Information.UBound((Array) this.FNISModList1, 1) - num1 - 2);
        }
        int length2 = checked ((int) fileSystem.GetFileInfo(mpath + mfile).Length);
        if (Information.UBound((Array) this.FNISModList1, 1) == -1 | num1 == -1)
        {
          flag = true;
        }
        else
        {
          string str1 = this.FNISModList1[checked (num1 + num3 + 1)];
          string str2 = this.FNISModList1[checked (num1 + num3 + 2)];
          if (num3 == FNIScommon1.FNIScommon.AnzMod & Versioned.IsNumeric((object) str1) & Versioned.IsNumeric((object) str2) && Conversions.ToInteger(str1) == length1 & Conversions.ToInteger(str2) > 0)
          {
            flag = false;
            int num4 = checked (FNIScommon1.FNIScommon.AnzMod - 1);
            int index3 = 0;
            while (index3 <= num4)
            {
              if (Operators.CompareString(this.FNISModList1[checked (num1 + 1 + index3)], ModList[index3], false) != 0)
                flag = true;
              checked { ++index3; }
            }
          }
        }
      }
      if (flag)
        FNIScommon1.FNIScommon.LogOutput("Generate " + mfile, false, true);
      else
        FNIScommon1.FNIScommon.LogOutput(mfile + " ok", false, true);
      return flag;
    }

    public void Read_AnimsInDefault(int action, ref string[] DefaultArray, int NoElem, string PathToAnims, string PathToAnimsShort, string Outfile, string suffix)
    {
      List<string> stringList = new List<string>();
      bool[] flagArray = new bool[2001];
      string str1 = "";
      int num1;
      if (action >= 4 & action <= 7)
      {
        num1 = 0;
        int num2 = checked ((int) Math.Round(Math.Pow(2.0, unchecked ((double) checked (action - 4)))));
        IEnumerator<string> enumerator;
        try
        {
          enumerator = MyProject.Computer.FileSystem.GetFiles(PathToAnims, Microsoft.VisualBasic.FileIO.SearchOption.SearchTopLevelOnly, "*.hkx").GetEnumerator();
          while (enumerator.MoveNext())
          {
            string[] strArray = Strings.Split(enumerator.Current, "\\", -1, CompareMethod.Binary);
            int Rank = 1;
            int index1 = Information.UBound((Array) strArray, Rank);
            string str2 = strArray[index1];
            stringList.Add(str2);
            uint num3 = FNIScommon1.FNIScommon.CRC32_Calc(Strings.LCase(Strings.Left(str2, checked (Strings.Len(str2) - 4))));
            int index2 = 0;
            bool flag = false;
            while (!flag & index2 < GenerateFNISUsers.iPCEAgenderFile)
            {
              if ((int) GenerateFNISUsers.PCEAgenderFile[index2].crc == (int) num3)
              {
                if (FNIScommon1.FNIScommon.DebugOutput > 1)
                  FNIScommon1.FNIScommon.LogOutput(Conversion.Str((object) action) + " Multi PCEA/Gender filename: " + GenerateFNISUsers.PCEAgenderFile[index2].name, false, true);
                flag = true;
              }
              if (!flag)
                checked { ++index2; }
            }
            if (!flag & GenerateFNISUsers.iPCEAgenderFile < Information.UBound((Array) GenerateFNISUsers.PCEAgenderFile, 1))
            {
              GenerateFNISUsers.PCEAgenderFile[GenerateFNISUsers.iPCEAgenderFile].crc = num3;
              GenerateFNISUsers.PCEAgenderFile[GenerateFNISUsers.iPCEAgenderFile].name = str2;
              GenerateFNISUsers.PCEAgenderFile[GenerateFNISUsers.iPCEAgenderFile].isGender_F = false;
              GenerateFNISUsers.PCEAgenderFile[GenerateFNISUsers.iPCEAgenderFile].isGender_M = false;
              GenerateFNISUsers.PCEAgenderFile[GenerateFNISUsers.iPCEAgenderFile].isPCEA_F = false;
              GenerateFNISUsers.PCEAgenderFile[GenerateFNISUsers.iPCEAgenderFile].isPCEA_M = false;
              if (FNIScommon1.FNIScommon.DebugOutput > 1)
                FNIScommon1.FNIScommon.LogOutput(Conversion.Str((object) action) + "   New PCEA/Gender filename: " + GenerateFNISUsers.PCEAgenderFile[GenerateFNISUsers.iPCEAgenderFile].name, false, true);
              index2 = GenerateFNISUsers.iPCEAgenderFile;
              flag = true;
              checked { ++GenerateFNISUsers.iPCEAgenderFile; }
            }
            if (flag)
            {
              if (action == 4)
                GenerateFNISUsers.PCEAgenderFile[index2].isGender_F = true;
              else if (action == 5)
                GenerateFNISUsers.PCEAgenderFile[index2].isGender_M = true;
              else if (action == 6)
                GenerateFNISUsers.PCEAgenderFile[index2].isPCEA_F = true;
              else if (action == 7)
                GenerateFNISUsers.PCEAgenderFile[index2].isPCEA_M = true;
            }
          }
        }
        finally
        {
          if (enumerator != null)
            enumerator.Dispose();
        }
        if (action == 4 | action == 5)
          str1 = "GENDER";
        else if (action == 6 | action == 7)
          str1 = "PCEA";
      }
      int index3 = 0;
      while ((Strings.InStr(DefaultArray[index3], "<hkcstring>", CompareMethod.Binary) == 0 | Strings.InStr(DefaultArray[index3], "<!--", CompareMethod.Binary) == 1) & index3 < NoElem)
        checked { ++index3; }
      int num4 = 0;
      while (Strings.InStr(DefaultArray[index3], "<!-- Start FNIS", CompareMethod.Binary) == 0 & Strings.InStr(DefaultArray[index3], "</hkparam>", CompareMethod.Binary) <= 0 & index3 < NoElem)
      {
        string str2 = DefaultArray[index3];
        int num2 = Strings.InStr(str2, "<!--", CompareMethod.Binary);
        int num3 = Strings.InStr(str2, "<hkcstring>", CompareMethod.Binary);
        int Start = Strings.InStr(str2, "</hkcstring>", CompareMethod.Binary);
        if (num3 > 1 & Start > num3 & (num2 == 0 | num2 > Start))
        {
          string[] strArray = Strings.Split(Strings.Mid(str2, checked (num3 + 11), checked (Start - num3 - 11)), "\\", -1, CompareMethod.Binary);
          int Rank = 1;
          int index1 = Information.UBound((Array) strArray, Rank);
          string str3 = strArray[index1];
          if (action == 1 | action == 3)
          {
            FNIScommon1.FNIScommon.AnimFilecc animFilecc = new FNIScommon1.FNIScommon.AnimFilecc()
            {
              actor = FNIScommon1.FNIScommon.MyBO,
              modname = "Skyrim",
              animfile = str3,
              animfile_crc = FNIScommon1.FNIScommon.CRC32_Calc(Strings.LCase(str3)),
              animfile_ID = num4,
              animpath = "",
              isbsa = true,
              comp = FNIScommon1.FNIScommon.BO_List[FNIScommon1.FNIScommon.MyBO] + str3
            };
            FNIScommon1.FNIScommon.AnimFileList.Add(animFilecc);
            checked { ++num4; }
          }
          else if (action >= 4 & action <= 7)
          {
            int index2 = 0;
            List<string>.Enumerator enumerator;
            try
            {
              enumerator = stringList.GetEnumerator();
              while (enumerator.MoveNext())
              {
                string current = enumerator.Current;
                if (Operators.CompareString(str3.ToUpperInvariant(), current.ToUpperInvariant(), false) == 0)
                {
                  DefaultArray[index3] = Strings.Left(str2, checked (num3 + 10)) + "animations\\" + PathToAnimsShort + "\\" + str3 + Strings.Mid(str2, Start);
                  if (FNIScommon1.FNIScommon.DebugOutput > 1)
                    FNIScommon1.FNIScommon.LogOutput(str1 + " file: Animations\\" + PathToAnimsShort + "\\" + str3, false, true);
                  checked { ++num1; }
                  flagArray[index2] = true;
                }
                checked { ++index2; }
              }
            }
            finally
            {
              enumerator.Dispose();
            }
          }
        }
        checked { ++index3; }
      }
      FNIScommon1.FNIScommon.AnimFilecc animFilecc1;
      if (action == 1)
      {
        int num2 = checked (FNIScommon1.FNIScommon.iPatchAF - 1);
        int index1 = 0;
        while (index1 <= num2)
        {
          if (FNIScommon1.FNIScommon.PatchAF[index1].inDefault)
          {
            animFilecc1 = new FNIScommon1.FNIScommon.AnimFilecc();
            animFilecc1.actor = 0;
            animFilecc1.modname = FNIScommon1.FNIScommon.PatchAF[index1].path;
            animFilecc1.animfile = FNIScommon1.FNIScommon.PatchAF[index1].name;
            animFilecc1.animfile_crc = FNIScommon1.FNIScommon.CRC32_Calc(Strings.LCase(animFilecc1.animfile));
            animFilecc1.animfile_ID = num4;
            animFilecc1.animpath = PathToAnims;
            animFilecc1.isbsa = true;
            animFilecc1.comp = FNIScommon1.FNIScommon.BO_List[0] + animFilecc1.animfile;
            FNIScommon1.FNIScommon.AnimFilecc animFilecc2 = animFilecc1;
            FNIScommon1.FNIScommon.AnimFileList.Add(animFilecc2);
            FNIScommon1.FNIScommon.PatchAF[index1].AnimationID = num4;
            checked { ++num4; }
          }
          checked { ++index1; }
        }
      }
      if (action == 1 | action == 3)
      {
        int num2 = checked (FNIScommon1.FNIScommon.AnzAnim - 1);
        int index1 = 0;
        while (index1 <= num2)
        {
          if ((uint) Operators.CompareString(FNIScommon1.FNIScommon.AnimFile[index1], "", false) > 0U & !FNIScommon1.FNIScommon.AnimKoption[index1])
          {
            animFilecc1 = new FNIScommon1.FNIScommon.AnimFilecc();
            animFilecc1.actor = FNIScommon1.FNIScommon.MyBO;
            animFilecc1.modname = FNIScommon1.FNIScommon.MyMod[FNIScommon1.FNIScommon.AnimMod[index1]];
            animFilecc1.animfile = FNIScommon1.FNIScommon.AnimFile[index1];
            animFilecc1.animfile_crc = FNIScommon1.FNIScommon.CRC32_Calc(Strings.LCase(FNIScommon1.FNIScommon.AnimFile[index1]));
            animFilecc1.animfile_ID = num4;
            animFilecc1.animpath = PathToAnims;
            animFilecc1.isbsa = FNIScommon1.FNIScommon.Has_Option(FNIScommon1.FNIScommon.AnimOption[index1], "bsa");
            animFilecc1.comp = FNIScommon1.FNIScommon.BO_List[animFilecc1.actor] + animFilecc1.animfile;
            FNIScommon1.FNIScommon.AnimFilecc animFilecc2 = animFilecc1;
            FNIScommon1.FNIScommon.AnimFileList.Add(animFilecc2);
            checked { ++num4; }
          }
          checked { ++index1; }
        }
      }
      if (action == 1)
      {
        int num2 = checked (FNIScommon1.FNIScommon.iPatchAF - 1);
        int index1 = 0;
        while (index1 <= num2)
        {
          if (!FNIScommon1.FNIScommon.PatchAF[FNIScommon1.FNIScommon.iPatchAF].inDefault)
          {
            uint num3 = FNIScommon1.FNIScommon.CRC32_Calc(Strings.LCase(FNIScommon1.FNIScommon.PatchAF[index1].name));
            List<FNIScommon1.FNIScommon.AnimFilecc>.Enumerator enumerator;
            try
            {
              enumerator = FNIScommon1.FNIScommon.AnimFileList.GetEnumerator();
              while (enumerator.MoveNext())
              {
                FNIScommon1.FNIScommon.AnimFilecc current = enumerator.Current;
                if ((int) num3 == (int) current.animfile_crc && Operators.CompareString(Strings.LCase(FNIScommon1.FNIScommon.PatchAF[index1].path), Strings.LCase(current.modname), false) == 0)
                {
                  FNIScommon1.FNIScommon.PatchAF[index1].AnimationID = current.animfile_ID;
                  break;
                }
              }
            }
            finally
            {
              enumerator.Dispose();
            }
            if (FNIScommon1.FNIScommon.PatchAF[index1].AnimationID <= 0)
            {
              FNIScommon1.FNIScommon.WriteWarning("Patched animation file not found: " + FNIScommon1.FNIScommon.PatchAF[index1].path + "\\" + FNIScommon1.FNIScommon.PatchAF[index1].name);
              // ISSUE: variable of a reference type
              int& local1;
              // ISSUE: explicit reference operation
              // ISSUE: explicit reference operation
              int num5 = checked (^(local1 = @FNIScommon1.FNIScommon.nPatchAF[2]) - 1);
              // ISSUE: explicit reference operation
              ^local1 = num5;
              FNIScommon1.FNIScommon.PatchAF[index1].inADSF = false;
              if (FNIScommon1.FNIScommon.PatchAF[index1].inASDSF)
              {
                // ISSUE: variable of a reference type
                int& local2;
                // ISSUE: explicit reference operation
                // ISSUE: explicit reference operation
                int num6 = checked (^(local2 = @FNIScommon1.FNIScommon.nPatchAF[3]) - 1);
                // ISSUE: explicit reference operation
                ^local2 = num6;
                FNIScommon1.FNIScommon.PatchAF[index1].inASDSF = false;
              }
            }
          }
          checked { ++index1; }
        }
      }
      List<FNIScommon1.FNIScommon.AnimFilecc>.Enumerator enumerator1;
      try
      {
        enumerator1 = FNIScommon1.FNIScommon.AnimFileList.GetEnumerator();
        while (enumerator1.MoveNext())
        {
          FNIScommon1.FNIScommon.AnimFilecc current = enumerator1.Current;
          if (FNIScommon1.FNIScommon.DebugOutput > 1)
            FNIScommon1.FNIScommon.LogOutput("YYY AnimList actor animfile_ID modname animfile:" + current.actor.ToString() + " " + current.animfile_ID.ToString() + " " + current.modname + " " + current.animfile + " ", false, true);
        }
      }
      finally
      {
        enumerator1.Dispose();
      }
      if (action == 1 | action == 3)
      {
        if (FNIScommon1.FNIScommon.MRD_DataListONE.Count <= 0)
          return;
        string[] strArray = new string[10001];
        List<FNIScommon1.FNIScommon.MRD_Data>.Enumerator enumerator2;
        try
        {
          enumerator2 = FNIScommon1.FNIScommon.MRD_DataListONE.GetEnumerator();
          while (enumerator2.MoveNext())
          {
            FNIScommon1.FNIScommon.MRD_Data current1 = enumerator2.Current;
            bool flag;
            int animfileId;
            if (current1.firstOfBlock)
            {
              flag = true;
              uint num2 = current1.anim_crc32;
              List<FNIScommon1.FNIScommon.AnimFilecc>.Enumerator enumerator3;
              try
              {
                enumerator3 = FNIScommon1.FNIScommon.AnimFileList.GetEnumerator();
                while (enumerator3.MoveNext())
                {
                  FNIScommon1.FNIScommon.AnimFilecc current2 = enumerator3.Current;
                  uint animfileCrc = current2.animfile_crc;
                  if (FNIScommon1.FNIScommon.MyBO == current2.actor & (int) num2 == (int) animfileCrc)
                  {
                    animfileId = current2.animfile_ID;
                    if (current2.animfile_ID < FNIScommon1.FNIScommon.BO_DefaultAnims[FNIScommon1.FNIScommon.MyBO] | (uint) Operators.CompareString(strArray[animfileId], "", false) > 0U)
                    {
                      FNIScommon1.FNIScommon.LogOutput("WARNING: Motion Data (MD/RD) multiply defined for " + current2.animfile + ". Mods " + current2.modname + " and " + FNIScommon1.FNIScommon.MyMod[current1.modId], true, true);
                      flag = false;
                    }
                    strArray[animfileId] = current2.modname;
                    num2 = num2;
                  }
                }
              }
              finally
              {
                enumerator3.Dispose();
              }
              if (flag)
              {
                // ISSUE: variable of a reference type
                int& local;
                // ISSUE: explicit reference operation
                // ISSUE: explicit reference operation
                int num3 = checked (^(local = @FNIScommon1.FNIScommon.MRD_BO_nAnims[FNIScommon1.FNIScommon.MyBO]) + 1);
                // ISSUE: explicit reference operation
                ^local = num3;
              }
            }
            if (flag)
            {
              current1.currAnim = animfileId;
              FNIScommon1.FNIScommon.MRD_DataListALL.Add(current1);
              // ISSUE: variable of a reference type
              int& local;
              // ISSUE: explicit reference operation
              // ISSUE: explicit reference operation
              int num2 = checked (^(local = @FNIScommon1.FNIScommon.MRD_BO_nMRD[FNIScommon1.FNIScommon.MyBO]) + 1);
              // ISSUE: explicit reference operation
              ^local = num2;
            }
          }
        }
        finally
        {
          enumerator2.Dispose();
        }
        FNIScommon1.FNIScommon.MRD_DataListONE.Clear();
      }
      else if (action == 4 | action == 5)
      {
        FNIScommon1.FNIScommon.LogOutput(Conversion.Str((object) num1) + " " + FNIScommon1.FNIScommon.tMsgu[16] + " Animations\\" + PathToAnimsShort, true, true);
        FNIScommon1.FNIScommon.WriteAFile(Outfile, ref DefaultArray, NoElem);
      }
      else
      {
        if (!(action == 6 | action == 7))
          return;
        FNIScommon1.FNIScommon.LogOutput(Conversion.Str((object) num1) + " " + FNIScommon1.FNIScommon.tMsgu[16] + "Animations\\ " + PathToAnimsShort, true, true);
        int num2 = 0;
        int index1 = 0;
        List<string>.Enumerator enumerator2;
        try
        {
          enumerator2 = stringList.GetEnumerator();
          while (enumerator2.MoveNext())
          {
            string current = enumerator2.Current;
            if (!flagArray[index1])
            {
              FNIScommon1.FNIScommon.LogOutput(FNIScommon1.FNIScommon.tMsgu[14] + ": Animations\\" + PathToAnimsShort + "\\" + current, false, true);
              checked { ++num2; }
            }
            checked { ++index1; }
          }
        }
        finally
        {
          enumerator2.Dispose();
        }
        if (num2 > 0)
          FNIScommon1.FNIScommon.WriteWarning(Conversion.Str((object) num2) + " " + Strings.Replace(FNIScommon1.FNIScommon.tWarn[9], "<1>", PathToAnimsShort, 1, -1, CompareMethod.Binary));
        FNIScommon1.FNIScommon.WriteAFile(Outfile, ref DefaultArray, NoElem);
      }
    }

    [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
    public void Read_PatchAFNames()
    {
      int num1;
      int num2;
      try
      {
        string str1 = "PatchAnimationFiles.txt";
        string str2 = "";
        string Right = "";
        if (!MyProject.Computer.FileSystem.FileExists(str1))
        {
          FNIScommon1.FNIScommon.ErrString = str1;
          Information.Err().Raise(2001, (object) null, (object) null, (object) null, (object) null);
        }
        string[] strArray1 = FNIScommon1.FNIScommon.ReadAFile(str1);
        ProjectData.ClearProjectError();
        num1 = 2;
        string[] strArray2 = strArray1;
        int index1 = 0;
        int num3;
        while (index1 < strArray2.Length)
        {
          string str3 = strArray2[index1];
          checked { ++num3; }
          int num4 = Strings.InStr(str3, "'", CompareMethod.Binary);
          if (num4 > 0)
            str3 = Strings.Left(str3, checked (num4 - 1));
          string str4 = str3.Replace("\t", " ").Replace("  ", " ");
          if (!(Operators.CompareString(str4, "", false) == 0 | Operators.CompareString(str4, " ", false) == 0))
          {
            string[] strArray3 = Strings.Split(str4, " ", -1, CompareMethod.Binary);
            if (Information.UBound((Array) strArray3, 1) < 3)
              Information.Err().Raise(1, (object) null, (object) null, (object) null, (object) null);
            bool flag1;
            bool flag2;
            if (Operators.CompareString(strArray3[0], str2, false) == 0)
            {
              flag2 = flag1;
            }
            else
            {
              str2 = strArray3[0];
              if (Operators.CompareString(str2, "*", false) == 0)
                flag2 = true;
              else if (Operators.CompareString(str2, "*FNIS_AA", false) == 0)
                flag2 = (long) FNIScommon1.FNIScommon.isAAbehavior > 0L;
              else if (Operators.CompareString(Strings.Left(str2, 1), "*", false) == 0)
              {
                int num5 = checked (FNIScommon1.FNIScommon.PatchCount - 1);
                int index2 = 0;
                while (index2 <= num5)
                {
                  if (Operators.CompareString(FNIScommon1.FNIScommon.PatchID[index2], Strings.Mid(str2, 2), false) == 0)
                  {
                    flag2 = FNIScommon1.FNIScommon.isPatch[index2];
                    index2 = FNIScommon1.FNIScommon.PatchCount;
                  }
                  checked { ++index2; }
                }
              }
              else
                flag2 = MyProject.Computer.FileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\animations\\" + str2);
              flag1 = flag2;
            }
            if (flag2)
            {
              string[] strArray4 = Strings.Split(strArray3[1], "/", -1, CompareMethod.Binary);
              int num5 = Information.UBound((Array) strArray4, 1);
              int index2 = 0;
              while (index2 <= num5)
              {
                if (Operators.CompareString(strArray4[index2], "1", false) == 0)
                  FNIScommon1.FNIScommon.PatchAF[FNIScommon1.FNIScommon.iPatchAF].inDefault = true;
                else if (Operators.CompareString(strArray4[index2], "2", false) == 0)
                  FNIScommon1.FNIScommon.PatchAF[FNIScommon1.FNIScommon.iPatchAF].inADSF = true;
                else if (Operators.CompareString(strArray4[index2], "3", false) == 0)
                  FNIScommon1.FNIScommon.PatchAF[FNIScommon1.FNIScommon.iPatchAF].inASDSF = true;
                else
                  Information.Err().Raise(1, (object) null, (object) null, (object) null, (object) null);
                checked { ++index2; }
              }
              if (Strings.InStr(strArray3[2], "..", CompareMethod.Binary) > 0)
                Information.Err().Raise(1, (object) null, (object) null, (object) null, (object) null);
              if (Operators.CompareString(strArray3[2], Right, false) != 0)
              {
                if (MyProject.Computer.FileSystem.DirectoryExists("..\\..\\meshes\\actors\\character\\animations\\" + strArray3[2]))
                  Right = strArray3[2];
                else
                  goto label_44;
              }
              FNIScommon1.FNIScommon.PatchAF[FNIScommon1.FNIScommon.iPatchAF].path = Right;
              if (MyProject.Computer.FileSystem.FileExists("..\\..\\meshes\\actors\\character\\animations\\" + Right + "\\" + strArray3[3]))
              {
                FNIScommon1.FNIScommon.PatchAF[FNIScommon1.FNIScommon.iPatchAF].name = strArray3[3];
                if (FNIScommon1.FNIScommon.PatchAF[FNIScommon1.FNIScommon.iPatchAF].inADSF)
                {
                  if (Information.UBound((Array) strArray3, 1) < 4)
                    Information.Err().Raise(1, (object) null, (object) null, (object) null, (object) null);
                  else
                    FNIScommon1.FNIScommon.PatchAF[FNIScommon1.FNIScommon.iPatchAF].ClipGenName = strArray3[4];
                }
                checked { ++FNIScommon1.FNIScommon.iPatchAF; }
              }
            }
          }
label_44:
          checked { ++index1; }
        }
        FNIScommon1.FNIScommon.nPatchAF[1] = 0;
        FNIScommon1.FNIScommon.nPatchAF[2] = 0;
        FNIScommon1.FNIScommon.nPatchAF[3] = 0;
        int num6 = checked (FNIScommon1.FNIScommon.iPatchAF - 1);
        int index3 = 0;
        while (index3 <= num6)
        {
          if (FNIScommon1.FNIScommon.PatchAF[index3].inDefault)
          {
            // ISSUE: variable of a reference type
            int& local;
            // ISSUE: explicit reference operation
            // ISSUE: explicit reference operation
            int num4 = checked (^(local = @FNIScommon1.FNIScommon.nPatchAF[1]) + 1);
            // ISSUE: explicit reference operation
            ^local = num4;
          }
          if (FNIScommon1.FNIScommon.PatchAF[index3].inADSF)
          {
            // ISSUE: variable of a reference type
            int& local;
            // ISSUE: explicit reference operation
            // ISSUE: explicit reference operation
            int num4 = checked (^(local = @FNIScommon1.FNIScommon.nPatchAF[2]) + 1);
            // ISSUE: explicit reference operation
            ^local = num4;
          }
          if (FNIScommon1.FNIScommon.PatchAF[index3].inASDSF)
          {
            // ISSUE: variable of a reference type
            int& local;
            // ISSUE: explicit reference operation
            // ISSUE: explicit reference operation
            int num4 = checked (^(local = @FNIScommon1.FNIScommon.nPatchAF[3]) + 1);
            // ISSUE: explicit reference operation
            ^local = num4;
          }
          checked { ++index3; }
        }
        goto label_61;
label_56:
        num2 = -1;
        switch (num1)
        {
          case 2:
            FNIScommon1.FNIScommon.ErrString = Conversion.Str((object) num3) + " PatchAnimationFiles.txt";
            Information.Err().Raise(2015, (object) null, (object) null, (object) null, (object) null);
            goto label_61;
        }
      }
      catch (Exception ex) when (ex is Exception & (uint) num1 > 0U & num2 == 0)
      {
        ProjectData.SetProjectError(ex);
        goto label_56;
      }
      throw ProjectData.CreateProjectError(-2146828237);
label_61:
      if (num2 == 0)
        return;
      ProjectData.ClearProjectError();
    }

    public void ConsistenceCheck()
    {
      int num1 = 0;
      FNIScommon1.FNIScommon.LogFile = new StreamWriter("temporary_logs\\GenerateFNIS_LogFile.txt", true);
      if (FNIScommon1.FNIScommon.DebugOutput > 1)
        FNIScommon1.FNIScommon.LogFile.AutoFlush = true;
      FNIScommon1.FNIScommon.LogOpen = true;
      FNIScommon1.FNIScommon.LogOutput("", true, true);
      int num2 = -1;
      string str1 = "";
      string Replacement1 = "";
      List<FNIScommon1.FNIScommon.AEcc> aeList = FNIScommon1.FNIScommon.AEList;
      Comparison<FNIScommon1.FNIScommon.AEcc> comparison1;
      // ISSUE: reference to a compiler-generated field
      if (GenerateFNISUsers._Closure\u0024__.\u0024I46\u002D0 != null)
      {
        // ISSUE: reference to a compiler-generated field
        comparison1 = GenerateFNISUsers._Closure\u0024__.\u0024I46\u002D0;
      }
      else
      {
        // ISSUE: reference to a compiler-generated field
        GenerateFNISUsers._Closure\u0024__.\u0024I46\u002D0 = comparison1 = (Comparison<FNIScommon1.FNIScommon.AEcc>) ((x, y) => x.comp.CompareTo(y.comp));
      }
      aeList.Sort(comparison1);
      List<FNIScommon1.FNIScommon.AEcc>.Enumerator enumerator1;
      try
      {
        enumerator1 = FNIScommon1.FNIScommon.AEList.GetEnumerator();
        while (enumerator1.MoveNext())
        {
          FNIScommon1.FNIScommon.AEcc current = enumerator1.Current;
          int actor = current.actor;
          string Left = Strings.LCase(current.AE);
          int num3 = num2;
          if (actor == num3 && Operators.CompareString(Left, Strings.LCase(str1), false) == 0)
          {
            FNIScommon1.FNIScommon.LogOutput(Strings.Replace(Strings.Replace(Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[23], "<1>", current.AE, 1, -1, CompareMethod.Binary), "<2>", FNIScommon1.FNIScommon.BO_List[current.actor], 1, -1, CompareMethod.Binary), "<3>", Replacement1, 1, -1, CompareMethod.Binary), "<4>", current.modname, 1, -1, CompareMethod.Binary), true, true);
            checked { ++num1; }
          }
          num2 = current.actor;
          str1 = current.AE;
          Replacement1 = current.modname;
        }
      }
      finally
      {
        enumerator1.Dispose();
      }
      List<FNIScommon1.FNIScommon.AnimFilecc>.Enumerator enumerator2;
      try
      {
        enumerator2 = FNIScommon1.FNIScommon.AnimFileList.GetEnumerator();
        while (enumerator2.MoveNext())
        {
          FNIScommon1.FNIScommon.AnimFilecc current = enumerator2.Current;
          if (!current.isbsa && !MyProject.Computer.FileSystem.FileExists(current.animpath + current.modname + "\\" + current.animfile))
          {
            FNIScommon1.FNIScommon.LogOutput(Strings.Replace(Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[19], "<1>", current.animfile, 1, -1, CompareMethod.Binary), "<2>", FNIScommon1.FNIScommon.BO_List[current.actor], 1, -1, CompareMethod.Binary), "<3>", current.modname, 1, -1, CompareMethod.Binary), true, true);
            checked { ++num1; }
          }
        }
      }
      finally
      {
        enumerator2.Dispose();
      }
      int num4 = -1;
      string str2 = "";
      string Replacement2 = "";
      List<FNIScommon1.FNIScommon.AnimFilecc> animFileList = FNIScommon1.FNIScommon.AnimFileList;
      Comparison<FNIScommon1.FNIScommon.AnimFilecc> comparison2;
      // ISSUE: reference to a compiler-generated field
      if (GenerateFNISUsers._Closure\u0024__.\u0024I46\u002D1 != null)
      {
        // ISSUE: reference to a compiler-generated field
        comparison2 = GenerateFNISUsers._Closure\u0024__.\u0024I46\u002D1;
      }
      else
      {
        // ISSUE: reference to a compiler-generated field
        GenerateFNISUsers._Closure\u0024__.\u0024I46\u002D1 = comparison2 = (Comparison<FNIScommon1.FNIScommon.AnimFilecc>) ((x, y) => x.comp.CompareTo(y.comp));
      }
      animFileList.Sort(comparison2);
      List<FNIScommon1.FNIScommon.AnimFilecc>.Enumerator enumerator3;
      try
      {
        enumerator3 = FNIScommon1.FNIScommon.AnimFileList.GetEnumerator();
        while (enumerator3.MoveNext())
        {
          FNIScommon1.FNIScommon.AnimFilecc current = enumerator3.Current;
          if (current.actor == num4 & Operators.CompareString(Strings.LCase(current.animfile), Strings.LCase(str2), false) == 0)
          {
            FNIScommon1.FNIScommon.LogOutput(Strings.Replace(Strings.Replace(Strings.Replace(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[18], "<1>", current.animfile, 1, -1, CompareMethod.Binary), "<2>", FNIScommon1.FNIScommon.BO_List[current.actor], 1, -1, CompareMethod.Binary), "<3>", Replacement2, 1, -1, CompareMethod.Binary), "<4>", current.modname, 1, -1, CompareMethod.Binary), true, true);
            checked { ++num1; }
          }
          num4 = current.actor;
          str2 = current.animfile;
          Replacement2 = current.modname;
        }
      }
      finally
      {
        enumerator3.Dispose();
      }
      FNIScommon1.FNIScommon.LogOutput(Strings.Replace(FNIScommon1.FNIScommon.tMsgu[30], "<1>", Conversion.Str((object) num1), 1, -1, CompareMethod.Binary), true, true);
      FNIScommon1.FNIScommon.FinishSub();
    }

    public void MyHandler(object sender, UnhandledExceptionEventArgs args)
    {
      int num = (int) Interaction.MsgBox((object) ("FNIS generator caught unhandled exception : " + ((Exception) args.ExceptionObject).Message), MsgBoxStyle.OkOnly, (object) null);
    }

    private void RichTextBox1_LinkClicked(object sender, LinkClickedEventArgs e)
    {
      Process.Start(e.LinkText);
    }

    private void FNISSM2_RichTextBox_LinkClicked(object sender, LinkClickedEventArgs e)
    {
      Process.Start(e.LinkText);
    }

    [DebuggerNonUserCode]
    protected override void Dispose(bool disposing)
    {
      try
      {
        if (!disposing || this.components == null)
          return;
        this.components.Dispose();
      }
      finally
      {
        base.Dispose(disposing);
      }
    }

    [DebuggerStepThrough]
    private void InitializeComponent()
    {
      ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (GenerateFNISUsers));
      this.TextBox1 = new TextBox();
      this.Button1 = new Button();
      this.Button2 = new Button();
      this.Button3 = new Button();
      this.Patch_ListBox = new CheckedListBox();
      this.PatchList_Header = new TextBox();
      this.TextBox2 = new TextBox();
      this.LanguageBox = new ComboBox();
      this.Button5 = new Button();
      this.RichTextBox1 = new RichTextBox();
      this.RichTextBox2 = new RichTextBox();
      this.SuspendLayout();
      this.TextBox1.Font = new Font("Microsoft Sans Serif", 8f);
      this.TextBox1.ForeColor = SystemColors.WindowText;
      this.TextBox1.Location = new Point(8, 52);
      this.TextBox1.Multiline = true;
      this.TextBox1.Name = "TextBox1";
      this.TextBox1.ScrollBars = ScrollBars.Vertical;
      this.TextBox1.Size = new Size(510, 280);
      this.TextBox1.TabIndex = 2;
      this.TextBox1.Text = componentResourceManager.GetString("TextBox1.Text");
      this.Button1.BackColor = Color.Gold;
      this.Button1.Font = new Font("Microsoft Sans Serif", 10f, FontStyle.Bold);
      this.Button1.Location = new Point(50, 352);
      this.Button1.Name = "Button1";
      this.Button1.Size = new Size(428, 34);
      this.Button1.TabIndex = 1;
      this.Button1.Text = "Update FNIS Behavior";
      this.Button1.UseVisualStyleBackColor = false;
      this.Button2.Enabled = false;
      this.Button2.FlatStyle = FlatStyle.System;
      this.Button2.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
      this.Button2.Location = new Point(8, 407);
      this.Button2.Name = "Button2";
      this.Button2.Size = new Size(146, 34);
      this.Button2.TabIndex = 2;
      this.Button2.Text = "Consistence Check";
      this.Button2.UseVisualStyleBackColor = true;
      this.Button3.FlatAppearance.BorderColor = Color.White;
      this.Button3.FlatAppearance.MouseDownBackColor = Color.White;
      this.Button3.FlatStyle = FlatStyle.System;
      this.Button3.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Bold, GraphicsUnit.Point, (byte) 0);
      this.Button3.Location = new Point(342, 407);
      this.Button3.Name = "Button3";
      this.Button3.Size = new Size(175, 34);
      this.Button3.TabIndex = 3;
      this.Button3.Text = "Exit";
      this.Button3.UseVisualStyleBackColor = true;
      this.Patch_ListBox.BackColor = Color.LemonChiffon;
      this.Patch_ListBox.BorderStyle = BorderStyle.None;
      this.Patch_ListBox.CheckOnClick = true;
      this.Patch_ListBox.Enabled = false;
      this.Patch_ListBox.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
      this.Patch_ListBox.FormattingEnabled = true;
      this.Patch_ListBox.Location = new Point(8, 496);
      this.Patch_ListBox.Name = "Patch_ListBox";
      this.Patch_ListBox.Size = new Size(510, 195);
      this.Patch_ListBox.TabIndex = 4;
      this.PatchList_Header.BackColor = Color.LemonChiffon;
      this.PatchList_Header.BorderStyle = BorderStyle.None;
      this.PatchList_Header.Enabled = false;
      this.PatchList_Header.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Bold, GraphicsUnit.Point, (byte) 0);
      this.PatchList_Header.Location = new Point(8, 457);
      this.PatchList_Header.MinimumSize = new Size(510, 16);
      this.PatchList_Header.Multiline = true;
      this.PatchList_Header.Name = "PatchList_Header";
      this.PatchList_Header.Size = new Size(510, 18);
      this.PatchList_Header.TabIndex = 5;
      this.PatchList_Header.Text = "Available Patches  (DON'T tick if unknown!)";
      this.PatchList_Header.TextAlign = HorizontalAlignment.Center;
      this.TextBox2.BackColor = Color.LemonChiffon;
      this.TextBox2.BorderStyle = BorderStyle.None;
      this.TextBox2.Enabled = false;
      this.TextBox2.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Bold, GraphicsUnit.Point, (byte) 0);
      this.TextBox2.ForeColor = Color.Chocolate;
      this.TextBox2.Location = new Point(8, 475);
      this.TextBox2.Multiline = true;
      this.TextBox2.Name = "TextBox2";
      this.TextBox2.Size = new Size(510, 20);
      this.TextBox2.TabIndex = 6;
      this.TextBox2.Text = "* Patch requires additional files (animations, etc.) from original mod";
      this.TextBox2.TextAlign = HorizontalAlignment.Center;
      this.LanguageBox.DropDownStyle = ComboBoxStyle.DropDownList;
      this.LanguageBox.FormattingEnabled = true;
      this.LanguageBox.Location = new Point(370, 23);
      this.LanguageBox.MinimumSize = new Size(4, 0);
      this.LanguageBox.Name = "LanguageBox";
      this.LanguageBox.Size = new Size(149, 21);
      this.LanguageBox.TabIndex = 7;
      this.Button5.Enabled = false;
      this.Button5.FlatStyle = FlatStyle.System;
      this.Button5.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
      this.Button5.Location = new Point(171, 407);
      this.Button5.Name = "Button5";
      this.Button5.Size = new Size(146, 34);
      this.Button5.TabIndex = 9;
      this.Button5.Text = "De-Install Creatures";
      this.Button5.UseVisualStyleBackColor = true;
      this.RichTextBox1.BackColor = Color.Chocolate;
      this.RichTextBox1.BorderStyle = BorderStyle.None;
      this.RichTextBox1.ForeColor = Color.White;
      this.RichTextBox1.Location = new Point(8, 3);
      this.RichTextBox1.Name = "RichTextBox1";
      this.RichTextBox1.Size = new Size(350, 43);
      this.RichTextBox1.TabIndex = 10;
      this.RichTextBox1.Text = "FNIS: http://www.nexusmods.com/skyrim/mods/11811\nFNIS Sexy Move: http://www.nexusmods.com/skyrim/mods/54521\nFNIS PCEA2: http://www.nexusmods.com/skyrim/mods/71055";
      this.RichTextBox2.BackColor = Color.Goldenrod;
      this.RichTextBox2.BorderStyle = BorderStyle.None;
      this.RichTextBox2.ForeColor = Color.White;
      this.RichTextBox2.Location = new Point(8, 3);
      this.RichTextBox2.Name = "RichTextBox2";
      this.RichTextBox2.ScrollBars = RichTextBoxScrollBars.None;
      this.RichTextBox2.Size = new Size(360, 43);
      this.RichTextBox2.TabIndex = 14;
      this.RichTextBox2.Text = componentResourceManager.GetString("RichTextBox2.Text");
      this.RichTextBox2.WordWrap = false;
      this.AutoScaleDimensions = new SizeF(6f, 13f);
      this.AutoScaleMode = AutoScaleMode.Font;
      this.BackColor = Color.Chocolate;
      this.ClientSize = new Size(530, 697);
      this.Controls.Add((Control) this.RichTextBox2);
      this.Controls.Add((Control) this.Button5);
      this.Controls.Add((Control) this.LanguageBox);
      this.Controls.Add((Control) this.TextBox2);
      this.Controls.Add((Control) this.PatchList_Header);
      this.Controls.Add((Control) this.Patch_ListBox);
      this.Controls.Add((Control) this.Button3);
      this.Controls.Add((Control) this.Button2);
      this.Controls.Add((Control) this.Button1);
      this.Controls.Add((Control) this.TextBox1);
      this.Controls.Add((Control) this.RichTextBox1);
      this.Font = new Font("Microsoft Sans Serif", 8.5f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
      this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
      this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
      this.Name = "GenerateFNISUsers";
      this.Text = "Generate FNIS for Users";
      this.ResumeLayout(false);
      this.PerformLayout();
    }

    public struct CustomPreCache
    {
      public uint refpath_crc;
      public uint reffile_crc;
      public int refnumber1;
      public int refnumber2;
      public int refcount;
      public uint custompath_crc;
      public int nCustomAnims;
      public int indexCustomAnims;
    }

    public struct PCEAgenderFileData
    {
      public uint crc;
      public string name;
      public bool isGender_F;
      public bool isGender_M;
      public bool isPCEA_F;
      public bool isPCEA_M;
    }
  }
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download