begin implementation of item creation SDK

This commit is contained in:
Bitl 2021-07-27 15:45:12 -07:00
parent ce2066c1ed
commit 7d7a7da8e2
18 changed files with 3509 additions and 720 deletions

View File

@ -16,7 +16,7 @@ class CharacterCustomizationShared
public string Custom_Pants_URL = ""; public string Custom_Pants_URL = "";
public string Custom_Face_URL = ""; public string Custom_Face_URL = "";
public List<VarStorage.PartColors> PartColorList; public List<VarStorage.PartColors> PartColorList;
public Settings.Provider[] contentProviders; public Provider[] contentProviders;
public Form Parent; public Form Parent;
public Settings.UIOptions.Style FormStyle; public Settings.UIOptions.Style FormStyle;
public Button WhiteButton, LightStoneGreyButton, MediumStoneGreyButton, DarkStoneGreyButton, BlackButton, public Button WhiteButton, LightStoneGreyButton, MediumStoneGreyButton, DarkStoneGreyButton, BlackButton,
@ -121,9 +121,9 @@ class CharacterCustomizationShared
#region Form Event Functions #region Form Event Functions
public void InitForm() public void InitForm()
{ {
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
contentProviders = Settings.OnlineClothing.GetContentProviders(); contentProviders = OnlineClothing.GetContentProviders();
for (int i = 0; i < contentProviders.Length; i++) for (int i = 0; i < contentProviders.Length; i++)
{ {
@ -136,7 +136,7 @@ class CharacterCustomizationShared
//face //face
if (GlobalVars.UserCustomization.Face.Contains("http://")) if (GlobalVars.UserCustomization.Face.Contains("http://"))
{ {
Settings.Provider faceProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Face); Provider faceProvider = OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Face);
FaceIDBox.Text = GlobalVars.UserCustomization.Face.Replace(faceProvider.URL, ""); FaceIDBox.Text = GlobalVars.UserCustomization.Face.Replace(faceProvider.URL, "");
FaceTypeBox.SelectedItem = faceProvider.Name; FaceTypeBox.SelectedItem = faceProvider.Name;
} }
@ -144,21 +144,21 @@ class CharacterCustomizationShared
//clothing //clothing
if (GlobalVars.UserCustomization.TShirt.Contains("http://")) if (GlobalVars.UserCustomization.TShirt.Contains("http://"))
{ {
Settings.Provider tShirtProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.TShirt); Provider tShirtProvider = OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.TShirt);
TShirtsIDBox.Text = GlobalVars.UserCustomization.TShirt.Replace(tShirtProvider.URL, ""); TShirtsIDBox.Text = GlobalVars.UserCustomization.TShirt.Replace(tShirtProvider.URL, "");
TShirtsTypeBox.SelectedItem = tShirtProvider.Name; TShirtsTypeBox.SelectedItem = tShirtProvider.Name;
} }
if (GlobalVars.UserCustomization.Shirt.Contains("http://")) if (GlobalVars.UserCustomization.Shirt.Contains("http://"))
{ {
Settings.Provider shirtProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Shirt); Provider shirtProvider = OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Shirt);
ShirtsIDBox.Text = GlobalVars.UserCustomization.Shirt.Replace(shirtProvider.URL, ""); ShirtsIDBox.Text = GlobalVars.UserCustomization.Shirt.Replace(shirtProvider.URL, "");
ShirtsTypeBox.SelectedItem = shirtProvider.Name; ShirtsTypeBox.SelectedItem = shirtProvider.Name;
} }
if (GlobalVars.UserCustomization.Pants.Contains("http://")) if (GlobalVars.UserCustomization.Pants.Contains("http://"))
{ {
Settings.Provider pantsProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Pants); Provider pantsProvider = OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Pants);
PantsIDBox.Text = GlobalVars.UserCustomization.Pants.Replace(pantsProvider.URL, ""); PantsIDBox.Text = GlobalVars.UserCustomization.Pants.Replace(pantsProvider.URL, "");
PantsTypeBox.SelectedItem = pantsProvider.Name; PantsTypeBox.SelectedItem = pantsProvider.Name;
} }
@ -304,7 +304,7 @@ class CharacterCustomizationShared
FaceDesc, FaceDesc,
FaceList, FaceList,
true, true,
FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()) : null FaceTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()) : null
); );
break; break;
@ -331,7 +331,7 @@ class CharacterCustomizationShared
TShirtDesc, TShirtDesc,
TShirtList, TShirtList,
true, true,
TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null TShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null
); );
break; break;
@ -358,7 +358,7 @@ class CharacterCustomizationShared
ShirtDesc, ShirtDesc,
ShirtList, ShirtList,
true, true,
ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null ShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null
); );
break; break;
@ -385,7 +385,7 @@ class CharacterCustomizationShared
PantsDesc, PantsDesc,
PantsList, PantsList,
true, true,
PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()) : null PantsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()) : null
); );
break; break;

View File

@ -0,0 +1,66 @@
#region Usings
using System.IO;
using System.Linq;
using System.Xml.Serialization;
#endregion
#region Content Provider Options
public class Provider
{
public string Name;
public string URL;
public string Icon;
}
[XmlRoot("ContentProviders")]
public class ContentProviders
{
[XmlArray("Providers")]
public Provider[] Providers;
}
public class OnlineClothing
{
public static Provider[] GetContentProviders()
{
if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{
XmlSerializer serializer = new XmlSerializer(typeof(ContentProviders));
FileStream fs = new FileStream(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName, FileMode.Open);
ContentProviders providers;
providers = (ContentProviders)serializer.Deserialize(fs);
return providers.Providers;
}
else
{
return null;
}
}
public static Provider FindContentProviderByName(Provider[] providers, string query)
{
if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{
return providers.SingleOrDefault(item => query.Contains(item.Name));
}
else
{
return null;
}
}
public static Provider FindContentProviderByURL(Provider[] providers, string query)
{
if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{
return providers.SingleOrDefault(item => query.Contains(item.URL));
}
else
{
return null;
}
}
}
#endregion

View File

