more ItemCreationSDK changes
This commit is contained in:
parent
254199e9c1
commit
33c141d3a4
|
|
@ -79,7 +79,9 @@ partial class ItemCreationSDK
|
|||
this.ItemNameLabel = new System.Windows.Forms.Label();
|
||||
this.ItemNameBox = new System.Windows.Forms.TextBox();
|
||||
this.Warning = new System.Windows.Forms.Label();
|
||||
this.EditItem = new System.Windows.Forms.CheckBox();
|
||||
this.EditItemBox = new System.Windows.Forms.CheckBox();
|
||||
this.ReskinBox = new System.Windows.Forms.CheckBox();
|
||||
this.ResetButton = new System.Windows.Forms.Button();
|
||||
this.ItemSettingsGroup.SuspendLayout();
|
||||
this.CoordGroup2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.ZBox2)).BeginInit();
|
||||
|
|
@ -460,7 +462,7 @@ partial class ItemCreationSDK
|
|||
//
|
||||
// BulgeBox
|
||||
//
|
||||
this.BulgeBox.DecimalPlaces = 6;
|
||||
this.BulgeBox.DecimalPlaces = 20;
|
||||
this.BulgeBox.Location = new System.Drawing.Point(104, 98);
|
||||
this.BulgeBox.Maximum = new decimal(new int[] {
|
||||
1661992959,
|
||||
|
|
@ -478,7 +480,7 @@ partial class ItemCreationSDK
|
|||
//
|
||||
// RoundnessBox
|
||||
//
|
||||
this.RoundnessBox.DecimalPlaces = 6;
|
||||
this.RoundnessBox.DecimalPlaces = 20;
|
||||
this.RoundnessBox.Location = new System.Drawing.Point(104, 73);
|
||||
this.RoundnessBox.Maximum = new decimal(new int[] {
|
||||
1661992959,
|
||||
|
|
@ -496,7 +498,7 @@ partial class ItemCreationSDK
|
|||
//
|
||||
// BevelBox
|
||||
//
|
||||
this.BevelBox.DecimalPlaces = 6;
|
||||
this.BevelBox.DecimalPlaces = 20;
|
||||
this.BevelBox.Location = new System.Drawing.Point(104, 49);
|
||||
this.BevelBox.Maximum = new decimal(new int[] {
|
||||
1661992959,
|
||||
|
|
@ -711,9 +713,9 @@ partial class ItemCreationSDK
|
|||
//
|
||||
// CreateItemButton
|
||||
//
|
||||
this.CreateItemButton.Location = new System.Drawing.Point(11, 560);
|
||||
this.CreateItemButton.Location = new System.Drawing.Point(229, 560);
|
||||
this.CreateItemButton.Name = "CreateItemButton";
|
||||
this.CreateItemButton.Size = new System.Drawing.Size(197, 23);
|
||||
this.CreateItemButton.Size = new System.Drawing.Size(70, 23);
|
||||
this.CreateItemButton.TabIndex = 6;
|
||||
this.CreateItemButton.Text = "Create Item";
|
||||
this.CreateItemButton.UseVisualStyleBackColor = true;
|
||||
|
|
@ -775,15 +777,35 @@ partial class ItemCreationSDK
|
|||
this.Warning.Text = "\r\n";
|
||||
this.Warning.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// EditItem
|
||||
// EditItemBox
|
||||
//
|
||||
this.EditItem.Location = new System.Drawing.Point(214, 559);
|
||||
this.EditItem.Name = "EditItem";
|
||||
this.EditItem.Size = new System.Drawing.Size(85, 24);
|
||||
this.EditItem.TabIndex = 12;
|
||||
this.EditItem.Text = "Item Editing";
|
||||
this.EditItem.UseVisualStyleBackColor = true;
|
||||
this.EditItem.CheckedChanged += new System.EventHandler(this.EditItem_CheckedChanged);
|
||||
this.EditItemBox.Location = new System.Drawing.Point(11, 560);
|
||||
this.EditItemBox.Name = "EditItemBox";
|
||||
this.EditItemBox.Size = new System.Drawing.Size(85, 24);
|
||||
this.EditItemBox.TabIndex = 12;
|
||||
this.EditItemBox.Text = "Item Editing";
|
||||
this.EditItemBox.UseVisualStyleBackColor = true;
|
||||
this.EditItemBox.CheckedChanged += new System.EventHandler(this.EditItem_CheckedChanged);
|
||||
//
|
||||
// ReskinBox
|
||||
//
|
||||
this.ReskinBox.Location = new System.Drawing.Point(102, 560);
|
||||
this.ReskinBox.Name = "ReskinBox";
|
||||
this.ReskinBox.Size = new System.Drawing.Size(59, 24);
|
||||
this.ReskinBox.TabIndex = 13;
|
||||
this.ReskinBox.Text = "Reskin";
|
||||
this.ReskinBox.UseVisualStyleBackColor = true;
|
||||
this.ReskinBox.CheckedChanged += new System.EventHandler(this.ReskinBox_CheckedChanged);
|
||||
//
|
||||
// ResetButton
|
||||
//
|
||||
this.ResetButton.Location = new System.Drawing.Point(175, 560);
|
||||
this.ResetButton.Name = "ResetButton";
|
||||
this.ResetButton.Size = new System.Drawing.Size(48, 23);
|
||||
this.ResetButton.TabIndex = 14;
|
||||
this.ResetButton.Text = "Reset";
|
||||
this.ResetButton.UseVisualStyleBackColor = true;
|
||||
this.ResetButton.Click += new System.EventHandler(this.ResetButton_Click);
|
||||
//
|
||||
// ItemCreationSDK
|
||||
//
|
||||
|
|
@ -791,7 +813,9 @@ partial class ItemCreationSDK
|
|||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.ClientSize = new System.Drawing.Size(585, 595);
|
||||
this.Controls.Add(this.EditItem);
|
||||
this.Controls.Add(this.ResetButton);
|
||||
this.Controls.Add(this.ReskinBox);
|
||||
this.Controls.Add(this.EditItemBox);
|
||||
this.Controls.Add(this.Warning);
|
||||
this.Controls.Add(this.ItemNameBox);
|
||||
this.Controls.Add(this.ItemNameLabel);
|
||||
|
|
@ -890,5 +914,7 @@ partial class ItemCreationSDK
|
|||
private System.Windows.Forms.Label UsesHatTexLabel;
|
||||
private System.Windows.Forms.ComboBox UsesHatTexBox;
|
||||
private System.Windows.Forms.Label Warning;
|
||||
private System.Windows.Forms.CheckBox EditItem;
|
||||
private System.Windows.Forms.CheckBox EditItemBox;
|
||||
private System.Windows.Forms.CheckBox ReskinBox;
|
||||
private System.Windows.Forms.Button ResetButton;
|
||||
}
|
||||
|
|
@ -20,6 +20,7 @@ public partial class ItemCreationSDK : Form
|
|||
private static bool Option2Required = false;
|
||||
private static bool RequiresIconForTexture = false;
|
||||
private static bool ItemEditing = false;
|
||||
private static bool IsReskin = false;
|
||||
private OpenFileDialog openFileDialog1;
|
||||
private static string FileDialogFilter1 = "";
|
||||
private static string FileDialogName1 = "";
|
||||
|
|
@ -98,6 +99,7 @@ public partial class ItemCreationSDK : Form
|
|||
|
||||
private void ItemNameBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
LoadItemIfExists();
|
||||
UpdateWarnings();
|
||||
}
|
||||
|
||||
|
|
@ -230,7 +232,7 @@ public partial class ItemCreationSDK : Form
|
|||
break;
|
||||
}
|
||||
|
||||
UpdateWarnings();
|
||||
LoadItemIfExists();
|
||||
}
|
||||
|
||||
private void CreateItemButton_Click(object sender, EventArgs e)
|
||||
|
|
@ -340,9 +342,19 @@ public partial class ItemCreationSDK : Form
|
|||
|
||||
private void EditItem_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
ItemEditing = EditItem.Checked;
|
||||
ItemEditing = EditItemBox.Checked;
|
||||
UpdateWarnings();
|
||||
}
|
||||
|
||||
private void ReskinBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
IsReskin = ReskinBox.Checked;
|
||||
}
|
||||
private void ResetButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
Reset(true);
|
||||
MessageBox.Show("All fields reset!", "Novetus Item Creation SDK - Reset", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
|
|
@ -380,6 +392,38 @@ public partial class ItemCreationSDK : Form
|
|||
}
|
||||
}
|
||||
|
||||
public static string GetItemFontVals(XDocument doc, VarStorage.AssetCacheDef assetdef, int idIndex)
|
||||
{
|
||||
return GetItemFontVals(doc, assetdef.Class, assetdef.Id[idIndex]);
|
||||
}
|
||||
|
||||
public static string GetItemFontVals(XDocument doc, string itemClassValue, string itemIdValue)
|
||||
{
|
||||
var v = from nodes in doc.Descendants("Item")
|
||||
where nodes.Attribute("class").Value == itemClassValue
|
||||
select nodes;
|
||||
|
||||
foreach (var item in v)
|
||||
{
|
||||
var v2 = from nodes in item.Descendants("Content")
|
||||
where nodes.Attribute("name").Value == itemIdValue
|
||||
select nodes;
|
||||
|
||||
foreach (var item2 in v2)
|
||||
{
|
||||
var v3 = from nodes in item2.Descendants("url")
|
||||
select nodes;
|
||||
|
||||
foreach (var item3 in v3)
|
||||
{
|
||||
return item3.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void SetItemCoordVals(XDocument doc, VarStorage.AssetCacheDef assetdef, double X, double Y, double Z, string CoordClass, string CoordName)
|
||||
{
|
||||
SetItemCoordVals(doc, assetdef.Class, X, Y, Z, CoordClass, CoordName);
|
||||
|
|
@ -439,6 +483,69 @@ public partial class ItemCreationSDK : Form
|
|||
}
|
||||
}
|
||||
|
||||
public static string GetItemCoordVals(XDocument doc, VarStorage.AssetCacheDef assetdef, string CoordClass, string CoordName)
|
||||
{
|
||||
return GetItemCoordVals(doc, assetdef.Class, CoordClass, CoordName);
|
||||
}
|
||||
|
||||
public static string GetItemCoordVals(XDocument doc, string itemClassValue, string CoordClass, string CoordName)
|
||||
{
|
||||
var v = from nodes in doc.Descendants("Item")
|
||||
where nodes.Attribute("class").Value == itemClassValue
|
||||
select nodes;
|
||||
|
||||
return GetItemCoordXML(v, CoordClass, CoordName);
|
||||
}
|
||||
|
||||
public static string GetItemCoordValsNoClassSearch(XDocument doc, string CoordClass, string CoordName)
|
||||
{
|
||||
var v = from nodes in doc.Descendants("Item")
|
||||
select nodes;
|
||||
|
||||
return GetItemCoordXML(v, CoordClass, CoordName);
|
||||
}
|
||||
|
||||
private static string GetItemCoordXML(IEnumerable<XElement> v, string CoordClass, string CoordName)
|
||||
{
|
||||
string coord = "";
|
||||
|
||||
foreach (var item in v)
|
||||
{
|
||||
var v2 = from nodes in item.Descendants(CoordClass)
|
||||
where nodes.Attribute("name").Value == CoordName
|
||||
select nodes;
|
||||
|
||||
foreach (var item2 in v2)
|
||||
{
|
||||
var v3 = from nodes in item2.Descendants("X")
|
||||
select nodes;
|
||||
|
||||
foreach (var item3 in v3)
|
||||
{
|
||||
coord += item3.Value + ",";
|
||||
}
|
||||
|
||||
var v4 = from nodes in item2.Descendants("Y")
|
||||
select nodes;
|
||||
|
||||
foreach (var item4 in v4)
|
||||
{
|
||||
coord += item4.Value + ",";
|
||||
}
|
||||
|
||||
var v5 = from nodes in item2.Descendants("Z")
|
||||
select nodes;
|
||||
|
||||
foreach (var item5 in v5)
|
||||
{
|
||||
coord += item5.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return coord;
|
||||
}
|
||||
|
||||
public static void SetHatScaleVals(XDocument doc, double X, double Y, double Z)
|
||||
{
|
||||
var v = from nodes in doc.Descendants("Item")
|
||||
|
|
@ -465,6 +572,34 @@ public partial class ItemCreationSDK : Form
|
|||
}
|
||||
}
|
||||
|
||||
public static string GetHatScaleVals(XDocument doc)
|
||||
{
|
||||
var v = from nodes in doc.Descendants("Item")
|
||||
where nodes.Attribute("class").Value == "Hat"
|
||||
select nodes;
|
||||
|
||||
foreach (var item in v)
|
||||
{
|
||||
var v2 = from nodes in doc.Descendants("Item")
|
||||
where nodes.Attribute("class").Value == "Part"
|
||||
select nodes;
|
||||
|
||||
foreach (var item2 in v2)
|
||||
{
|
||||
var v3 = from nodes in doc.Descendants("Item")
|
||||
where nodes.Attribute("class").Value == "SpecialMesh"
|
||||
select nodes;
|
||||
|
||||
foreach (var item3 in v3)
|
||||
{
|
||||
return GetItemCoordXML(v3, "Vector3", "Scale");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void SetHeadBevel(XDocument doc, double bevel, double bevelRoundness, double bulge, int meshtype, string meshclass, int LODX, int LODY)
|
||||
{
|
||||
var v = from nodes in doc.Descendants("Item")
|
||||
|
|
@ -530,6 +665,105 @@ public partial class ItemCreationSDK : Form
|
|||
}
|
||||
}
|
||||
|
||||
public static string GetHeadBevel(XDocument doc)
|
||||
{
|
||||
string bevelsettings = "";
|
||||
|
||||
var v = from nodes in doc.Descendants("Item")
|
||||
select nodes;
|
||||
|
||||
foreach (var item in v)
|
||||
{
|
||||
var v2 = from nodes in item.Descendants(XMLTypes.Float.ToString().ToLower())
|
||||
where nodes.Attribute("name").Value == "Bevel"
|
||||
select nodes;
|
||||
|
||||
foreach (var item2 in v2)
|
||||
{
|
||||
bevelsettings += item2.Value + ",";
|
||||
}
|
||||
|
||||
var v3 = from nodes in item.Descendants(XMLTypes.Float.ToString().ToLower())
|
||||
where nodes.Attribute("name").Value == "Bevel Roundness"
|
||||
select nodes;
|
||||
|
||||
foreach (var item3 in v3)
|
||||
{
|
||||
bevelsettings += item3.Value + ",";
|
||||
}
|
||||
|
||||
var v4 = from nodes in item.Descendants(XMLTypes.Float.ToString().ToLower())
|
||||
where nodes.Attribute("name").Value == "Bulge"
|
||||
select nodes;
|
||||
|
||||
foreach (var item4 in v4)
|
||||
{
|
||||
bevelsettings += item4.Value + ",";
|
||||
}
|
||||
|
||||
var vX = from nodes in item.Descendants(XMLTypes.Token.ToString().ToLower())
|
||||
where nodes.Attribute("name").Value == "LODX"
|
||||
select nodes;
|
||||
|
||||
foreach (var itemX in vX)
|
||||
{
|
||||
bevelsettings += itemX.Value + ",";
|
||||
}
|
||||
|
||||
var vY = from nodes in item.Descendants(XMLTypes.Token.ToString().ToLower())
|
||||
where nodes.Attribute("name").Value == "LODY"
|
||||
select nodes;
|
||||
|
||||
foreach (var itemY in vY)
|
||||
{
|
||||
bevelsettings += itemY.Value + ",";
|
||||
}
|
||||
|
||||
var v5 = from nodes in item.Descendants(XMLTypes.Token.ToString().ToLower())
|
||||
where nodes.Attribute("name").Value == "MeshType"
|
||||
select nodes;
|
||||
|
||||
foreach (var item5 in v5)
|
||||
{
|
||||
bevelsettings += item5.Value;
|
||||
}
|
||||
}
|
||||
|
||||
return bevelsettings;
|
||||
}
|
||||
|
||||
public static bool IsHeadMesh(XDocument doc)
|
||||
{
|
||||
bool check = true;
|
||||
|
||||
var v = from nodes in doc.Descendants("Item")
|
||||
where nodes.Attribute("class").Value == "SpecialMesh"
|
||||
select nodes;
|
||||
|
||||
foreach (var item in v)
|
||||
{
|
||||
var v2 = from nodes in item.Descendants("Content")
|
||||
where nodes.Attribute("name").Value == "MeshId"
|
||||
select nodes;
|
||||
|
||||
foreach (var item2 in v2)
|
||||
{
|
||||
var v3 = from nodes in item2.Descendants("url")
|
||||
select nodes;
|
||||
|
||||
foreach (var item3 in v3)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(item3.Value))
|
||||
{
|
||||
check = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return check;
|
||||
}
|
||||
|
||||
public static string GetPathForType(RobloxFileType type)
|
||||
{
|
||||
switch (type)
|
||||
|
|
@ -597,19 +831,8 @@ public partial class ItemCreationSDK : Form
|
|||
}
|
||||
}
|
||||
|
||||
public static bool CreateItem(string filepath, RobloxFileType type, string itemname, string[] assetfilenames, double[] coordoptions, double[] coordoptions2, object[] headoptions, string desctext = "")
|
||||
public bool CreateItem(string filepath, RobloxFileType type, string itemname, string[] assetfilenames, double[] coordoptions, double[] coordoptions2, object[] headoptions, string desctext = "")
|
||||
{
|
||||
/*MessageBox.Show(assetfilenames[0] + "\n" +
|
||||
assetfilenames[1] + "\n" +
|
||||
assetfilenames[2] + "\n" +
|
||||
assetfilenames[3] + "\n" +
|
||||
coordoptions[0] + "\n" +
|
||||
coordoptions[1] + "\n" +
|
||||
coordoptions[2] + "\n" +
|
||||
headoptions[0] + "\n" +
|
||||
headoptions[1] + "\n" +
|
||||
headoptions[2] + "\n");*/
|
||||
|
||||
string oldfile = File.ReadAllText(filepath);
|
||||
string fixedfile = RobloxXML.RemoveInvalidXmlChars(RobloxXML.ReplaceHexadecimalSymbols(oldfile));
|
||||
XDocument doc = XDocument.Parse(fixedfile);
|
||||
|
|
@ -675,6 +898,149 @@ public partial class ItemCreationSDK : Form
|
|||
return success;
|
||||
}
|
||||
|
||||
//https://stackoverflow.com/questions/6921105/given-a-filesystem-path-is-there-a-shorter-way-to-extract-the-filename-without
|
||||
static string GetFileBaseNameUsingSplit(string path)
|
||||
{
|
||||
string[] pathArr = path.Split('/');
|
||||
string[] fileArr = pathArr.Last().Split('.');
|
||||
string fileBaseName = fileArr.First().ToString();
|
||||
|
||||
return fileBaseName;
|
||||
}
|
||||
|
||||
public bool LoadItem(string filepath, RobloxFileType type)
|
||||
{
|
||||
Option1Path = "";
|
||||
Option2Path = "";
|
||||
|
||||
string oldfile = File.ReadAllText(filepath);
|
||||
string fixedfile = RobloxXML.RemoveInvalidXmlChars(RobloxXML.ReplaceHexadecimalSymbols(oldfile));
|
||||
XDocument doc = XDocument.Parse(fixedfile);
|
||||
bool success = true;
|
||||
|
||||
try
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case RobloxFileType.Hat:
|
||||
string MeshFilename = GetFileBaseNameUsingSplit(GetItemFontVals(doc, RobloxDefs.ItemHatFonts, 0)) + ".mesh";
|
||||
string TextureFilename = GetFileBaseNameUsingSplit(GetItemFontVals(doc, RobloxDefs.ItemHatFonts, 1)) + ".png";
|
||||
|
||||
//https://stackoverflow.com/questions/10160708/how-do-i-find-an-item-by-value-in-an-combobox-in-c
|
||||
int i = UsesHatMeshBox.FindStringExact(MeshFilename);
|
||||
if (i >= 0)
|
||||
{
|
||||
UsesHatMeshBox.SelectedIndex = i;
|
||||
}
|
||||
|
||||
int i2 = UsesHatTexBox.FindStringExact(TextureFilename);
|
||||
if (i2 >= 0)
|
||||
{
|
||||
UsesHatTexBox.SelectedIndex = i2;
|
||||
}
|
||||
|
||||
string HatCoords = GetItemCoordVals(doc, "Hat", "CoordinateFrame", "AttachmentPoint");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(HatCoords))
|
||||
{
|
||||
string[] HatCoordsSplit = HatCoords.Split(',');
|
||||
XBox.Value = Convert.ToDecimal(HatCoordsSplit[0]);
|
||||
YBox.Value = Convert.ToDecimal(HatCoordsSplit[1]);
|
||||
ZBox.Value = Convert.ToDecimal(HatCoordsSplit[2]);
|
||||
}
|
||||
|
||||
string HatScaleCoords = GetHatScaleVals(doc);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(HatScaleCoords))
|
||||
{
|
||||
string[] HatScaleCoordsSplit = HatScaleCoords.Split(',');
|
||||
XBox360.Value = Convert.ToDecimal(HatScaleCoordsSplit[0]);
|
||||
YBox2.Value = Convert.ToDecimal(HatScaleCoordsSplit[1]);
|
||||
ZBox2.Value = Convert.ToDecimal(HatScaleCoordsSplit[2]);
|
||||
}
|
||||
break;
|
||||
case RobloxFileType.Head:
|
||||
case RobloxFileType.HeadNoCustomMesh:
|
||||
if (IsHeadMesh(doc))
|
||||
{
|
||||
string BevelCoords = GetHeadBevel(doc);
|
||||
if (!string.IsNullOrWhiteSpace(BevelCoords))
|
||||
{
|
||||
string[] BevelCoordsSplit = BevelCoords.Split(',');
|
||||
|
||||
BevelBox.Value = Convert.ToDecimal(BevelCoordsSplit[0]);
|
||||
RoundnessBox.Value = Convert.ToDecimal(BevelCoordsSplit[1]);
|
||||
BulgeBox.Value = Convert.ToDecimal(BevelCoordsSplit[2]);
|
||||
LODXBox.Value = Convert.ToDecimal(BevelCoordsSplit[3]);
|
||||
LODYBox.Value = Convert.ToDecimal(BevelCoordsSplit[4]);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(BevelCoordsSplit[5]))
|
||||
{
|
||||
SpecialMeshTypeBox.SelectedIndex = Convert.ToInt32(BevelCoordsSplit[5]);
|
||||
}
|
||||
}
|
||||
|
||||
string HeadScaleCoords = GetItemCoordValsNoClassSearch(doc, "Vector3", "Scale");
|
||||
if (!string.IsNullOrWhiteSpace(HeadScaleCoords))
|
||||
{
|
||||
string[] HeadScaleCoordsSplit = HeadScaleCoords.Split(',');
|
||||
XBox.Value = Convert.ToDecimal(HeadScaleCoordsSplit[0]);
|
||||
YBox.Value = Convert.ToDecimal(HeadScaleCoordsSplit[1]);
|
||||
ZBox.Value = Convert.ToDecimal(HeadScaleCoordsSplit[2]);
|
||||
}
|
||||
|
||||
ItemTypeListBox.SelectedIndex = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
string HeadMeshFilename = GetFileBaseNameUsingSplit(GetItemFontVals(doc, RobloxDefs.ItemHeadFonts, 0)) + ".mesh";
|
||||
string HeadTextureFilename = GetFileBaseNameUsingSplit(GetItemFontVals(doc, RobloxDefs.ItemHeadFonts, 1)) + ".png";
|
||||
|
||||
Option1TextBox.Text = HeadMeshFilename;
|
||||
Option2TextBox.Text = HeadTextureFilename;
|
||||
|
||||
string HeadMeshScaleCoords = GetItemCoordVals(doc, RobloxDefs.ItemHeadFonts, "Vector3", "Scale");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(HeadMeshScaleCoords))
|
||||
{
|
||||
string[] HeadMeshScaleCoordsSplit = HeadMeshScaleCoords.Split(',');
|
||||
XBox.Value = Convert.ToDecimal(HeadMeshScaleCoordsSplit[0]);
|
||||
YBox.Value = Convert.ToDecimal(HeadMeshScaleCoordsSplit[1]);
|
||||
ZBox.Value = Convert.ToDecimal(HeadMeshScaleCoordsSplit[2]);
|
||||
}
|
||||
|
||||
ItemTypeListBox.SelectedIndex = 1;
|
||||
}
|
||||
break;
|
||||
case RobloxFileType.Face:
|
||||
string FaceTextureFilename = GetFileBaseNameUsingSplit(GetItemFontVals(doc, RobloxDefs.ItemFaceTexture, 0)) + ".png";
|
||||
Option1TextBox.Text = FaceTextureFilename;
|
||||
break;
|
||||
case RobloxFileType.TShirt:
|
||||
string TShirtTextureFilename = GetFileBaseNameUsingSplit(GetItemFontVals(doc, RobloxDefs.ItemTShirtTexture, 0)) + ".png";
|
||||
Option1TextBox.Text = TShirtTextureFilename;
|
||||
break;
|
||||
case RobloxFileType.Shirt:
|
||||
string ShirtTextureFilename = GetFileBaseNameUsingSplit(GetItemFontVals(doc, RobloxDefs.ItemShirtTexture, 0)) + ".png";
|
||||
Option1TextBox.Text = ShirtTextureFilename;
|
||||
break;
|
||||
case RobloxFileType.Pants:
|
||||
string PantsTextureFilename = GetFileBaseNameUsingSplit(GetItemFontVals(doc, RobloxDefs.ItemPantsTexture, 0)) + ".png";
|
||||
Option1TextBox.Text = PantsTextureFilename;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("The Item Creation SDK has experienced an error: " + ex.Message, "Novetus Item Creation SDK - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
success = false;
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
private void ToggleOptionSet(Label label, TextBox textbox, Button button, string labelText, bool browseButton, bool enable = true)
|
||||
{
|
||||
label.Text = enable ? labelText : (string.IsNullOrWhiteSpace(labelText) ? "This option is disabled." : labelText);
|
||||
|
|
@ -779,7 +1145,7 @@ public partial class ItemCreationSDK : Form
|
|||
}
|
||||
else
|
||||
{
|
||||
if(File.Exists(GetPathForType(type) + "\\" + ItemNameBox.Text.Replace(" ", "") + ".rbxm"))
|
||||
if(File.Exists(GetPathForType(type) + "\\" + ItemNameBox.Text.Replace(" ", "") + ".rbxm") && !ItemEditing)
|
||||
{
|
||||
msgboxtext += "\n - The item already exists.";
|
||||
passed = false;
|
||||
|
|
@ -812,7 +1178,7 @@ public partial class ItemCreationSDK : Form
|
|||
{
|
||||
if (string.IsNullOrWhiteSpace(UsesHatTexBox.Text) || UsesHatMeshBox.Text == "None")
|
||||
{
|
||||
if (!File.Exists(Option1Path))
|
||||
if (!File.Exists(Option1Path) && !File.Exists(GetOptionPathsForType(type)[0] + "\\" + Option1TextBox.Text) && !ItemEditing)
|
||||
{
|
||||
msgboxtext += "\n - The file assigned as a " + Option1Label.Text + " does not exist. Please rebrowse for the file again.";
|
||||
passed = false;
|
||||
|
|
@ -838,7 +1204,7 @@ public partial class ItemCreationSDK : Form
|
|||
{
|
||||
if (string.IsNullOrWhiteSpace(UsesHatTexBox.Text) || UsesHatTexBox.Text == "None")
|
||||
{
|
||||
if (!File.Exists(Option2Path))
|
||||
if (!File.Exists(Option2Path) && !File.Exists(GetOptionPathsForType(type)[1] + "\\" + Option2TextBox.Text) && !ItemEditing)
|
||||
{
|
||||
msgboxtext += "\n - The file assigned as a " + Option2Label.Text + " does not exist. Please rebrowse for the file again.";
|
||||
passed = false;
|
||||
|
|
@ -863,7 +1229,7 @@ public partial class ItemCreationSDK : Form
|
|||
return passed;
|
||||
}
|
||||
|
||||
private void UpdateWarnings()
|
||||
private void LoadItemIfExists()
|
||||
{
|
||||
string iconpath = GetPathForType(type) + "\\" + ItemNameBox.Text.Replace(" ", "") + ".png";
|
||||
|
||||
|
|
@ -877,6 +1243,34 @@ public partial class ItemCreationSDK : Form
|
|||
ItemIcon.Image = null;
|
||||
}
|
||||
|
||||
string descpath = GetPathForType(type) + "\\" + ItemNameBox.Text.Replace(" ", "") + "_desc.txt";
|
||||
|
||||
if (File.Exists(descpath))
|
||||
{
|
||||
DescBox.Text = File.ReadAllText(descpath);
|
||||
}
|
||||
else
|
||||
{
|
||||
DescBox.Text = "";
|
||||
}
|
||||
|
||||
string rxbmpath = GetPathForType(type) + "\\" + ItemNameBox.Text.Replace(" ", "") + ".rbxm";
|
||||
|
||||
if (File.Exists(rxbmpath))
|
||||
{
|
||||
LoadItem(rxbmpath, type);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!IsReskin)
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateWarnings()
|
||||
{
|
||||
string warningtext = "";
|
||||
|
||||
if (File.Exists(GetPathForType(type) + "\\" + ItemNameBox.Text.Replace(" ", "") + ".rbxm"))
|
||||
|
|
@ -906,6 +1300,39 @@ public partial class ItemCreationSDK : Form
|
|||
GlobalFuncs.FixedFileDelete(previconpath);
|
||||
}
|
||||
}
|
||||
|
||||
private void Reset(bool full = false)
|
||||
{
|
||||
if (full)
|
||||
{
|
||||
ItemNameBox.Text = "";
|
||||
DescBox.Text = "";
|
||||
ItemTypeListBox.SelectedItem = "Hat";
|
||||
ItemIcon.Image = null;
|
||||
Option1Path = "";
|
||||
Option2Path = "";
|
||||
EditItemBox.Checked = false;
|
||||
ReskinBox.Checked = false;
|
||||
UpdateWarnings();
|
||||
}
|
||||
|
||||
UsesHatMeshBox.SelectedItem = "None";
|
||||
UsesHatTexBox.SelectedItem = "None";
|
||||
SpecialMeshTypeBox.SelectedItem = "Head";
|
||||
Option1TextBox.Text = "";
|
||||
Option2TextBox.Text = "";
|
||||
XBox.Value = 1;
|
||||
YBox.Value = 1;
|
||||
ZBox.Value = 1;
|
||||
XBox360.Value = 1;
|
||||
YBox2.Value = 1;
|
||||
ZBox2.Value = 1;
|
||||
BevelBox.Value = 0M;
|
||||
RoundnessBox.Value = 0M;
|
||||
BulgeBox.Value = 0M;
|
||||
LODXBox.Value = 1M;
|
||||
LODYBox.Value = 2M;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ Changes from 1.3 Pre-Release 3:
|
|||
- Re-added Teams and Spawn Locations to 2006S to fix crashes when joining a server.
|
||||
- Clicking on "Argument Help" for Novetus CMD in the Bootstrapper will no longer close the Bootstrapper.
|
||||
- Added item editing to the Item Creation SDK.
|
||||
- Added the ability to reset all item fields in the Item Creation SDK.
|
||||
- Changed the console text font.
|
||||
- Added more items (full list at end of changelog)
|
||||
Changes from 1.2.4.1:
|
||||
|
|
@ -250,6 +251,10 @@ Pinobe
|
|||
[Nobelium Imports] Shaggy Frenemy
|
||||
Inverted Top Hat
|
||||
Camp ROBLOX
|
||||
Golden Hair
|
||||
Cinnamon Hair
|
||||
Sassy Headband
|
||||
Orinthian Lady
|
||||
Faces:
|
||||
Remastered Face
|
||||
Pumpkin Face (2009)
|
||||
|
|
|
|||
Loading…
Reference in New Issue