예제 #1
0
 private void BtnExport_Click(object sender, EventArgs e)
 {
     if (FileList.SelectedIndex == -1)
     {
         return;
     }
     using (SaveFileDialog saveDlg = new SaveFileDialog())
     {
         var list = container.GetList();
         saveDlg.Title    = "Export file";
         saveDlg.FileName = list[FileList.SelectedIndex].name;
         saveDlg.Filter   = "All files|*.*";
         if (saveDlg.ShowDialog() == DialogResult.OK)
         {
             OContainer.FileEntry file = list[FileList.SelectedIndex];
             File.WriteAllBytes(saveDlg.FileName, Read(file));
         }
     }
 }
예제 #2
0
        /// <summary>
        ///     Loads a BS animation file from Pokémon.
        /// </summary>
        /// <param name="data">The data</param>
        /// <returns>The Model group with the animations</returns>
        public static RenderBase.OModelGroup load(Stream data)
        {
            List <RenderBase.OModelGroup> models = new List <RenderBase.OModelGroup>();
            OContainer naCont = PkmnContainer.load(data); //Get NA containers from BS
            var        naList = naCont.GetList();

            foreach (var entry in naCont.Skip(1))
            {
                OContainer bchCont = PkmnContainer.load(new MemoryStream(entry.data)); //Get BCH from NA containers
                models.Add(BCH.load(new MemoryStream(bchCont.First().data)));
            }

            return(models[0]); //TODO: Figure out how to load all anim BCHs
        }