public void setEbxFile(DAIEbx ebxFile) { if (ebxFile != null) { setData(EbxDataContainers.fromDAIEbx(ebxFile, statusConsumer)); } }
private void setEbxFile(DAIEbx ebxFile) { rawXmlViewer.setEbxFile(ebxFile); treeXmlViewer.setEbxFile(ebxFile); assetViewer.setEbxFile(ebxFile); textViewer.setEbxFile(ebxFile); }
private DAIEbx deserializeEbx(byte[] bytes) { DAIEbx ebxFile = new DAIEbx(); ebxFile.Serialize(new MemoryStream(bytes)); return(ebxFile); }
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { try { if (ignoreonce) { ignoreonce = false; hideViewer(); } else { statusConsumer("Loading requested EBX..."); TreeNode t = treeView1.SelectedNode; if (t == null || t.Name == "") { return; } string sha1 = t.Name; byte[] data = Tools.GetDataBySHA1(sha1, GlobalStuff.getCatFile()); DAIEbx ebxFile = deserializeEbx(data); setEbxFile(ebxFile); statusConsumer("Done."); showViewer(); } } catch (Exception ex) { messageBoxOnException(ex); } }
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) { 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); }
private void toolStripButton1_Click(object sender, EventArgs e) { TreeNode t = treeView1.SelectedNode; if (t == null) { t = treeView1.Nodes[0]; } string search = toolStripTextBox1.Text; toolStripButton2.Visible = true; stop = false; while ((t = FindNext(t)) != null) { Application.DoEvents(); statusConsumer("Searching : " + GetPath(t) + "..."); if (stop) { statusConsumer("Search stopped."); toolStripButton2.Visible = false; return; } try { byte[] data = Tools.GetDataBySHA1(t.Name, GlobalStuff.getCatFile()); if (data.Length != 0) { DAIEbx ebxFile = deserializeEbx(data); string xml = ebxFile.ToXml(); if (xml.Contains(search)) { ignoreonce = true; treeView1.SelectedNode = t; showViewer(); setEbxFile(ebxFile); rawXmlViewer.search(search); statusConsumer("Match!"); toolStripButton2.Visible = false; return; } } } catch (Exception ex) { messageBoxOnException(ex); } } toolStripButton2.Visible = false; statusConsumer("Not found."); }
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 }); } } }
public void setEbxFile(DAIEbx ebxFile) { currentFile = ebxFile; renderXml(); }