public override void OnClick(TreeView treeView) { foreach (Control control in FirstPlugin.MainF.Controls) { if (control is DockPanel) { if (FirstPlugin.DockedEditorS == null) { FirstPlugin.DockedEditorS = new DockContent(); FirstPlugin.DockedEditorS.Show((DockPanel)control, PluginRuntime.FSHPDockState); } } } if (!EditorIsActive(FirstPlugin.DockedEditorS)) { FirstPlugin.DockedEditorS.Controls.Clear(); BNTXEditor = new BNTXEditor(); BNTXEditor.Text = Text; BNTXEditor.Dock = DockStyle.Fill; BNTXEditor.LoadPicture(DisplayTexture()); BNTXEditor.LoadProperty(this); FirstPlugin.DockedEditorS.Controls.Add(BNTXEditor); } }
public void Replace(string FileName) { string ext = Path.GetExtension(FileName); ext = ext.ToLower(); switch (ext) { case ".bftex": Texture.Import(FileName); break; case ".dds": TextureImporterSettings importDDS = new TextureImporterSettings(); importDDS.LoadDDS(FileName, bntxFile, null, this); break; default: TextureImporterSettings import = new TextureImporterSettings(); import.LoadBitMap(FileName, bntxFile, this); break; } Texture.Name = Text; UpdateBfresTextureMapping(); if (BNTXEditor != null) { BNTXEditor.LoadPicture(DisplayTexture()); BNTXEditor.LoadProperty(this); } }