ModelEditor - Add 'GetModelContainer' function

This commit is contained in:
miku-666
2024-12-24 13:11:42 +01:00
parent 08c605d9a6
commit 33b80afdec
2 changed files with 5 additions and 0 deletions

View File

@@ -39,6 +39,8 @@ namespace PckStudio.Forms.Editor
modelTreeView.ImageList.Images.AddRange(ApplicationScope.EntityImages);
}
internal ModelContainer GetModelContainer() => _models;
private const int InvalidImageIndex = 127;
// TODO: move to json file. -miku
private static Dictionary<string, int> ModelImageIndex = new Dictionary<string, int>()

View File

@@ -755,6 +755,9 @@ namespace PckStudio
var editor = new ModelEditor(modelContainer, TryGetSet<string, Image>.FromDelegates(tryGetTexture, trySetTexture), TryGet<string, MaterialContainer.Material>.FromDelegate(entityMaterials.TryGetValue));
if (editor.ShowDialog() == DialogResult.OK)
{
asset.SetData(new ModelFileWriter(editor.GetModelContainer(), modelContainer.Version));
BuildMainTreeView();
wasModified = true;
return;
}
}