@ -46,7 +46,7 @@ using System.Windows.Forms;
ChangeItem(item, itemdir, defaultitem, outputImage, outputString, box, initial, null, hatsinextra); ChangeItem(item, itemdir, defaultitem, outputImage, outputString, box, initial, null, hatsinextra);
} }
public static void ChangeItem(string item, string itemdir, string defaultitem, PictureBox outputImage, TextBox outputString, ListBox box, bool initial, Settings.Provider provider, bool hatsinextra = false) public static void ChangeItem(string item, string itemdir, string defaultitem, PictureBox outputImage, TextBox outputString, ListBox box, bool initial, Provider provider, bool hatsinextra = false)
{ {
if (Directory.Exists(itemdir)) if (Directory.Exists(itemdir))
{ {
@ -116,7 +116,7 @@ using System.Windows.Forms;
return false; return false;
} }
public static Image GetItemURLImageFromProvider(Settings.Provider provider) public static Image GetItemURLImageFromProvider(Provider provider)
{ {
if (provider != null) if (provider != null)
return LoadImage(GlobalPaths.CustomPlayerDir + @"\\" + provider.Icon, GlobalPaths.extradir + @"\\NoExtra.png"); return LoadImage(GlobalPaths.CustomPlayerDir + @"\\" + provider.Icon, GlobalPaths.extradir + @"\\NoExtra.png");

View File

@ -133,7 +133,7 @@ public partial class CharacterCustomizationCompact : Form
if (!FaceIDBox.Focused && !FaceTypeBox.Focused) if (!FaceIDBox.Focused && !FaceTypeBox.Focused)
{ {
FaceIDBox.Text = ""; FaceIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -149,7 +149,7 @@ public partial class CharacterCustomizationCompact : Form
textBox6, textBox6,
listBox4, listBox4,
false, false,
FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()) : null FaceTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()) : null
); );
} }
} }
@ -159,7 +159,7 @@ public partial class CharacterCustomizationCompact : Form
if (Directory.Exists(GlobalPaths.facedir)) if (Directory.Exists(GlobalPaths.facedir))
{ {
FaceIDBox.Text = ""; FaceIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -174,7 +174,7 @@ public partial class CharacterCustomizationCompact : Form
if (Directory.Exists(GlobalPaths.facedir)) if (Directory.Exists(GlobalPaths.facedir))
{ {
FaceIDBox.Text = ""; FaceIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -204,17 +204,17 @@ public partial class CharacterCustomizationCompact : Form
textBox6, textBox6,
listBox4, listBox4,
false, false,
FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()) : null FaceTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()) : null
); );
} }
private void FaceTypeBox_SelectedIndexChanged(object sender, EventArgs e) private void FaceTypeBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
Settings.Provider faceProvider = null; Provider faceProvider = null;
if (FaceTypeBox.SelectedItem != null) if (FaceTypeBox.SelectedItem != null)
{ {
faceProvider = Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()); faceProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString());
characterCustomizationForm.Custom_Face_URL = faceProvider.URL; characterCustomizationForm.Custom_Face_URL = faceProvider.URL;
} }
@ -246,7 +246,7 @@ public partial class CharacterCustomizationCompact : Form
if (!TShirtsIDBox.Focused && !TShirtsTypeBox.Focused) if (!TShirtsIDBox.Focused && !TShirtsTypeBox.Focused)
{ {
TShirtsIDBox.Text = ""; TShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -262,7 +262,7 @@ public partial class CharacterCustomizationCompact : Form
textBox7, textBox7,
listBox5, listBox5,
false, false,
TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null TShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null
); );
} }
} }
@ -272,7 +272,7 @@ public partial class CharacterCustomizationCompact : Form
if (Directory.Exists(GlobalPaths.tshirtdir)) if (Directory.Exists(GlobalPaths.tshirtdir))
{ {
TShirtsIDBox.Text = ""; TShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -287,7 +287,7 @@ public partial class CharacterCustomizationCompact : Form
if (Directory.Exists(GlobalPaths.tshirtdir)) if (Directory.Exists(GlobalPaths.tshirtdir))
{ {
TShirtsIDBox.Text = ""; TShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -317,17 +317,17 @@ public partial class CharacterCustomizationCompact : Form
textBox7, textBox7,
listBox5, listBox5,
false, false,
TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null TShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null
); );
} }
private void TShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) private void TShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
Settings.Provider tShirtProvider = null; Provider tShirtProvider = null;
if (TShirtsTypeBox.SelectedItem != null) if (TShirtsTypeBox.SelectedItem != null)
{ {
tShirtProvider = Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString()); tShirtProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString());
characterCustomizationForm.Custom_T_Shirt_URL = tShirtProvider.URL; characterCustomizationForm.Custom_T_Shirt_URL = tShirtProvider.URL;
} }
@ -358,7 +358,7 @@ public partial class CharacterCustomizationCompact : Form
if (!ShirtsIDBox.Focused && !ShirtsTypeBox.Focused) if (!ShirtsIDBox.Focused && !ShirtsTypeBox.Focused)
{ {
ShirtsIDBox.Text = ""; ShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -374,7 +374,7 @@ public partial class CharacterCustomizationCompact : Form
textBox8, textBox8,
listBox6, listBox6,
false, false,
ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null ShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null
); );
} }
} }
@ -384,7 +384,7 @@ public partial class CharacterCustomizationCompact : Form
if (Directory.Exists(GlobalPaths.shirtdir)) if (Directory.Exists(GlobalPaths.shirtdir))
{ {
ShirtsIDBox.Text = ""; ShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -399,7 +399,7 @@ public partial class CharacterCustomizationCompact : Form
if (Directory.Exists(GlobalPaths.shirtdir)) if (Directory.Exists(GlobalPaths.shirtdir))
{ {
ShirtsIDBox.Text = ""; ShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -429,17 +429,17 @@ public partial class CharacterCustomizationCompact : Form
textBox8, textBox8,
listBox6, listBox6,
false, false,
ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null ShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null
); );
} }
private void ShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) private void ShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
Settings.Provider shirtProvider = null; Provider shirtProvider = null;
if (ShirtsTypeBox.SelectedItem != null) if (ShirtsTypeBox.SelectedItem != null)
{ {
shirtProvider = Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()); shirtProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString());
characterCustomizationForm.Custom_Shirt_URL = shirtProvider.URL; characterCustomizationForm.Custom_Shirt_URL = shirtProvider.URL;
} }
@ -470,7 +470,7 @@ public partial class CharacterCustomizationCompact : Form
if (!PantsIDBox.Focused && !PantsTypeBox.Focused) if (!PantsIDBox.Focused && !PantsTypeBox.Focused)
{ {
PantsIDBox.Text = ""; PantsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -486,7 +486,7 @@ public partial class CharacterCustomizationCompact : Form
textBox9, textBox9,
listBox7, listBox7,
false, false,
PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()) : null PantsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()) : null
); );
} }
} }
@ -496,7 +496,7 @@ public partial class CharacterCustomizationCompact : Form
if (Directory.Exists(GlobalPaths.pantsdir)) if (Directory.Exists(GlobalPaths.pantsdir))
{ {
PantsIDBox.Text = ""; PantsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -511,7 +511,7 @@ public partial class CharacterCustomizationCompact : Form
if (Directory.Exists(GlobalPaths.pantsdir)) if (Directory.Exists(GlobalPaths.pantsdir))
{ {
PantsIDBox.Text = ""; PantsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -541,17 +541,17 @@ public partial class CharacterCustomizationCompact : Form
textBox9, textBox9,
listBox7, listBox7,
false, false,
PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()) : null PantsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()) : null
); );
} }
private void PantsTypeBox_SelectedIndexChanged(object sender, EventArgs e) private void PantsTypeBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
Settings.Provider pantsProvider = null; Provider pantsProvider = null;
if (PantsTypeBox.SelectedItem != null) if (PantsTypeBox.SelectedItem != null)
{ {
pantsProvider = Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()); pantsProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString());
characterCustomizationForm.Custom_Pants_URL = pantsProvider.URL; characterCustomizationForm.Custom_Pants_URL = pantsProvider.URL;
} }

View File

@ -136,7 +136,7 @@ public partial class CharacterCustomizationExtended : Form
if (!FaceIDBox.Focused && !FaceTypeBox.Focused) if (!FaceIDBox.Focused && !FaceTypeBox.Focused)
{ {
FaceIDBox.Text = ""; FaceIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -152,7 +152,7 @@ public partial class CharacterCustomizationExtended : Form
textBox6, textBox6,
listBox4, listBox4,
false, false,
FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()) : null FaceTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()) : null
); );
} }
} }
@ -162,7 +162,7 @@ public partial class CharacterCustomizationExtended : Form
if (Directory.Exists(GlobalPaths.facedir)) if (Directory.Exists(GlobalPaths.facedir))
{ {
FaceIDBox.Text = ""; FaceIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -177,7 +177,7 @@ public partial class CharacterCustomizationExtended : Form
if (Directory.Exists(GlobalPaths.facedir)) if (Directory.Exists(GlobalPaths.facedir))
{ {
FaceIDBox.Text = ""; FaceIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -207,17 +207,17 @@ public partial class CharacterCustomizationExtended : Form
textBox6, textBox6,
listBox4, listBox4,
false, false,
FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()) : null FaceTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()) : null
); );
} }
private void FaceTypeBox_SelectedIndexChanged(object sender, EventArgs e) private void FaceTypeBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
Settings.Provider faceProvider = null; Provider faceProvider = null;
if (FaceTypeBox.SelectedItem != null) if (FaceTypeBox.SelectedItem != null)
{ {
faceProvider = Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()); faceProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString());
characterCustomizationForm.Custom_Face_URL = faceProvider.URL; characterCustomizationForm.Custom_Face_URL = faceProvider.URL;
} }
@ -249,7 +249,7 @@ public partial class CharacterCustomizationExtended : Form
if (!TShirtsIDBox.Focused && !TShirtsTypeBox.Focused) if (!TShirtsIDBox.Focused && !TShirtsTypeBox.Focused)
{ {
TShirtsIDBox.Text = ""; TShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -265,7 +265,7 @@ public partial class CharacterCustomizationExtended : Form
textBox7, textBox7,
listBox5, listBox5,
false, false,
TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null TShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null
); );
} }
} }
@ -275,7 +275,7 @@ public partial class CharacterCustomizationExtended : Form
if (Directory.Exists(GlobalPaths.tshirtdir)) if (Directory.Exists(GlobalPaths.tshirtdir))
{ {
TShirtsIDBox.Text = ""; TShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -290,7 +290,7 @@ public partial class CharacterCustomizationExtended : Form
if (Directory.Exists(GlobalPaths.tshirtdir)) if (Directory.Exists(GlobalPaths.tshirtdir))
{ {
TShirtsIDBox.Text = ""; TShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; TShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -320,17 +320,17 @@ public partial class CharacterCustomizationExtended : Form
textBox7, textBox7,
listBox5, listBox5,
false, false,
TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null TShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null
); );
} }
private void TShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) private void TShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
Settings.Provider tShirtProvider = null; Provider tShirtProvider = null;
if (TShirtsTypeBox.SelectedItem != null) if (TShirtsTypeBox.SelectedItem != null)
{ {
tShirtProvider = Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString()); tShirtProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, TShirtsTypeBox.SelectedItem.ToString());
characterCustomizationForm.Custom_T_Shirt_URL = tShirtProvider.URL; characterCustomizationForm.Custom_T_Shirt_URL = tShirtProvider.URL;
} }
@ -361,7 +361,7 @@ public partial class CharacterCustomizationExtended : Form
if (!ShirtsIDBox.Focused && !ShirtsTypeBox.Focused) if (!ShirtsIDBox.Focused && !ShirtsTypeBox.Focused)
{ {
ShirtsIDBox.Text = ""; ShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -377,7 +377,7 @@ public partial class CharacterCustomizationExtended : Form
textBox8, textBox8,
listBox6, listBox6,
false, false,
ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null ShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null
); );
} }
} }
@ -387,7 +387,7 @@ public partial class CharacterCustomizationExtended : Form
if (Directory.Exists(GlobalPaths.shirtdir)) if (Directory.Exists(GlobalPaths.shirtdir))
{ {
ShirtsIDBox.Text = ""; ShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -402,7 +402,7 @@ public partial class CharacterCustomizationExtended : Form
if (Directory.Exists(GlobalPaths.shirtdir)) if (Directory.Exists(GlobalPaths.shirtdir))
{ {
ShirtsIDBox.Text = ""; ShirtsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; ShirtsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -432,17 +432,17 @@ public partial class CharacterCustomizationExtended : Form
textBox8, textBox8,
listBox6, listBox6,
false, false,
ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null ShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null
); );
} }
private void ShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) private void ShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
Settings.Provider shirtProvider = null; Provider shirtProvider = null;
if (ShirtsTypeBox.SelectedItem != null) if (ShirtsTypeBox.SelectedItem != null)
{ {
shirtProvider = Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()); shirtProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString());
characterCustomizationForm.Custom_Shirt_URL = shirtProvider.URL; characterCustomizationForm.Custom_Shirt_URL = shirtProvider.URL;
} }
@ -473,7 +473,7 @@ public partial class CharacterCustomizationExtended : Form
if (!PantsIDBox.Focused && !PantsTypeBox.Focused) if (!PantsIDBox.Focused && !PantsTypeBox.Focused)
{ {
PantsIDBox.Text = ""; PantsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -489,7 +489,7 @@ public partial class CharacterCustomizationExtended : Form
textBox9, textBox9,
listBox7, listBox7,
false, false,
PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()) : null PantsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()) : null
); );
} }
} }
@ -499,7 +499,7 @@ public partial class CharacterCustomizationExtended : Form
if (Directory.Exists(GlobalPaths.pantsdir)) if (Directory.Exists(GlobalPaths.pantsdir))
{ {
PantsIDBox.Text = ""; PantsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -514,7 +514,7 @@ public partial class CharacterCustomizationExtended : Form
if (Directory.Exists(GlobalPaths.pantsdir)) if (Directory.Exists(GlobalPaths.pantsdir))
{ {
PantsIDBox.Text = ""; PantsIDBox.Text = "";
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName))
{ {
PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name;
} }
@ -544,17 +544,17 @@ public partial class CharacterCustomizationExtended : Form
textBox9, textBox9,
listBox7, listBox7,
false, false,
PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()) : null PantsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()) : null
); );
} }
private void PantsTypeBox_SelectedIndexChanged(object sender, EventArgs e) private void PantsTypeBox_SelectedIndexChanged(object sender, EventArgs e)
{ {
Settings.Provider pantsProvider = null; Provider pantsProvider = null;
if (PantsTypeBox.SelectedItem != null) if (PantsTypeBox.SelectedItem != null)
{ {
pantsProvider = Settings.OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()); pantsProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString());
characterCustomizationForm.Custom_Pants_URL = pantsProvider.URL; characterCustomizationForm.Custom_Pants_URL = pantsProvider.URL;
} }

