Exemplo n.º 1
0
 private void tfenglishtxtToolStripMenuItem_Click(object sender, EventArgs e)
 {
     string ret = "";
     using (var diag = new OpenFileWindow())
     {
         Cursor = Cursors.WaitCursor;
         ret = diag.ShowWindow("tf_english.txt", @"\tf\resource\");
     }
     Cursor = Cursors.Arrow;
     if (!String.IsNullOrEmpty(ret))
     {
         wait = true;
         Cursor.Current = Cursors.WaitCursor;
         englishParser = new ValveFormatParser(ret);
         englishParser.LoadFile();
         Cursor.Current = Cursors.Arrow;
         if (englishParser.RootNode.Key != "lang")
         {
             MessageBox.Show("That is not tf_english.txt.\r\nPlease select tf_english.txt!",
                             "TF2 Items Editor",
                             MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
             englishParser = null;
             wait = false;
             return;
         }
         stripTxt.Text = "";
         stripTxt.Image = null;
         groupTips.Enabled = true;
         comboTipClasses.SelectedIndex = 0;
         wait = false;
     }
 }
Exemplo n.º 2
0
 private void itemsgametxtToolStripMenuItem_Click(object sender, EventArgs e)
 {
     string ret;
     using (var diag = new OpenFileWindow())
     {
         Cursor = Cursors.WaitCursor;
         ret = diag.ShowWindow("items_game.txt", @"\tf\scripts\items\");
     }
     Cursor = Cursors.Arrow;
     if (!String.IsNullOrEmpty(ret))
     {
         Cursor.Current = Cursors.WaitCursor;
         itemsParser = new ValveFormatParser(ret);
         itemsParser.LoadFile();
         Cursor.Current = Cursors.Arrow;
         if (itemsParser.RootNode.Key != "items_game")
         {
             MessageBox.Show("That is not items_game.txt.\r\nPlease select items_game.txt!",
                             "TF2 Items Editor",
                             MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
             itemsParser = null;
             return;
         }
         LoadItems();
         stripTxt.Text = "Edit->Attributes to open the attributes window!";
         stripTxt.Image = images.Images["Info"];
     }
 }