mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-24 22:46:14 +00:00
MainForm - Fix unable to create skin when no loc file is found
This commit is contained in:
@@ -242,15 +242,23 @@ namespace PckStudio.Popups
|
||||
}
|
||||
string skinId = _skinId.ToString("d08");
|
||||
skin.Filename = $"dlcskin{skinId}.png";
|
||||
string skinDisplayNameLocKey = $"IDS_dlcskin{skinId}_DISPLAYNAME";
|
||||
currentLoc.AddLocKey(skinDisplayNameLocKey, textSkinName.Text);
|
||||
skin.Properties.Add("DISPLAYNAME", textSkinName.Text);
|
||||
skin.Properties.Add("DISPLAYNAMEID", skinDisplayNameLocKey);
|
||||
|
||||
if (currentLoc is not null)
|
||||
{
|
||||
string skinDisplayNameLocKey = $"IDS_dlcskin{skinId}_DISPLAYNAME";
|
||||
skin.Properties.Add("DISPLAYNAMEID", skinDisplayNameLocKey);
|
||||
currentLoc.AddLocKey(skinDisplayNameLocKey, textSkinName.Text);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(textThemeName.Text))
|
||||
{
|
||||
skin.Properties.Add("THEMENAME", textThemeName.Text);
|
||||
skin.Properties.Add("THEMENAMEID", $"IDS_dlcskin{skinId}_THEMENAME");
|
||||
currentLoc.AddLocKey($"IDS_dlcskin{skinId}_THEMENAME", textThemeName.Text);
|
||||
if (currentLoc is not null)
|
||||
{
|
||||
skin.Properties.Add("THEMENAMEID", $"IDS_dlcskin{skinId}_THEMENAME");
|
||||
currentLoc.AddLocKey($"IDS_dlcskin{skinId}_THEMENAME", textThemeName.Text);
|
||||
}
|
||||
}
|
||||
skin.Properties.Add("ANIM", anim);
|
||||
skin.Properties.Add("GAME_FLAGS", "0x18");
|
||||
|
||||
@@ -801,12 +801,9 @@ namespace PckStudio
|
||||
|
||||
private void createSkinToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!TryGetLocFile(out LOCFile locFile))
|
||||
{
|
||||
MessageBox.Show("No .loc file found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
using (AddNewSkin add = new AddNewSkin(locFile))
|
||||
LOCFile locFile = null;
|
||||
TryGetLocFile(out locFile);
|
||||
using AddNewSkin add = new AddNewSkin(locFile);
|
||||
if (add.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user