mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-27 17:25:48 +00:00
MainForm - Remove move up/down menu items in favor of drag n' drop
This commit is contained in:
48
PCK-Studio/MainForm.Designer.cs
generated
48
PCK-Studio/MainForm.Designer.cs
generated
@@ -75,8 +75,7 @@
|
||||
this.setModelContainerFormatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.version1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.version2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.moveUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.version3114ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.extractToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.cloneFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.renameFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -150,9 +149,8 @@
|
||||
this.label11 = new MetroFramework.Controls.MetroLabel();
|
||||
this.treeViewMain = new System.Windows.Forms.TreeView();
|
||||
this.imageList = new System.Windows.Forms.ImageList(this.components);
|
||||
this.LittleEndianCheckBox = new MetroFramework.Controls.MetroCheckBox();
|
||||
this.previewPictureBox = new PckStudio.ToolboxItems.InterpolationPictureBox();
|
||||
this.version3114ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.LittleEndianCheckBox = new MetroFramework.Controls.MetroCheckBox();
|
||||
logoPictureBox = new System.Windows.Forms.PictureBox();
|
||||
toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
@@ -204,8 +202,6 @@
|
||||
this.exportToolStripMenuItem,
|
||||
this.setFileTypeToolStripMenuItem,
|
||||
this.miscFunctionsToolStripMenuItem,
|
||||
this.moveUpToolStripMenuItem,
|
||||
this.moveDownToolStripMenuItem,
|
||||
this.extractToolStripMenuItem,
|
||||
this.cloneFileToolStripMenuItem,
|
||||
this.renameFileToolStripMenuItem,
|
||||
@@ -478,17 +474,11 @@
|
||||
resources.ApplyResources(this.version2ToolStripMenuItem, "version2ToolStripMenuItem");
|
||||
this.version2ToolStripMenuItem.Click += new System.EventHandler(this.setModelVersion2ToolStripMenuItem_Click);
|
||||
//
|
||||
// moveUpToolStripMenuItem
|
||||
// version3114ToolStripMenuItem
|
||||
//
|
||||
this.moveUpToolStripMenuItem.Name = "moveUpToolStripMenuItem";
|
||||
resources.ApplyResources(this.moveUpToolStripMenuItem, "moveUpToolStripMenuItem");
|
||||
this.moveUpToolStripMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click);
|
||||
//
|
||||
// moveDownToolStripMenuItem
|
||||
//
|
||||
this.moveDownToolStripMenuItem.Name = "moveDownToolStripMenuItem";
|
||||
resources.ApplyResources(this.moveDownToolStripMenuItem, "moveDownToolStripMenuItem");
|
||||
this.moveDownToolStripMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click);
|
||||
this.version3114ToolStripMenuItem.Name = "version3114ToolStripMenuItem";
|
||||
resources.ApplyResources(this.version3114ToolStripMenuItem, "version3114ToolStripMenuItem");
|
||||
this.version3114ToolStripMenuItem.Click += new System.EventHandler(this.setModelVersion3ToolStripMenuItem_Click);
|
||||
//
|
||||
// extractToolStripMenuItem
|
||||
//
|
||||
@@ -1118,13 +1108,13 @@
|
||||
this.treeViewMain.Name = "treeViewMain";
|
||||
this.treeViewMain.PathSeparator = "/";
|
||||
this.treeViewMain.BeforeLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(this.treeViewMain_BeforeLabelEdit);
|
||||
this.treeViewMain.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.selectNode);
|
||||
this.treeViewMain.DoubleClick += new System.EventHandler(this.treeViewMain_DoubleClick);
|
||||
this.treeViewMain.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeViewMain_KeyDown);
|
||||
this.treeViewMain.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.treeViewMain_ItemDrag);
|
||||
this.treeViewMain.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.selectNode);
|
||||
this.treeViewMain.DragDrop += new System.Windows.Forms.DragEventHandler(this.treeViewMain_DragDrop);
|
||||
this.treeViewMain.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeViewMain_DragEnter);
|
||||
this.treeViewMain.DragOver += new System.Windows.Forms.DragEventHandler(this.treeViewMain_DragOver);
|
||||
this.treeViewMain.DoubleClick += new System.EventHandler(this.treeViewMain_DoubleClick);
|
||||
this.treeViewMain.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeViewMain_KeyDown);
|
||||
//
|
||||
// imageList
|
||||
//
|
||||
@@ -1132,15 +1122,6 @@
|
||||
resources.ApplyResources(this.imageList, "imageList");
|
||||
this.imageList.TransparentColor = System.Drawing.Color.Transparent;
|
||||
//
|
||||
// LittleEndianCheckBox
|
||||
//
|
||||
resources.ApplyResources(this.LittleEndianCheckBox, "LittleEndianCheckBox");
|
||||
this.LittleEndianCheckBox.BackColor = System.Drawing.Color.Transparent;
|
||||
this.LittleEndianCheckBox.Name = "LittleEndianCheckBox";
|
||||
this.LittleEndianCheckBox.Style = MetroFramework.MetroColorStyle.White;
|
||||
this.LittleEndianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.LittleEndianCheckBox.UseSelectable = true;
|
||||
//
|
||||
// previewPictureBox
|
||||
//
|
||||
resources.ApplyResources(this.previewPictureBox, "previewPictureBox");
|
||||
@@ -1149,11 +1130,14 @@
|
||||
this.previewPictureBox.Name = "previewPictureBox";
|
||||
this.previewPictureBox.TabStop = false;
|
||||
//
|
||||
// version3114ToolStripMenuItem
|
||||
// LittleEndianCheckBox
|
||||
//
|
||||
this.version3114ToolStripMenuItem.Name = "version3114ToolStripMenuItem";
|
||||
resources.ApplyResources(this.version3114ToolStripMenuItem, "version3114ToolStripMenuItem");
|
||||
this.version3114ToolStripMenuItem.Click += new System.EventHandler(this.setModelVersion3ToolStripMenuItem_Click);
|
||||
resources.ApplyResources(this.LittleEndianCheckBox, "LittleEndianCheckBox");
|
||||
this.LittleEndianCheckBox.BackColor = System.Drawing.Color.Transparent;
|
||||
this.LittleEndianCheckBox.Name = "LittleEndianCheckBox";
|
||||
this.LittleEndianCheckBox.Style = MetroFramework.MetroColorStyle.White;
|
||||
this.LittleEndianCheckBox.Theme = MetroFramework.MetroThemeStyle.Dark;
|
||||
this.LittleEndianCheckBox.UseSelectable = true;
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
|
||||
@@ -2467,59 +2467,6 @@ namespace PckStudio
|
||||
MessageBox.Show(this, "Already up to date.", "No update available");
|
||||
}
|
||||
|
||||
[Obsolete] // the move functions are to eventually be removed in favor of drag and drop
|
||||
private void moveFile(int amount)
|
||||
{
|
||||
if (treeViewMain.SelectedNode is not TreeNode t || t.Tag is not PckAsset)
|
||||
return;
|
||||
|
||||
PckAsset file = t.Tag as PckAsset;
|
||||
string path = t.FullPath;
|
||||
|
||||
// skin and cape files only
|
||||
if (!(file.Type == PckAssetType.SkinFile || file.Type == PckAssetType.CapeFile)) return;
|
||||
|
||||
PckFile pck = currentPCK;
|
||||
bool IsSubPCK = IsSubPCKNode(path);
|
||||
if (IsSubPCK)
|
||||
{
|
||||
using (var stream = new MemoryStream((GetSubPCK(path).Tag as PckAsset).Data))
|
||||
{
|
||||
var reader = new PckFileReader(LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian);
|
||||
pck = reader.FromStream(stream);
|
||||
}
|
||||
}
|
||||
|
||||
int index = pck.IndexOfFile(file);
|
||||
|
||||
try
|
||||
{
|
||||
if (index + amount < 0 || index + amount > pck.FileCount) return;
|
||||
pck.RemoveFile(file);
|
||||
pck.InsertFile(index + amount, file);
|
||||
|
||||
if (IsSubPCK)
|
||||
{
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
var writer = new PckFileWriter(pck, LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian);
|
||||
writer.WriteToStream(stream);
|
||||
(GetSubPCK(path).Tag as PckAsset).SetData(stream.ToArray());
|
||||
}
|
||||
}
|
||||
BuildMainTreeView();
|
||||
wasModified = true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
MessageBox.Show(this, "Can't move file under or above a folder");
|
||||
}
|
||||
}
|
||||
[Obsolete]
|
||||
private void moveUpToolStripMenuItem_Click(object sender, EventArgs e) => moveFile(-1);
|
||||
[Obsolete]
|
||||
private void moveDownToolStripMenuItem_Click(object sender, EventArgs e) => moveFile(1);
|
||||
|
||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Application.Exit();
|
||||
|
||||
Reference in New Issue
Block a user