Fix cmdl export filter
This commit is contained in:
parent
bb575251b9
commit
9c0dbc8815
@ -47,8 +47,7 @@ namespace FirstPlugin
|
|||||||
|
|
||||||
private List<STGenericTexture> Textures = new List<STGenericTexture>();
|
private List<STGenericTexture> Textures = new List<STGenericTexture>();
|
||||||
|
|
||||||
public List<STGenericTexture> GetTextures()
|
public List<STGenericTexture> GetTextures() {
|
||||||
{
|
|
||||||
return Textures;
|
return Textures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ namespace FirstPlugin
|
|||||||
assimp.SaveFromModel(model, FileName, BcresParent.GetTextures(), Skeleton.Renderable);
|
assimp.SaveFromModel(model, FileName, BcresParent.GetTextures(), Skeleton.Renderable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ExportFilter => FileFilters.CMDL;
|
||||||
|
|
||||||
public CMDLWrapper(Model model, BCRES bcres) : base()
|
public CMDLWrapper(Model model, BCRES bcres) : base()
|
||||||
{
|
{
|
||||||
BcresParent = bcres;
|
BcresParent = bcres;
|
||||||
|
@ -63,7 +63,7 @@ namespace LayoutBXLYT
|
|||||||
private void LoadUserData(IUserDataContainer container)
|
private void LoadUserData(IUserDataContainer container)
|
||||||
{
|
{
|
||||||
if (container.UserData != null && container.UserData.Entries != null)
|
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
|
class DoubleBufferedTabPage : System.Windows.Forms.TabPage
|
||||||
|
@ -20,23 +20,28 @@ namespace LayoutBXLYT
|
|||||||
listViewCustom1.HeaderStyle = ColumnHeaderStyle.Nonclickable;
|
listViewCustom1.HeaderStyle = ColumnHeaderStyle.Nonclickable;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<UserDataEntry> ActiveUserData;
|
BasePane activePane;
|
||||||
|
UserData ActiveUserData;
|
||||||
UserDataEntry SelectedEntry;
|
UserDataEntry SelectedEntry;
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
ActiveUserData = new List<UserDataEntry>();
|
ActiveUserData = new UserData();
|
||||||
SelectedEntry = null;
|
SelectedEntry = null;
|
||||||
listViewCustom1.Items.Clear();
|
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;
|
ActiveUserData = UserData;
|
||||||
foreach (var item in ActiveUserData)
|
foreach (var item in ActiveUserData.Entries)
|
||||||
LoadUserData(item);
|
LoadUserData(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadUserData(UserDataEntry item)
|
private void LoadUserData(UserDataEntry item)
|
||||||
@ -84,7 +89,7 @@ namespace LayoutBXLYT
|
|||||||
btnEdit.Enabled = true;
|
btnEdit.Enabled = true;
|
||||||
btnRemove.Enabled = true;
|
btnRemove.Enabled = true;
|
||||||
|
|
||||||
SelectedEntry = ActiveUserData[listViewCustom1.SelectedIndices[0]];
|
SelectedEntry = ActiveUserData.Entries[listViewCustom1.SelectedIndices[0]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -103,17 +108,20 @@ namespace LayoutBXLYT
|
|||||||
|
|
||||||
private void btnAdd_Click(object sender, EventArgs e)
|
private void btnAdd_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (activePane == null) return;
|
||||||
|
|
||||||
UserDataEntry userDataNew = new UserDataEntry();
|
UserDataEntry userDataNew = new UserDataEntry();
|
||||||
userDataNew.SetValue(new int[0]);
|
userDataNew.SetValue(new int[0]);
|
||||||
SelectedEntry = userDataNew;
|
SelectedEntry = userDataNew;
|
||||||
bool IsEdited = EditData();
|
bool IsEdited = EditData();
|
||||||
if (IsEdited)
|
if (IsEdited)
|
||||||
{
|
{
|
||||||
ActiveUserData.Add(userDataNew);
|
ActiveUserData.Entries.Add(userDataNew);
|
||||||
LoadUserData(userDataNew);
|
LoadUserData(userDataNew);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private bool EditData()
|
private bool EditData()
|
||||||
|
|
||||||
{
|
{
|
||||||
if (SelectedEntry != null)
|
if (SelectedEntry != null)
|
||||||
{
|
{
|
||||||
@ -147,7 +155,10 @@ namespace LayoutBXLYT
|
|||||||
if (parser.Type == UserDataType.String)
|
if (parser.Type == UserDataType.String)
|
||||||
SelectedEntry.SetValue(parser.GetStringASCII());
|
SelectedEntry.SetValue(parser.GetStringASCII());
|
||||||
|
|
||||||
LoadUserData(ActiveUserData);
|
if (ActiveUserData == null)
|
||||||
|
ActiveUserData = activePane.CreateUserData();
|
||||||
|
|
||||||
|
LoadUserData(activePane, ActiveUserData);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -162,7 +173,7 @@ namespace LayoutBXLYT
|
|||||||
listViewCustom1.Items.RemoveAt(index);
|
listViewCustom1.Items.RemoveAt(index);
|
||||||
|
|
||||||
if (ActiveUserData != null)
|
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 FSCN = GetFilter(".bfscn");
|
||||||
public static string FSHA = GetFilter(".bfspa");
|
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 NUTEXB = GetFilter(".dds",".png", ".bmp", ".tga", ".jpg", ".tiff", ".tif", ".gif");
|
||||||
public static string XTX = GetFilter(".dds", ".png", ".bmp", ".tga", ".jpg", ".tiff", ".tif", ".gif");
|
public static string XTX = GetFilter(".dds", ".png", ".bmp", ".tga", ".jpg", ".tiff", ".tif", ".gif");
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user