mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-24 08:06:32 +00:00
Fix exception when moving skin under or below a folder
This commit is contained in:
@@ -49,7 +49,7 @@ namespace PckStudio.IO.TGA
|
||||
extensionData.JobTime = new TimeSpan(extensionData.TimeStamp.Hour, extensionData.TimeStamp.Minute, extensionData.TimeStamp.Second);
|
||||
extensionData.SoftwareID = Application.ProductName;
|
||||
Version.TryParse(Application.ProductVersion, out Version currentVersion);
|
||||
extensionData.SoftwareVersion = [(byte)currentVersion.Major, (byte)currentVersion.Minor, (byte)currentVersion.Build];
|
||||
extensionData.SoftwareVersion = new byte[] { (byte)currentVersion.Major, (byte)currentVersion.Minor, (byte)currentVersion.Build };
|
||||
extensionData.KeyColor = 0;
|
||||
extensionData.PixelAspectRatio = 0;
|
||||
extensionData.GammaValue = 0;
|
||||
|
||||
@@ -2276,21 +2276,28 @@ namespace PckStudio
|
||||
|
||||
int index = pck.IndexOfFile(file);
|
||||
|
||||
if (index + amount < 0 || index + amount > pck.FileCount) return;
|
||||
pck.RemoveFile(file);
|
||||
pck.InsertFile(index + amount, 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())
|
||||
if (IsSubPCK)
|
||||
{
|
||||
var writer = new PckFileWriter(pck, LittleEndianCheckBox.Checked ? OMI.Endianness.LittleEndian : OMI.Endianness.BigEndian);
|
||||
writer.WriteToStream(stream);
|
||||
(GetSubPCK(path).Tag as PckFileData).SetData(stream.ToArray());
|
||||
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 PckFileData).SetData(stream.ToArray());
|
||||
}
|
||||
}
|
||||
BuildMainTreeView();
|
||||
wasModified = true;
|
||||
}
|
||||
BuildMainTreeView();
|
||||
wasModified = true;
|
||||
catch(Exception ex)
|
||||
{
|
||||
MessageBox.Show("Can't move file under or above a folder");
|
||||
}
|
||||
}
|
||||
[Obsolete]
|
||||
private void moveUpToolStripMenuItem_Click(object sender, EventArgs e) => moveFile(-1);
|
||||
|
||||
Reference in New Issue
Block a user