Exemple #1
0
        private void reloadFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F_Base file = FileProcessor.ProcessFile(TabControl.Tabs[tabControl1.SelectedIndex].File.FilePath);

            TabControl.ReloadTab(file);
            SessionManager.GCC();
        }
Exemple #2
0
        private void validateSaveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                SessionManager.Report("Writing to save...", SessionManager.RType.DEBUG);
                SaveFile(TabControl.Tabs[tabControl1.SelectedIndex].File.FilePath);
            }
            F_NGN loadedNGN = (F_NGN)TabControl.Tabs[tabControl1.SelectedIndex].File;
            F_NGN validater = (F_NGN)FileProcessor.ProcessFile(TabControl.Tabs[tabControl1.SelectedIndex].File.FilePath);

            SessionManager.Report("Validating save file...", SessionManager.RType.DEBUG);
            for (int i = 0; i < loadedNGN.Schema.NGNFunctions.Count; i++)
            {
                bool val = loadedNGN.Schema.NGNFunctions[i].FunctionOffset == validater.Schema.NGNFunctions[i].FunctionOffset;
                SessionManager.Report(Enum.GetName(typeof(F_NGN.NGNFunction), loadedNGN.Schema.NGNFunctions[i].FunctionType) + ((val) ? " successfully validated" : " did not validate succesfully"), ((val) ? SessionManager.RType.DEBUG : SessionManager.RType.WARN));//, Color.DarkGreen);
            }
        }
Exemple #3
0
 public void OpenFile(string path = "")
 {
     if (path == "")
     {
         OpenFileDialog OFD = new OpenFileDialog {
             Filter = "T2T Files | *.NGN;*.SAV|Level File | *.NGN|Save File | *.SAV|All files (*.*)|*.*"
         };
         if (OFD.ShowDialog() == DialogResult.OK)
         {
             path = OFD.FileName;
         }
     }
     if (path != "")
     {
         firstOpenPanel1.Visible = false;
         tabControl1.Visible     = true;
         TabControl.CreateTab(FileProcessor.ProcessFile(path));
     }
 }