commit ecb2492f45776e01ad92eb57eb0dd5036a54c880 Author: AlexBolotsin Date: Tue May 10 00:08:13 2011 +0300 Add button to search DBC files diff --git a/SpellWork/DBC/DBC.cs b/SpellWork/DBC/DBC.cs index 5e65ed9..c4197e1 100644 --- a/SpellWork/DBC/DBC.cs +++ b/SpellWork/DBC/DBC.cs @@ -5,7 +5,7 @@ namespace SpellWork public static class DBC { public const string VERSION = "SpellWork 3.3.5a (12340)"; - public const string DBC_PATH = @"dbc"; + public static string DBC_PATH = @"dbc"; public const int MAX_DBC_LOCALE = 16; public const int MAX_EFFECT_INDEX = 3; diff --git a/SpellWork/DBC/DBCReader.cs b/SpellWork/DBC/DBCReader.cs index 11a1c56..30f4ed2 100644 --- a/SpellWork/DBC/DBCReader.cs +++ b/SpellWork/DBC/DBCReader.cs @@ -8,7 +8,7 @@ namespace SpellWork { static class DBCReader { - public static unsafe Dictionary ReadDBC(Dictionary strDict) where T : struct + public static unsafe Dictionary ReadDBC(Dictionary strDict = null) where T : struct { Dictionary dict = new Dictionary(); String fileName = Path.Combine(DBC.DBC_PATH, typeof(T).Name + ".dbc").Replace("Entry", String.Empty); diff --git a/SpellWork/Forms/FormDirChose.Designer.cs b/SpellWork/Forms/FormDirChose.Designer.cs new file mode 100644 index 0000000..18e8063 --- /dev/null +++ b/SpellWork/Forms/FormDirChose.Designer.cs @@ -0,0 +1,74 @@ +namespace SpellWork +{ + partial class DBCSearchingFrom + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pathToDBC = new System.Windows.Forms.TextBox(); + this.sendInfo = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // textBox1 + // + this.pathToDBC.Location = new System.Drawing.Point(13, 12); + this.pathToDBC.Name = "Path Box"; + this.pathToDBC.Size = new System.Drawing.Size(358, 20); + this.pathToDBC.TabIndex = 0; + this.pathToDBC.TextChanged += new System.EventHandler(this.textBox1_TextChanged); + // + // sendInfo + // + this.sendInfo.Location = new System.Drawing.Point(296, 40); + this.sendInfo.Name = "Search"; + this.sendInfo.Size = new System.Drawing.Size(75, 23); + this.sendInfo.TabIndex = 1; + this.sendInfo.Text = "Search"; + this.sendInfo.UseVisualStyleBackColor = true; + this.sendInfo.Click += new System.EventHandler(this.button1_Click); + // + // DBCSearchingFrom + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(383, 75); + this.Controls.Add(this.sendInfo); + this.Controls.Add(this.pathToDBC); + this.Name = "Search for DBC"; + this.Text = "Chose directory includes DBC files"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.ShowIcon = false; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox pathToDBC; + private System.Windows.Forms.Button sendInfo; + } +} \ No newline at end of file diff --git a/SpellWork/Forms/FormDirChose.cs b/SpellWork/Forms/FormDirChose.cs new file mode 100644 index 0000000..0e30e2e --- /dev/null +++ b/SpellWork/Forms/FormDirChose.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace SpellWork +{ + public partial class DBCSearchingFrom : Form + { + bool inputHasBeenChanged; + + public DBCSearchingFrom() + { + InitializeComponent(); + + pathToDBC.Text = "There is not such file. Chose directory for looking."; + inputHasBeenChanged = false; + } + + private void textBox1_TextChanged(object sender, EventArgs e) + { + inputHasBeenChanged = true; + } + + private void button1_Click(object sender, EventArgs e) + { + if (inputHasBeenChanged) + { + StringBuilder sb = new StringBuilder(pathToDBC.Text); + sb.Append("\\spell.dbc"); + + if (File.Exists(sb.ToString())) + { + DBC.DBC_PATH = pathToDBC.Text; + Program.loader.Load(); + this.Close(); + } + else + { + throw new FileNotFoundException(); + } + } + else + { + Program.loader.Load(); + this.Close(); + } + } + } +} diff --git a/SpellWork/Forms/FormDirChose.resx b/SpellWork/Forms/FormDirChose.resx new file mode 100644 index 0000000..7080a7d --- /dev/null +++ b/SpellWork/Forms/FormDirChose.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SpellWork/Forms/FormMain.Designer.cs b/SpellWork/Forms/FormMain.Designer.cs index 44fc38a..4aef9ce 100644 --- a/SpellWork/Forms/FormMain.Designer.cs +++ b/SpellWork/Forms/FormMain.Designer.cs @@ -165,6 +165,7 @@ this.textBox2 = new System.Windows.Forms.TextBox(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.richTextBox2 = new System.Windows.Forms.RichTextBox(); + this.searchDBCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); @@ -250,6 +251,7 @@ // _tsmFile // this._tsmFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.searchDBCToolStripMenuItem, this._Connected, this._tsmSettings, this._tsmExit}); @@ -260,21 +262,21 @@ // _Connected // this._Connected.Name = "_Connected"; - this._Connected.Size = new System.Drawing.Size(132, 22); + this._Connected.Size = new System.Drawing.Size(152, 22); this._Connected.Text = "Connected"; this._Connected.Click += new System.EventHandler(this._Connected_Click); // // _tsmSettings // this._tsmSettings.Name = "_tsmSettings"; - this._tsmSettings.Size = new System.Drawing.Size(132, 22); + this._tsmSettings.Size = new System.Drawing.Size(152, 22); this._tsmSettings.Text = "Setting"; this._tsmSettings.Click += new System.EventHandler(this.Settings_Click); // // _tsmExit // this._tsmExit.Name = "_tsmExit"; - this._tsmExit.Size = new System.Drawing.Size(132, 22); + this._tsmExit.Size = new System.Drawing.Size(152, 22); this._tsmExit.Text = "Exit"; this._tsmExit.Click += new System.EventHandler(this.Exit_Click); // @@ -320,9 +322,9 @@ // // splitContainer1 // - this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; this.splitContainer1.Location = new System.Drawing.Point(3, 3); this.splitContainer1.Name = "splitContainer1"; @@ -366,9 +368,9 @@ // _lvSpellList // this._lvSpellList.AllowColumnReorder = true; - this._lvSpellList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._lvSpellList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._lvSpellList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.chSpellID, this.chSpellName}); @@ -398,8 +400,8 @@ // // _gSpellFilter // - this._gSpellFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._gSpellFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._gSpellFilter.BackColor = System.Drawing.Color.LightGray; this._gSpellFilter.Controls.Add(this._gbAdvansedSearch); this._gSpellFilter.Controls.Add(this._cbTarget2); @@ -416,8 +418,8 @@ // // _gbAdvansedSearch // - this._gbAdvansedSearch.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._gbAdvansedSearch.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._gbAdvansedSearch.Controls.Add(this._cbAdvancedFilter2CompareType); this._gbAdvansedSearch.Controls.Add(this._cbAdvancedFilter1CompareType); this._gbAdvansedSearch.Controls.Add(this._tbAdvancedFilter2Val); @@ -475,8 +477,8 @@ // // _cbAdvancedFilter2 // - this._cbAdvancedFilter2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbAdvancedFilter2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbAdvancedFilter2.DropDownHeight = 500; this._cbAdvancedFilter2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbAdvancedFilter2.FormattingEnabled = true; @@ -488,8 +490,8 @@ // // _cbAdvancedFilter1 // - this._cbAdvancedFilter1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbAdvancedFilter1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbAdvancedFilter1.DropDownHeight = 500; this._cbAdvancedFilter1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbAdvancedFilter1.FormattingEnabled = true; @@ -501,8 +503,8 @@ // // _cbTarget2 // - this._cbTarget2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbTarget2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbTarget2.DropDownHeight = 500; this._cbTarget2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbTarget2.DropDownWidth = 302; @@ -516,8 +518,8 @@ // // _cbTarget1 // - this._cbTarget1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbTarget1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbTarget1.DropDownHeight = 500; this._cbTarget1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbTarget1.DropDownWidth = 302; @@ -531,8 +533,8 @@ // // _cbSpellEffect // - this._cbSpellEffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbSpellEffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbSpellEffect.DropDownHeight = 500; this._cbSpellEffect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbSpellEffect.DropDownWidth = 302; @@ -546,8 +548,8 @@ // // _cbSpellAura // - this._cbSpellAura.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbSpellAura.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbSpellAura.DropDownHeight = 500; this._cbSpellAura.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbSpellAura.DropDownWidth = 302; @@ -561,8 +563,8 @@ // // _cbSpellFamilyName // - this._cbSpellFamilyName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbSpellFamilyName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbSpellFamilyName.DropDownHeight = 500; this._cbSpellFamilyName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbSpellFamilyName.DropDownWidth = 302; @@ -577,8 +579,8 @@ // // groupBox7 // - this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.groupBox7.BackColor = System.Drawing.Color.LightGray; this.groupBox7.Controls.Add(this.label6); this.groupBox7.Controls.Add(this.label5); @@ -634,8 +636,8 @@ // // _tbSearchAttributes // - this._tbSearchAttributes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._tbSearchAttributes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._tbSearchAttributes.Location = new System.Drawing.Point(73, 57); this._tbSearchAttributes.Name = "_tbSearchAttributes"; this._tbSearchAttributes.Size = new System.Drawing.Size(180, 20); @@ -644,8 +646,8 @@ // // _tbSearchIcon // - this._tbSearchIcon.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._tbSearchIcon.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._tbSearchIcon.Location = new System.Drawing.Point(73, 35); this._tbSearchIcon.Name = "_tbSearchIcon"; this._tbSearchIcon.Size = new System.Drawing.Size(180, 20); @@ -654,8 +656,8 @@ // // _tbSearchId // - this._tbSearchId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._tbSearchId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._tbSearchId.Location = new System.Drawing.Point(73, 13); this._tbSearchId.Name = "_tbSearchId"; this._tbSearchId.Size = new System.Drawing.Size(180, 20); @@ -716,8 +718,8 @@ // // groupBox5 // - this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.groupBox5.BackColor = System.Drawing.Color.WhiteSmoke; this.groupBox5.Controls.Add(this._clbProcFlags); this.groupBox5.Location = new System.Drawing.Point(3, 128); @@ -742,8 +744,8 @@ // // groupBox4 // - this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.groupBox4.BackColor = System.Drawing.Color.WhiteSmoke; this.groupBox4.Controls.Add(this._clbProcFlagEx); this.groupBox4.Location = new System.Drawing.Point(3, 60); @@ -768,8 +770,8 @@ // // _gSpellProcEvent // - this._gSpellProcEvent.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._gSpellProcEvent.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._gSpellProcEvent.BackColor = System.Drawing.Color.WhiteSmoke; this._gSpellProcEvent.Controls.Add(this._clbSchools); this._gSpellProcEvent.Controls.Add(this._cbProcFitstSpellFamily); @@ -892,8 +894,8 @@ // // _cbProcSpellFamilyTree // - this._cbProcSpellFamilyTree.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbProcSpellFamilyTree.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbProcSpellFamilyTree.DropDownHeight = 500; this._cbProcSpellFamilyTree.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbProcSpellFamilyTree.FormattingEnabled = true; @@ -906,9 +908,9 @@ // // _tvFamilyTree // - this._tvFamilyTree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._tvFamilyTree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._tvFamilyTree.CheckBoxes = true; this._tvFamilyTree.ImageIndex = 0; this._tvFamilyTree.ImageList = this._ilPro; @@ -972,9 +974,9 @@ // _lvProcSpellList // this._lvProcSpellList.AllowColumnReorder = true; - this._lvProcSpellList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._lvProcSpellList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._lvProcSpellList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this._chProcID, this._chProcName}); @@ -1016,8 +1018,8 @@ // // _tbProcSeach // - this._tbProcSeach.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._tbProcSeach.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._tbProcSeach.Location = new System.Drawing.Point(3, 3); this._tbProcSeach.Name = "_tbProcSeach"; this._tbProcSeach.Size = new System.Drawing.Size(207, 20); @@ -1039,8 +1041,8 @@ // // _cbProcTarget1 // - this._cbProcTarget1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbProcTarget1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbProcTarget1.DropDownHeight = 500; this._cbProcTarget1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbProcTarget1.FormattingEnabled = true; @@ -1053,8 +1055,8 @@ // // _cbProcSpellEffect // - this._cbProcSpellEffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbProcSpellEffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbProcSpellEffect.DropDownHeight = 500; this._cbProcSpellEffect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbProcSpellEffect.FormattingEnabled = true; @@ -1067,8 +1069,8 @@ // // _cbProcSpellAura // - this._cbProcSpellAura.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbProcSpellAura.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbProcSpellAura.DropDownHeight = 500; this._cbProcSpellAura.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbProcSpellAura.FormattingEnabled = true; @@ -1081,8 +1083,8 @@ // // _cbProcSpellFamilyName // - this._cbProcSpellFamilyName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._cbProcSpellFamilyName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._cbProcSpellFamilyName.DropDownHeight = 500; this._cbProcSpellFamilyName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._cbProcSpellFamilyName.FormattingEnabled = true; @@ -1186,9 +1188,9 @@ // // _rtbCompareSpell1 // - this._rtbCompareSpell1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._rtbCompareSpell1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._rtbCompareSpell1.BackColor = System.Drawing.Color.Gainsboro; this._rtbCompareSpell1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this._rtbCompareSpell1.Location = new System.Drawing.Point(0, 29); @@ -1218,9 +1220,9 @@ // // _rtbCompareSpell2 // - this._rtbCompareSpell2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._rtbCompareSpell2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._rtbCompareSpell2.BackColor = System.Drawing.Color.Gainsboro; this._rtbCompareSpell2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this._rtbCompareSpell2.Location = new System.Drawing.Point(3, 29); @@ -1250,8 +1252,8 @@ // // groupBox3 // - this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.groupBox3.BackColor = System.Drawing.Color.WhiteSmoke; this.groupBox3.Controls.Add(this._cbBinaryCompare); this.groupBox3.Controls.Add(this.label9); @@ -1430,9 +1432,9 @@ // // groupBox2 // - this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.groupBox2.Controls.Add(this.splitContainer6); this.groupBox2.Location = new System.Drawing.Point(0, 94); this.groupBox2.Name = "groupBox2"; @@ -1590,9 +1592,9 @@ // // _rtbSqlLog // - this._rtbSqlLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); + this._rtbSqlLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._rtbSqlLog.Location = new System.Drawing.Point(0, 32); this._rtbSqlLog.Name = "_rtbSqlLog"; this._rtbSqlLog.Size = new System.Drawing.Size(858, 182); @@ -1702,6 +1704,14 @@ this.richTextBox2.TabIndex = 0; this.richTextBox2.Text = ""; // + // searchDBCToolStripMenuItem + // + this.searchDBCToolStripMenuItem.Name = "searchDBCToolStripMenuItem"; + this.searchDBCToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.searchDBCToolStripMenuItem.Text = "Search DBC"; + this.searchDBCToolStripMenuItem.Click += new System.EventHandler(this.searchDBCToolStripMenuItem_Click); + Program.loader.LocaleEvent += UpdateLocale; + // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1913,5 +1923,6 @@ private System.Windows.Forms.ColumnHeader spellfamilymaskC2; private System.Windows.Forms.ComboBox _cbAdvancedFilter2CompareType; private System.Windows.Forms.ComboBox _cbAdvancedFilter1CompareType; + private System.Windows.Forms.ToolStripMenuItem searchDBCToolStripMenuItem; } } \ No newline at end of file diff --git a/SpellWork/Forms/FormMain.cs b/SpellWork/Forms/FormMain.cs index 0816a0b..b117981 100644 --- a/SpellWork/Forms/FormMain.cs +++ b/SpellWork/Forms/FormMain.cs @@ -40,7 +40,7 @@ namespace SpellWork _cbSqlSpellFamily.SetEnumValues("SpellFamilyName"); - _status.Text = String.Format("DBC Locale: {0}", DBC.Locale); + _status.Text = "Didn't load anything."; _cbAdvancedFilter1.SetStructFields(); _cbAdvancedFilter2.SetStructFields(); @@ -640,5 +640,15 @@ namespace SpellWork } #endregion + + private void searchDBCToolStripMenuItem_Click(object sender, EventArgs e) + { + new DBCSearchingFrom().Show(); + } + + public void UpdateLocale(LocalesDBC locale) + { + _status.Text = _status.Text = String.Format("DBC Locale: {0}", DBC.Locale); + } } } diff --git a/SpellWork/Forms/FormMain.resx b/SpellWork/Forms/FormMain.resx index 66fc062..1f9c5e5 100644 --- a/SpellWork/Forms/FormMain.resx +++ b/SpellWork/Forms/FormMain.resx @@ -131,7 +131,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAY - DQAAAk1TRnQBSQFMAgEBBgEAARwBAAEcAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + DQAAAk1TRnQBSQFMAgEBBgEAASwBAAEsAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/SpellWork/Loader.cs b/SpellWork/Loader.cs index c8462c0..a570115 100644 --- a/SpellWork/Loader.cs +++ b/SpellWork/Loader.cs @@ -3,28 +3,18 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; +using System.Windows.Forms; namespace SpellWork { class Loader { + public bool HasLoaded { get; set; } + public delegate void FormMainDelegate(LocalesDBC locale); + public event FormMainDelegate LocaleEvent; + public Loader() { - DBC.Spell = DBCReader.ReadDBC(DBC.SpellStrings); - DBC.SkillLine = DBCReader.ReadDBC(DBC.SkillLineStrings); - DBC.SpellRange = DBCReader.ReadDBC(DBC.SpellRangeStrings); - DBC.ScreenEffect = DBCReader.ReadDBC(DBC.ScreenEffectStrings); - - DBC.SpellDuration = DBCReader.ReadDBC(null); - DBC.SkillLineAbility = DBCReader.ReadDBC(null); - DBC.SpellRadius = DBCReader.ReadDBC(null); - DBC.SpellCastTimes = DBCReader.ReadDBC(null); - DBC.SpellDifficulty = DBCReader.ReadDBC(null); - - DBC.OverrideSpellData = DBCReader.ReadDBC(null); - - - DBC.Locale = DetectedLocale; } private LocalesDBC DetectedLocale @@ -42,5 +32,26 @@ namespace SpellWork return (LocalesDBC)locale; } } + + public void Load() + { + DBC.Spell = DBCReader.ReadDBC(DBC.SpellStrings); + DBC.SkillLine = DBCReader.ReadDBC(DBC.SkillLineStrings); + DBC.SpellRange = DBCReader.ReadDBC(DBC.SpellRangeStrings); + DBC.ScreenEffect = DBCReader.ReadDBC(DBC.ScreenEffectStrings); + + DBC.SpellDuration = DBCReader.ReadDBC(); + DBC.SkillLineAbility = DBCReader.ReadDBC(); + DBC.SpellRadius = DBCReader.ReadDBC(); + DBC.SpellCastTimes = DBCReader.ReadDBC(); + DBC.SpellDifficulty = DBCReader.ReadDBC(); + + DBC.OverrideSpellData = DBCReader.ReadDBC(); + + DBC.Locale = DetectedLocale; + + LocaleEvent(DBC.Locale); + HasLoaded = true; + } } } diff --git a/SpellWork/Program.cs b/SpellWork/Program.cs index 4b22f49..f16c8ab 100644 --- a/SpellWork/Program.cs +++ b/SpellWork/Program.cs @@ -8,10 +8,14 @@ namespace SpellWork { static class Program { + + public static Loader loader = new Loader(); + /// /// The main entry point for the application. /// [STAThread] + static void Main(string[] args) { Application.EnableVisualStyles(); @@ -19,7 +23,6 @@ namespace SpellWork try { - new Loader(); Application.Run(new FormMain()); } catch (Exception ex) diff --git a/SpellWork/SpellWork.csproj b/SpellWork/SpellWork.csproj index 9ee59d8..b5f9d20 100644 --- a/SpellWork/SpellWork.csproj +++ b/SpellWork/SpellWork.csproj @@ -81,6 +81,12 @@ + + Form + + + FormDirChose.cs + Form @@ -125,6 +131,9 @@ + + FormDirChose.cs + FormAboutBox.cs