コード例 #1
0
ファイル: Form1.cs プロジェクト: shawwwn/BJ_Edit
 private void button9_Click(object sender, EventArgs e)
 {
     if (openMapDialog.ShowDialog() == DialogResult.OK)
     {
         if (File.Exists("war3map_edited.wts"))
         {
             File.Delete("war3map_edited.wts");
         }
         if (File.Exists("war3map.j"))
         {
             File.Delete("war3map.j");
         }
         if (File.Exists("war3mapMisc.txt"))
         {
             File.Delete("war3mapMisc.txt");
         }
         //导出文件
         MpqLib.Mpq.CArchive map = new MpqLib.Mpq.CArchive(openMapDialog.FileName);
         if (map.FileExists("war3map.j"))
         {
             map.ExportFile("war3map.j", "war3map.j");
         }
         if (map.FileExists("war3mapMisc.txt"))
         {
             map.ExportFile("war3mapMisc.txt", "war3mapMisc.txt");
         }
         if (map.FileExists("war3map.wts"))
         {
             map.ExportFile("war3map.wts", "war3map_edited.wts");
         }
         else
         {
             label1.Text = "war3map.wts doesn't exist in this map.";
             map.Close();
             return;
         }
         TransferStatus(true);
         label1.Text = "Transfering strings from war3map.wts...";
         wts_file wts = new wts_file("war3map_edited.wts");
         wts.SaveStripDataFile(true);
         wts.StringMapping();
         //打包进地图
         map.ImportFile("war3map.wts", "war3map_edited.wts");
         map.Flush();
         map.Compact();
         map.Close();
         if (File.Exists("war3map_edited.wts"))
         {
             File.Delete("war3map_edited.wts");
         }
         TransferStatus(false);
         refreshfrm();
         label1.Text = "Finish.";
         MessageBox.Show("Finish!");
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: shawwwn/BJ_Edit
        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult dr = openFileDialog1.ShowDialog();

            if (openFileDialog1.FileName != "" && dr == DialogResult.OK)
            {
                wts_file wts = new wts_file(openFileDialog1.FileName);
                wts.SaveStripDataFile();
                wts.StringMapping();
                MessageBox.Show("Finish!");
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: shawwwn/BJ_Edit
 private void button9_Click(object sender, EventArgs e)
 {
     if (openMapDialog.ShowDialog() == DialogResult.OK)
     {
         if (File.Exists("war3map_edited.wts")) { File.Delete("war3map_edited.wts"); }
         if (File.Exists("war3map.j")) { File.Delete("war3map.j"); }
         if (File.Exists("war3mapMisc.txt")) { File.Delete("war3mapMisc.txt"); }
         //导出文件
         MpqLib.Mpq.CArchive map = new MpqLib.Mpq.CArchive(openMapDialog.FileName);
         if (map.FileExists("war3map.j")) { map.ExportFile("war3map.j", "war3map.j"); }
         if (map.FileExists("war3mapMisc.txt")) { map.ExportFile("war3mapMisc.txt", "war3mapMisc.txt"); }
         if (map.FileExists("war3map.wts")) { map.ExportFile("war3map.wts", "war3map_edited.wts"); }
         else
         {
             label1.Text = "war3map.wts doesn't exist in this map.";
             map.Close();
             return;
         }
         TransferStatus(true);
         label1.Text = "Transfering strings from war3map.wts...";
         wts_file wts = new wts_file("war3map_edited.wts");
         wts.SaveStripDataFile(true);
         wts.StringMapping();
         //打包进地图
         map.ImportFile("war3map.wts", "war3map_edited.wts");
         map.Flush();
         map.Compact();
         map.Close();
         if (File.Exists("war3map_edited.wts")) { File.Delete("war3map_edited.wts"); }
         TransferStatus(false);
         refreshfrm();
         label1.Text = "Finish.";
         MessageBox.Show("Finish!");
     }
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: shawwwn/BJ_Edit
 private void button1_Click(object sender, EventArgs e)
 {
     DialogResult dr= openFileDialog1.ShowDialog();
     if (openFileDialog1.FileName != "" && dr == DialogResult.OK)
     {
         wts_file wts = new wts_file(openFileDialog1.FileName);
         wts.SaveStripDataFile();
         wts.StringMapping();
         MessageBox.Show("Finish!");
     }
 }