View File

@ -10,6 +10,9 @@ public class IconLoader
{ {
private OpenFileDialog openFileDialog1; private OpenFileDialog openFileDialog1;
private string installOutcome = ""; private string installOutcome = "";
public bool CopyToItemDir = false;
public string ItemDir = "";
public string ItemName = "";
public IconLoader() public IconLoader()
{ {
@ -33,13 +36,15 @@ public class IconLoader
public void LoadImage() public void LoadImage()
{ {
string dir = CopyToItemDir ? ItemDir + "\\" + ItemName : GlobalPaths.extradir + "\\icons\\" + GlobalVars.UserConfiguration.PlayerName;
if (openFileDialog1.ShowDialog() == DialogResult.OK) if (openFileDialog1.ShowDialog() == DialogResult.OK)
{ {
try try
{ {
using (Stream str = openFileDialog1.OpenFile()) using (Stream str = openFileDialog1.OpenFile())
{ {
using (Stream output = new FileStream(GlobalPaths.extradir + "\\icons\\" + GlobalVars.UserConfiguration.PlayerName + ".png", FileMode.Create)) using (Stream output = new FileStream(dir + ".png", FileMode.Create))
{ {
byte[] buffer = new byte[32 * 1024]; byte[] buffer = new byte[32 * 1024];
int read; int read;

View File

@ -1,34 +1,10 @@
#region Usings #region Usings
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Xml; using System.Xml;
using System.Xml.Linq; using System.Xml.Linq;
#endregion #endregion
#region Roblox File Types
public enum RobloxFileType
{
//RBXL and RBXM
RBXL,
RBXM,
//Items
Hat,
Head,
Face,
TShirt,
Shirt,
Pants,
//for downloading script assets
//Script
}
#endregion
#region XML Types #region XML Types
public enum XMLTypes public enum XMLTypes
{ {
@ -39,481 +15,9 @@ public enum XMLTypes
} }
#endregion #endregion
#region Roblox Type Definitions
public struct RobloxDefs
{
public static VarStorage.AssetCacheDef Fonts
{
get
{
return new VarStorage.AssetCacheDef("SpecialMesh",
new string[] { "MeshId", "TextureId" },
new string[] { ".mesh", ".png" },
new string[] { GlobalPaths.AssetCacheDirFonts, GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheFontsGameDir, GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Sky
{
get
{
return new VarStorage.AssetCacheDef("Sky",
new string[] { "SkyboxBk", "SkyboxDn", "SkyboxFt", "SkyboxLf", "SkyboxRt", "SkyboxUp" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirSky },
new string[] { GlobalPaths.AssetCacheSkyGameDir });
}
}
public static VarStorage.AssetCacheDef Decal
{
get
{
return new VarStorage.AssetCacheDef("Decal",
new string[] { "Texture" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Texture
{
get
{
return new VarStorage.AssetCacheDef("Texture",
new string[] { "Texture" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef HopperBin
{
get
{
return new VarStorage.AssetCacheDef("HopperBin",
new string[] { "TextureId" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Tool
{
get
{
return new VarStorage.AssetCacheDef("Tool",
new string[] { "TextureId" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Sound
{
get
{
return new VarStorage.AssetCacheDef("Sound",
new string[] { "SoundId" },
new string[] { ".wav" },
new string[] { GlobalPaths.AssetCacheDirSounds },
new string[] { GlobalPaths.AssetCacheSoundsGameDir });
}
}
public static VarStorage.AssetCacheDef ImageLabel
{
get
{
return new VarStorage.AssetCacheDef("ImageLabel",
new string[] { "Image" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Shirt
{
get
{
return new VarStorage.AssetCacheDef("Shirt",
new string[] { "ShirtTemplate" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef ShirtGraphic
{
get
{
return new VarStorage.AssetCacheDef("ShirtGraphic",
new string[] { "Graphic" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Pants
{
get
{
return new VarStorage.AssetCacheDef("Pants",
new string[] { "PantsTemplate" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Script
{
get
{
return new VarStorage.AssetCacheDef("Script",
new string[] { "LinkedSource" },
new string[] { ".lua" },
new string[] { GlobalPaths.AssetCacheDirScripts },
new string[] { GlobalPaths.AssetCacheScriptsGameDir });
}
}
public static VarStorage.AssetCacheDef LocalScript
{
get
{
return new VarStorage.AssetCacheDef("LocalScript",
new string[] { "LinkedSource" },
new string[] { ".lua" },
new string[] { GlobalPaths.AssetCacheDirScripts },
new string[] { GlobalPaths.AssetCacheScriptsGameDir });
}
}
//item defs below
public static VarStorage.AssetCacheDef ItemHatFonts
{
get
{
return new VarStorage.AssetCacheDef("SpecialMesh",
new string[] { "MeshId", "TextureId" },
new string[] { ".mesh", ".png" },
new string[] { GlobalPaths.hatdirFonts, GlobalPaths.hatdirTextures },
new string[] { GlobalPaths.hatGameDirFonts, GlobalPaths.hatGameDirTextures });
}
}
public static VarStorage.AssetCacheDef ItemHatSound
{
get
{
return new VarStorage.AssetCacheDef("Sound",
new string[] { "SoundId" },
new string[] { ".wav" },
new string[] { GlobalPaths.hatdirSounds },
new string[] { GlobalPaths.hatGameDirSounds });
}
}
public static VarStorage.AssetCacheDef ItemHatScript
{
get
{
return new VarStorage.AssetCacheDef("Script",
new string[] { "LinkedSource" },
new string[] { ".lua" },
new string[] { GlobalPaths.hatdirScripts },
new string[] { GlobalPaths.hatGameDirScripts });
}
}
public static VarStorage.AssetCacheDef ItemHatLocalScript
{
get
{
return new VarStorage.AssetCacheDef("LocalScript",
new string[] { "LinkedSource" },
new string[] { ".lua" },
new string[] { GlobalPaths.hatdirScripts },
new string[] { GlobalPaths.hatGameDirScripts });
}
}
public static VarStorage.AssetCacheDef ItemHeadFonts
{
get
{
return new VarStorage.AssetCacheDef("SpecialMesh",
new string[] { "MeshId", "TextureId" },
new string[] { ".mesh", ".png" },
new string[] { GlobalPaths.headdirFonts, GlobalPaths.headdirTextures },
new string[] { GlobalPaths.headGameDirFonts, GlobalPaths.headGameDirTextures });
}
}
public static VarStorage.AssetCacheDef ItemFaceTexture
{
get
{
return new VarStorage.AssetCacheDef("Decal",
new string[] { "Texture" },
new string[] { ".png" },
new string[] { GlobalPaths.facedirTextures },
new string[] { GlobalPaths.faceGameDirTextures });
}
}
public static VarStorage.AssetCacheDef ItemShirtTexture
{
get
{
return new VarStorage.AssetCacheDef("Shirt",
new string[] { "ShirtTemplate" },
new string[] { ".png" },
new string[] { GlobalPaths.shirtdirTextures },
new string[] { GlobalPaths.shirtGameDirTextures });
}
}
public static VarStorage.AssetCacheDef ItemTShirtTexture
{
get
{
return new VarStorage.AssetCacheDef("ShirtGraphic",
new string[] { "Graphic" },
new string[] { ".png" },
new string[] { GlobalPaths.tshirtdirTextures },
new string[] { GlobalPaths.tshirtGameDirTextures });
}
}
public static VarStorage.AssetCacheDef ItemPantsTexture
{
get
{
return new VarStorage.AssetCacheDef("Pants",
new string[] { "PantsTemplate" },
new string[] { ".png" },
new string[] { GlobalPaths.pantsdirTextures },
new string[] { GlobalPaths.pantsGameDirTextures });
}
}
}
#endregion
#region Roblox XML Parser #region Roblox XML Parser
public static class RobloxXML public static class RobloxXML
{ {
public static void DownloadFromNodes(string filepath, VarStorage.AssetCacheDef assetdef, string name = "", string meshname = "")
{
DownloadFromNodes(filepath, assetdef.Class, assetdef.Id[0], assetdef.Ext[0], assetdef.Dir[0], assetdef.GameDir[0], name, meshname);
}
public static void DownloadFromNodes(string filepath, VarStorage.AssetCacheDef assetdef, int idIndex, int extIndex, int outputPathIndex, int inGameDirIndex, string name = "", string meshname = "")
{
DownloadFromNodes(filepath, assetdef.Class, assetdef.Id[idIndex], assetdef.Ext[extIndex], assetdef.Dir[outputPathIndex], assetdef.GameDir[inGameDirIndex], name, meshname);
}
public static void DownloadFromNodes(string filepath, string itemClassValue, string itemIdValue, string fileext, string outputPath, string inGameDir, string name = "", string meshname = "")
{
string oldfile = File.ReadAllText(filepath);
string fixedfile = RemoveInvalidXmlChars(ReplaceHexadecimalSymbols(oldfile));
XDocument doc = XDocument.Parse(fixedfile);
try
{
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)
{
if (!item3.Value.Contains("rbxassetid"))
{
if (!item3.Value.Contains("rbxasset"))
{
if (string.IsNullOrWhiteSpace(meshname))
{
string url = item3.Value;
string newurl = "assetdelivery.roblox.com/v1/asset/?id=";
string urlFixed = url.Replace("http://", "https://")
.Replace("?version=1&amp;id=", "?id=")
.Replace("www.roblox.com/asset/?id=", newurl)
.Replace("www.roblox.com/asset?id=", newurl)
.Replace("assetgame.roblox.com/asset/?id=", newurl)
.Replace("assetgame.roblox.com/asset?id=", newurl)
.Replace("roblox.com/asset/?id=", newurl)
.Replace("roblox.com/asset?id=", newurl)
.Replace("&amp;", "&")
.Replace("amp;", "&");
string peram = "id=";
if (string.IsNullOrWhiteSpace(name))
{
if (urlFixed.Contains(peram))
{
string IDVal = urlFixed.After(peram);
DownloadFilesFromNode(urlFixed, outputPath, fileext, IDVal);
item3.Value = (inGameDir + IDVal + fileext).Replace(" ", "");
}
}
else
{
DownloadFilesFromNode(urlFixed, outputPath, fileext, name);
item3.Value = inGameDir + name + fileext;
}
}
else
{
item3.Value = inGameDir + meshname;
}
}
}
else
{
if (string.IsNullOrWhiteSpace(meshname))
{
string url = item3.Value;
string rbxassetid = "rbxassetid://";
string urlFixed = "https://assetdelivery.roblox.com/v1/asset/?id=" + url.After(rbxassetid);
string peram = "id=";
if (string.IsNullOrWhiteSpace(name))
{
if (urlFixed.Contains(peram))
{
string IDVal = urlFixed.After(peram);
DownloadFilesFromNode(urlFixed, outputPath, fileext, IDVal);
item3.Value = inGameDir + IDVal + fileext;
}
}
else
{
DownloadFilesFromNode(urlFixed, outputPath, fileext, name);
item3.Value = inGameDir + name + fileext;
}
}
else
{
item3.Value = inGameDir + meshname;
}
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
doc.Save(filepath);
}
}
//TODO: actually download the script assets instead of fixing the scripts lol. fixing the scripts won't work anyways because we don't support https natively.
/*
public static void DownloadScriptFromNodes(string filepath, string itemClassValue)
{
string oldfile = File.ReadAllText(filepath);
string fixedfile = RemoveInvalidXmlChars(ReplaceHexadecimalSymbols(oldfile));
XDocument doc = XDocument.Parse(fixedfile);
try
{
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("Properties")
select nodes;
foreach (var item2 in v2)
{
var v3 = from nodes in doc.Descendants("ProtectedString")
where nodes.Attribute("name").Value == "Source"
select nodes;
foreach (var item3 in v3)
{
string newurl = "assetdelivery.roblox.com/v1/asset/?id=";
item3.Value.Replace("http://", "https://")
.Replace("?version=1&id=", "?id=")
.Replace("www.roblox.com/asset/?id=", newurl)
.Replace("www.roblox.com/asset?id=", newurl)
.Replace("assetgame.roblox.com/asset/?id=", newurl)
.Replace("assetgame.roblox.com/asset?id=", newurl)
.Replace("roblox.com/asset/?id=", newurl)
.Replace("roblox.com/asset?id=", newurl);
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
doc.Save(filepath);
}
}
public static void DownloadFromScript(string filepath)
{
string[] file = File.ReadAllLines(filepath);
try
{
foreach (var line in file)
{
if (line.Contains("www.roblox.com/asset/?id=") || line.Contains("assetgame.roblox.com/asset/?id="))
{
string newurl = "assetdelivery.roblox.com/v1/asset/?id=";
line.Replace("http://", "https://")
.Replace("?version=1&id=", "?id=")
.Replace("www.roblox.com/asset/?id=", newurl)
.Replace("www.roblox.com/asset?id=", newurl)
.Replace("assetgame.roblox.com/asset/?id=", newurl)
.Replace("assetgame.roblox.com/asset?id=", newurl)
.Replace("roblox.com/asset/?id=", newurl)
.Replace("roblox.com/asset?id=", newurl);
}
}
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
File.WriteAllLines(filepath, file);
}
}*/
public static string GetStringForXMLType(XMLTypes type) public static string GetStringForXMLType(XMLTypes type)
{ {
switch (type) switch (type)
@ -594,23 +98,6 @@ public static class RobloxXML
return ""; return "";
} }
private static void DownloadFilesFromNode(string url, string path, string fileext, string id)
{
if (!string.IsNullOrWhiteSpace(id))
{
Downloader download = new Downloader(url, id);
try
{
download.InitDownload(path, fileext, "", true);
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
public static string RemoveInvalidXmlChars(string content) public static string RemoveInvalidXmlChars(string content)
{ {
return new string(content.Where(ch => XmlConvert.IsXmlChar(ch)).ToArray()); return new string(content.Where(ch => XmlConvert.IsXmlChar(ch)).ToArray());

View File

@ -1,8 +1,6 @@
#region Settings #region Settings
using System; using System;
using System.IO; using System.IO;
using System.Linq;
using System.Xml.Serialization;
public class Settings public class Settings
{ {
@ -246,66 +244,5 @@ public class Settings
} }
} }
#endregion #endregion
#region Content Provider Options
public class Provider
{
public string Name;
public string URL;
public string Icon;
}
[XmlRoot("ContentProviders")]
public class ContentProviders
{
[XmlArray("Providers")]
public Provider[] Providers;
}
public class OnlineClothing
{
public static Provider[] GetContentProviders()
{
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml"))
{
XmlSerializer serializer = new XmlSerializer(typeof(ContentProviders));
FileStream fs = new FileStream(GlobalPaths.ConfigDir + "\\ContentProviders.xml", FileMode.Open);
ContentProviders providers;
providers = (ContentProviders)serializer.Deserialize(fs);
return providers.Providers;
}
else
{
return null;
}
}
public static Provider FindContentProviderByName(Provider[] providers, string query)
{
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml"))
{
return providers.SingleOrDefault(item => query.Contains(item.Name));
}
else
{
return null;
}
}
public static Provider FindContentProviderByURL(Provider[] providers, string query)
{
if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml"))
{
return providers.SingleOrDefault(item => query.Contains(item.URL));
}
else
{
return null;
}
}
}
#endregion
} }
#endregion #endregion

View File

@ -9,6 +9,7 @@
<Import_RootNamespace>NovetusCore</Import_RootNamespace> <Import_RootNamespace>NovetusCore</Import_RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)CharCustom\ContentProviders.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CharCustom\CustomizationFuncs.cs" /> <Compile Include="$(MSBuildThisFileDirectory)CharCustom\CustomizationFuncs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CharCustom\IconLoader.cs" /> <Compile Include="$(MSBuildThisFileDirectory)CharCustom\IconLoader.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Classes\CommandLineArguments.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Classes\CommandLineArguments.cs" />
@ -19,8 +20,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Classes\RobloxXML.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Classes\RobloxXML.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Classes\Settings.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Classes\Settings.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Classes\TextLineRemover.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Classes\TextLineRemover.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SDK\Downloader.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SDK\SDKFuncs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)StorageAndFunctions\GlobalFuncs.cs" /> <Compile Include="$(MSBuildThisFileDirectory)StorageAndFunctions\GlobalFuncs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)StorageAndFunctions\GlobalPaths.cs" /> <Compile Include="$(MSBuildThisFileDirectory)StorageAndFunctions\GlobalPaths.cs" />
<Compile Include="$(MSBuildThisFileDirectory)StorageAndFunctions\GlobalVars.cs" /> <Compile Include="$(MSBuildThisFileDirectory)StorageAndFunctions\GlobalVars.cs" />

View File

@ -110,6 +110,7 @@ public class GlobalPaths
public static readonly string InfoName = "info.ini"; public static readonly string InfoName = "info.ini";
public static readonly string ScriptName = "CSMPFunctions"; public static readonly string ScriptName = "CSMPFunctions";
public static readonly string ScriptGenName = "CSMPBoot"; public static readonly string ScriptGenName = "CSMPBoot";
public static readonly string ContentProviderXMLName = "ContentProviders.xml";
#endregion #endregion
#region Empty Paths (automatically changed) #region Empty Paths (automatically changed)

View File

@ -0,0 +1,288 @@
#region Roblox File Types
public enum RobloxFileType
{
//RBXL and RBXM
RBXL,
RBXM,
//Items
Hat,
Head,
Face,
TShirt,
Shirt,
Pants,
HeadNoCustomMesh,
//for downloading script assets
//Script
}
#endregion
#region Roblox Type Definitions
public struct RobloxDefs
{
public static VarStorage.AssetCacheDef Fonts
{
get
{
return new VarStorage.AssetCacheDef("SpecialMesh",
new string[] { "MeshId", "TextureId" },
new string[] { ".mesh", ".png" },
new string[] { GlobalPaths.AssetCacheDirFonts, GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheFontsGameDir, GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Sky
{
get
{
return new VarStorage.AssetCacheDef("Sky",
new string[] { "SkyboxBk", "SkyboxDn", "SkyboxFt", "SkyboxLf", "SkyboxRt", "SkyboxUp" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirSky },
new string[] { GlobalPaths.AssetCacheSkyGameDir });
}
}
public static VarStorage.AssetCacheDef Decal
{
get
{
return new VarStorage.AssetCacheDef("Decal",
new string[] { "Texture" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Texture
{
get
{
return new VarStorage.AssetCacheDef("Texture",
new string[] { "Texture" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef HopperBin
{
get
{
return new VarStorage.AssetCacheDef("HopperBin",
new string[] { "TextureId" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Tool
{
get
{
return new VarStorage.AssetCacheDef("Tool",
new string[] { "TextureId" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Sound
{
get
{
return new VarStorage.AssetCacheDef("Sound",
new string[] { "SoundId" },
new string[] { ".wav" },
new string[] { GlobalPaths.AssetCacheDirSounds },
new string[] { GlobalPaths.AssetCacheSoundsGameDir });
}
}
public static VarStorage.AssetCacheDef ImageLabel
{
get
{
return new VarStorage.AssetCacheDef("ImageLabel",
new string[] { "Image" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Shirt
{
get
{
return new VarStorage.AssetCacheDef("Shirt",
new string[] { "ShirtTemplate" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef ShirtGraphic
{
get
{
return new VarStorage.AssetCacheDef("ShirtGraphic",
new string[] { "Graphic" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Pants
{
get
{
return new VarStorage.AssetCacheDef("Pants",
new string[] { "PantsTemplate" },
new string[] { ".png" },
new string[] { GlobalPaths.AssetCacheDirTextures },
new string[] { GlobalPaths.AssetCacheTexturesGameDir });
}
}
public static VarStorage.AssetCacheDef Script
{
get
{
return new VarStorage.AssetCacheDef("Script",
new string[] { "LinkedSource" },
new string[] { ".lua" },
new string[] { GlobalPaths.AssetCacheDirScripts },
new string[] { GlobalPaths.AssetCacheScriptsGameDir });
}
}
public static VarStorage.AssetCacheDef LocalScript
{
get
{
return new VarStorage.AssetCacheDef("LocalScript",
new string[] { "LinkedSource" },
new string[] { ".lua" },
new string[] { GlobalPaths.AssetCacheDirScripts },
new string[] { GlobalPaths.AssetCacheScriptsGameDir });
}
}
//item defs below
public static VarStorage.AssetCacheDef ItemHatFonts
{
get
{
return new VarStorage.AssetCacheDef("SpecialMesh",
new string[] { "MeshId", "TextureId" },
new string[] { ".mesh", ".png" },
new string[] { GlobalPaths.hatdirFonts, GlobalPaths.hatdirTextures },
new string[] { GlobalPaths.hatGameDirFonts, GlobalPaths.hatGameDirTextures });
}
}
public static VarStorage.AssetCacheDef ItemHatSound
{
get
{
return new VarStorage.AssetCacheDef("Sound",
new string[] { "SoundId" },
new string[] { ".wav" },
new string[] { GlobalPaths.hatdirSounds },
new string[] { GlobalPaths.hatGameDirSounds });
}
}
public static VarStorage.AssetCacheDef ItemHatScript
{
get
{
return new VarStorage.AssetCacheDef("Script",
new string[] { "LinkedSource" },
new string[] { ".lua" },
new string[] { GlobalPaths.hatdirScripts },
new string[] { GlobalPaths.hatGameDirScripts });
}
}
public static VarStorage.AssetCacheDef ItemHatLocalScript
{
get
{
return new VarStorage.AssetCacheDef("LocalScript",
new string[] { "LinkedSource" },
new string[] { ".lua" },
new string[] { GlobalPaths.hatdirScripts },
new string[] { GlobalPaths.hatGameDirScripts });
}
}
public static VarStorage.AssetCacheDef ItemHeadFonts
{
get
{
return new VarStorage.AssetCacheDef("SpecialMesh",
new string[] { "MeshId", "TextureId" },
new string[] { ".mesh", ".png" },
new string[] { GlobalPaths.headdirFonts, GlobalPaths.headdirTextures },
new string[] { GlobalPaths.headGameDirFonts, GlobalPaths.headGameDirTextures });
}
}
public static VarStorage.AssetCacheDef ItemFaceTexture
{
get
{
return new VarStorage.AssetCacheDef("Decal",
new string[] { "Texture" },
new string[] { ".png" },
new string[] { GlobalPaths.facedirTextures },
new string[] { GlobalPaths.faceGameDirTextures });
}
}
public static VarStorage.AssetCacheDef ItemShirtTexture
{
get
{
return new VarStorage.AssetCacheDef("Shirt",
new string[] { "ShirtTemplate" },
new string[] { ".png" },
new string[] { GlobalPaths.shirtdirTextures },
new string[] { GlobalPaths.shirtGameDirTextures });
}
}
public static VarStorage.AssetCacheDef ItemTShirtTexture
{
get
{
return new VarStorage.AssetCacheDef("ShirtGraphic",
new string[] { "Graphic" },
new string[] { ".png" },
new string[] { GlobalPaths.tshirtdirTextures },
new string[] { GlobalPaths.tshirtGameDirTextures });
}
}
public static VarStorage.AssetCacheDef ItemPantsTexture
{
get
{
return new VarStorage.AssetCacheDef("Pants",
new string[] { "PantsTemplate" },
new string[] { ".png" },
new string[] { GlobalPaths.pantsdirTextures },
new string[] { GlobalPaths.pantsGameDirTextures });
}
}
}
#endregion

View File

@ -1,12 +1,11 @@
#region Usings #region Usings
using NLog.Filters;
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Security.Policy;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml.Linq;
using System.Linq;
#endregion #endregion
#region SDKApps #region SDKApps
@ -27,6 +26,224 @@ enum SDKApps
class SDKFuncs class SDKFuncs
{ {
#region Asset Localizer #region Asset Localizer
private static void DownloadFilesFromNode(string url, string path, string fileext, string id)
{
if (!string.IsNullOrWhiteSpace(id))
{
Downloader download = new Downloader(url, id);
try
{
download.InitDownload(path, fileext, "", true);
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
public static void DownloadFromNodes(string filepath, VarStorage.AssetCacheDef assetdef, string name = "", string meshname = "")
{
DownloadFromNodes(filepath, assetdef.Class, assetdef.Id[0], assetdef.Ext[0], assetdef.Dir[0], assetdef.GameDir[0], name, meshname);
}
public static void DownloadFromNodes(string filepath, VarStorage.AssetCacheDef assetdef, int idIndex, int extIndex, int outputPathIndex, int inGameDirIndex, string name = "", string meshname = "")
{
DownloadFromNodes(filepath, assetdef.Class, assetdef.Id[idIndex], assetdef.Ext[extIndex], assetdef.Dir[outputPathIndex], assetdef.GameDir[inGameDirIndex], name, meshname);
}
public static void DownloadFromNodes(string filepath, string itemClassValue, string itemIdValue, string fileext, string outputPath, string inGameDir, string name = "", string meshname = "")
{
string oldfile = File.ReadAllText(filepath);
string fixedfile = RobloxXML.RemoveInvalidXmlChars(RobloxXML.ReplaceHexadecimalSymbols(oldfile));
XDocument doc = XDocument.Parse(fixedfile);
try
{
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)
{
if (!item3.Value.Contains("rbxassetid"))
{
if (!item3.Value.Contains("rbxasset"))
{
if (string.IsNullOrWhiteSpace(meshname))
{
string url = item3.Value;
string newurl = "assetdelivery.roblox.com/v1/asset/?id=";
string urlFixed = url.Replace("http://", "https://")
.Replace("?version=1&amp;id=", "?id=")
.Replace("www.roblox.com/asset/?id=", newurl)
.Replace("www.roblox.com/asset?id=", newurl)
.Replace("assetgame.roblox.com/asset/?id=", newurl)
.Replace("assetgame.roblox.com/asset?id=", newurl)
.Replace("roblox.com/asset/?id=", newurl)
.Replace("roblox.com/asset?id=", newurl)
.Replace("&amp;", "&")
.Replace("amp;", "&");
string peram = "id=";
if (string.IsNullOrWhiteSpace(name))
{
if (urlFixed.Contains(peram))
{
string IDVal = urlFixed.After(peram);
DownloadFilesFromNode(urlFixed, outputPath, fileext, IDVal);
item3.Value = (inGameDir + IDVal + fileext).Replace(" ", "");
}
}
else
{
DownloadFilesFromNode(urlFixed, outputPath, fileext, name);
item3.Value = inGameDir + name + fileext;
}
}
else
{
item3.Value = inGameDir + meshname;
}
}
}
else
{
if (string.IsNullOrWhiteSpace(meshname))
{
string url = item3.Value;
string rbxassetid = "rbxassetid://";
string urlFixed = "https://assetdelivery.roblox.com/v1/asset/?id=" + url.After(rbxassetid);
string peram = "id=";
if (string.IsNullOrWhiteSpace(name))
{
if (urlFixed.Contains(peram))
{
string IDVal = urlFixed.After(peram);
DownloadFilesFromNode(urlFixed, outputPath, fileext, IDVal);
item3.Value = inGameDir + IDVal + fileext;
}
}
else
{
DownloadFilesFromNode(urlFixed, outputPath, fileext, name);
item3.Value = inGameDir + name + fileext;
}
}
else
{
item3.Value = inGameDir + meshname;
}
}
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
doc.Save(filepath);
}
}
//TODO: actually download the script assets instead of fixing the scripts lol. fixing the scripts won't work anyways because we don't support https natively.
/*
public static void DownloadScriptFromNodes(string filepath, string itemClassValue)
{
string oldfile = File.ReadAllText(filepath);
string fixedfile = RemoveInvalidXmlChars(ReplaceHexadecimalSymbols(oldfile));
XDocument doc = XDocument.Parse(fixedfile);
try
{
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("Properties")
select nodes;
foreach (var item2 in v2)
{
var v3 = from nodes in doc.Descendants("ProtectedString")
where nodes.Attribute("name").Value == "Source"
select nodes;
foreach (var item3 in v3)
{
string newurl = "assetdelivery.roblox.com/v1/asset/?id=";
item3.Value.Replace("http://", "https://")
.Replace("?version=1&id=", "?id=")
.Replace("www.roblox.com/asset/?id=", newurl)
.Replace("www.roblox.com/asset?id=", newurl)
.Replace("assetgame.roblox.com/asset/?id=", newurl)
.Replace("assetgame.roblox.com/asset?id=", newurl)
.Replace("roblox.com/asset/?id=", newurl)
.Replace("roblox.com/asset?id=", newurl);
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
doc.Save(filepath);
}
}
public static void DownloadFromScript(string filepath)
{
string[] file = File.ReadAllLines(filepath);
try
{
foreach (var line in file)
{
if (line.Contains("www.roblox.com/asset/?id=") || line.Contains("assetgame.roblox.com/asset/?id="))
{
string newurl = "assetdelivery.roblox.com/v1/asset/?id=";
line.Replace("http://", "https://")
.Replace("?version=1&id=", "?id=")
.Replace("www.roblox.com/asset/?id=", newurl)
.Replace("www.roblox.com/asset?id=", newurl)
.Replace("assetgame.roblox.com/asset/?id=", newurl)
.Replace("assetgame.roblox.com/asset?id=", newurl)
.Replace("roblox.com/asset/?id=", newurl)
.Replace("roblox.com/asset?id=", newurl);
}
}
}
catch (Exception ex)
{
MessageBox.Show("The download has experienced an error: " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
File.WriteAllLines(filepath, file);
}
}*/
public static OpenFileDialog LoadROBLOXFileDialog(RobloxFileType type) public static OpenFileDialog LoadROBLOXFileDialog(RobloxFileType type)
{ {
string typeFilter = ""; string typeFilter = "";
@ -81,8 +298,8 @@ class SDKFuncs
type = RobloxFileType.Pants; type = RobloxFileType.Pants;
break; break;
//case 8: //case 8:
//type = RobloxFileType.Script; //type = RobloxFileType.Script;
//break; //break;
default: default:
type = RobloxFileType.RBXL; type = RobloxFileType.RBXL;
break; break;
@ -142,10 +359,10 @@ class SDKFuncs
case 90: case 90:
progressString = "Downloading RBXL Linked LocalScripts..."; progressString = "Downloading RBXL Linked LocalScripts...";
break; break;
//case 95: //case 95:
//progressString = "Fixing RBXL Scripts..."; //progressString = "Fixing RBXL Scripts...";
//break; //break;
//case 97: //case 97:
//progressString = "Fixing RBXL LocalScripts..."; //progressString = "Fixing RBXL LocalScripts...";
//break; //break;
} }
@ -192,10 +409,10 @@ class SDKFuncs
case 90: case 90:
progressString = "Downloading RBXM Linked LocalScripts..."; progressString = "Downloading RBXM Linked LocalScripts...";
break; break;
//case 95: //case 95:
//progressString = "Fixing RBXM Scripts..."; //progressString = "Fixing RBXM Scripts...";
//break; //break;
//case 97: //case 97:
//progressString = "Fixing RBXM LocalScripts..."; //progressString = "Fixing RBXM LocalScripts...";
//break; //break;
} }
@ -262,16 +479,16 @@ class SDKFuncs
break; break;
} }
break; break;
/* /*
case RobloxFileType.Script: case RobloxFileType.Script:
//script //script
switch (percent) switch (percent)
{ {
case 0: case 0:
progressString = "Fixing Script..."; progressString = "Fixing Script...";
break; break;
} }
break;*/ break;*/
default: default:
progressString = "Idle"; progressString = "Idle";
break; break;
@ -306,44 +523,44 @@ class SDKFuncs
} }
//meshes //meshes
worker.ReportProgress(5); worker.ReportProgress(5);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Fonts); DownloadFromNodes(path, RobloxDefs.Fonts);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Fonts, 1, 1, 1, 1); DownloadFromNodes(path, RobloxDefs.Fonts, 1, 1, 1, 1);
//skybox //skybox
worker.ReportProgress(10); worker.ReportProgress(10);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky); DownloadFromNodes(path, RobloxDefs.Sky);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky, 1, 0, 0, 0); DownloadFromNodes(path, RobloxDefs.Sky, 1, 0, 0, 0);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky, 2, 0, 0, 0); DownloadFromNodes(path, RobloxDefs.Sky, 2, 0, 0, 0);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky, 3, 0, 0, 0); DownloadFromNodes(path, RobloxDefs.Sky, 3, 0, 0, 0);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky, 4, 0, 0, 0); DownloadFromNodes(path, RobloxDefs.Sky, 4, 0, 0, 0);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky, 5, 0, 0, 0); DownloadFromNodes(path, RobloxDefs.Sky, 5, 0, 0, 0);
//decal //decal
worker.ReportProgress(15); worker.ReportProgress(15);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Decal); DownloadFromNodes(path, RobloxDefs.Decal);
//texture //texture
worker.ReportProgress(20); worker.ReportProgress(20);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Texture); DownloadFromNodes(path, RobloxDefs.Texture);
//tools and hopperbin //tools and hopperbin
worker.ReportProgress(25); worker.ReportProgress(25);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Tool); DownloadFromNodes(path, RobloxDefs.Tool);
worker.ReportProgress(30); worker.ReportProgress(30);
RobloxXML.DownloadFromNodes(path, RobloxDefs.HopperBin); DownloadFromNodes(path, RobloxDefs.HopperBin);
//sound //sound
worker.ReportProgress(40); worker.ReportProgress(40);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sound); DownloadFromNodes(path, RobloxDefs.Sound);
worker.ReportProgress(50); worker.ReportProgress(50);
RobloxXML.DownloadFromNodes(path, RobloxDefs.ImageLabel); DownloadFromNodes(path, RobloxDefs.ImageLabel);
//clothing //clothing
worker.ReportProgress(60); worker.ReportProgress(60);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Shirt); DownloadFromNodes(path, RobloxDefs.Shirt);
worker.ReportProgress(65); worker.ReportProgress(65);
RobloxXML.DownloadFromNodes(path, RobloxDefs.ShirtGraphic); DownloadFromNodes(path, RobloxDefs.ShirtGraphic);
worker.ReportProgress(70); worker.ReportProgress(70);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Pants); DownloadFromNodes(path, RobloxDefs.Pants);
//scripts //scripts
worker.ReportProgress(80); worker.ReportProgress(80);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Script); DownloadFromNodes(path, RobloxDefs.Script);
worker.ReportProgress(90); worker.ReportProgress(90);
RobloxXML.DownloadFromNodes(path, RobloxDefs.LocalScript); DownloadFromNodes(path, RobloxDefs.LocalScript);
//localize any scripts that are not handled //localize any scripts that are not handled
/* /*
worker.ReportProgress(95); worker.ReportProgress(95);
@ -370,44 +587,44 @@ class SDKFuncs
worker.ReportProgress(0); worker.ReportProgress(0);
} }
//meshes //meshes
RobloxXML.DownloadFromNodes(path, RobloxDefs.Fonts); DownloadFromNodes(path, RobloxDefs.Fonts);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Fonts, 1, 1, 1, 1); DownloadFromNodes(path, RobloxDefs.Fonts, 1, 1, 1, 1);
//skybox //skybox
worker.ReportProgress(10); worker.ReportProgress(10);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky); DownloadFromNodes(path, RobloxDefs.Sky);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky, 1, 0, 0, 0); DownloadFromNodes(path, RobloxDefs.Sky, 1, 0, 0, 0);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky, 2, 0, 0, 0); DownloadFromNodes(path, RobloxDefs.Sky, 2, 0, 0, 0);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky, 3, 0, 0, 0); DownloadFromNodes(path, RobloxDefs.Sky, 3, 0, 0, 0);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky, 4, 0, 0, 0); DownloadFromNodes(path, RobloxDefs.Sky, 4, 0, 0, 0);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sky, 5, 0, 0, 0); DownloadFromNodes(path, RobloxDefs.Sky, 5, 0, 0, 0);
//decal //decal
worker.ReportProgress(15); worker.ReportProgress(15);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Decal); DownloadFromNodes(path, RobloxDefs.Decal);
//texture //texture
worker.ReportProgress(20); worker.ReportProgress(20);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Texture); DownloadFromNodes(path, RobloxDefs.Texture);
//tools and hopperbin //tools and hopperbin
worker.ReportProgress(25); worker.ReportProgress(25);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Tool); DownloadFromNodes(path, RobloxDefs.Tool);
worker.ReportProgress(30); worker.ReportProgress(30);
RobloxXML.DownloadFromNodes(path, RobloxDefs.HopperBin); DownloadFromNodes(path, RobloxDefs.HopperBin);
//sound //sound
worker.ReportProgress(40); worker.ReportProgress(40);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Sound); DownloadFromNodes(path, RobloxDefs.Sound);
worker.ReportProgress(50); worker.ReportProgress(50);
RobloxXML.DownloadFromNodes(path, RobloxDefs.ImageLabel); DownloadFromNodes(path, RobloxDefs.ImageLabel);
//clothing //clothing
worker.ReportProgress(60); worker.ReportProgress(60);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Shirt); DownloadFromNodes(path, RobloxDefs.Shirt);
worker.ReportProgress(65); worker.ReportProgress(65);
RobloxXML.DownloadFromNodes(path, RobloxDefs.ShirtGraphic); DownloadFromNodes(path, RobloxDefs.ShirtGraphic);
worker.ReportProgress(70); worker.ReportProgress(70);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Pants); DownloadFromNodes(path, RobloxDefs.Pants);
//scripts //scripts
worker.ReportProgress(80); worker.ReportProgress(80);
RobloxXML.DownloadFromNodes(path, RobloxDefs.Script); DownloadFromNodes(path, RobloxDefs.Script);
worker.ReportProgress(90); worker.ReportProgress(90);
RobloxXML.DownloadFromNodes(path, RobloxDefs.LocalScript); DownloadFromNodes(path, RobloxDefs.LocalScript);
//localize any scripts that are not handled //localize any scripts that are not handled
/* /*
worker.ReportProgress(95); worker.ReportProgress(95);
@ -434,15 +651,15 @@ class SDKFuncs
worker.ReportProgress(0); worker.ReportProgress(0);
} }
//meshes //meshes
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemHatFonts, itemname, meshname); DownloadFromNodes(path, RobloxDefs.ItemHatFonts, itemname, meshname);
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemHatFonts, 1, 1, 1, 1, itemname); DownloadFromNodes(path, RobloxDefs.ItemHatFonts, 1, 1, 1, 1, itemname);
worker.ReportProgress(25); worker.ReportProgress(25);
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemHatSound); DownloadFromNodes(path, RobloxDefs.ItemHatSound);
//scripts //scripts
worker.ReportProgress(50); worker.ReportProgress(50);
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemHatScript); DownloadFromNodes(path, RobloxDefs.ItemHatScript);
worker.ReportProgress(75); worker.ReportProgress(75);
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemHatLocalScript); DownloadFromNodes(path, RobloxDefs.ItemHatLocalScript);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.Head: case RobloxFileType.Head:
@ -463,8 +680,8 @@ class SDKFuncs
worker.ReportProgress(0); worker.ReportProgress(0);
} }
//meshes //meshes
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemHeadFonts, itemname); DownloadFromNodes(path, RobloxDefs.ItemHeadFonts, itemname);
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemHeadFonts, 1, 1, 1, 1, itemname); DownloadFromNodes(path, RobloxDefs.ItemHeadFonts, 1, 1, 1, 1, itemname);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.Face: case RobloxFileType.Face:
@ -485,7 +702,7 @@ class SDKFuncs
worker.ReportProgress(0); worker.ReportProgress(0);
} }
//decal //decal
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemFaceTexture, itemname); DownloadFromNodes(path, RobloxDefs.ItemFaceTexture, itemname);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.TShirt: case RobloxFileType.TShirt:
@ -506,7 +723,7 @@ class SDKFuncs
worker.ReportProgress(0); worker.ReportProgress(0);
} }
//texture //texture
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemTShirtTexture, itemname); DownloadFromNodes(path, RobloxDefs.ItemTShirtTexture, itemname);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.Shirt: case RobloxFileType.Shirt:
@ -527,7 +744,7 @@ class SDKFuncs
worker.ReportProgress(0); worker.ReportProgress(0);
} }
//texture //texture
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemShirtTexture, itemname); DownloadFromNodes(path, RobloxDefs.ItemShirtTexture, itemname);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
case RobloxFileType.Pants: case RobloxFileType.Pants:
@ -548,7 +765,7 @@ class SDKFuncs
worker.ReportProgress(0); worker.ReportProgress(0);
} }
//texture //texture
RobloxXML.DownloadFromNodes(path, RobloxDefs.ItemPantsTexture, itemname); DownloadFromNodes(path, RobloxDefs.ItemPantsTexture, itemname);
worker.ReportProgress(100); worker.ReportProgress(100);
break; break;
/*case RobloxFileType.Script: /*case RobloxFileType.Script:
@ -584,6 +801,181 @@ class SDKFuncs
} }
#endregion #endregion
#region Item Creation SDK
public static void SetItemFontVals(XDocument doc, VarStorage.AssetCacheDef assetdef, int idIndex, int outputPathIndex, int inGameDirIndex, string assetfilename)
{
SetItemFontVals(doc, assetdef.Class, assetdef.Id[idIndex], assetdef.Dir[outputPathIndex], assetdef.GameDir[inGameDirIndex], assetfilename);
}
public static void SetItemFontVals(XDocument doc, string itemClassValue, string itemIdValue, string outputPath, string inGameDir, string assetfilename)
{
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)
{
GlobalFuncs.FixedFileCopy(assetfilename, outputPath, true);
string fixedfilename = Path.GetFileName(assetfilename);
item3.Value = inGameDir + fixedfilename;
}
}
}
}
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);
}
public static void SetItemCoordVals(XDocument doc, string itemClassValue, double X, double Y, double Z, string CoordClass, string CoordName)
{
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(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)
{
item3.Value = X.ToString();
}
var v4 = from nodes in item2.Descendants("Y")
select nodes;
foreach (var item4 in v4)
{
item4.Value = Y.ToString();
}
var v5 = from nodes in item2.Descendants("Z")
select nodes;
foreach (var item5 in v5)
{
item5.Value = Z.ToString();
}
}
}
}
public static void SetHeadBevel(XDocument doc, float bevel, float bevelRoundness, float bulge)
{
var v = from nodes in doc.Descendants("Item")
select nodes;
foreach (var item in v)
{
var v2 = from nodes in item.Descendants(RobloxXML.GetStringForXMLType(XMLTypes.Float))
where nodes.Attribute("name").Value == "Bevel"
select nodes;
foreach (var item2 in v2)
{
item2.Value = bevel.ToString();
}
var v3 = from nodes in item.Descendants(RobloxXML.GetStringForXMLType(XMLTypes.Float))
where nodes.Attribute("name").Value == "Bevel Roundness"
select nodes;
foreach (var item3 in v3)
{
item3.Value = bevelRoundness.ToString();
}
var v4 = from nodes in item.Descendants(RobloxXML.GetStringForXMLType(XMLTypes.Float))
where nodes.Attribute("name").Value == "Bulge"
select nodes;
foreach (var item4 in v4)
{
item4.Value = bulge.ToString();
}
}
}
public static void CreateItem(string filepath, RobloxFileType type, string itemname, string[] assetfilenames, double[] coordoptions, float[] headoptions)
{
string oldfile = File.ReadAllText(filepath);
string fixedfile = RobloxXML.RemoveInvalidXmlChars(RobloxXML.ReplaceHexadecimalSymbols(oldfile));
XDocument doc = XDocument.Parse(fixedfile);
string savDocPath = "";
try
{
switch (type)
{
case RobloxFileType.Hat:
SetItemFontVals(doc, RobloxDefs.ItemHatFonts, 0, 0, 0, assetfilenames[0]);
SetItemFontVals(doc, RobloxDefs.ItemHatFonts, 1, 1, 1, assetfilenames[1]);
SetItemCoordVals(doc, RobloxDefs.ItemHatFonts, coordoptions[0], coordoptions[1], coordoptions[2], "CoordinateFrame", "AttachmentPoint");
savDocPath = GlobalPaths.hatdir;
break;
case RobloxFileType.Head:
SetItemFontVals(doc, RobloxDefs.ItemHeadFonts, 0, 0, 0, assetfilenames[0]);
SetItemFontVals(doc, RobloxDefs.ItemHeadFonts, 1, 1, 1, assetfilenames[1]);
SetItemCoordVals(doc, RobloxDefs.ItemHatFonts, coordoptions[0], coordoptions[1], coordoptions[2], "Vector3", "Scale");
savDocPath = GlobalPaths.headdir;
break;
case RobloxFileType.Face:
SetItemFontVals(doc, RobloxDefs.ItemFaceTexture, 0, 0, 0, assetfilenames[0]);
savDocPath = GlobalPaths.facedir;
break;
case RobloxFileType.TShirt:
SetItemFontVals(doc, RobloxDefs.ItemTShirtTexture, 0, 0, 0, assetfilenames[0]);
savDocPath = GlobalPaths.tshirtdir;
break;
case RobloxFileType.Shirt:
SetItemFontVals(doc, RobloxDefs.ItemShirtTexture, 0, 0, 0, assetfilenames[0]);
savDocPath = GlobalPaths.shirtdir;
break;
case RobloxFileType.Pants:
SetItemFontVals(doc, RobloxDefs.ItemPantsTexture, 0, 0, 0, assetfilenames[0]);
savDocPath = GlobalPaths.pantsdir;
break;
case RobloxFileType.HeadNoCustomMesh:
SetHeadBevel(doc, headoptions[0], headoptions[1], headoptions[2]);
SetItemCoordVals(doc, RobloxDefs.ItemHatFonts, coordoptions[0], coordoptions[1], coordoptions[2], "Vector3", "Scale");
savDocPath = GlobalPaths.headdir;
break;
default:
break;
}
}
catch (Exception ex)
{
MessageBox.Show("The Item Creation SDK has experienced an error: " + ex.Message, "Novetus Item Creation SDK", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
doc.Save(savDocPath + "\\" + itemname + ".rbxm");
}
}
#endregion
#region Item SDK #region Item SDK
public static void StartItemDownload(string name, string url, string id, int ver, bool iswebsite) public static void StartItemDownload(string name, string url, string id, int ver, bool iswebsite)

View File

@ -0,0 +1,187 @@

partial class ItemCreationSDK
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ItemCreationSDK));
this.ItemTypeListBox = new System.Windows.Forms.ComboBox();
this.ItemTypeLabel = new System.Windows.Forms.Label();
this.ItemIconLabel = new System.Windows.Forms.Label();
this.BrowseImageButton = new System.Windows.Forms.Button();
this.ItemSettingsGroup = new System.Windows.Forms.GroupBox();
this.CreateItemButton = new System.Windows.Forms.Button();
this.ItemIcon = new System.Windows.Forms.PictureBox();
this.ItemDescLabel = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.ItemNameLabel = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.ItemIcon)).BeginInit();
this.SuspendLayout();
//
// ItemTypeListBox
//
this.ItemTypeListBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ItemTypeListBox.FormattingEnabled = true;
this.ItemTypeListBox.Items.AddRange(new object[] {
"Hat",
"Head",
"Face",
"T-Shirt",
"Shirt",
"Pants"});
this.ItemTypeListBox.Location = new System.Drawing.Point(97, 167);
this.ItemTypeListBox.Name = "ItemTypeListBox";
this.ItemTypeListBox.Size = new System.Drawing.Size(132, 21);
this.ItemTypeListBox.TabIndex = 0;
//
// ItemTypeLabel
//
this.ItemTypeLabel.AutoSize = true;
this.ItemTypeLabel.Location = new System.Drawing.Point(37, 170);
this.ItemTypeLabel.Name = "ItemTypeLabel";
this.ItemTypeLabel.Size = new System.Drawing.Size(54, 13);
this.ItemTypeLabel.TabIndex = 1;
this.ItemTypeLabel.Text = "Item Type";
//
// ItemIconLabel
//
this.ItemIconLabel.AutoSize = true;
this.ItemIconLabel.Location = new System.Drawing.Point(142, 26);
this.ItemIconLabel.Name = "ItemIconLabel";
this.ItemIconLabel.Size = new System.Drawing.Size(51, 13);
this.ItemIconLabel.TabIndex = 3;
this.ItemIconLabel.Text = "Item Icon";
//
// BrowseImageButton
//
this.BrowseImageButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.BrowseImageButton.Location = new System.Drawing.Point(142, 42);
this.BrowseImageButton.Name = "BrowseImageButton";
this.BrowseImageButton.Size = new System.Drawing.Size(55, 20);
this.BrowseImageButton.TabIndex = 4;
this.BrowseImageButton.Text = "Browse...";
this.BrowseImageButton.UseVisualStyleBackColor = true;
//
// ItemSettingsGroup
//
this.ItemSettingsGroup.Location = new System.Drawing.Point(12, 194);
this.ItemSettingsGroup.Name = "ItemSettingsGroup";
this.ItemSettingsGroup.Size = new System.Drawing.Size(255, 275);
this.ItemSettingsGroup.TabIndex = 5;
this.ItemSettingsGroup.TabStop = false;
this.ItemSettingsGroup.Text = "Item Settings";
//
// CreateItemButton
//
this.CreateItemButton.Location = new System.Drawing.Point(12, 475);
this.CreateItemButton.Name = "CreateItemButton";
this.CreateItemButton.Size = new System.Drawing.Size(255, 23);
this.CreateItemButton.TabIndex = 6;
this.CreateItemButton.Text = "Create Item";
this.CreateItemButton.UseVisualStyleBackColor = true;
//
// ItemIcon
//
this.ItemIcon.Location = new System.Drawing.Point(203, 12);
this.ItemIcon.Name = "ItemIcon";
this.ItemIcon.Size = new System.Drawing.Size(64, 64);
this.ItemIcon.TabIndex = 2;
this.ItemIcon.TabStop = false;
//
// ItemDescLabel
//
this.ItemDescLabel.AutoSize = true;
this.ItemDescLabel.Location = new System.Drawing.Point(68, 85);
this.ItemDescLabel.Name = "ItemDescLabel";
this.ItemDescLabel.Size = new System.Drawing.Size(131, 13);
this.ItemDescLabel.TabIndex = 7;
this.ItemDescLabel.Text = "Item Description (Optional)";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(12, 101);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(255, 60);
this.textBox1.TabIndex = 8;
//
// ItemNameLabel
//
this.ItemNameLabel.AutoSize = true;
this.ItemNameLabel.Location = new System.Drawing.Point(40, 26);
this.ItemNameLabel.Name = "ItemNameLabel";
this.ItemNameLabel.Size = new System.Drawing.Size(58, 13);
this.ItemNameLabel.TabIndex = 9;
this.ItemNameLabel.Text = "Item Name";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(12, 42);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(124, 20);
this.textBox2.TabIndex = 10;
//
// ItemCreationSDK
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.ClientSize = new System.Drawing.Size(279, 510);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.ItemNameLabel);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.ItemDescLabel);
this.Controls.Add(this.CreateItemButton);
this.Controls.Add(this.ItemSettingsGroup);
this.Controls.Add(this.BrowseImageButton);
this.Controls.Add(this.ItemIconLabel);
this.Controls.Add(this.ItemIcon);
this.Controls.Add(this.ItemTypeLabel);
this.Controls.Add(this.ItemTypeListBox);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ItemCreationSDK";
this.Text = "Novetus Item Creation SDK";
((System.ComponentModel.ISupportInitialize)(this.ItemIcon)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox ItemTypeListBox;
private System.Windows.Forms.Label ItemTypeLabel;
private System.Windows.Forms.PictureBox ItemIcon;
private System.Windows.Forms.Label ItemIconLabel;
private System.Windows.Forms.Button BrowseImageButton;
private System.Windows.Forms.GroupBox ItemSettingsGroup;
private System.Windows.Forms.Button CreateItemButton;
private System.Windows.Forms.Label ItemDescLabel;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label ItemNameLabel;
private System.Windows.Forms.TextBox textBox2;
}

View File

@ -0,0 +1,29 @@
#region Usings
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
#endregion
#region Item Creation SDK
public partial class ItemCreationSDK : Form
{
#region Variables
public static readonly string ItemCreationTypesName = "SDKItemCreationTypes.xml";
#endregion
#region Constructor
public ItemCreationSDK()
{
InitializeComponent();
}
#endregion
#region Form Events
#endregion
}
#endregion

File diff suppressed because it is too large Load Diff

View File

@ -132,6 +132,9 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\NovetusCore\CharCustom\CharacterCustomizationShared.cs">
<Link>Forms\CharCustom\CharacterCustomizationShared.cs</Link>
</Compile>
<Compile Include="..\NovetusCore\CharCustom\Forms\Compact\CharacterCustomizationCompact.cs"> <Compile Include="..\NovetusCore\CharCustom\Forms\Compact\CharacterCustomizationCompact.cs">
<Link>Forms\CharCustom\Compact\CharacterCustomizationCompact.cs</Link> <Link>Forms\CharCustom\Compact\CharacterCustomizationCompact.cs</Link>
<SubType>Form</SubType> <SubType>Form</SubType>
@ -152,7 +155,9 @@
<Compile Include="Classes\Launcher\EasterEggs.cs" /> <Compile Include="Classes\Launcher\EasterEggs.cs" />
<Compile Include="Classes\Launcher\SplashLoader.cs" /> <Compile Include="Classes\Launcher\SplashLoader.cs" />
<Compile Include="Classes\LocalVars.cs" /> <Compile Include="Classes\LocalVars.cs" />
<Compile Include="Forms\CharCustom\CharacterCustomizationShared.cs" /> <Compile Include="Classes\SDK\Downloader.cs" />
<Compile Include="Classes\SDK\ROBLOXFileTypes.cs" />
<Compile Include="Classes\SDK\SDKFuncs.cs" />
<Compile Include="Forms\CustomGraphicsOptions.cs"> <Compile Include="Forms\CustomGraphicsOptions.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -196,6 +201,12 @@
<Compile Include="Forms\SDK\DiogenesEditor.Designer.cs"> <Compile Include="Forms\SDK\DiogenesEditor.Designer.cs">
<DependentUpon>DiogenesEditor.cs</DependentUpon> <DependentUpon>DiogenesEditor.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Forms\SDK\ItemCreationSDK.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\SDK\ItemCreationSDK.Designer.cs">
<DependentUpon>ItemCreationSDK.cs</DependentUpon>
</Compile>
<Compile Include="Forms\SDK\NovetusSDK.cs"> <Compile Include="Forms\SDK\NovetusSDK.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -261,6 +272,9 @@
<EmbeddedResource Include="Forms\SDK\DiogenesEditor.resx"> <EmbeddedResource Include="Forms\SDK\DiogenesEditor.resx">
<DependentUpon>DiogenesEditor.cs</DependentUpon> <DependentUpon>DiogenesEditor.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Forms\SDK\ItemCreationSDK.resx">
<DependentUpon>ItemCreationSDK.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SDK\NovetusSDK.resx"> <EmbeddedResource Include="Forms\SDK\NovetusSDK.resx">
<DependentUpon>NovetusSDK.cs</DependentUpon> <DependentUpon>NovetusSDK.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>

View File

@ -89,6 +89,9 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\NovetusCore\CharCustom\CharacterCustomizationShared.cs">
<Link>Forms\CharCustom\CharacterCustomizationShared.cs</Link>
</Compile>
<Compile Include="..\novetuscore\charcustom\forms\compact\CharacterCustomizationCompact.cs"> <Compile Include="..\novetuscore\charcustom\forms\compact\CharacterCustomizationCompact.cs">
<Link>Forms\CharCustom\Compact\CharacterCustomizationCompact.cs</Link> <Link>Forms\CharCustom\Compact\CharacterCustomizationCompact.cs</Link>
<SubType>Form</SubType> <SubType>Form</SubType>
@ -105,9 +108,6 @@
<Link>Forms\CharCustom\Extended\CharacterCustomizationExtended.designer.cs</Link> <Link>Forms\CharCustom\Extended\CharacterCustomizationExtended.designer.cs</Link>
<DependentUpon>CharacterCustomizationExtended.cs</DependentUpon> <DependentUpon>CharacterCustomizationExtended.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="..\NovetusLauncher\Forms\CharCustom\CharacterCustomizationShared.cs">
<Link>Forms\CharCustom\CharacterCustomizationShared.cs</Link>
</Compile>
<Compile Include="Classes\LocalFuncs.cs" /> <Compile Include="Classes\LocalFuncs.cs" />
<Compile Include="Classes\URIReg.cs" /> <Compile Include="Classes\URIReg.cs" />
<Compile Include="Forms\InstallForm.cs"> <Compile Include="Forms\InstallForm.cs">