From 33b80afdecc90c48ae22c0c5fe66f1b424b63045 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Tue, 24 Dec 2024 13:11:42 +0100 Subject: [PATCH] ModelEditor - Add 'GetModelContainer' function --- PCK-Studio/Forms/Editor/ModelEditor.cs | 2 ++ PCK-Studio/MainForm.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/PCK-Studio/Forms/Editor/ModelEditor.cs b/PCK-Studio/Forms/Editor/ModelEditor.cs index 0beae32b..a83c9ec0 100644 --- a/PCK-Studio/Forms/Editor/ModelEditor.cs +++ b/PCK-Studio/Forms/Editor/ModelEditor.cs @@ -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 ModelImageIndex = new Dictionary() diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 9109ebcc..afe33442 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -755,6 +755,9 @@ namespace PckStudio var editor = new ModelEditor(modelContainer, TryGetSet.FromDelegates(tryGetTexture, trySetTexture), TryGet.FromDelegate(entityMaterials.TryGetValue)); if (editor.ShowDialog() == DialogResult.OK) { + asset.SetData(new ModelFileWriter(editor.GetModelContainer(), modelContainer.Version)); + BuildMainTreeView(); + wasModified = true; return; } }