private void ScanButton_Click(object sender, EventArgs e) { // empty all fields and disables all controls ActivateControls(false); tv1.Nodes.Clear(); tv2.Nodes.Clear(); tv3.Nodes.Clear(); MorphDetailsTB.Text = ""; hb1.ByteProvider = new DynamicByteProvider(new byte[0]); hb2.ByteProvider = new DynamicByteProvider(new byte[0]); TreeNode tempNode = new TreeNode("Loading, please wait..."); tv1.Nodes.Add(tempNode); // delete cache PluginMorphCache.CleanCache(); // clean objects holding data tocFiles.Clear(); bundlePaths.Clear(); tocChunks.Clear(); currBundle = ""; res.Clear(); chunks.Clear(); globalChunks.Clear(); resByBundles.Clear(); // scan for content again ScanForContent(); }
// // form loading functions // public void MainForm_Load() { // set autopatching to false : for some reason, the morph res is f****d up when patched. main.Host.setAutoPatching(false); // load ebx guids (needed to get base mesh) EbxUtils.ebxGuid = main.Host.getEBXGuids(); tocChunks = new Dictionary <string, List <ChunkInfo> >(); globalChunks = new List <ChunkInfo>(); // check if cache was already generated and load from there if so. if (PluginMorphCache.CheckForCache()) { bundlePaths = PluginMorphCache.LoadFromCache(); tocFiles = new List <string>(); tocFiles.AddRange(bundlePaths.Keys); LoadChunks(); RefreshTocTree(); ActivateControls(true); } else { // if no cache, scan for content (ie scan for toc and bundles containing morph static assets) ScanForContent(); } }
private void LoadBackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { StatusBarLabel.Text = "Writing cache..."; PluginMorphCache.WriteCache(bundlePaths); StatusBarLabel.Text = "Loading chunks..."; LoadChunks(); StatusBarLabel.Text = ""; StatusBarProgressBar.Value = 0; RefreshTocTree(); ActivateControls(true); }