Esempio n. 1
0
        public byte[] Save()
        {
            Console.WriteLine("Saving sarc");

            sarcData.Files.Clear();
            foreach (TreeNode node in Collect(EditorRoot.Nodes))
            {
                if (node is SarcEntry)
                {
                    Console.WriteLine("Saving " + node);
                    SaveFileEntryData((SarcEntry)node);
                }
                if (node is TreeNodeFile && node != EditorRoot)
                {
                    TreeNodeFile treeNodeFile = (TreeNodeFile)node;
                    if (treeNodeFile.FileHandler != null && treeNodeFile.FileHandler.IFileInfo.ArchiveHash == SarcHash)
                    {
                        sarcData.Files.Add(SARC.SetSarcPath(node, (TreeNode)this.EditorRoot), STLibraryCompression.CompressFile(treeNodeFile.FileHandler.Save(), treeNodeFile.FileHandler));
                    }
                }
            }

            Tuple <int, byte[]> sarc = SARCExt.SARC.PackN(sarcData);

            IFileInfo.Alignment = sarc.Item1;
            return(sarc.Item2);
        }
Esempio n. 2
0
            public RootNode(string n, SARC s)
            {
                Text = n;
                sarc = s;

                ContextMenu = new ContextMenu();
                MenuItem save = new MenuItem("Save");

                ContextMenu.MenuItems.Add(save);
                save.Click += Save;
            }
Esempio n. 3
0
            private void CreateNewLittleEndianSarc(object sender, EventArgs e)
            {
                SARC sarc = new SARC();

                sarc.IFileInfo = new IFileInfo();
                sarc.FileName  = "NewArchive.szs";
                CreateNewSARC(sarc, false);

                ObjectEditor editor = new ObjectEditor(sarc);

                editor.Text = "NewArchive.szs";
                LibraryGUI.CreateMdiWindow(editor);
            }
Esempio n. 4
0
        public static void CreateNewSARC(SARC sarc, bool IsBigEndian)
        {
            sarc.CanSave = true;
            sarc.IFileInfo.UseEditMenu = true;

            sarc.sarcData          = new SarcData();
            sarc.sarcData.HashOnly = false;
            sarc.sarcData.Files    = new Dictionary <string, byte[]>();

            if (IsBigEndian)
            {
                sarc.sarcData.endianness = Syroot.BinaryData.ByteOrder.BigEndian;
            }
            else
            {
                sarc.sarcData.endianness = Syroot.BinaryData.ByteOrder.LittleEndian;
            }
        }