forked from Pveska/CreatureScriptsParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainForm.cs
More file actions
59 lines (52 loc) · 1.85 KB
/
MainForm.cs
File metadata and controls
59 lines (52 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CreatureScriptsParser
{
public partial class MainForm : Form
{
private Creator creator;
private Parsers parsers;
public MainForm()
{
InitializeComponent();
}
private void toolStripButton_ImportSniff_Click(object sender, EventArgs e)
{
OpenFileDialog();
}
private void OpenFileDialog()
{
openFileDialog.Title = "Open File";
openFileDialog.Filter = "Parsed Sniff or Data File (*.txt;*.dat)|*.txt;*.dat";
openFileDialog.FilterIndex = 1;
openFileDialog.ShowReadOnly = false;
openFileDialog.Multiselect = false;
openFileDialog.CheckFileExists = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
parsers = new Parsers(this);
Dbc.Dbc.Load();
if (openFileDialog.FileName.Contains("txt"))
{
creator = new Creator(this, parsers.GetPacketsFromSniffFile(openFileDialog.FileName, checkBox_CreateDataFile.Checked));
}
else if (openFileDialog.FileName.Contains("dat"))
{
creator = new Creator(this, parsers.GetPacketsFromDataFile(openFileDialog.FileName));
}
toolStripStatusLabel_FileStatus.Text = openFileDialog.FileName + " is selected for input.";
}
}
private void toolStripButton_Search_Click(object sender, EventArgs e)
{
creator.CreateScriptsForCreatureWithGuid(toolStripTextBox_CreatureGuid.Text);
}
}
}