Esempio n. 1
0
 internal DebugEditor(EditorConnection connection)
 {
     InitializeComponent();
     this.connection = connection;
     mode            = Mode.Globals;
     if (File.Exists("globals.txt"))
     {
         StreamReader sr = new StreamReader("globals.txt");
         while (!sr.EndOfStream)
         {
             string[] line = sr.ReadLine().Split(' ');
             GlobNames[int.Parse(line[0])] = line[1];
         }
         sr.Close();
     }
     if (File.Exists("critters.txt"))
     {
         StreamReader sr = new StreamReader("critters.txt");
         while (!sr.EndOfStream)
         {
             string line = sr.ReadLine();
             CritNames[uint.Parse(line.Remove(line.IndexOf(' ')))] = line.Substring(line.IndexOf(' ') + 1);
         }
         sr.Close();
     }
     Redraw();
 }
Esempio n. 2
0
 internal DebugEditor(EditorConnection connection)
 {
     InitializeComponent();
     this.connection = connection;
     mode            = Mode.Globals;
     if (File.Exists(".\\data\\data\\vault13.gam"))
     {
         StreamReader sr   = new StreamReader(".\\data\\data\\vault13.gam");
         int          gvar = 0;
         while (!sr.EndOfStream)
         {
             string line = sr.ReadLine().TrimStart();
             if (line.StartsWith("GVAR_"))
             {
                 GlobNames[gvar++] = line.Remove(line.IndexOf(':')).TrimEnd();
             }
         }
         sr.Close();
     }
     else if (File.Exists("globals.txt"))
     {
         StreamReader sr = new StreamReader("globals.txt");
         while (!sr.EndOfStream)
         {
             string[] line = sr.ReadLine().Split(' ');
             GlobNames[int.Parse(line[0])] = line[1];
         }
         sr.Close();
     }
     if (File.Exists("critters.txt"))
     {
         StreamReader sr = new StreamReader("critters.txt");
         while (!sr.EndOfStream)
         {
             string line = sr.ReadLine();
             CritNames[uint.Parse(line.Remove(line.IndexOf(' ')))] = line.Substring(line.IndexOf(' ') + 1);
         }
         sr.Close();
     }
     Redraw();
     redrawTimer.Start();
 }