mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-25 09:55:34 +00:00
CustomSkinEditor - Add simple unselection when clicking away from an item or pressing escape
This commit is contained in:
15
PCK-Studio/Forms/Editor/CustomSkinEditor.Designer.cs
generated
15
PCK-Studio/Forms/Editor/CustomSkinEditor.Designer.cs
generated
@@ -67,9 +67,9 @@
|
||||
this.offsetListBox = new System.Windows.Forms.ListBox();
|
||||
this.offsetTabContextMenu = new MetroFramework.Controls.MetroContextMenu(this.components);
|
||||
this.addOffsetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.removeOffsetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.renderer3D1 = new PckStudio.Rendering.SkinRenderer();
|
||||
this.uvPictureBox = new PckStudio.ToolboxItems.InterpolationPictureBox();
|
||||
this.removeOffsetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
label5 = new System.Windows.Forms.Label();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
label7 = new System.Windows.Forms.Label();
|
||||
@@ -321,6 +321,7 @@
|
||||
this.skinPartListBox.FormattingEnabled = true;
|
||||
this.skinPartListBox.Name = "skinPartListBox";
|
||||
this.skinPartListBox.Tag = "";
|
||||
this.skinPartListBox.MouseClick += new System.Windows.Forms.MouseEventHandler(this.skinPartListBox_MouseClick);
|
||||
this.skinPartListBox.SelectedIndexChanged += new System.EventHandler(this.skinPartListBox_SelectedIndexChanged);
|
||||
this.skinPartListBox.DoubleClick += new System.EventHandler(this.skinPartListBox_DoubleClick);
|
||||
this.skinPartListBox.KeyUp += new System.Windows.Forms.KeyEventHandler(this.skinPartListBox_KeyUp);
|
||||
@@ -401,6 +402,12 @@
|
||||
resources.ApplyResources(this.addOffsetToolStripMenuItem, "addOffsetToolStripMenuItem");
|
||||
this.addOffsetToolStripMenuItem.Click += new System.EventHandler(this.addOffsetToolStripMenuItem_Click);
|
||||
//
|
||||
// removeOffsetToolStripMenuItem
|
||||
//
|
||||
this.removeOffsetToolStripMenuItem.Name = "removeOffsetToolStripMenuItem";
|
||||
resources.ApplyResources(this.removeOffsetToolStripMenuItem, "removeOffsetToolStripMenuItem");
|
||||
this.removeOffsetToolStripMenuItem.Click += new System.EventHandler(this.removeOffsetToolStripMenuItem_Click);
|
||||
//
|
||||
// renderer3D1
|
||||
//
|
||||
resources.ApplyResources(this.renderer3D1, "renderer3D1");
|
||||
@@ -426,12 +433,6 @@
|
||||
this.uvPictureBox.Name = "uvPictureBox";
|
||||
this.uvPictureBox.TabStop = false;
|
||||
//
|
||||
// removeOffsetToolStripMenuItem
|
||||
//
|
||||
this.removeOffsetToolStripMenuItem.Name = "removeOffsetToolStripMenuItem";
|
||||
resources.ApplyResources(this.removeOffsetToolStripMenuItem, "removeOffsetToolStripMenuItem");
|
||||
this.removeOffsetToolStripMenuItem.Click += new System.EventHandler(this.removeOffsetToolStripMenuItem_Click);
|
||||
//
|
||||
// CustomSkinEditor
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
|
||||
@@ -304,8 +304,17 @@ namespace PckStudio.Forms.Editor
|
||||
|
||||
private void skinPartListBox_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Delete)
|
||||
deleteToolStripMenuItem_Click(sender, e);
|
||||
switch (e.KeyCode)
|
||||
{
|
||||
case Keys.Delete:
|
||||
deleteToolStripMenuItem_Click(sender, e);
|
||||
break;
|
||||
case Keys.Escape:
|
||||
ClearSelection();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ReloadOffsetList()
|
||||
@@ -353,5 +362,17 @@ namespace PckStudio.Forms.Editor
|
||||
ReloadOffsetList();
|
||||
}
|
||||
}
|
||||
|
||||
private void skinPartListBox_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (skinPartListBox.IndexFromPoint(e.X, e.Y) == -1)
|
||||
ClearSelection();
|
||||
}
|
||||
|
||||
private void ClearSelection()
|
||||
{
|
||||
skinPartListBox.ClearSelected();
|
||||
renderer3D1.SelectedIndex = skinPartListBox.SelectedIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1015,19 +1015,19 @@
|
||||
<value>204, 17</value>
|
||||
</metadata>
|
||||
<data name="addOffsetToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>180, 22</value>
|
||||
<value>152, 22</value>
|
||||
</data>
|
||||
<data name="addOffsetToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Add Offset</value>
|
||||
</data>
|
||||
<data name="removeOffsetToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>180, 22</value>
|
||||
<value>152, 22</value>
|
||||
</data>
|
||||
<data name="removeOffsetToolStripMenuItem.Text" xml:space="preserve">
|
||||
<value>Remove Offset</value>
|
||||
</data>
|
||||
<data name="offsetTabContextMenu.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>181, 70</value>
|
||||
<value>153, 48</value>
|
||||
</data>
|
||||
<data name=">>offsetTabContextMenu.Name" xml:space="preserve">
|
||||
<value>offsetTabContextMenu</value>
|
||||
|
||||
Reference in New Issue
Block a user