QOL fixes

This commit is contained in:
Bitl 2021-07-28 11:38:21 -07:00
parent ae1608d438
commit c09c373046
1 changed files with 48 additions and 25 deletions

View File

@ -50,6 +50,10 @@ public partial class ItemCreationSDK : Form
MessageBox.Show("You must assign an item name before you change the icon.", "Novetus Item Creation SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show("You must assign an item name before you change the icon.", "Novetus Item Creation SDK", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
else else
{
string previconpath = SDKFuncs.GetPathForType(type) + "\\" + ItemNameBox.Text.Replace(" ", "") + ".png";
if (!File.Exists(previconpath))
{ {
IconLoader icon = new IconLoader(); IconLoader icon = new IconLoader();
icon.CopyToItemDir = true; icon.CopyToItemDir = true;
@ -79,9 +83,22 @@ public partial class ItemCreationSDK : Form
if (!Option1TextBox.ReadOnly) Option1TextBox.ReadOnly = true; if (!Option1TextBox.ReadOnly) Option1TextBox.ReadOnly = true;
} }
} }
else
{
MessageBox.Show("An icon with this item's name already exists. Please change the item's name.", "Novetus Item Creation SDK", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
} }
private void ItemTypeListBox_SelectedIndexChanged(object sender, EventArgs e) private void ItemTypeListBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
string previconpath = SDKFuncs.GetPathForType(type) + "\\" + ItemNameBox.Text.Replace(" ", "") + ".png";
if (File.Exists(previconpath))
{
File.SetAttributes(previconpath, FileAttributes.Normal);
File.Delete(previconpath);
}
type = SDKFuncs.GetTypeForInt(ItemTypeListBox.SelectedIndex); type = SDKFuncs.GetTypeForInt(ItemTypeListBox.SelectedIndex);
switch (type) switch (type)
@ -332,13 +349,19 @@ public partial class ItemCreationSDK : Form
string msgboxtext = "The Item Creation SDK has experienced an error: You are missing some requirements:\n"; string msgboxtext = "The Item Creation SDK has experienced an error: You are missing some requirements:\n";
bool passed = true; bool passed = true;
if (string.IsNullOrWhiteSpace(ItemNameBox.Text) && ItemIcon.Image == null || string.IsNullOrWhiteSpace(ItemNameBox.Text) || ItemIcon.Image == null) if (string.IsNullOrWhiteSpace(ItemNameBox.Text))
{ {
msgboxtext += "\n - You must assign an item name and/or icon."; msgboxtext += "\n - You must assign an item name.";
passed = false;
}
if (ItemIcon.Image == null)
{
msgboxtext += "\n - You must assign an icon.";
if (RequiresIconForTexture && ItemIcon.Image == null) if (RequiresIconForTexture && ItemIcon.Image == null)
{ {
msgboxtext += " This item type requires that you must select an Icon to select a Template or Texture."; msgboxtext += " This item type requires that you must select an Icon to use as a Template or Texture.";
} }
passed = false; passed = false;