private void toolStripButton_ImportSniff_Click(object sender, EventArgs e) { creatureScriptsCreator.OpenFileDialog(); if (openFileDialog.ShowDialog() == DialogResult.OK) { creatureScriptsCreator.ImportStarted(); if (IsTxtFileValidForParse(openFileDialog.FileName) && creatureScriptsCreator.GetDataFromSniffFile(openFileDialog.FileName)) { creatureScriptsCreator.ImportSuccessful(); } else { toolStripStatusLabel_CurrentAction.Text = ""; toolStripStatusLabel_FileStatus.Text = "No File Loaded"; toolStripButton_CSC_ImportSniff.Enabled = true; this.Cursor = Cursors.Default; } } }
private void toolStripButton_ImportSniff_Click(object sender, EventArgs e) { creatureScriptsCreator.OpenFileDialog(); if (openFileDialog.ShowDialog() == DialogResult.OK) { creatureScriptsCreator.ImportStarted(); if (!DBC.DBC.IsLoaded()) { SetCurrentStatus("Loading DBC..."); DBC.DBC.Load(); } if (openFileDialog.FileName.Contains("txt")) { if (IsTxtFileValidForParse(openFileDialog.FileName) && creatureScriptsCreator.GetDataFromSniffFile(openFileDialog.FileName)) { creatureScriptsCreator.ImportSuccessful(); } else { toolStripStatusLabel_CurrentAction.Text = ""; toolStripStatusLabel_FileStatus.Text = "No File Loaded"; toolStripButton_CSC_ImportSniff.Enabled = true; Cursor = Cursors.Default; } } else if (openFileDialog.FileName.Contains("dat")) { if (creatureScriptsCreator.GetPacketsFromDataFile(openFileDialog.FileName)) { creatureScriptsCreator.ImportSuccessful(); } } } }