Exemple #1
0
 private void onClickExtractPalette(object sender, EventArgs e)
 {
     if (FileType != 0)
     {
         ToolStripMenuItem menu = (ToolStripMenuItem)sender;
         AnimIdx           edit = Ultima.AnimationEdit.GetAnimation(FileType, CurrBody, CurrAction, CurrDir);
         if (edit != null)
         {
             string name = String.Format("palette_anim{0}_{1}_{2}_{3}", FileType, CurrBody, CurrAction, CurrDir);
             if (((string)menu.Tag) == "txt")
             {
                 string path = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, name + ".txt");
                 edit.ExportPalette(path, 0);
             }
             else
             {
                 string path = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, name + "." + (string)menu.Tag);
                 if (((string)menu.Tag) == "bmp")
                 {
                     edit.ExportPalette(path, 1);
                 }
                 else
                 {
                     edit.ExportPalette(path, 2);
                 }
             }
             MessageBox.Show(
                 String.Format("Палитра сохранена в {0}", AppDomain.CurrentDomain.SetupInformation.ApplicationBase),
                 "Сохранено",
                 MessageBoxButtons.OK,
                 MessageBoxIcon.Information,
                 MessageBoxDefaultButton.Button1);
         }
     }
 }