1
0
mirror of synced 2025-01-19 09:17:30 +01:00

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) switch (Folder.Type)
{ {
case BCRESGroupType.Models: case BCRESGroupType.Models:
Folder.AddNode(new CMDLWrapper((Model)section) { BcresParent = this } ); Folder.AddNode(new CMDLWrapper((Model)section, this));
break; break;
case BCRESGroupType.Textures: case BCRESGroupType.Textures:
Folder.AddNode(new TXOBWrapper((Texture)section) { BcresParent = this }); Folder.AddNode(new TXOBWrapper((Texture)section, this));
break; break;
} }
} }

View File

@ -20,8 +20,12 @@ namespace FirstPlugin
ImageKey = "Model"; ImageKey = "Model";
SelectedImageKey = "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) { public override void OnClick(TreeView treeview) {
BcresParent.LoadEditors(this, OnPropertyChanged); 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; Model = model;
Text = model.Name; Text = model.Name;
var MaterialFolder = new TreeNode(); var MaterialFolder = new TreeNode("Materials");
Nodes.Add(MaterialFolder); Nodes.Add(MaterialFolder);
foreach (var material in model.Materials.Values) foreach (var material in model.Materials.Values)
{ {
var matWrapper = new MTOBWrapper(); var matWrapper = new MTOBWrapper() { BcresParent = bcres };
matWrapper.Load(material); matWrapper.Load(material);
matWrapper.BcresParent = BcresParent;
MaterialFolder.Nodes.Add(matWrapper); MaterialFolder.Nodes.Add(matWrapper);
} }
} }

View File

@ -21,7 +21,11 @@ namespace FirstPlugin
ImageKey = "Texture"; ImageKey = "Texture";
SelectedImageKey = "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 public override TEX_FORMAT[] SupportedFormats