More fixes

This commit is contained in:
KillzXGaming 2019-05-09 16:14:42 -04:00
parent f48529590c
commit d4419ec67a
7 changed files with 17 additions and 8 deletions

Binary file not shown.

View file

@ -75,10 +75,10 @@ namespace FirstPlugin
switch (Folder.Type)
{
case BCRESGroupType.Models:
Folder.AddNode(new CMDLWrapper((Model)section) { BcresParent = this } );
Folder.AddNode(new CMDLWrapper((Model)section, this));
break;
case BCRESGroupType.Textures:
Folder.AddNode(new TXOBWrapper((Texture)section) { BcresParent = this });
Folder.AddNode(new TXOBWrapper((Texture)section, this));
break;
}
}

View file

@ -20,8 +20,12 @@ namespace FirstPlugin
ImageKey = "Model";
SelectedImageKey = "Model";
}
public CMDLWrapper(Model model) : base() { LoadModel(model); }
public CMDLWrapper(Model model, BCRES bcres) : base()
{
BcresParent = bcres;
LoadModel(model, bcres);
}
public override void OnClick(TreeView treeview) {
BcresParent.LoadEditors(this, OnPropertyChanged);
@ -32,18 +36,19 @@ namespace FirstPlugin
}
public void LoadModel(Model model)
public void LoadModel(Model model, BCRES bcres)
{
BcresParent = bcres;
Model = model;
Text = model.Name;
var MaterialFolder = new TreeNode();
var MaterialFolder = new TreeNode("Materials");
Nodes.Add(MaterialFolder);
foreach (var material in model.Materials.Values)
{
var matWrapper = new MTOBWrapper();
var matWrapper = new MTOBWrapper() { BcresParent = bcres };
matWrapper.Load(material);
matWrapper.BcresParent = BcresParent;
MaterialFolder.Nodes.Add(matWrapper);
}
}

View file

@ -21,7 +21,11 @@ namespace FirstPlugin
ImageKey = "Texture";
SelectedImageKey = "Texture";
}
public TXOBWrapper(Texture texture) : base() { LoadTexture(texture); }
public TXOBWrapper(Texture texture, BCRES bcres) : base()
{
BcresParent = bcres;
LoadTexture(texture);
}
public override TEX_FORMAT[] SupportedFormats