Exemplo n.º 1
0
        public void MergePacks(string[] files)
        {
            string type = Path.GetExtension(files[0]);

            if (type == ".ispk")
            {
                CIndexSpritePack respack = new CIndexSpritePack();

                foreach (string f in files)
                {
                    CIndexSpritePack pack = CIndexSpritePackHelper.LoadFromFile(f);

                    foreach (CIndexSprite s in pack.Sprites)
                    {
                        respack.Sprites.Add(s);
                    }
                }

                saveFileDialog.Filter       = "ISPK File|*.ispk";
                saveFileDialog.AddExtension = true;
                saveFileDialog.DefaultExt   = ".ispk";

                saveFileDialog.InitialDirectory = Path.GetDirectoryName(files[0]);
                saveFileDialog.FileName         = "new index.ispk";

                if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    respack.SaveToFile(saveFileDialog.FileName);
                }
            }
        }
 private void tsmiFileSave_Click(object sender, EventArgs e)
 {
     loadedISPK.SaveToFile(dirInfo.FullName);
 }