diff --git a/File_Format_Library/FileFormats/BCRES/BCRES.cs b/File_Format_Library/FileFormats/BCRES/BCRES.cs index a63b4ae8..cfb60a6e 100644 --- a/File_Format_Library/FileFormats/BCRES/BCRES.cs +++ b/File_Format_Library/FileFormats/BCRES/BCRES.cs @@ -47,8 +47,7 @@ namespace FirstPlugin private List Textures = new List(); - public List GetTextures() - { + public List GetTextures() { return Textures; } diff --git a/File_Format_Library/FileFormats/BCRES/Wrappers/CMDL/CMDLWrapper.cs b/File_Format_Library/FileFormats/BCRES/Wrappers/CMDL/CMDLWrapper.cs index ce21886c..3c14b61d 100644 --- a/File_Format_Library/FileFormats/BCRES/Wrappers/CMDL/CMDLWrapper.cs +++ b/File_Format_Library/FileFormats/BCRES/Wrappers/CMDL/CMDLWrapper.cs @@ -40,6 +40,8 @@ namespace FirstPlugin assimp.SaveFromModel(model, FileName, BcresParent.GetTextures(), Skeleton.Renderable); } + public override string ExportFilter => FileFilters.CMDL; + public CMDLWrapper(Model model, BCRES bcres) : base() { BcresParent = bcres; diff --git a/File_Format_Library/GUI/BFLYT/LayoutProperties.cs b/File_Format_Library/GUI/BFLYT/LayoutProperties.cs index 051f3a63..4343ffc9 100644 --- a/File_Format_Library/GUI/BFLYT/LayoutProperties.cs +++ b/File_Format_Library/GUI/BFLYT/LayoutProperties.cs @@ -63,7 +63,7 @@ namespace LayoutBXLYT private void LoadUserData(IUserDataContainer container) { if (container.UserData != null && container.UserData.Entries != null) - userDataEditor.LoadUserData(container.UserData.Entries); + userDataEditor.LoadUserData(container as BasePane, container.UserData); } class DoubleBufferedTabPage : System.Windows.Forms.TabPage diff --git a/File_Format_Library/GUI/BFLYT/UserDataEditor.cs b/File_Format_Library/GUI/BFLYT/UserDataEditor.cs index 2b7b3987..a7af7b46 100644 --- a/File_Format_Library/GUI/BFLYT/UserDataEditor.cs +++ b/File_Format_Library/GUI/BFLYT/UserDataEditor.cs @@ -20,23 +20,28 @@ namespace LayoutBXLYT listViewCustom1.HeaderStyle = ColumnHeaderStyle.Nonclickable; } - List ActiveUserData; + BasePane activePane; + UserData ActiveUserData; UserDataEntry SelectedEntry; public void Reset() { - ActiveUserData = new List(); + ActiveUserData = new UserData(); SelectedEntry = null; listViewCustom1.Items.Clear(); } - public void LoadUserData(List UserDataList) + public void LoadUserData(BasePane pane, UserData UserData) { - listViewCustom1.Items.Clear(); + activePane = pane; + if (UserData != null) + { + listViewCustom1.Items.Clear(); - ActiveUserData = UserDataList; - foreach (var item in ActiveUserData) - LoadUserData(item); + ActiveUserData = UserData; + foreach (var item in ActiveUserData.Entries) + LoadUserData(item); + } } private void LoadUserData(UserDataEntry item) @@ -84,7 +89,7 @@ namespace LayoutBXLYT btnEdit.Enabled = true; btnRemove.Enabled = true; - SelectedEntry = ActiveUserData[listViewCustom1.SelectedIndices[0]]; + SelectedEntry = ActiveUserData.Entries[listViewCustom1.SelectedIndices[0]]; } else { @@ -103,17 +108,20 @@ namespace LayoutBXLYT private void btnAdd_Click(object sender, EventArgs e) { + if (activePane == null) return; + UserDataEntry userDataNew = new UserDataEntry(); userDataNew.SetValue(new int[0]); SelectedEntry = userDataNew; bool IsEdited = EditData(); if (IsEdited) { - ActiveUserData.Add(userDataNew); + ActiveUserData.Entries.Add(userDataNew); LoadUserData(userDataNew); } } private bool EditData() + { if (SelectedEntry != null) { @@ -147,7 +155,10 @@ namespace LayoutBXLYT if (parser.Type == UserDataType.String) SelectedEntry.SetValue(parser.GetStringASCII()); - LoadUserData(ActiveUserData); + if (ActiveUserData == null) + ActiveUserData = activePane.CreateUserData(); + + LoadUserData(activePane, ActiveUserData); return true; } } @@ -162,7 +173,7 @@ namespace LayoutBXLYT listViewCustom1.Items.RemoveAt(index); if (ActiveUserData != null) - ActiveUserData.RemoveAt(index); + ActiveUserData.Entries.RemoveAt(index); } } diff --git a/File_Format_Library/NodeWrappers/BfresFilters.cs b/File_Format_Library/NodeWrappers/FileFilters.cs similarity index 99% rename from File_Format_Library/NodeWrappers/BfresFilters.cs rename to File_Format_Library/NodeWrappers/FileFilters.cs index be182eb2..b4b053b7 100644 --- a/File_Format_Library/NodeWrappers/BfresFilters.cs +++ b/File_Format_Library/NodeWrappers/FileFilters.cs @@ -41,6 +41,8 @@ namespace FirstPlugin public static string FSCN = GetFilter(".bfscn"); public static string FSHA = GetFilter(".bfspa"); + public static string CMDL = GetFilter(".dae"); + public static string NUTEXB = GetFilter(".dds",".png", ".bmp", ".tga", ".jpg", ".tiff", ".tif", ".gif"); public static string XTX = GetFilter(".dds", ".png", ".bmp", ".tga", ".jpg", ".tiff", ".tif", ".gif");