Fix cmdl export filter

This commit is contained in:
KillzXGaming 2019-10-13 17:02:25 -04:00
parent bb575251b9
commit 9c0dbc8815
5 changed files with 28 additions and 14 deletions

View file

@ -47,8 +47,7 @@ namespace FirstPlugin
private List<STGenericTexture> Textures = new List<STGenericTexture>();
public List<STGenericTexture> GetTextures()
{
public List<STGenericTexture> GetTextures() {
return Textures;
}

View file

@ -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;

View file

@ -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

View file

@ -20,23 +20,28 @@ namespace LayoutBXLYT
listViewCustom1.HeaderStyle = ColumnHeaderStyle.Nonclickable;
}
List<UserDataEntry> ActiveUserData;
BasePane activePane;
UserData ActiveUserData;
UserDataEntry SelectedEntry;
public void Reset()
{
ActiveUserData = new List<UserDataEntry>();
ActiveUserData = new UserData();
SelectedEntry = null;
listViewCustom1.Items.Clear();
}
public void LoadUserData(List<UserDataEntry> 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);
}
}

View file

@ -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");