mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-26 06:20:24 +00:00
Fix cmdl export filter
This commit is contained in:
parent
bb575251b9
commit
9c0dbc8815
5 changed files with 28 additions and 14 deletions
|
@ -47,8 +47,7 @@ namespace FirstPlugin
|
|||
|
||||
private List<STGenericTexture> Textures = new List<STGenericTexture>();
|
||||
|
||||
public List<STGenericTexture> GetTextures()
|
||||
{
|
||||
public List<STGenericTexture> GetTextures() {
|
||||
return Textures;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
Loading…
Reference in a new issue