diff --git a/MinecraftUSkinEditor/Forms/Form1.Designer.cs b/MinecraftUSkinEditor/Forms/Form1.Designer.cs
index fe32b21a..ee223bdb 100644
--- a/MinecraftUSkinEditor/Forms/Form1.Designer.cs
+++ b/MinecraftUSkinEditor/Forms/Form1.Designer.cs
@@ -40,6 +40,8 @@
this.importExtractedSkinsFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.importFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.extractToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.cloneFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); // Clone file tool
+ this.renameFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); // Rename file tool
this.replaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.moveUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.deleteFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -164,8 +166,10 @@
//
this.contextMenuPCKEntries.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.createToolStripMenuItem,
+ this.cloneFileToolStripMenuItem,
this.importSkinsToolStripMenuItem,
this.extractToolStripMenuItem,
+ this.renameFileToolStripMenuItem,
this.replaceToolStripMenuItem,
this.moveUpToolStripMenuItem,
this.deleteFileToolStripMenuItem,
@@ -233,6 +237,18 @@
this.extractToolStripMenuItem.Name = "extractToolStripMenuItem";
this.extractToolStripMenuItem.Click += new System.EventHandler(this.extractToolStripMenuItem_Click);
//
+ // cloneFileToolStripMenuItem
+ //
+ resources.ApplyResources(this.cloneFileToolStripMenuItem, "cloneFileToolStripMenuItem");
+ this.cloneFileToolStripMenuItem.Name = "cloneFileToolStripMenuItem";
+ this.cloneFileToolStripMenuItem.Click += new System.EventHandler(this.cloneFileToolStripMenuItem_Click);
+ //
+ // renameFileToolStripMenuItem
+ //
+ resources.ApplyResources(this.renameFileToolStripMenuItem, "renameFileToolStripMenuItem");
+ this.renameFileToolStripMenuItem.Name = "renameFileToolStripMenuItem";
+ this.renameFileToolStripMenuItem.Click += new System.EventHandler(this.renameFileToolStripMenuItem_Click);
+ //
// replaceToolStripMenuItem
//
resources.ApplyResources(this.replaceToolStripMenuItem, "replaceToolStripMenuItem");
@@ -1052,7 +1068,9 @@
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip contextMenuPCKEntries;
+ private System.Windows.Forms.ToolStripMenuItem cloneFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem extractToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem renameFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem replaceToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem deleteFileToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip contextMenuMetaTree;
diff --git a/MinecraftUSkinEditor/Forms/Form1.cs b/MinecraftUSkinEditor/Forms/Form1.cs
index 43b8d072..4fd7e702 100644
--- a/MinecraftUSkinEditor/Forms/Form1.cs
+++ b/MinecraftUSkinEditor/Forms/Form1.cs
@@ -818,6 +818,70 @@ namespace PckStudio
}
#endregion
+ #region renames pck entry from treeview and pck.minefiles
+ private void renameFileToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ PCK.MineFile mf = (PCK.MineFile)treeViewMain.SelectedNode.Tag;
+ string old_name = treeViewMain.SelectedNode.Text;
+ string new_name = Microsoft.VisualBasic.Interaction.InputBox("Please insert the new file name", "Rename File", mf.name);
+
+ if (new_name == "") new_name = old_name;
+ currentPCK.mineFiles[currentPCK.mineFiles.IndexOf(mf)].name = new_name;
+ mf.name = new_name;
+ treeViewMain.SelectedNode.Text = Path.GetFileName(new_name);
+ }
+ #endregion
+
+ #region clones pck entry from treeview and pck.minefiles
+ private void cloneFileToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (treeViewMain.SelectedNode.Tag == null) return;
+
+ PCK.MineFile mfO = (PCK.MineFile)treeViewMain.SelectedNode.Tag;
+ FileInfo mfCO = new FileInfo(mfO.name);
+
+ PCK.MineFile mf = new PCK.MineFile();//Creates new minefile template
+ mf.data = mfO.data;//adds file data to minefile
+ mf.filesize = mfO.data.Length;//gets filesize for minefile
+ mf.name = Path.GetDirectoryName(mfO.name).Replace("\\", "/") + "/" + Path.GetFileNameWithoutExtension(mfO.name) + "_clone" + mfCO.Extension;//sets minfile name to file name
+ if (treeViewMain.SelectedNode.Parent == null && mf.name.StartsWith("/")) mf.name = mf.name.Remove(0, 1);
+ mf.entries = mfO.entries;
+ mf.type = 0;//sets minefile type to default
+ TreeNode add = new TreeNode(Path.GetFileName(mf.name)) { Tag = mf };//creates node for minefile
+
+ //Gets proper file icon for minefile
+ if (Path.GetExtension(add.Text) == ".binka")
+ {
+ add.ImageIndex = 1;
+ add.SelectedImageIndex = 1;
+ }
+ else if (Path.GetExtension(add.Text) == ".png")
+ {
+ add.ImageIndex = 2;
+ add.SelectedImageIndex = 2;
+ }
+ else if (Path.GetExtension(add.Text) == ".loc")
+ {
+ add.ImageIndex = 3;
+ add.SelectedImageIndex = 3;
+ }
+ else if (Path.GetExtension(add.Text) == ".pck")
+ {
+ add.ImageIndex = 4;
+ add.SelectedImageIndex = 4;
+ }
+ else
+ {
+ add.ImageIndex = 5;
+ add.SelectedImageIndex = 5;
+ }
+
+ currentPCK.mineFiles.Insert(currentPCK.mineFiles.IndexOf(mfO) + 1, mf); //inserts minefile into proper list index
+ if (treeViewMain.SelectedNode.Parent == null) treeViewMain.Nodes.Insert(treeViewMain.SelectedNode.Index + 1, add); //adds generated minefile node
+ else treeViewMain.SelectedNode.Parent.Nodes.Insert(treeViewMain.SelectedNode.Index + 1, add);//adds generated minefile node to selected folder
+ }
+ #endregion
+
#region adds file to treeview and pck.minefiles
private void addFileToolStripMenuItem_Click(object sender, EventArgs e)
{
diff --git a/MinecraftUSkinEditor/Forms/Form1.ja.resx b/MinecraftUSkinEditor/Forms/Form1.ja.resx
index 2552f049..f0754290 100644
--- a/MinecraftUSkinEditor/Forms/Form1.ja.resx
+++ b/MinecraftUSkinEditor/Forms/Form1.ja.resx
@@ -260,7 +260,8 @@
インポート
-
+
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAACYSURBVDhPpZBZ
@@ -306,6 +307,28 @@
上に移動
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAMUExURZ2dnba2tpKSkgAAAGUs/dQAAAAEdFJOU////wBAKqn0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAANElEQVQoU63IMQIAIAjDQLT//7OWDlBZzZYLIBRUwRog6ZBiQCnYrEOKAcXhygMxgPcfgAOqpAEWLNB/5wAAAABJRU5ErkJggg==
+
+
+
+ 228, 22
+
+
+ Clone (translate JP)
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAtSURBVDhPY2TABP+hNC6ATQ9OADIMr4FMUJpsMGrAqAEgMGoA9qxJQnZmYAAAuTwEG2FXInEAAAAASUVORK5CYII=
+
+
+
+ 138, 22
+
+
+ Rename (translate JP)
+
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
diff --git a/MinecraftUSkinEditor/Forms/Form1.resx b/MinecraftUSkinEditor/Forms/Form1.resx
index 553f2211..f8348ff6 100644
--- a/MinecraftUSkinEditor/Forms/Form1.resx
+++ b/MinecraftUSkinEditor/Forms/Form1.resx
@@ -309,6 +309,28 @@
Move Up
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAMUExURZ2dnba2tpKSkgAAAGUs/dQAAAAEdFJOU////wBAKqn0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAANElEQVQoU63IMQIAIAjDQLT//7OWDlBZzZYLIBRUwRog6ZBiQCnYrEOKAcXhygMxgPcfgAOqpAEWLNB/5wAAAABJRU5ErkJggg==
+
+
+
+ 228, 22
+
+
+ Clone
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAtSURBVDhPY2TABP+hNC6ATQ9OADIMr4FMUJpsMGrAqAEgMGoA9qxJQnZmYAAAuTwEG2FXInEAAAAASUVORK5CYII=
+
+
+
+ 138, 22
+
+
+ Rename
+
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
diff --git a/MinecraftUSkinEditor/PckStudio.csproj b/MinecraftUSkinEditor/PckStudio.csproj
index f8a11455..3537aec2 100644
--- a/MinecraftUSkinEditor/PckStudio.csproj
+++ b/MinecraftUSkinEditor/PckStudio.csproj
@@ -148,6 +148,7 @@
..\packages\MapSuiteDependency-MicrosoftSqlServerTypes.10.2.0\lib\net45\Microsoft.SqlServer.Types.dll
True
+
..\packages\Microsoft.Win32.Primitives.4.0.0\lib\net46\Microsoft.Win32.Primitives.dll
True
@@ -728,9 +729,11 @@
Form1.cs
+ Designer
Form1.cs
+ Designer
generateModel.cs