MainForm - Fix issue where new packs would overwrite last open pck file

This commit is contained in:
miku-666
2024-08-16 17:28:43 +02:00
parent 76c091ed98
commit 5b6703f337

View File

@@ -1461,8 +1461,7 @@ namespace PckStudio
if (namePrompt.ShowDialog(this) == DialogResult.OK)
{
currentPCK = InitializePack(new Random().Next(8000, int.MaxValue), 0, namePrompt.NewText, true);
isTemplateFile = true;
wasModified = true;
MarkTemplateFile();
LoadEditorTab();
}
}
@@ -1474,8 +1473,7 @@ namespace PckStudio
if (packPrompt.ShowDialog(this) == DialogResult.OK)
{
currentPCK = InitializeTexturePack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes, packPrompt.CreateSkinsPck);
isTemplateFile = true;
wasModified = true;
MarkTemplateFile();
LoadEditorTab();
}
}
@@ -1487,12 +1485,18 @@ namespace PckStudio
if (packPrompt.ShowDialog(this) == DialogResult.OK)
{
currentPCK = InitializeMashUpPack(new Random().Next(8000, int.MaxValue), 0, packPrompt.PackName, packPrompt.PackRes);
isTemplateFile = true;
wasModified = false;
MarkTemplateFile();
LoadEditorTab();
}
}
private void MarkTemplateFile()
{
isTemplateFile = true;
wasModified = true;
saveLocation = string.Empty;
}
private void quickChangeToolStripMenuItem_Click(object sender, EventArgs e)
{
using AdvancedOptions advanced = new AdvancedOptions(currentPCK);
@@ -1839,6 +1843,8 @@ namespace PckStudio
{
if (!string.IsNullOrEmpty(saveLocation))
Save(saveLocation);
if (string.IsNullOrWhiteSpace(saveLocation) || isTemplateFile)
SaveTemplate();
}
private void saveAsPCK(object sender, EventArgs e)