1
0
mirror of synced 2025-01-19 09:17:30 +01:00

Add option to create new layout editor. Sort the file selector.

This commit is contained in:
KillzXGaming 2019-08-29 19:35:50 -04:00
parent 7e7afc6377
commit 18ffeb980b
2 changed files with 32 additions and 0 deletions

View File

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Toolbox;
using System.Windows.Forms;
using Toolbox.Library;
using Toolbox.Library.Forms;
using Toolbox.Library.IO;
using FirstPlugin.Forms;
using Syroot.Maths;
@ -38,10 +39,37 @@ namespace LayoutBXLYT
get
{
List<Type> types = new List<Type>();
types.Add(typeof(MenuExt));
return types.ToArray();
}
}
class MenuExt : IFileMenuExtension
{
public STToolStripItem[] NewFileMenuExtensions => newFileExt;
public STToolStripItem[] NewFromFileMenuExtensions => null;
public STToolStripItem[] ToolsMenuExtensions => null;
public STToolStripItem[] TitleBarExtensions => null;
public STToolStripItem[] CompressionMenuExtensions => null;
public STToolStripItem[] ExperimentalMenuExtensions => null;
public STToolStripItem[] EditMenuExtensions => null;
public ToolStripButton[] IconButtonMenuExtensions => null;
STToolStripItem[] newFileExt = new STToolStripItem[1];
public MenuExt()
{
newFileExt[0] = new STToolStripItem("Layout Editor");
newFileExt[0].Click += LoadNewLayoutEditor;
}
private void LoadNewLayoutEditor(object sender, EventArgs e)
{
LayoutEditor editor = new LayoutEditor();
editor.Show();
}
}
#region Text Converter Interface
public TextFileType TextFileType => TextFileType.Xml;
public bool CanConvertBack => false;

View File

@ -19,6 +19,8 @@ namespace LayoutBXLYT
{
InitializeComponent();
listViewCustom1.Sorting = SortOrder.Ascending;
listViewCustom1.MultiSelect = true;
}
@ -36,6 +38,8 @@ namespace LayoutBXLYT
listViewCustom1.BeginUpdate();
foreach (var file in layoutFiles)
listViewCustom1.Items.Add(file.FileName);
listViewCustom1.Sort();
listViewCustom1.EndUpdate();
}