Add option to create new layout editor. Sort the file selector.
This commit is contained in:
parent
7e7afc6377
commit
18ffeb980b
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user