Esempio n. 1
0
        private void exportAllButton_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog d = new FolderBrowserDialog();

            if (d.ShowDialog() == DialogResult.OK)
            {
                var entries   = Database.LoadAllEbxEntries();
                var stopwatch = new Stopwatch();
                stopwatch.Start();

                for (int i = 0; i < entries.Count; i++)
                {
                    var ebxEntry = entries[i];

                    var bytes  = Tools.GetDataBySHA1(ebxEntry.sha1, GlobalStuff.getCatFile());
                    var daiEbx = new DAIEbx();
                    daiEbx.Serialize(new MemoryStream(bytes));
                    var ebxContainers = EbxDataContainers.fromDAIEbx(daiEbx, str => {}, false);
                    var txt           = ebxContainers.toText();

                    var outPath = Path.Combine(d.SelectedPath, $"{ebxEntry.path}_{ebxEntry.sha1.Substring(0, 8)}");
                    var dir     = Path.GetDirectoryName(outPath);
                    Directory.CreateDirectory(dir);
                    File.WriteAllText(outPath, txt, Encoding.UTF8);

                    if (i % 100 == 0)
                    {
                        Frontend.updateStatus($"Exported {i}/{entries.Count}, elapsec {stopwatch.ElapsedMilliseconds/1000}s");
                    }
                }

                Frontend.updateStatus("Finished export");
            }
        }
 public void setEbxFile(DAIEbx ebxFile)
 {
     if (ebxFile != null)
     {
         setData(EbxDataContainers.fromDAIEbx(ebxFile, statusConsumer));
     }
 }
Esempio n. 3
0
 public void setEbxFile(DAIEbx ebxFile)
 {
     if (ebxFile != null)
     {
         currentFile = EbxDataContainers.fromDAIEbx(ebxFile, newStatus => {});
         render();
     }
 }
        private EbxDataContainers loadEbx(string ebxGuid)
        {
            byte[] data = Tools.GetDataBySHA1(ebxGuid, GlobalStuff.getCatFile());

            DAIEbx ebxFile = new DAIEbx();

            ebxFile.Serialize(new MemoryStream(data));
            var containers = EbxDataContainers.fromDAIEbx(ebxFile, statusConsumer);

            return(containers);
        }
Esempio n. 5
0
        public void setEbxFile(DAIEbx ebxFile)
        {
            assetList.Rows.Clear();
            currentContainers      = null;
            currentlySelectedAsset = null;
            graphVizButton.Enabled = false;

            if (ebxFile != null)
            {
                currentContainers = EbxDataContainers.fromDAIEbx(ebxFile, statusConsumer);
                var assets = currentContainers.getAllWithPartial("Asset");

                foreach (var asset in assets)
                {
                    var assetType = asset.data.name;
                    var assetName = asset.getPartial("Asset").fields["Name"].castTo <ASimpleValue>().Val;

                    assetList.Rows.Add(new string[] { assetType, assetName, asset.guid });
                }
            }
        }