From 906c0ca542e876bf4d34d7c30b88740f6b1fe368 Mon Sep 17 00:00:00 2001 From: Bitl Date: Mon, 28 Sep 2020 15:12:38 -0700 Subject: [PATCH] customizable offline clothing --- ContentProviders.xml | 26 + .../CharCustom/CustomizationFuncs.cs | 37 +- .../CharacterCustomizationCompact.Designer.cs | 12 - .../Compact/CharacterCustomizationCompact.cs | 302 +- ...CharacterCustomizationExtended.Designer.cs | 12 - .../CharacterCustomizationExtended.cs | 2966 +++++++++-------- Novetus/NovetusCore/Classes/Settings.cs | 63 + .../Extended/LauncherFormExtended.cs | 1 + .../Forms/SDK/ClientinfoCreator.Designer.cs | 54 +- .../Forms/SDK/ClientinfoCreator.cs | 34 + batch/github_scripts.bat | 3 +- scripts/2007M-Shaders/CSMPFunctions.lua | 6 +- scripts/2007M/CSMPFunctions.lua | 6 +- scripts/2008M/CSMPFunctions.lua | 18 +- scripts/2009E/CSMPFunctions.lua | 26 +- scripts/2009L/CSMPFunctions.lua | 26 +- scripts/2010L/CSMPFunctions.lua | 26 +- scripts/2011E/CSMPFunctions.lua | 26 +- scripts/2011M/CSMPFunctions.lua | 26 +- scripts/3DView/CSView.lua | 26 +- 20 files changed, 1860 insertions(+), 1836 deletions(-) create mode 100644 ContentProviders.xml diff --git a/ContentProviders.xml b/ContentProviders.xml new file mode 100644 index 0000000..6e3fd59 --- /dev/null +++ b/ContentProviders.xml @@ -0,0 +1,26 @@ + + + + + + Roblox (Epicgamers Redirect) + http://epicgamers.xyz/asset/?id= + roblox.png + + + Roblox (Epicgamers Redirect Shortened) + http://epiccc.xyz/asset/?id= + roblox.png + + + Finobe + http://finobe.com/asset/?id= + finobe.png + + + Imgur + http://i.imgur.com/ + imgur.png + + + \ No newline at end of file diff --git a/Novetus/NovetusCore/CharCustom/CustomizationFuncs.cs b/Novetus/NovetusCore/CharCustom/CustomizationFuncs.cs index 71df264..dcd6853 100644 --- a/Novetus/NovetusCore/CharCustom/CustomizationFuncs.cs +++ b/Novetus/NovetusCore/CharCustom/CustomizationFuncs.cs @@ -42,6 +42,11 @@ using System.Windows.Forms; } public static void ChangeItem(string item, string itemdir, string defaultitem, PictureBox outputImage, TextBox outputString, ListBox box, bool initial, bool hatsinextra = false) + { + 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) { if (Directory.Exists(itemdir)) { @@ -93,9 +98,9 @@ using System.Windows.Forms; outputString.Text = item; } - if (IsItemURL(item)) + if (provider != null && IsItemURL(item)) { - outputImage.Image = GetItemURLImage(item); + outputImage.Image = GetItemURLImageFromProvider(provider); } else { @@ -105,28 +110,18 @@ using System.Windows.Forms; public static bool IsItemURL(string item) { - switch (item) - { - case string finobe when finobe.Contains("http://finobe.com/asset/?id="): - return true; - case string roblox when roblox.Contains("http://epicgamers.xyz/asset/?id="): - return true; - default: - return false; - } + if (item.Contains("http://")) + return true; + + return false; } - public static Image GetItemURLImage(string item) + public static Image GetItemURLImageFromProvider(Settings.Provider provider) { - switch (item) - { - case string finobe when finobe.Contains("http://finobe.com/asset/?id="): - return LoadImage(GlobalPaths.CustomPlayerDir + @"\\finobe.png", GlobalPaths.extradir + @"\\NoExtra.png"); - case string roblox when roblox.Contains("http://epicgamers.xyz/asset/?id="): - return LoadImage(GlobalPaths.CustomPlayerDir + @"\\roblox.png", GlobalPaths.extradir + @"\\NoExtra.png"); - default: - return LoadImage(GlobalPaths.extradir + @"\\NoExtra.png"); - } + if (provider != null) + return LoadImage(GlobalPaths.CustomPlayerDir + @"\\" + provider.Icon, GlobalPaths.extradir + @"\\NoExtra.png"); + + return LoadImage(GlobalPaths.extradir + @"\\NoExtra.png"); } //we launch the 3dview seperately from normal clients. diff --git a/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.Designer.cs b/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.Designer.cs index 7044d5f..14998db 100644 --- a/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.Designer.cs +++ b/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.Designer.cs @@ -1200,9 +1200,6 @@ partial class CharacterCustomizationCompact // this.TShirtsTypeBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.TShirtsTypeBox.FormattingEnabled = true; - this.TShirtsTypeBox.Items.AddRange(new object[] { - "Roblox", - "Finobe"}); this.TShirtsTypeBox.Location = new System.Drawing.Point(6, 162); this.TShirtsTypeBox.Name = "TShirtsTypeBox"; this.TShirtsTypeBox.Size = new System.Drawing.Size(219, 21); @@ -1296,9 +1293,6 @@ partial class CharacterCustomizationCompact // this.ShirtsTypeBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.ShirtsTypeBox.FormattingEnabled = true; - this.ShirtsTypeBox.Items.AddRange(new object[] { - "Roblox", - "Finobe"}); this.ShirtsTypeBox.Location = new System.Drawing.Point(6, 162); this.ShirtsTypeBox.Name = "ShirtsTypeBox"; this.ShirtsTypeBox.Size = new System.Drawing.Size(219, 21); @@ -1392,9 +1386,6 @@ partial class CharacterCustomizationCompact // this.PantsTypeBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.PantsTypeBox.FormattingEnabled = true; - this.PantsTypeBox.Items.AddRange(new object[] { - "Roblox", - "Finobe"}); this.PantsTypeBox.Location = new System.Drawing.Point(6, 162); this.PantsTypeBox.Name = "PantsTypeBox"; this.PantsTypeBox.Size = new System.Drawing.Size(219, 21); @@ -1723,9 +1714,6 @@ partial class CharacterCustomizationCompact // this.FaceTypeBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.FaceTypeBox.FormattingEnabled = true; - this.FaceTypeBox.Items.AddRange(new object[] { - "Roblox", - "Finobe"}); this.FaceTypeBox.Location = new System.Drawing.Point(6, 162); this.FaceTypeBox.Name = "FaceTypeBox"; this.FaceTypeBox.Size = new System.Drawing.Size(219, 21); diff --git a/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.cs b/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.cs index 25c2bd8..e23c996 100644 --- a/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.cs +++ b/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.cs @@ -5,6 +5,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.IO; +using System.Linq; using System.Windows.Forms; #endregion @@ -13,11 +14,12 @@ public partial class CharacterCustomizationCompact : Form { #region Private Variables private string SelectedPart = "Head"; - private string Custom_T_Shirt_URL = "http://epicgamers.xyz/asset/?id="; - private string Custom_Shirt_URL = "http://epicgamers.xyz/asset/?id="; - private string Custom_Pants_URL = "http://epicgamers.xyz/asset/?id="; - private string Custom_Face_URL = "http://epicgamers.xyz/asset/?id="; + private string Custom_T_Shirt_URL = ""; + private string Custom_Shirt_URL = ""; + private string Custom_Pants_URL = ""; + private string Custom_Face_URL = ""; private List PartColorList; + private Settings.Provider[] contentProviders; #endregion #region Constructor @@ -107,6 +109,60 @@ public partial class CharacterCustomizationCompact : Form #region Form Events void CharacterCustomizationLoad(object sender, EventArgs e) { + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + contentProviders = Settings.OnlineClothing.GetContentProviders(); + + for (int i = 0; i < contentProviders.Length; i++) + { + FaceTypeBox.Items.Add(contentProviders[i].Name); + TShirtsTypeBox.Items.Add(contentProviders[i].Name); + ShirtsTypeBox.Items.Add(contentProviders[i].Name); + PantsTypeBox.Items.Add(contentProviders[i].Name); + } + + //face + if (GlobalVars.UserCustomization.Face.Contains("http://")) + { + Settings.Provider faceProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Face); + FaceIDBox.Text = GlobalVars.UserCustomization.Face.Replace(faceProvider.URL, ""); + FaceTypeBox.SelectedItem = faceProvider.Name; + } + + //clothing + if (GlobalVars.UserCustomization.TShirt.Contains("http://")) + { + Settings.Provider tShirtProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.TShirt); + TShirtsIDBox.Text = GlobalVars.UserCustomization.TShirt.Replace(tShirtProvider.URL, ""); + TShirtsTypeBox.SelectedItem = tShirtProvider.Name; + } + + if (GlobalVars.UserCustomization.Shirt.Contains("http://")) + { + Settings.Provider shirtProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Shirt); + ShirtsIDBox.Text = GlobalVars.UserCustomization.Shirt.Replace(shirtProvider.URL, ""); + ShirtsTypeBox.SelectedItem = shirtProvider.Name; + } + + if (GlobalVars.UserCustomization.Pants.Contains("http://")) + { + Settings.Provider pantsProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Pants); + PantsIDBox.Text = GlobalVars.UserCustomization.Pants.Replace(pantsProvider.URL, ""); + PantsTypeBox.SelectedItem = pantsProvider.Name; + } + } + else + { + FaceTypeBox.Enabled = false; + TShirtsTypeBox.Enabled = false; + ShirtsTypeBox.Enabled = false; + PantsTypeBox.Enabled = false; + FaceIDBox.Enabled = false; + TShirtsIDBox.Enabled = false; + ShirtsIDBox.Enabled = false; + PantsIDBox.Enabled = false; + } + //body label2.Text = SelectedPart; button1.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.HeadColorString); @@ -124,88 +180,6 @@ public partial class CharacterCustomizationCompact : Form checkBox1.Checked = GlobalVars.UserCustomization.ShowHatsInExtra; - //face - if (GlobalVars.UserCustomization.Face.Contains("http://")) - { - string FaceWebSource = "Roblox"; - - switch (GlobalVars.UserCustomization.Face) - { - case string finobe when finobe.Contains("http://finobe.com/asset/?id="): - FaceIDBox.Text = GlobalVars.UserCustomization.Face.Replace("http://finobe.com/asset/?id=", ""); - FaceWebSource = "Finobe"; - break; - case string roblox when roblox.Contains("http://epicgamers.xyz/asset/?id="): - default: - FaceIDBox.Text = GlobalVars.UserCustomization.Face.Replace("http://epicgamers.xyz/asset/?id=", ""); - FaceWebSource = "Roblox"; - break; - } - - FaceTypeBox.SelectedItem = FaceWebSource; - } - - //clothing - if (GlobalVars.UserCustomization.TShirt.Contains("http://")) - { - string TShirtWebSource = "Roblox"; - - switch (GlobalVars.UserCustomization.TShirt) - { - case string finobe when finobe.Contains("http://finobe.com/asset/?id="): - TShirtsIDBox.Text = GlobalVars.UserCustomization.TShirt.Replace("http://finobe.com/asset/?id=", ""); - TShirtWebSource = "Finobe"; - break; - case string roblox when roblox.Contains("http://epicgamers.xyz/asset/?id="): - default: - TShirtsIDBox.Text = GlobalVars.UserCustomization.TShirt.Replace("http://epicgamers.xyz/asset/?id=", ""); - TShirtWebSource = "Roblox"; - break; - } - - TShirtsTypeBox.SelectedItem = TShirtWebSource; - } - - if (GlobalVars.UserCustomization.Shirt.Contains("http://")) - { - string ShirtWebSource = "Roblox"; - - switch (GlobalVars.UserCustomization.Shirt) - { - case string finobe when finobe.Contains("http://finobe.com/asset/?id="): - ShirtsIDBox.Text = GlobalVars.UserCustomization.Shirt.Replace("http://finobe.com/asset/?id=", ""); - ShirtWebSource = "Finobe"; - break; - case string roblox when roblox.Contains("http://epicgamers.xyz/asset/?id="): - default: - ShirtsIDBox.Text = GlobalVars.UserCustomization.Shirt.Replace("http://epicgamers.xyz/asset/?id=", ""); - ShirtWebSource = "Roblox"; - break; - } - - ShirtsTypeBox.SelectedItem = ShirtWebSource; - } - - if (GlobalVars.UserCustomization.Pants.Contains("http://")) - { - string PantsWebSource = "Roblox"; - - switch (GlobalVars.UserCustomization.Pants) - { - case string finobe when finobe.Contains("http://finobe.com/asset/?id="): - PantsIDBox.Text = GlobalVars.UserCustomization.Pants.Replace("http://finobe.com/asset/?id=", ""); - PantsWebSource = "Finobe"; - break; - case string roblox when roblox.Contains("http://epicgamers.xyz/asset/?id="): - default: - PantsIDBox.Text = GlobalVars.UserCustomization.Pants.Replace("http://epicgamers.xyz/asset/?id=", ""); - PantsWebSource = "Roblox"; - break; - } - - PantsTypeBox.SelectedItem = PantsWebSource; - } - //discord GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InCustomization, GlobalVars.UserConfiguration.Map); @@ -304,7 +278,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox4, textBox6, listBox4, - true + true, + FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()) : null ); break; @@ -327,7 +302,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox5, textBox7, listBox5, - true + true, + TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null ); break; @@ -350,7 +326,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox6, textBox8, listBox6, - true + true, + ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null ); break; @@ -373,7 +350,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox7, textBox9, listBox7, - true + true, + PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()) : null ); break; @@ -551,7 +529,10 @@ public partial class CharacterCustomizationCompact : Form if (!FaceIDBox.Focused && !FaceTypeBox.Focused) { FaceIDBox.Text = ""; - FaceTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + FaceTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } } listBox4.SelectedItem = previtem; GlobalVars.UserCustomization.Face = previtem; @@ -563,7 +544,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox4, textBox6, listBox4, - false + false, + FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()) : null ); } } @@ -573,7 +555,10 @@ public partial class CharacterCustomizationCompact : Form if (Directory.Exists(GlobalPaths.facedir)) { FaceIDBox.Text = ""; - FaceTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + FaceTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } Random random = new Random(); int randomFace1 = random.Next(listBox4.Items.Count); listBox4.SelectedItem = listBox4.Items[randomFace1]; @@ -585,7 +570,10 @@ public partial class CharacterCustomizationCompact : Form if (Directory.Exists(GlobalPaths.facedir)) { FaceIDBox.Text = ""; - FaceTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + FaceTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } listBox4.SelectedItem = "DefaultFace.rbxm"; } } @@ -611,20 +599,19 @@ public partial class CharacterCustomizationCompact : Form pictureBox4, textBox6, listBox4, - false + false, + FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()) : null ); } private void FaceTypeBox_SelectedIndexChanged(object sender, EventArgs e) { - switch (FaceTypeBox.SelectedIndex) + Settings.Provider faceProvider = null; + + if (FaceTypeBox.SelectedItem != null) { - case 1: - Custom_Face_URL = "http://finobe.com/asset/?id="; - break; - default: - Custom_Face_URL = "http://epicgamers.xyz/asset/?id="; - break; + faceProvider = Settings.OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()); + Custom_Face_URL = faceProvider.URL; } if (!string.IsNullOrWhiteSpace(FaceIDBox.Text)) @@ -637,7 +624,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox4, textBox6, listBox4, - false + false, + faceProvider ); } } @@ -654,7 +642,10 @@ public partial class CharacterCustomizationCompact : Form if (!TShirtsIDBox.Focused && !TShirtsTypeBox.Focused) { TShirtsIDBox.Text = ""; - TShirtsTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + TShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } } listBox5.SelectedItem = previtem; GlobalVars.UserCustomization.TShirt = previtem; @@ -666,7 +657,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox5, textBox7, listBox5, - false + false, + TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null ); } } @@ -676,7 +668,10 @@ public partial class CharacterCustomizationCompact : Form if (Directory.Exists(GlobalPaths.tshirtdir)) { TShirtsIDBox.Text = ""; - TShirtsTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + TShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } Random random = new Random(); int randomTShirt1 = random.Next(listBox5.Items.Count); listBox5.SelectedItem = listBox5.Items[randomTShirt1]; @@ -688,7 +683,10 @@ public partial class CharacterCustomizationCompact : Form if (Directory.Exists(GlobalPaths.tshirtdir)) { TShirtsIDBox.Text = ""; - TShirtsTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + TShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } listBox5.SelectedItem = "NoTShirt.rbxm"; } } @@ -714,20 +712,19 @@ public partial class CharacterCustomizationCompact : Form pictureBox5, textBox7, listBox5, - false + false, + TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null ); } private void TShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) { - switch (TShirtsTypeBox.SelectedIndex) + Settings.Provider tShirtProvider = null; + + if (TShirtsTypeBox.SelectedItem != null) { - case 1: - Custom_T_Shirt_URL = "http://finobe.com/asset/?id="; - break; - default: - Custom_T_Shirt_URL = "http://epicgamers.xyz/asset/?id="; - break; + tShirtProvider = Settings.OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()); + Custom_T_Shirt_URL = tShirtProvider.URL; } if (!string.IsNullOrWhiteSpace(TShirtsIDBox.Text)) @@ -740,7 +737,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox5, textBox7, listBox5, - false + false, + tShirtProvider ); } } @@ -756,7 +754,10 @@ public partial class CharacterCustomizationCompact : Form if (!ShirtsIDBox.Focused && !ShirtsTypeBox.Focused) { ShirtsIDBox.Text = ""; - ShirtsTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + ShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } } listBox6.SelectedItem = previtem; GlobalVars.UserCustomization.Shirt = previtem; @@ -768,7 +769,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox6, textBox8, listBox6, - false + false, + ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null ); } } @@ -778,7 +780,10 @@ public partial class CharacterCustomizationCompact : Form if (Directory.Exists(GlobalPaths.shirtdir)) { ShirtsIDBox.Text = ""; - ShirtsTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + ShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } Random random = new Random(); int randomShirt1 = random.Next(listBox6.Items.Count); listBox6.SelectedItem = listBox6.Items[randomShirt1]; @@ -790,7 +795,10 @@ public partial class CharacterCustomizationCompact : Form if (Directory.Exists(GlobalPaths.shirtdir)) { ShirtsIDBox.Text = ""; - ShirtsTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + ShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } listBox6.SelectedItem = "NoShirt.rbxm"; } } @@ -816,20 +824,19 @@ public partial class CharacterCustomizationCompact : Form pictureBox6, textBox8, listBox6, - false + false, + ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null ); } private void ShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) { - switch (ShirtsTypeBox.SelectedIndex) + Settings.Provider shirtProvider = null; + + if (ShirtsTypeBox.SelectedItem != null) { - case 1: - Custom_Shirt_URL = "http://finobe.com/asset/?id="; - break; - default: - Custom_Shirt_URL = "http://epicgamers.xyz/asset/?id="; - break; + shirtProvider = Settings.OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()); + Custom_Shirt_URL = shirtProvider.URL; } if (!string.IsNullOrWhiteSpace(ShirtsIDBox.Text)) @@ -842,7 +849,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox6, textBox8, listBox6, - false + false, + shirtProvider ); } } @@ -858,7 +866,10 @@ public partial class CharacterCustomizationCompact : Form if (!PantsIDBox.Focused && !PantsTypeBox.Focused) { PantsIDBox.Text = ""; - PantsTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + PantsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } } listBox7.SelectedItem = previtem; GlobalVars.UserCustomization.Pants = previtem; @@ -870,7 +881,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox7, textBox9, listBox7, - false + false, + PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()) : null ); } } @@ -880,7 +892,10 @@ public partial class CharacterCustomizationCompact : Form if (Directory.Exists(GlobalPaths.pantsdir)) { PantsIDBox.Text = ""; - PantsTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + PantsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } Random random = new Random(); int randomPants1 = random.Next(listBox7.Items.Count); listBox7.SelectedItem = listBox7.Items[randomPants1]; @@ -892,7 +907,10 @@ public partial class CharacterCustomizationCompact : Form if (Directory.Exists(GlobalPaths.pantsdir)) { PantsIDBox.Text = ""; - PantsTypeBox.SelectedItem = "Roblox"; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + PantsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } listBox7.SelectedItem = "NoPants.rbxm"; } } @@ -918,20 +936,19 @@ public partial class CharacterCustomizationCompact : Form pictureBox7, textBox9, listBox7, - false + false, + PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()) : null ); } private void PantsTypeBox_SelectedIndexChanged(object sender, EventArgs e) { - switch (PantsTypeBox.SelectedIndex) + Settings.Provider pantsProvider = null; + + if (PantsTypeBox.SelectedItem != null) { - case 1: - Custom_Pants_URL = "http://finobe.com/asset/?id="; - break; - default: - Custom_Pants_URL = "http://epicgamers.xyz/asset/?id="; - break; + pantsProvider = Settings.OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()); + Custom_Pants_URL = pantsProvider.URL; } if (!string.IsNullOrWhiteSpace(PantsIDBox.Text)) @@ -944,7 +961,8 @@ public partial class CharacterCustomizationCompact : Form pictureBox7, textBox9, listBox7, - false + false, + pantsProvider ); } } diff --git a/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.Designer.cs b/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.Designer.cs index cf17ffa..69c862a 100644 --- a/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.Designer.cs +++ b/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.Designer.cs @@ -1382,9 +1382,6 @@ partial class CharacterCustomizationExtended // this.TShirtsTypeBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.TShirtsTypeBox.FormattingEnabled = true; - this.TShirtsTypeBox.Items.AddRange(new object[] { - "Roblox", - "Finobe"}); this.TShirtsTypeBox.Location = new System.Drawing.Point(3, 221); this.TShirtsTypeBox.Name = "TShirtsTypeBox"; this.TShirtsTypeBox.Size = new System.Drawing.Size(253, 21); @@ -1478,9 +1475,6 @@ partial class CharacterCustomizationExtended // this.ShirtsTypeBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.ShirtsTypeBox.FormattingEnabled = true; - this.ShirtsTypeBox.Items.AddRange(new object[] { - "Roblox", - "Finobe"}); this.ShirtsTypeBox.Location = new System.Drawing.Point(3, 221); this.ShirtsTypeBox.Name = "ShirtsTypeBox"; this.ShirtsTypeBox.Size = new System.Drawing.Size(253, 21); @@ -1574,9 +1568,6 @@ partial class CharacterCustomizationExtended // this.PantsTypeBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.PantsTypeBox.FormattingEnabled = true; - this.PantsTypeBox.Items.AddRange(new object[] { - "Roblox", - "Finobe"}); this.PantsTypeBox.Location = new System.Drawing.Point(3, 221); this.PantsTypeBox.Name = "PantsTypeBox"; this.PantsTypeBox.Size = new System.Drawing.Size(253, 21); @@ -1947,9 +1938,6 @@ partial class CharacterCustomizationExtended // this.FaceTypeBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.FaceTypeBox.FormattingEnabled = true; - this.FaceTypeBox.Items.AddRange(new object[] { - "Roblox", - "Finobe"}); this.FaceTypeBox.Location = new System.Drawing.Point(3, 221); this.FaceTypeBox.Name = "FaceTypeBox"; this.FaceTypeBox.Size = new System.Drawing.Size(253, 21); diff --git a/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.cs b/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.cs index 1d22e72..0a7354a 100644 --- a/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.cs +++ b/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.cs @@ -5,1011 +5,404 @@ using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.IO; +using System.Linq; using System.Windows.Forms; #endregion #region CharacterCustomization - Extended - public partial class CharacterCustomizationExtended : Form +public partial class CharacterCustomizationExtended : Form +{ + #region Private Variables + private string SelectedPart = "Head"; + private string Custom_T_Shirt_URL = ""; + private string Custom_Shirt_URL = ""; + private string Custom_Pants_URL = ""; + private string Custom_Face_URL = ""; + private List PartColorList; + private Settings.Provider[] contentProviders; + #endregion + + #region Constructor + public CharacterCustomizationExtended() { - #region Private Variables - private string SelectedPart = "Head"; - private string Custom_T_Shirt_URL = "http://epicgamers.xyz/asset/?id="; - private string Custom_Shirt_URL = "http://epicgamers.xyz/asset/?id="; - private string Custom_Pants_URL = "http://epicgamers.xyz/asset/?id="; - private string Custom_Face_URL = "http://epicgamers.xyz/asset/?id="; - private List PartColorList; - #endregion + InitializeComponent(); + InitColors(); - #region Constructor - public CharacterCustomizationExtended() - { - InitializeComponent(); - InitColors(); - - Size = new Size(671, 337); - panel2.Size = new Size(568, 302); - } + Size = new Size(671, 337); + panel2.Size = new Size(568, 302); + } - void InitColors() + void InitColors() + { + PartColorList = new List() { - PartColorList = new List() - { - //White - new VarStorage.PartColors{ ColorID = 1, ButtonColor = button7.BackColor }, - //Light stone grey - new VarStorage.PartColors{ ColorID = 208, ButtonColor = button8.BackColor }, - //Medium stone grey - new VarStorage.PartColors{ ColorID = 194, ButtonColor = button9.BackColor }, - //Dark stone grey - new VarStorage.PartColors{ ColorID = 199, ButtonColor = button10.BackColor }, - //Black - new VarStorage.PartColors{ ColorID = 26, ButtonColor = button14.BackColor }, - //Bright red - new VarStorage.PartColors{ ColorID = 21, ButtonColor = button13.BackColor }, - //Bright yellow - new VarStorage.PartColors{ ColorID = 24, ButtonColor = button12.BackColor }, - //Cool yellow - new VarStorage.PartColors{ ColorID = 226, ButtonColor = button11.BackColor }, - //Bright blue - new VarStorage.PartColors{ ColorID = 23, ButtonColor = button18.BackColor }, - //Bright bluish green - new VarStorage.PartColors{ ColorID = 107, ButtonColor = button17.BackColor }, - //Medium blue - new VarStorage.PartColors{ ColorID = 102, ButtonColor = button16.BackColor }, - //Pastel Blue - new VarStorage.PartColors{ ColorID = 11, ButtonColor = button15.BackColor }, - //Light blue - new VarStorage.PartColors{ ColorID = 45, ButtonColor = button22.BackColor }, - //Sand blue - new VarStorage.PartColors{ ColorID = 135, ButtonColor = button21.BackColor }, - //Bright orange - new VarStorage.PartColors{ ColorID = 106, ButtonColor = button20.BackColor }, - //Br. yellowish orange - new VarStorage.PartColors{ ColorID = 105, ButtonColor = button19.BackColor }, - //Earth green - new VarStorage.PartColors{ ColorID = 141, ButtonColor = button26.BackColor }, - //Dark green - new VarStorage.PartColors{ ColorID = 28, ButtonColor = button25.BackColor }, - //Bright green - new VarStorage.PartColors{ ColorID = 37, ButtonColor = button24.BackColor }, - //Br. yellowish green - new VarStorage.PartColors{ ColorID = 119, ButtonColor = button23.BackColor }, - //Medium green - new VarStorage.PartColors{ ColorID = 29, ButtonColor = button30.BackColor }, - //Sand green - new VarStorage.PartColors{ ColorID = 151, ButtonColor = button29.BackColor }, - //Dark orange - new VarStorage.PartColors{ ColorID = 38, ButtonColor = button28.BackColor }, - //Reddish brown - new VarStorage.PartColors{ ColorID = 192, ButtonColor = button27.BackColor }, - //Bright violet - new VarStorage.PartColors{ ColorID = 104, ButtonColor = button34.BackColor }, - //Light reddish violet - new VarStorage.PartColors{ ColorID = 9, ButtonColor = button33.BackColor }, - //Medium red - new VarStorage.PartColors{ ColorID = 101, ButtonColor = button32.BackColor }, - //Brick yellow - new VarStorage.PartColors{ ColorID = 5, ButtonColor = button31.BackColor }, - //Sand red - new VarStorage.PartColors{ ColorID = 153, ButtonColor = button38.BackColor }, - //Brown - new VarStorage.PartColors{ ColorID = 217, ButtonColor = button37.BackColor }, - //Nougat - new VarStorage.PartColors{ ColorID = 18, ButtonColor = button36.BackColor }, - //Light orange - new VarStorage.PartColors{ ColorID = 125, ButtonColor = button35.BackColor }, - // RARE 2006 COLORS!! - //Med. reddish violet - new VarStorage.PartColors{ ColorID = 22, ButtonColor = button69.BackColor }, - //Dark nougat - new VarStorage.PartColors{ ColorID = 128, ButtonColor = button70.BackColor } - }; - } - #endregion + //White + new VarStorage.PartColors{ ColorID = 1, ButtonColor = button7.BackColor }, + //Light stone grey + new VarStorage.PartColors{ ColorID = 208, ButtonColor = button8.BackColor }, + //Medium stone grey + new VarStorage.PartColors{ ColorID = 194, ButtonColor = button9.BackColor }, + //Dark stone grey + new VarStorage.PartColors{ ColorID = 199, ButtonColor = button10.BackColor }, + //Black + new VarStorage.PartColors{ ColorID = 26, ButtonColor = button14.BackColor }, + //Bright red + new VarStorage.PartColors{ ColorID = 21, ButtonColor = button13.BackColor }, + //Bright yellow + new VarStorage.PartColors{ ColorID = 24, ButtonColor = button12.BackColor }, + //Cool yellow + new VarStorage.PartColors{ ColorID = 226, ButtonColor = button11.BackColor }, + //Bright blue + new VarStorage.PartColors{ ColorID = 23, ButtonColor = button18.BackColor }, + //Bright bluish green + new VarStorage.PartColors{ ColorID = 107, ButtonColor = button17.BackColor }, + //Medium blue + new VarStorage.PartColors{ ColorID = 102, ButtonColor = button16.BackColor }, + //Pastel Blue + new VarStorage.PartColors{ ColorID = 11, ButtonColor = button15.BackColor }, + //Light blue + new VarStorage.PartColors{ ColorID = 45, ButtonColor = button22.BackColor }, + //Sand blue + new VarStorage.PartColors{ ColorID = 135, ButtonColor = button21.BackColor }, + //Bright orange + new VarStorage.PartColors{ ColorID = 106, ButtonColor = button20.BackColor }, + //Br. yellowish orange + new VarStorage.PartColors{ ColorID = 105, ButtonColor = button19.BackColor }, + //Earth green + new VarStorage.PartColors{ ColorID = 141, ButtonColor = button26.BackColor }, + //Dark green + new VarStorage.PartColors{ ColorID = 28, ButtonColor = button25.BackColor }, + //Bright green + new VarStorage.PartColors{ ColorID = 37, ButtonColor = button24.BackColor }, + //Br. yellowish green + new VarStorage.PartColors{ ColorID = 119, ButtonColor = button23.BackColor }, + //Medium green + new VarStorage.PartColors{ ColorID = 29, ButtonColor = button30.BackColor }, + //Sand green + new VarStorage.PartColors{ ColorID = 151, ButtonColor = button29.BackColor }, + //Dark orange + new VarStorage.PartColors{ ColorID = 38, ButtonColor = button28.BackColor }, + //Reddish brown + new VarStorage.PartColors{ ColorID = 192, ButtonColor = button27.BackColor }, + //Bright violet + new VarStorage.PartColors{ ColorID = 104, ButtonColor = button34.BackColor }, + //Light reddish violet + new VarStorage.PartColors{ ColorID = 9, ButtonColor = button33.BackColor }, + //Medium red + new VarStorage.PartColors{ ColorID = 101, ButtonColor = button32.BackColor }, + //Brick yellow + new VarStorage.PartColors{ ColorID = 5, ButtonColor = button31.BackColor }, + //Sand red + new VarStorage.PartColors{ ColorID = 153, ButtonColor = button38.BackColor }, + //Brown + new VarStorage.PartColors{ ColorID = 217, ButtonColor = button37.BackColor }, + //Nougat + new VarStorage.PartColors{ ColorID = 18, ButtonColor = button36.BackColor }, + //Light orange + new VarStorage.PartColors{ ColorID = 125, ButtonColor = button35.BackColor }, + // RARE 2006 COLORS!! + //Med. reddish violet + new VarStorage.PartColors{ ColorID = 22, ButtonColor = button69.BackColor }, + //Dark nougat + new VarStorage.PartColors{ ColorID = 128, ButtonColor = button70.BackColor } + }; + } + #endregion - #region Form Events - void CharacterCustomizationLoad(object sender, EventArgs e) - { - //body - label2.Text = SelectedPart; - button1.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.HeadColorString); - button2.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.TorsoColorString); - button3.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightArmColorString); - button4.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftArmColorString); - button5.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightLegColorString); - button6.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftLegColorString); - - //icon - label5.Text = GlobalVars.UserCustomization.Icon; - - //charid - textBox1.Text = GlobalVars.UserCustomization.CharacterID; - - checkBox1.Checked = GlobalVars.UserCustomization.ShowHatsInExtra; + #region Form Events + void CharacterCustomizationLoad(object sender, EventArgs e) + { + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + contentProviders = Settings.OnlineClothing.GetContentProviders(); + + for (int i = 0; i < contentProviders.Length; i++) + { + FaceTypeBox.Items.Add(contentProviders[i].Name); + TShirtsTypeBox.Items.Add(contentProviders[i].Name); + ShirtsTypeBox.Items.Add(contentProviders[i].Name); + PantsTypeBox.Items.Add(contentProviders[i].Name); + } //face if (GlobalVars.UserCustomization.Face.Contains("http://")) { - string FaceWebSource = "Roblox"; - - switch (GlobalVars.UserCustomization.Face) - { - case string finobe when finobe.Contains("http://finobe.com/asset/?id="): - FaceIDBox.Text = GlobalVars.UserCustomization.Face.Replace("http://finobe.com/asset/?id=", ""); - FaceWebSource = "Finobe"; - break; - case string roblox when roblox.Contains("http://epicgamers.xyz/asset/?id="): - default: - FaceIDBox.Text = GlobalVars.UserCustomization.Face.Replace("http://epicgamers.xyz/asset/?id=", ""); - FaceWebSource = "Roblox"; - break; - } - - FaceTypeBox.SelectedItem = FaceWebSource; + Settings.Provider faceProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Face); + FaceIDBox.Text = GlobalVars.UserCustomization.Face.Replace(faceProvider.URL, ""); + FaceTypeBox.SelectedItem = faceProvider.Name; } - + //clothing if (GlobalVars.UserCustomization.TShirt.Contains("http://")) { - string TShirtWebSource = "Roblox"; - - switch (GlobalVars.UserCustomization.TShirt) - { - case string finobe when finobe.Contains("http://finobe.com/asset/?id="): - TShirtsIDBox.Text = GlobalVars.UserCustomization.TShirt.Replace("http://finobe.com/asset/?id=", ""); - TShirtWebSource = "Finobe"; - break; - case string roblox when roblox.Contains("http://epicgamers.xyz/asset/?id="): - default: - TShirtsIDBox.Text = GlobalVars.UserCustomization.TShirt.Replace("http://epicgamers.xyz/asset/?id=", ""); - TShirtWebSource = "Roblox"; - break; - } - - TShirtsTypeBox.SelectedItem = TShirtWebSource; + Settings.Provider tShirtProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.TShirt); + TShirtsIDBox.Text = GlobalVars.UserCustomization.TShirt.Replace(tShirtProvider.URL, ""); + TShirtsTypeBox.SelectedItem = tShirtProvider.Name; } if (GlobalVars.UserCustomization.Shirt.Contains("http://")) { - string ShirtWebSource = "Roblox"; - - switch (GlobalVars.UserCustomization.Shirt) - { - case string finobe when finobe.Contains("http://finobe.com/asset/?id="): - ShirtsIDBox.Text = GlobalVars.UserCustomization.Shirt.Replace("http://finobe.com/asset/?id=", ""); - ShirtWebSource = "Finobe"; - break; - case string roblox when roblox.Contains("http://epicgamers.xyz/asset/?id="): - default: - ShirtsIDBox.Text = GlobalVars.UserCustomization.Shirt.Replace("http://epicgamers.xyz/asset/?id=", ""); - ShirtWebSource = "Roblox"; - break; - } - - ShirtsTypeBox.SelectedItem = ShirtWebSource; + Settings.Provider shirtProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Shirt); + ShirtsIDBox.Text = GlobalVars.UserCustomization.Shirt.Replace(shirtProvider.URL, ""); + ShirtsTypeBox.SelectedItem = shirtProvider.Name; } if (GlobalVars.UserCustomization.Pants.Contains("http://")) { - string PantsWebSource = "Roblox"; - - switch (GlobalVars.UserCustomization.Pants) - { - case string finobe when finobe.Contains("http://finobe.com/asset/?id="): - PantsIDBox.Text = GlobalVars.UserCustomization.Pants.Replace("http://finobe.com/asset/?id=", ""); - PantsWebSource = "Finobe"; - break; - case string roblox when roblox.Contains("http://epicgamers.xyz/asset/?id="): - default: - PantsIDBox.Text = GlobalVars.UserCustomization.Pants.Replace("http://epicgamers.xyz/asset/?id=", ""); - PantsWebSource = "Roblox"; - break; - } - - PantsTypeBox.SelectedItem = PantsWebSource; + Settings.Provider pantsProvider = Settings.OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Pants); + PantsIDBox.Text = GlobalVars.UserCustomization.Pants.Replace(pantsProvider.URL, ""); + PantsTypeBox.SelectedItem = pantsProvider.Name; } + } + else + { + FaceTypeBox.Enabled = false; + TShirtsTypeBox.Enabled = false; + ShirtsTypeBox.Enabled = false; + PantsTypeBox.Enabled = false; + FaceIDBox.Enabled = false; + TShirtsIDBox.Enabled = false; + ShirtsIDBox.Enabled = false; + PantsIDBox.Enabled = false; + } - //discord - GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InCustomization, GlobalVars.UserConfiguration.Map); + //body + label2.Text = SelectedPart; + button1.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.HeadColorString); + button2.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.TorsoColorString); + button3.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightArmColorString); + button4.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftArmColorString); + button5.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightLegColorString); + button6.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftLegColorString); + + //icon + label5.Text = GlobalVars.UserCustomization.Icon; + + //charid + textBox1.Text = GlobalVars.UserCustomization.CharacterID; + + checkBox1.Checked = GlobalVars.UserCustomization.ShowHatsInExtra; + + //discord + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InCustomization, GlobalVars.UserConfiguration.Map); - GlobalFuncs.ReloadLoadoutValue(); - } + GlobalFuncs.ReloadLoadoutValue(); + } - void tabControl1_SelectedIndexChanged(object sender, EventArgs e) + void tabControl1_SelectedIndexChanged(object sender, EventArgs e) + { + switch (tabControl1.SelectedTab) { - switch (tabControl1.SelectedTab) - { - case TabPage pg1 when pg1 == tabControl1.TabPages["tabPage1"]: - panel3.Location = new Point(110, 359); - listBox1.Items.Clear(); - listBox2.Items.Clear(); - listBox3.Items.Clear(); - listBox4.Items.Clear(); - listBox5.Items.Clear(); - listBox6.Items.Clear(); - listBox7.Items.Clear(); - listBox8.Items.Clear(); - listBox9.Items.Clear(); - break; - case TabPage pg7 when pg7 == tabControl1.TabPages["tabPage7"]: - panel3.Location = new Point(110, 359); - listBox1.Items.Clear(); - listBox2.Items.Clear(); - listBox3.Items.Clear(); - listBox4.Items.Clear(); - listBox5.Items.Clear(); - listBox6.Items.Clear(); - listBox7.Items.Clear(); - listBox8.Items.Clear(); - listBox9.Items.Clear(); + case TabPage pg1 when pg1 == tabControl1.TabPages["tabPage1"]: + panel3.Location = new Point(110, 359); + listBox1.Items.Clear(); + listBox2.Items.Clear(); + listBox3.Items.Clear(); + listBox4.Items.Clear(); + listBox5.Items.Clear(); + listBox6.Items.Clear(); + listBox7.Items.Clear(); + listBox8.Items.Clear(); + listBox9.Items.Clear(); + break; + case TabPage pg7 when pg7 == tabControl1.TabPages["tabPage7"]: + panel3.Location = new Point(110, 359); + listBox1.Items.Clear(); + listBox2.Items.Clear(); + listBox3.Items.Clear(); + listBox4.Items.Clear(); + listBox5.Items.Clear(); + listBox6.Items.Clear(); + listBox7.Items.Clear(); + listBox8.Items.Clear(); + listBox9.Items.Clear(); - Image icon1 = CustomizationFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png", GlobalPaths.extradir + "\\NoExtra.png"); - pictureBox10.Image = icon1; + Image icon1 = CustomizationFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png", GlobalPaths.extradir + "\\NoExtra.png"); + pictureBox10.Image = icon1; - break; - case TabPage pg2 when pg2 == tabControl1.TabPages["tabPage2"]: - //hats - panel3.Location = new Point(110, 239); - listBox4.Items.Clear(); - listBox5.Items.Clear(); - listBox6.Items.Clear(); - listBox7.Items.Clear(); - listBox8.Items.Clear(); - listBox9.Items.Clear(); - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Hat1, - GlobalPaths.hatdir, - "NoHat", - pictureBox1, - textBox2, - listBox1, - true - ); - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Hat2, - GlobalPaths.hatdir, - "NoHat", - pictureBox2, - textBox3, - listBox2, - true - ); - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Hat3, - GlobalPaths.hatdir, - "NoHat", - pictureBox3, - textBox4, - listBox3, - true - ); - - break; - case TabPage pg3 when pg3 == tabControl1.TabPages["tabPage3"]: - //faces - panel3.Location = new Point(110, 359); - listBox1.Items.Clear(); - listBox2.Items.Clear(); - listBox3.Items.Clear(); - listBox5.Items.Clear(); - listBox6.Items.Clear(); - listBox7.Items.Clear(); - listBox8.Items.Clear(); - listBox9.Items.Clear(); - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Face, - GlobalPaths.facedir, - "DefaultFace", - pictureBox4, - textBox6, - listBox4, - true - ); - - break; - case TabPage pg4 when pg4 == tabControl1.TabPages["tabPage4"]: - //faces - panel3.Location = new Point(110, 359); - listBox1.Items.Clear(); - listBox2.Items.Clear(); - listBox3.Items.Clear(); - listBox4.Items.Clear(); - listBox6.Items.Clear(); - listBox7.Items.Clear(); - listBox8.Items.Clear(); - listBox9.Items.Clear(); - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.TShirt, - GlobalPaths.tshirtdir, - "NoTShirt", - pictureBox5, - textBox7, - listBox5, - true - ); - - break; - case TabPage pg5 when pg5 == tabControl1.TabPages["tabPage5"]: - //faces - panel3.Location = new Point(110, 359); - listBox1.Items.Clear(); - listBox2.Items.Clear(); - listBox3.Items.Clear(); - listBox4.Items.Clear(); - listBox5.Items.Clear(); - listBox7.Items.Clear(); - listBox8.Items.Clear(); - listBox9.Items.Clear(); - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Shirt, - GlobalPaths.shirtdir, - "NoShirt", - pictureBox6, - textBox8, - listBox6, - true - ); - - break; - case TabPage pg6 when pg6 == tabControl1.TabPages["tabPage6"]: - //faces - panel3.Location = new Point(110, 359); - listBox1.Items.Clear(); - listBox2.Items.Clear(); - listBox3.Items.Clear(); - listBox4.Items.Clear(); - listBox5.Items.Clear(); - listBox6.Items.Clear(); - listBox8.Items.Clear(); - listBox9.Items.Clear(); - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Pants, - GlobalPaths.pantsdir, - "NoPants", - pictureBox7, - textBox9, - listBox7, - true - ); - - break; - case TabPage pg8 when pg8 == tabControl1.TabPages["tabPage8"]: - //faces - panel3.Location = new Point(110, 359); - listBox1.Items.Clear(); - listBox2.Items.Clear(); - listBox3.Items.Clear(); - listBox4.Items.Clear(); - listBox5.Items.Clear(); - listBox6.Items.Clear(); - listBox7.Items.Clear(); - listBox9.Items.Clear(); - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Head, - GlobalPaths.headdir, - "DefaultHead", - pictureBox8, - textBox5, - listBox8, - true - ); - - break; - case TabPage pg9 when pg9 == tabControl1.TabPages["tabPage9"]: - //faces - panel3.Location = new Point(110, 359); - listBox1.Items.Clear(); - listBox2.Items.Clear(); - listBox3.Items.Clear(); - listBox4.Items.Clear(); - listBox5.Items.Clear(); - listBox6.Items.Clear(); - listBox7.Items.Clear(); - listBox8.Items.Clear(); - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Extra, - GlobalPaths.extradir, - "NoExtra", - pictureBox9, - textBox10, - listBox9, - true - ); - - if (GlobalVars.UserCustomization.ShowHatsInExtra) - { - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Extra, - GlobalPaths.hatdir, - "NoHat", - pictureBox9, - textBox10, - listBox9, - true, - GlobalVars.UserCustomization.ShowHatsInExtra - ); - } - break; - default: - panel3.Location = new Point(110, 359); - listBox1.Items.Clear(); - listBox2.Items.Clear(); - listBox3.Items.Clear(); - listBox4.Items.Clear(); - listBox5.Items.Clear(); - listBox6.Items.Clear(); - listBox7.Items.Clear(); - listBox8.Items.Clear(); - listBox9.Items.Clear(); - break; - } - } - - void CharacterCustomizationClose(object sender, CancelEventArgs e) - { - GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); - GlobalFuncs.ReloadLoadoutValue(); - } - - #region Hats - - void ListBox1SelectedIndexChanged(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.hatdir)) - { - GlobalVars.UserCustomization.Hat1 = listBox1.SelectedItem.ToString(); + break; + case TabPage pg2 when pg2 == tabControl1.TabPages["tabPage2"]: + //hats + panel3.Location = new Point(110, 239); + listBox4.Items.Clear(); + listBox5.Items.Clear(); + listBox6.Items.Clear(); + listBox7.Items.Clear(); + listBox8.Items.Clear(); + listBox9.Items.Clear(); CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Hat1, - GlobalPaths.hatdir, - "NoHat", - pictureBox1, - textBox2, - listBox1, - false - ); - } - } - - void ListBox2SelectedIndexChanged(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.hatdir)) - { - GlobalVars.UserCustomization.Hat2 = listBox2.SelectedItem.ToString(); + GlobalVars.UserCustomization.Hat1, + GlobalPaths.hatdir, + "NoHat", + pictureBox1, + textBox2, + listBox1, + true + ); CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Hat2, - GlobalPaths.hatdir, - "NoHat", - pictureBox2, - textBox3, - listBox2, - false - ); - } - } - - void ListBox3SelectedIndexChanged(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.hatdir)) - { - GlobalVars.UserCustomization.Hat3 = listBox3.SelectedItem.ToString(); + GlobalVars.UserCustomization.Hat2, + GlobalPaths.hatdir, + "NoHat", + pictureBox2, + textBox3, + listBox2, + true + ); CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Hat3, - GlobalPaths.hatdir, - "NoHat", - pictureBox3, - textBox4, - listBox3, - false - ); - } - } + GlobalVars.UserCustomization.Hat3, + GlobalPaths.hatdir, + "NoHat", + pictureBox3, + textBox4, + listBox3, + true + ); - void Button41Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.hatdir)) - { - Random random = new Random(); - int randomHat1 = random.Next(listBox1.Items.Count); - listBox1.SelectedItem = listBox1.Items[randomHat1]; - - int randomHat2 = random.Next(listBox2.Items.Count); - listBox2.SelectedItem = listBox1.Items[randomHat2]; - - int randomHat3 = random.Next(listBox3.Items.Count); - listBox3.SelectedItem = listBox1.Items[randomHat3]; - } - } - - void Button42Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.hatdir)) - { - listBox1.SelectedItem = "NoHat.rbxm"; - - listBox2.SelectedItem = "NoHat.rbxm"; - - listBox3.SelectedItem = "NoHat.rbxm"; - } - } - #endregion - - #region Faces - - void ListBox4SelectedIndexChanged(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.facedir)) - { - string previtem = listBox4.SelectedItem.ToString(); - if (!FaceIDBox.Focused && !FaceTypeBox.Focused) - { - FaceIDBox.Text = ""; - FaceTypeBox.SelectedItem = "Roblox"; - } - listBox4.SelectedItem = previtem; - GlobalVars.UserCustomization.Face = previtem; + break; + case TabPage pg3 when pg3 == tabControl1.TabPages["tabPage3"]: + //faces + panel3.Location = new Point(110, 359); + listBox1.Items.Clear(); + listBox2.Items.Clear(); + listBox3.Items.Clear(); + listBox5.Items.Clear(); + listBox6.Items.Clear(); + listBox7.Items.Clear(); + listBox8.Items.Clear(); + listBox9.Items.Clear(); CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Face, - GlobalPaths.facedir, - "DefaultFace", - pictureBox4, - textBox6, - listBox4, - false - ); - } - } + GlobalVars.UserCustomization.Face, + GlobalPaths.facedir, + "DefaultFace", + pictureBox4, + textBox6, + listBox4, + true, + FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()) : null + ); - void Button45Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.facedir)) - { - FaceIDBox.Text = ""; - FaceTypeBox.SelectedItem = "Roblox"; - Random random = new Random(); - int randomFace1 = random.Next(listBox4.Items.Count); - listBox4.SelectedItem = listBox4.Items[randomFace1]; - } - } - - void Button44Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.facedir)) - { - FaceIDBox.Text = ""; - FaceTypeBox.SelectedItem = "Roblox"; - listBox4.SelectedItem = "DefaultFace.rbxm"; - } - } - - private void FaceIDBox_TextChanged(object sender, EventArgs e) - { - listBox4.SelectedItem = "DefaultFace.rbxm"; - - if (!string.IsNullOrWhiteSpace(FaceIDBox.Text)) - { - GlobalVars.UserCustomization.Face = Custom_Face_URL + FaceIDBox.Text; - FaceIDBox.Focus(); - } - else - { - GlobalVars.UserCustomization.Face = listBox4.SelectedItem.ToString(); - } - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Face, - GlobalPaths.facedir, - "DefaultFace", - pictureBox4, - textBox6, - listBox4, - false - ); - } - - private void FaceTypeBox_SelectedIndexChanged(object sender, EventArgs e) - { - switch (FaceTypeBox.SelectedIndex) - { - case 1: - Custom_Face_URL = "http://finobe.com/asset/?id="; - break; - default: - Custom_Face_URL = "http://epicgamers.xyz/asset/?id="; - break; - } - - if (!string.IsNullOrWhiteSpace(FaceIDBox.Text)) - { - GlobalVars.UserCustomization.Face = Custom_Face_URL + FaceIDBox.Text; - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Face, - GlobalPaths.facedir, - "DefaultFace", - pictureBox4, - textBox6, - listBox4, - false - ); - } - } - - #endregion - - #region T-Shirt - - void ListBox5SelectedIndexChanged(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.tshirtdir)) - { - string previtem = listBox5.SelectedItem.ToString(); - if (!TShirtsIDBox.Focused && !TShirtsTypeBox.Focused) - { - TShirtsIDBox.Text = ""; - TShirtsTypeBox.SelectedItem = "Roblox"; - } - listBox5.SelectedItem = previtem; - GlobalVars.UserCustomization.TShirt = previtem; + break; + case TabPage pg4 when pg4 == tabControl1.TabPages["tabPage4"]: + //faces + panel3.Location = new Point(110, 359); + listBox1.Items.Clear(); + listBox2.Items.Clear(); + listBox3.Items.Clear(); + listBox4.Items.Clear(); + listBox6.Items.Clear(); + listBox7.Items.Clear(); + listBox8.Items.Clear(); + listBox9.Items.Clear(); CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.TShirt, - GlobalPaths.tshirtdir, - "NoTShirt", - pictureBox5, - textBox7, - listBox5, - false - ); - } - } + GlobalVars.UserCustomization.TShirt, + GlobalPaths.tshirtdir, + "NoTShirt", + pictureBox5, + textBox7, + listBox5, + true, + TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null + ); - void Button47Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.tshirtdir)) - { - TShirtsIDBox.Text = ""; - TShirtsTypeBox.SelectedItem = "Roblox"; - Random random = new Random(); - int randomTShirt1 = random.Next(listBox5.Items.Count); - listBox5.SelectedItem = listBox5.Items[randomTShirt1]; - } - } - - void Button46Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.tshirtdir)) - { - TShirtsIDBox.Text = ""; - TShirtsTypeBox.SelectedItem = "Roblox"; - listBox5.SelectedItem = "NoTShirt.rbxm"; - } - } - - private void TShirtsIDBox_TextChanged(object sender, EventArgs e) - { - listBox5.SelectedItem = "NoTShirt.rbxm"; - - if (!string.IsNullOrWhiteSpace(TShirtsIDBox.Text)) - { - GlobalVars.UserCustomization.TShirt = Custom_T_Shirt_URL + TShirtsIDBox.Text; - TShirtsIDBox.Focus(); - } - else - { - GlobalVars.UserCustomization.TShirt = listBox5.SelectedItem.ToString(); - } - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.TShirt, - GlobalPaths.tshirtdir, - "NoTShirt", - pictureBox5, - textBox7, - listBox5, - false - ); - } - - private void TShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) - { - switch (TShirtsTypeBox.SelectedIndex) - { - case 1: - Custom_T_Shirt_URL = "http://finobe.com/asset/?id="; - break; - default: - Custom_T_Shirt_URL = "http://epicgamers.xyz/asset/?id="; - break; - } - - if (!string.IsNullOrWhiteSpace(TShirtsIDBox.Text)) - { - GlobalVars.UserCustomization.TShirt = Custom_T_Shirt_URL + TShirtsIDBox.Text; - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.TShirt, - GlobalPaths.tshirtdir, - "NoTShirt", - pictureBox5, - textBox7, - listBox5, - false - ); - } - } - #endregion - - #region Shirt - - void ListBox6SelectedIndexChanged(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.shirtdir)) - { - string previtem = listBox6.SelectedItem.ToString(); - if (!ShirtsIDBox.Focused && !ShirtsTypeBox.Focused) - { - ShirtsIDBox.Text = ""; - ShirtsTypeBox.SelectedItem = "Roblox"; - } - listBox6.SelectedItem = previtem; - GlobalVars.UserCustomization.Shirt = previtem; + break; + case TabPage pg5 when pg5 == tabControl1.TabPages["tabPage5"]: + //faces + panel3.Location = new Point(110, 359); + listBox1.Items.Clear(); + listBox2.Items.Clear(); + listBox3.Items.Clear(); + listBox4.Items.Clear(); + listBox5.Items.Clear(); + listBox7.Items.Clear(); + listBox8.Items.Clear(); + listBox9.Items.Clear(); CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Shirt, - GlobalPaths.shirtdir, - "NoShirt", - pictureBox6, - textBox8, - listBox6, - false - ); - } - } + GlobalVars.UserCustomization.Shirt, + GlobalPaths.shirtdir, + "NoShirt", + pictureBox6, + textBox8, + listBox6, + true, + ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null + ); - void Button49Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.shirtdir)) - { - ShirtsIDBox.Text = ""; - ShirtsTypeBox.SelectedItem = "Roblox"; - Random random = new Random(); - int randomShirt1 = random.Next(listBox6.Items.Count); - listBox6.SelectedItem = listBox6.Items[randomShirt1]; - } - } - - void Button48Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.shirtdir)) - { - ShirtsIDBox.Text = ""; - ShirtsTypeBox.SelectedItem = "Roblox"; - listBox6.SelectedItem = "NoShirt.rbxm"; - } - } - - private void ShirtsIDBox_TextChanged(object sender, EventArgs e) - { - listBox6.SelectedItem = "NoShirt.rbxm"; - - if (!string.IsNullOrWhiteSpace(ShirtsIDBox.Text)) - { - GlobalVars.UserCustomization.Shirt = Custom_Shirt_URL + ShirtsIDBox.Text; - ShirtsIDBox.Focus(); - } - else - { - GlobalVars.UserCustomization.Shirt = listBox6.SelectedItem.ToString(); - } - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Shirt, - GlobalPaths.shirtdir, - "NoShirt", - pictureBox6, - textBox8, - listBox6, - false - ); - } - - private void ShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) - { - switch (ShirtsTypeBox.SelectedIndex) - { - case 1: - Custom_Shirt_URL = "http://finobe.com/asset/?id="; - break; - default: - Custom_Shirt_URL = "http://epicgamers.xyz/asset/?id="; - break; - } - - if (!string.IsNullOrWhiteSpace(ShirtsIDBox.Text)) - { - GlobalVars.UserCustomization.Shirt = Custom_Shirt_URL + ShirtsIDBox.Text; - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Shirt, - GlobalPaths.shirtdir, - "NoShirt", - pictureBox6, - textBox8, - listBox6, - false - ); - } - } - #endregion - - #region Pants - - void ListBox7SelectedIndexChanged(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.pantsdir)) - { - string previtem = listBox7.SelectedItem.ToString(); - if (!PantsIDBox.Focused && !PantsTypeBox.Focused) - { - PantsIDBox.Text = ""; - PantsTypeBox.SelectedItem = "Roblox"; - } - listBox7.SelectedItem = previtem; - GlobalVars.UserCustomization.Pants = previtem; + break; + case TabPage pg6 when pg6 == tabControl1.TabPages["tabPage6"]: + //faces + panel3.Location = new Point(110, 359); + listBox1.Items.Clear(); + listBox2.Items.Clear(); + listBox3.Items.Clear(); + listBox4.Items.Clear(); + listBox5.Items.Clear(); + listBox6.Items.Clear(); + listBox8.Items.Clear(); + listBox9.Items.Clear(); CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Pants, - GlobalPaths.pantsdir, - "NoPants", - pictureBox7, - textBox9, - listBox7, - false - ); - } - } + GlobalVars.UserCustomization.Pants, + GlobalPaths.pantsdir, + "NoPants", + pictureBox7, + textBox9, + listBox7, + true, + PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()) : null + ); - void Button51Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.pantsdir)) - { - PantsIDBox.Text = ""; - PantsTypeBox.SelectedItem = "Roblox"; - Random random = new Random(); - int randomPants1 = random.Next(listBox7.Items.Count); - listBox7.SelectedItem = listBox7.Items[randomPants1]; - } - } - - void Button50Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.pantsdir)) - { - PantsIDBox.Text = ""; - PantsTypeBox.SelectedItem = "Roblox"; - listBox7.SelectedItem = "NoPants.rbxm"; - } - } - - private void PantsIDBox_TextChanged(object sender, EventArgs e) - { - listBox7.SelectedItem = "NoPants.rbxm"; - - if (!string.IsNullOrWhiteSpace(PantsIDBox.Text)) - { - GlobalVars.UserCustomization.Pants = Custom_Pants_URL + PantsIDBox.Text; - PantsIDBox.Focus(); - } - else - { - GlobalVars.UserCustomization.Pants = listBox7.SelectedItem.ToString(); - } - - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Pants, - GlobalPaths.pantsdir, - "NoPants", - pictureBox7, - textBox9, - listBox7, - false - ); - } - - private void PantsTypeBox_SelectedIndexChanged(object sender, EventArgs e) - { - switch (PantsTypeBox.SelectedIndex) - { - case 1: - Custom_Pants_URL = "http://finobe.com/asset/?id="; - break; - default: - Custom_Pants_URL = "http://epicgamers.xyz/asset/?id="; - break; - } - - if (!string.IsNullOrWhiteSpace(PantsIDBox.Text)) - { - GlobalVars.UserCustomization.Pants = Custom_Pants_URL + PantsIDBox.Text; - CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Pants, - GlobalPaths.pantsdir, - "NoPants", - pictureBox7, - textBox9, - listBox7, - false - ); - } - } - #endregion - - #region Head - - void ListBox8SelectedIndexChanged(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.headdir)) - { - GlobalVars.UserCustomization.Head = listBox8.SelectedItem.ToString(); + break; + case TabPage pg8 when pg8 == tabControl1.TabPages["tabPage8"]: + //faces + panel3.Location = new Point(110, 359); + listBox1.Items.Clear(); + listBox2.Items.Clear(); + listBox3.Items.Clear(); + listBox4.Items.Clear(); + listBox5.Items.Clear(); + listBox6.Items.Clear(); + listBox7.Items.Clear(); + listBox9.Items.Clear(); CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Head, - GlobalPaths.headdir, - "DefaultHead", - pictureBox8, - textBox5, - listBox8, - false - ); - } - } + GlobalVars.UserCustomization.Head, + GlobalPaths.headdir, + "DefaultHead", + pictureBox8, + textBox5, + listBox8, + true + ); - void Button57Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.headdir)) - { - Random random = new Random(); - int randomHead1 = random.Next(listBox8.Items.Count); - listBox8.SelectedItem = listBox8.Items[randomHead1]; - } - } - - void Button56Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.headdir)) - { - listBox8.SelectedItem = "DefaultHead.rbxm"; - } - } - #endregion - - #region Extra - void ListBox9SelectedIndexChanged(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.extradir)) - { - GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); + break; + case TabPage pg9 when pg9 == tabControl1.TabPages["tabPage9"]: + //faces + panel3.Location = new Point(110, 359); + listBox1.Items.Clear(); + listBox2.Items.Clear(); + listBox3.Items.Clear(); + listBox4.Items.Clear(); + listBox5.Items.Clear(); + listBox6.Items.Clear(); + listBox7.Items.Clear(); + listBox8.Items.Clear(); CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Extra, - GlobalPaths.extradir, - "NoExtra", - pictureBox9, - textBox10, - listBox9, - false - ); + GlobalVars.UserCustomization.Extra, + GlobalPaths.extradir, + "NoExtra", + pictureBox9, + textBox10, + listBox9, + true + ); if (GlobalVars.UserCustomization.ShowHatsInExtra) { @@ -1020,45 +413,621 @@ using System.Windows.Forms; pictureBox9, textBox10, listBox9, - false, + true, GlobalVars.UserCustomization.ShowHatsInExtra ); } - } + break; + default: + panel3.Location = new Point(110, 359); + listBox1.Items.Clear(); + listBox2.Items.Clear(); + listBox3.Items.Clear(); + listBox4.Items.Clear(); + listBox5.Items.Clear(); + listBox6.Items.Clear(); + listBox7.Items.Clear(); + listBox8.Items.Clear(); + listBox9.Items.Clear(); + break; } + } - void Button59Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.extradir)) - { - Random random = new Random(); - int randomItem1 = random.Next(listBox9.Items.Count); - listBox9.SelectedItem = listBox9.Items[randomItem1]; - } - } + void CharacterCustomizationClose(object sender, CancelEventArgs e) + { + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); + GlobalFuncs.ReloadLoadoutValue(); + } - void Button58Click(object sender, EventArgs e) - { - if (Directory.Exists(GlobalPaths.extradir)) - { - listBox9.SelectedItem = "NoExtra.rbxm"; - } - } + #region Hats - void CheckBox1CheckedChanged(object sender, EventArgs e) + void ListBox1SelectedIndexChanged(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.hatdir)) { - GlobalVars.UserCustomization.ShowHatsInExtra = checkBox1.Checked; - listBox9.Items.Clear(); + GlobalVars.UserCustomization.Hat1 = listBox1.SelectedItem.ToString(); CustomizationFuncs.ChangeItem( - GlobalVars.UserCustomization.Extra, - GlobalPaths.extradir, - "NoExtra", - pictureBox9, - textBox10, - listBox9, - true + GlobalVars.UserCustomization.Hat1, + GlobalPaths.hatdir, + "NoHat", + pictureBox1, + textBox2, + listBox1, + false ); + } + } + + void ListBox2SelectedIndexChanged(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.hatdir)) + { + GlobalVars.UserCustomization.Hat2 = listBox2.SelectedItem.ToString(); + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Hat2, + GlobalPaths.hatdir, + "NoHat", + pictureBox2, + textBox3, + listBox2, + false + ); + } + } + + void ListBox3SelectedIndexChanged(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.hatdir)) + { + GlobalVars.UserCustomization.Hat3 = listBox3.SelectedItem.ToString(); + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Hat3, + GlobalPaths.hatdir, + "NoHat", + pictureBox3, + textBox4, + listBox3, + false + ); + } + } + + void Button41Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.hatdir)) + { + Random random = new Random(); + int randomHat1 = random.Next(listBox1.Items.Count); + listBox1.SelectedItem = listBox1.Items[randomHat1]; + + int randomHat2 = random.Next(listBox2.Items.Count); + listBox2.SelectedItem = listBox1.Items[randomHat2]; + + int randomHat3 = random.Next(listBox3.Items.Count); + listBox3.SelectedItem = listBox1.Items[randomHat3]; + } + } + + void Button42Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.hatdir)) + { + listBox1.SelectedItem = "NoHat.rbxm"; + + listBox2.SelectedItem = "NoHat.rbxm"; + + listBox3.SelectedItem = "NoHat.rbxm"; + } + } + #endregion + + #region Faces + + void ListBox4SelectedIndexChanged(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.facedir)) + { + string previtem = listBox4.SelectedItem.ToString(); + if (!FaceIDBox.Focused && !FaceTypeBox.Focused) + { + FaceIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + FaceTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + } + listBox4.SelectedItem = previtem; + GlobalVars.UserCustomization.Face = previtem; + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Face, + GlobalPaths.facedir, + "DefaultFace", + pictureBox4, + textBox6, + listBox4, + false, + FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()) : null + ); + } + } + + void Button45Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.facedir)) + { + FaceIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + FaceTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + Random random = new Random(); + int randomFace1 = random.Next(listBox4.Items.Count); + listBox4.SelectedItem = listBox4.Items[randomFace1]; + } + } + + void Button44Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.facedir)) + { + FaceIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + FaceTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + listBox4.SelectedItem = "DefaultFace.rbxm"; + } + } + + private void FaceIDBox_TextChanged(object sender, EventArgs e) + { + listBox4.SelectedItem = "DefaultFace.rbxm"; + + if (!string.IsNullOrWhiteSpace(FaceIDBox.Text)) + { + GlobalVars.UserCustomization.Face = Custom_Face_URL + FaceIDBox.Text; + FaceIDBox.Focus(); + } + else + { + GlobalVars.UserCustomization.Face = listBox4.SelectedItem.ToString(); + } + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Face, + GlobalPaths.facedir, + "DefaultFace", + pictureBox4, + textBox6, + listBox4, + false, + FaceTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()) : null + ); + } + + private void FaceTypeBox_SelectedIndexChanged(object sender, EventArgs e) + { + Settings.Provider faceProvider = null; + + if (FaceTypeBox.SelectedItem != null) + { + faceProvider = Settings.OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()); + Custom_Face_URL = faceProvider.URL; + } + + if (!string.IsNullOrWhiteSpace(FaceIDBox.Text)) + { + GlobalVars.UserCustomization.Face = Custom_Face_URL + FaceIDBox.Text; + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Face, + GlobalPaths.facedir, + "DefaultFace", + pictureBox4, + textBox6, + listBox4, + false, + faceProvider + ); + } + } + + #endregion + + #region T-Shirt + + void ListBox5SelectedIndexChanged(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.tshirtdir)) + { + string previtem = listBox5.SelectedItem.ToString(); + if (!TShirtsIDBox.Focused && !TShirtsTypeBox.Focused) + { + TShirtsIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + TShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + } + listBox5.SelectedItem = previtem; + GlobalVars.UserCustomization.TShirt = previtem; + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.TShirt, + GlobalPaths.tshirtdir, + "NoTShirt", + pictureBox5, + textBox7, + listBox5, + false, + TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null + ); + } + } + + void Button47Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.tshirtdir)) + { + TShirtsIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + TShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + Random random = new Random(); + int randomTShirt1 = random.Next(listBox5.Items.Count); + listBox5.SelectedItem = listBox5.Items[randomTShirt1]; + } + } + + void Button46Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.tshirtdir)) + { + TShirtsIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + TShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + listBox5.SelectedItem = "NoTShirt.rbxm"; + } + } + + private void TShirtsIDBox_TextChanged(object sender, EventArgs e) + { + listBox5.SelectedItem = "NoTShirt.rbxm"; + + if (!string.IsNullOrWhiteSpace(TShirtsIDBox.Text)) + { + GlobalVars.UserCustomization.TShirt = Custom_T_Shirt_URL + TShirtsIDBox.Text; + TShirtsIDBox.Focus(); + } + else + { + GlobalVars.UserCustomization.TShirt = listBox5.SelectedItem.ToString(); + } + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.TShirt, + GlobalPaths.tshirtdir, + "NoTShirt", + pictureBox5, + textBox7, + listBox5, + false, + TShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null + ); + } + + private void TShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) + { + Settings.Provider tShirtProvider = null; + + if (TShirtsTypeBox.SelectedItem != null) + { + tShirtProvider = Settings.OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()); + Custom_T_Shirt_URL = tShirtProvider.URL; + } + + if (!string.IsNullOrWhiteSpace(TShirtsIDBox.Text)) + { + GlobalVars.UserCustomization.TShirt = Custom_T_Shirt_URL + TShirtsIDBox.Text; + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.TShirt, + GlobalPaths.tshirtdir, + "NoTShirt", + pictureBox5, + textBox7, + listBox5, + false, + tShirtProvider + ); + } + } + #endregion + + #region Shirt + + void ListBox6SelectedIndexChanged(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.shirtdir)) + { + string previtem = listBox6.SelectedItem.ToString(); + if (!ShirtsIDBox.Focused && !ShirtsTypeBox.Focused) + { + ShirtsIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + ShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + } + listBox6.SelectedItem = previtem; + GlobalVars.UserCustomization.Shirt = previtem; + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Shirt, + GlobalPaths.shirtdir, + "NoShirt", + pictureBox6, + textBox8, + listBox6, + false, + ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null + ); + } + } + + void Button49Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.shirtdir)) + { + ShirtsIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + ShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + Random random = new Random(); + int randomShirt1 = random.Next(listBox6.Items.Count); + listBox6.SelectedItem = listBox6.Items[randomShirt1]; + } + } + + void Button48Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.shirtdir)) + { + ShirtsIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + ShirtsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + listBox6.SelectedItem = "NoShirt.rbxm"; + } + } + + private void ShirtsIDBox_TextChanged(object sender, EventArgs e) + { + listBox6.SelectedItem = "NoShirt.rbxm"; + + if (!string.IsNullOrWhiteSpace(ShirtsIDBox.Text)) + { + GlobalVars.UserCustomization.Shirt = Custom_Shirt_URL + ShirtsIDBox.Text; + ShirtsIDBox.Focus(); + } + else + { + GlobalVars.UserCustomization.Shirt = listBox6.SelectedItem.ToString(); + } + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Shirt, + GlobalPaths.shirtdir, + "NoShirt", + pictureBox6, + textBox8, + listBox6, + false, + ShirtsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null + ); + } + + private void ShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) + { + Settings.Provider shirtProvider = null; + + if (ShirtsTypeBox.SelectedItem != null) + { + shirtProvider = Settings.OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()); + Custom_Shirt_URL = shirtProvider.URL; + } + + if (!string.IsNullOrWhiteSpace(ShirtsIDBox.Text)) + { + GlobalVars.UserCustomization.Shirt = Custom_Shirt_URL + ShirtsIDBox.Text; + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Shirt, + GlobalPaths.shirtdir, + "NoShirt", + pictureBox6, + textBox8, + listBox6, + false, + shirtProvider + ); + } + } + #endregion + + #region Pants + + void ListBox7SelectedIndexChanged(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.pantsdir)) + { + string previtem = listBox7.SelectedItem.ToString(); + if (!PantsIDBox.Focused && !PantsTypeBox.Focused) + { + PantsIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + PantsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + } + listBox7.SelectedItem = previtem; + GlobalVars.UserCustomization.Pants = previtem; + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Pants, + GlobalPaths.pantsdir, + "NoPants", + pictureBox7, + textBox9, + listBox7, + false, + PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()) : null + ); + } + } + + void Button51Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.pantsdir)) + { + PantsIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + PantsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + Random random = new Random(); + int randomPants1 = random.Next(listBox7.Items.Count); + listBox7.SelectedItem = listBox7.Items[randomPants1]; + } + } + + void Button50Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.pantsdir)) + { + PantsIDBox.Text = ""; + if (File.Exists(GlobalPaths.ConfigDir + "\\ContentProviders.xml")) + { + PantsTypeBox.SelectedItem = contentProviders.FirstOrDefault().Name; + } + listBox7.SelectedItem = "NoPants.rbxm"; + } + } + + private void PantsIDBox_TextChanged(object sender, EventArgs e) + { + listBox7.SelectedItem = "NoPants.rbxm"; + + if (!string.IsNullOrWhiteSpace(PantsIDBox.Text)) + { + GlobalVars.UserCustomization.Pants = Custom_Pants_URL + PantsIDBox.Text; + PantsIDBox.Focus(); + } + else + { + GlobalVars.UserCustomization.Pants = listBox7.SelectedItem.ToString(); + } + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Pants, + GlobalPaths.pantsdir, + "NoPants", + pictureBox7, + textBox9, + listBox7, + false, + PantsTypeBox.SelectedItem != null ? Settings.OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()) : null + ); + } + + private void PantsTypeBox_SelectedIndexChanged(object sender, EventArgs e) + { + Settings.Provider pantsProvider = null; + + if (PantsTypeBox.SelectedItem != null) + { + pantsProvider = Settings.OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()); + Custom_Pants_URL = pantsProvider.URL; + } + + if (!string.IsNullOrWhiteSpace(PantsIDBox.Text)) + { + GlobalVars.UserCustomization.Pants = Custom_Pants_URL + PantsIDBox.Text; + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Pants, + GlobalPaths.pantsdir, + "NoPants", + pictureBox7, + textBox9, + listBox7, + false, + pantsProvider + ); + } + } + #endregion + + #region Head + + void ListBox8SelectedIndexChanged(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.headdir)) + { + GlobalVars.UserCustomization.Head = listBox8.SelectedItem.ToString(); + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Head, + GlobalPaths.headdir, + "DefaultHead", + pictureBox8, + textBox5, + listBox8, + false + ); + } + } + + void Button57Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.headdir)) + { + Random random = new Random(); + int randomHead1 = random.Next(listBox8.Items.Count); + listBox8.SelectedItem = listBox8.Items[randomHead1]; + } + } + + void Button56Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.headdir)) + { + listBox8.SelectedItem = "DefaultHead.rbxm"; + } + } + #endregion + + #region Extra + void ListBox9SelectedIndexChanged(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.extradir)) + { + GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Extra, + GlobalPaths.extradir, + "NoExtra", + pictureBox9, + textBox10, + listBox9, + false + ); if (GlobalVars.UserCustomization.ShowHatsInExtra) { @@ -1069,517 +1038,566 @@ using System.Windows.Forms; pictureBox9, textBox10, listBox9, - true, + false, GlobalVars.UserCustomization.ShowHatsInExtra ); } - else + } + } + + void Button59Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.extradir)) + { + Random random = new Random(); + int randomItem1 = random.Next(listBox9.Items.Count); + listBox9.SelectedItem = listBox9.Items[randomItem1]; + } + } + + void Button58Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalPaths.extradir)) + { + listBox9.SelectedItem = "NoExtra.rbxm"; + } + } + + void CheckBox1CheckedChanged(object sender, EventArgs e) + { + GlobalVars.UserCustomization.ShowHatsInExtra = checkBox1.Checked; + listBox9.Items.Clear(); + + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Extra, + GlobalPaths.extradir, + "NoExtra", + pictureBox9, + textBox10, + listBox9, + true + ); + + if (GlobalVars.UserCustomization.ShowHatsInExtra) + { + CustomizationFuncs.ChangeItem( + GlobalVars.UserCustomization.Extra, + GlobalPaths.hatdir, + "NoHat", + pictureBox9, + textBox10, + listBox9, + true, + GlobalVars.UserCustomization.ShowHatsInExtra + ); + } + else + { + listBox9.SelectedItem = "NoExtra.rbxm"; + } + } + #endregion + + #region Body Colors + + void Button1Click(object sender, EventArgs e) + { + SelectedPart = "Head"; + label2.Text = SelectedPart; + } + + void Button2Click(object sender, EventArgs e) + { + SelectedPart = "Torso"; + label2.Text = SelectedPart; + } + + void Button3Click(object sender, EventArgs e) + { + SelectedPart = "Right Arm"; + label2.Text = SelectedPart; + } + + void Button4Click(object sender, EventArgs e) + { + SelectedPart = "Left Arm"; + label2.Text = SelectedPart; + } + + void Button5Click(object sender, EventArgs e) + { + SelectedPart = "Right Leg"; + label2.Text = SelectedPart; + } + + void Button6Click(object sender, EventArgs e) + { + SelectedPart = "Left Leg"; + label2.Text = SelectedPart; + } + + Color ConvertStringtoColor(string CString) + { + var p = CString.Split(new char[] { ',', ']' }); + + int A = Convert.ToInt32(p[0].Substring(p[0].IndexOf('=') + 1)); + int R = Convert.ToInt32(p[1].Substring(p[1].IndexOf('=') + 1)); + int G = Convert.ToInt32(p[2].Substring(p[2].IndexOf('=') + 1)); + int B = Convert.ToInt32(p[3].Substring(p[3].IndexOf('=') + 1)); + + return Color.FromArgb(A, R, G, B); + } + + void ChangeColorOfPart(int ColorID) + { + ChangeColorOfPart(ColorID, PartColorList.Find(x => x.ColorID == ColorID).ButtonColor); + } + + void ChangeColorOfPart(int ColorID, Color ButtonColor) + { + ChangeColorOfPart(SelectedPart, ColorID, ButtonColor); + } + + void ChangeColorOfPart(string part, int ColorID, Color ButtonColor) + { + switch (part) + { + case "Head": + GlobalVars.UserCustomization.HeadColorID = ColorID; + GlobalVars.UserCustomization.HeadColorString = ButtonColor.ToString(); + button1.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.HeadColorString); + break; + case "Torso": + GlobalVars.UserCustomization.TorsoColorID = ColorID; + GlobalVars.UserCustomization.TorsoColorString = ButtonColor.ToString(); + button2.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.TorsoColorString); + break; + case "Right Arm": + GlobalVars.UserCustomization.RightArmColorID = ColorID; + GlobalVars.UserCustomization.RightArmColorString = ButtonColor.ToString(); + button3.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightArmColorString); + break; + case "Left Arm": + GlobalVars.UserCustomization.LeftArmColorID = ColorID; + GlobalVars.UserCustomization.LeftArmColorString = ButtonColor.ToString(); + button4.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftArmColorString); + break; + case "Right Leg": + GlobalVars.UserCustomization.RightLegColorID = ColorID; + GlobalVars.UserCustomization.RightLegColorString = ButtonColor.ToString(); + button5.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightLegColorString); + break; + case "Left Leg": + GlobalVars.UserCustomization.LeftLegColorID = ColorID; + GlobalVars.UserCustomization.LeftLegColorString = ButtonColor.ToString(); + button6.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftLegColorString); + break; + default: + break; + } + } + + void Button7Click(object sender, EventArgs e) + { + ChangeColorOfPart(1); + } + + void Button8Click(object sender, EventArgs e) + { + ChangeColorOfPart(208); + } + + void Button9Click(object sender, EventArgs e) + { + ChangeColorOfPart(194); + } + + void Button10Click(object sender, EventArgs e) + { + ChangeColorOfPart(199); + } + + void Button14Click(object sender, EventArgs e) + { + ChangeColorOfPart(26); + } + + void Button13Click(object sender, EventArgs e) + { + ChangeColorOfPart(21); + } + + void Button12Click(object sender, EventArgs e) + { + ChangeColorOfPart(24); + } + + void Button11Click(object sender, EventArgs e) + { + ChangeColorOfPart(226); + } + + void Button18Click(object sender, EventArgs e) + { + ChangeColorOfPart(23); + } + + void Button17Click(object sender, EventArgs e) + { + ChangeColorOfPart(107); + } + + void Button16Click(object sender, EventArgs e) + { + ChangeColorOfPart(102); + } + + void Button15Click(object sender, EventArgs e) + { + ChangeColorOfPart(11); + } + + void Button22Click(object sender, EventArgs e) + { + ChangeColorOfPart(45); + } + + void Button21Click(object sender, EventArgs e) + { + ChangeColorOfPart(135); + } + + void Button20Click(object sender, EventArgs e) + { + ChangeColorOfPart(106); + } + + void Button19Click(object sender, EventArgs e) + { + ChangeColorOfPart(105); + } + + void Button26Click(object sender, EventArgs e) + { + ChangeColorOfPart(141); + } + + void Button25Click(object sender, EventArgs e) + { + ChangeColorOfPart(28); + } + + void Button24Click(object sender, EventArgs e) + { + ChangeColorOfPart(37); + } + + void Button23Click(object sender, EventArgs e) + { + ChangeColorOfPart(119); + } + + void Button30Click(object sender, EventArgs e) + { + ChangeColorOfPart(29); + } + + void Button29Click(object sender, EventArgs e) + { + ChangeColorOfPart(151); + } + + void Button28Click(object sender, EventArgs e) + { + ChangeColorOfPart(38); + } + + void Button27Click(object sender, EventArgs e) + { + ChangeColorOfPart(192); + } + + void Button34Click(object sender, EventArgs e) + { + ChangeColorOfPart(104); + } + + void Button33Click(object sender, EventArgs e) + { + ChangeColorOfPart(9); + } + + void Button32Click(object sender, EventArgs e) + { + ChangeColorOfPart(101); + } + + void Button31Click(object sender, EventArgs e) + { + ChangeColorOfPart(5); + } + + void Button38Click(object sender, EventArgs e) + { + ChangeColorOfPart(153); + } + + void Button37Click(object sender, EventArgs e) + { + ChangeColorOfPart(217); + } + + void Button36Click(object sender, EventArgs e) + { + ChangeColorOfPart(18); + } + + void Button35Click(object sender, EventArgs e) + { + ChangeColorOfPart(125); + } + + private void button69_Click(object sender, EventArgs e) + { + ChangeColorOfPart(22); + } + + private void button70_Click(object sender, EventArgs e) + { + ChangeColorOfPart(128); + } + + void Button39Click(object sender, EventArgs e) + { + Random rand = new Random(); + + for (int i = 1; i <= 6; i++) + { + int RandomColor = rand.Next(PartColorList.Count); + + switch (i) { - listBox9.SelectedItem = "NoExtra.rbxm"; - } - } - #endregion - - #region Body Colors - - void Button1Click(object sender, EventArgs e) - { - SelectedPart = "Head"; - label2.Text = SelectedPart; - } - - void Button2Click(object sender, EventArgs e) - { - SelectedPart = "Torso"; - label2.Text = SelectedPart; - } - - void Button3Click(object sender, EventArgs e) - { - SelectedPart = "Right Arm"; - label2.Text = SelectedPart; - } - - void Button4Click(object sender, EventArgs e) - { - SelectedPart = "Left Arm"; - label2.Text = SelectedPart; - } - - void Button5Click(object sender, EventArgs e) - { - SelectedPart = "Right Leg"; - label2.Text = SelectedPart; - } - - void Button6Click(object sender, EventArgs e) - { - SelectedPart = "Left Leg"; - label2.Text = SelectedPart; - } - - Color ConvertStringtoColor(string CString) - { - var p = CString.Split(new char[] { ',', ']' }); - - int A = Convert.ToInt32(p[0].Substring(p[0].IndexOf('=') + 1)); - int R = Convert.ToInt32(p[1].Substring(p[1].IndexOf('=') + 1)); - int G = Convert.ToInt32(p[2].Substring(p[2].IndexOf('=') + 1)); - int B = Convert.ToInt32(p[3].Substring(p[3].IndexOf('=') + 1)); - - return Color.FromArgb(A, R, G, B); - } - - void ChangeColorOfPart(int ColorID) - { - ChangeColorOfPart(ColorID, PartColorList.Find(x => x.ColorID == ColorID).ButtonColor); - } - - void ChangeColorOfPart(int ColorID, Color ButtonColor) - { - ChangeColorOfPart(SelectedPart, ColorID, ButtonColor); - } - - void ChangeColorOfPart(string part, int ColorID, Color ButtonColor) - { - switch (part) - { - case "Head": - GlobalVars.UserCustomization.HeadColorID = ColorID; - GlobalVars.UserCustomization.HeadColorString = ButtonColor.ToString(); - button1.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.HeadColorString); + case 1: + ChangeColorOfPart("Head", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); break; - case "Torso": - GlobalVars.UserCustomization.TorsoColorID = ColorID; - GlobalVars.UserCustomization.TorsoColorString = ButtonColor.ToString(); - button2.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.TorsoColorString); + case 2: + ChangeColorOfPart("Torso", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); break; - case "Right Arm": - GlobalVars.UserCustomization.RightArmColorID = ColorID; - GlobalVars.UserCustomization.RightArmColorString = ButtonColor.ToString(); - button3.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightArmColorString); + case 3: + ChangeColorOfPart("Left Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); break; - case "Left Arm": - GlobalVars.UserCustomization.LeftArmColorID = ColorID; - GlobalVars.UserCustomization.LeftArmColorString = ButtonColor.ToString(); - button4.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftArmColorString); + case 4: + ChangeColorOfPart("Right Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); break; - case "Right Leg": - GlobalVars.UserCustomization.RightLegColorID = ColorID; - GlobalVars.UserCustomization.RightLegColorString = ButtonColor.ToString(); - button5.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightLegColorString); + case 5: + ChangeColorOfPart("Left Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); break; - case "Left Leg": - GlobalVars.UserCustomization.LeftLegColorID = ColorID; - GlobalVars.UserCustomization.LeftLegColorString = ButtonColor.ToString(); - button6.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftLegColorString); + case 6: + ChangeColorOfPart("Right Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); break; default: break; } } - - void Button7Click(object sender, EventArgs e) - { - ChangeColorOfPart(1); - } - - void Button8Click(object sender, EventArgs e) - { - ChangeColorOfPart(208); - } - - void Button9Click(object sender, EventArgs e) - { - ChangeColorOfPart(194); - } - - void Button10Click(object sender, EventArgs e) - { - ChangeColorOfPart(199); - } - - void Button14Click(object sender, EventArgs e) - { - ChangeColorOfPart(26); - } - - void Button13Click(object sender, EventArgs e) - { - ChangeColorOfPart(21); - } - - void Button12Click(object sender, EventArgs e) - { - ChangeColorOfPart(24); - } - - void Button11Click(object sender, EventArgs e) - { - ChangeColorOfPart(226); - } - - void Button18Click(object sender, EventArgs e) - { - ChangeColorOfPart(23); - } - - void Button17Click(object sender, EventArgs e) - { - ChangeColorOfPart(107); - } - - void Button16Click(object sender, EventArgs e) - { - ChangeColorOfPart(102); - } - - void Button15Click(object sender, EventArgs e) - { - ChangeColorOfPart(11); - } - - void Button22Click(object sender, EventArgs e) - { - ChangeColorOfPart(45); - } - - void Button21Click(object sender, EventArgs e) - { - ChangeColorOfPart(135); - } - - void Button20Click(object sender, EventArgs e) - { - ChangeColorOfPart(106); - } - - void Button19Click(object sender, EventArgs e) - { - ChangeColorOfPart(105); - } - - void Button26Click(object sender, EventArgs e) - { - ChangeColorOfPart(141); - } - - void Button25Click(object sender, EventArgs e) - { - ChangeColorOfPart(28); - } - - void Button24Click(object sender, EventArgs e) - { - ChangeColorOfPart(37); - } - - void Button23Click(object sender, EventArgs e) - { - ChangeColorOfPart(119); - } - - void Button30Click(object sender, EventArgs e) - { - ChangeColorOfPart(29); - } - - void Button29Click(object sender, EventArgs e) - { - ChangeColorOfPart(151); - } - - void Button28Click(object sender, EventArgs e) - { - ChangeColorOfPart(38); - } - - void Button27Click(object sender, EventArgs e) - { - ChangeColorOfPart(192); - } - - void Button34Click(object sender, EventArgs e) - { - ChangeColorOfPart(104); - } - - void Button33Click(object sender, EventArgs e) - { - ChangeColorOfPart(9); - } - - void Button32Click(object sender, EventArgs e) - { - ChangeColorOfPart(101); - } - - void Button31Click(object sender, EventArgs e) - { - ChangeColorOfPart(5); - } - - void Button38Click(object sender, EventArgs e) - { - ChangeColorOfPart(153); - } - - void Button37Click(object sender, EventArgs e) - { - ChangeColorOfPart(217); - } - - void Button36Click(object sender, EventArgs e) - { - ChangeColorOfPart(18); - } - - void Button35Click(object sender, EventArgs e) - { - ChangeColorOfPart(125); - } - - private void button69_Click(object sender, EventArgs e) - { - ChangeColorOfPart(22); - } - - private void button70_Click(object sender, EventArgs e) - { - ChangeColorOfPart(128); - } - - void Button39Click(object sender, EventArgs e) - { - Random rand = new Random(); - - for (int i = 1; i <= 6; i++) - { - int RandomColor = rand.Next(PartColorList.Count); - - switch (i) - { - case 1: - ChangeColorOfPart("Head", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); - break; - case 2: - ChangeColorOfPart("Torso", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); - break; - case 3: - ChangeColorOfPart("Left Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); - break; - case 4: - ChangeColorOfPart("Right Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); - break; - case 5: - ChangeColorOfPart("Left Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); - break; - case 6: - ChangeColorOfPart("Right Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); - break; - default: - break; - } - } - } - - void Button40Click(object sender, EventArgs e) - { - GlobalVars.UserCustomization.HeadColorID = 24; - GlobalVars.UserCustomization.TorsoColorID = 23; - GlobalVars.UserCustomization.LeftArmColorID = 24; - GlobalVars.UserCustomization.RightArmColorID = 24; - GlobalVars.UserCustomization.LeftLegColorID = 119; - GlobalVars.UserCustomization.RightLegColorID = 119; - GlobalVars.UserCustomization.CharacterID = ""; - GlobalVars.UserCustomization.HeadColorString = "Color [A=255, R=245, G=205, B=47]"; - GlobalVars.UserCustomization.TorsoColorString = "Color [A=255, R=13, G=105, B=172]"; - GlobalVars.UserCustomization.LeftArmColorString = "Color [A=255, R=245, G=205, B=47]"; - GlobalVars.UserCustomization.RightArmColorString = "Color [A=255, R=245, G=205, B=47]"; - GlobalVars.UserCustomization.LeftLegColorString = "Color [A=255, R=164, G=189, B=71]"; - GlobalVars.UserCustomization.RightLegColorString = "Color [A=255, R=164, G=189, B=71]"; - button1.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.HeadColorString); - button2.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.TorsoColorString); - button3.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightArmColorString); - button4.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftArmColorString); - button5.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightLegColorString); - button6.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftLegColorString); - } - - public void ApplyPreset(int head, int torso, int larm, int rarm, int lleg, int rleg) - { - ChangeColorOfPart("Head", head, PartColorList.Find(x => x.ColorID == head).ButtonColor); - ChangeColorOfPart("Torso", torso, PartColorList.Find(x => x.ColorID == torso).ButtonColor); - ChangeColorOfPart("Left Arm", larm, PartColorList.Find(x => x.ColorID == larm).ButtonColor); - ChangeColorOfPart("Right Arm", rarm, PartColorList.Find(x => x.ColorID == rarm).ButtonColor); - ChangeColorOfPart("Left Leg", lleg, PartColorList.Find(x => x.ColorID == lleg).ButtonColor); - ChangeColorOfPart("Right Leg", rleg, PartColorList.Find(x => x.ColorID == rleg).ButtonColor); - } - - private void button61_Click(object sender, EventArgs e) - { - ApplyPreset(24, 194, 24, 24, 119, 119); - } - - private void button62_Click(object sender, EventArgs e) - { - ApplyPreset(24, 101, 24, 24, 9, 9); - } - - private void button63_Click(object sender, EventArgs e) - { - ApplyPreset(24, 23, 24, 24, 119, 119); - } - - private void button64_Click(object sender, EventArgs e) - { - ApplyPreset(24, 101, 24, 24, 119, 119); - } - - private void button68_Click(object sender, EventArgs e) - { - ApplyPreset(24, 45, 24, 24, 119, 119); - } - - private void button67_Click(object sender, EventArgs e) - { - ApplyPreset(106, 194, 106, 106, 119, 119); - } - - private void button66_Click(object sender, EventArgs e) - { - ApplyPreset(106, 119, 106, 106, 119, 119); - } - - private void button65_Click(object sender, EventArgs e) - { - ApplyPreset(9, 194, 9, 9, 119, 119); - } - #endregion - - #region Icon - void Button52Click(object sender, EventArgs e) - { - GlobalVars.UserCustomization.Icon = "BC"; - label5.Text = GlobalVars.UserCustomization.Icon; - } - - void Button53Click(object sender, EventArgs e) - { - GlobalVars.UserCustomization.Icon = "TBC"; - label5.Text = GlobalVars.UserCustomization.Icon; - } - - void Button54Click(object sender, EventArgs e) - { - GlobalVars.UserCustomization.Icon = "OBC"; - label5.Text = GlobalVars.UserCustomization.Icon; - } - - void Button55Click(object sender, EventArgs e) - { - GlobalVars.UserCustomization.Icon = "NBC"; - label5.Text = GlobalVars.UserCustomization.Icon; - } - - private void button60_Click(object sender, EventArgs e) - { - IconLoader icon = new IconLoader(); - try - { - icon.LoadImage(); - } - catch (Exception) - { - } - - if (!string.IsNullOrWhiteSpace(icon.getInstallOutcome())) - { - MessageBox.Show(icon.getInstallOutcome()); - } - - Image icon1 = CustomizationFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png", GlobalPaths.extradir + "\\NoExtra.png"); - pictureBox10.Image = icon1; - } - #endregion - - #region Navigation - private void button72_Click(object sender, EventArgs e) - { - tabControl1.SelectedTab = tabPage1; - } - - private void button73_Click(object sender, EventArgs e) - { - tabControl1.SelectedTab = tabPage2; - } - - private void button74_Click(object sender, EventArgs e) - { - tabControl1.SelectedTab = tabPage8; - } - - private void button75_Click(object sender, EventArgs e) - { - tabControl1.SelectedTab = tabPage3; - } - - private void button76_Click(object sender, EventArgs e) - { - tabControl1.SelectedTab = tabPage4; - } - - private void button77_Click(object sender, EventArgs e) - { - tabControl1.SelectedTab = tabPage5; - } - - private void button78_Click(object sender, EventArgs e) - { - tabControl1.SelectedTab = tabPage6; - } - - private void button79_Click(object sender, EventArgs e) - { - tabControl1.SelectedTab = tabPage9; - } - - private void button80_Click(object sender, EventArgs e) - { - tabControl1.SelectedTab = tabPage7; - } - - private void button81_Click(object sender, EventArgs e) - { - tabControl2.SelectedTab = tabPage10; - } - - private void button82_Click(object sender, EventArgs e) - { - tabControl2.SelectedTab = tabPage11; - } - - private void button83_Click(object sender, EventArgs e) - { - tabControl2.SelectedTab = tabPage12; - } - #endregion - - void Button43Click(object sender, EventArgs e) - { - CustomizationFuncs.Launch3DView(); - } - - private void button71_Click(object sender, EventArgs e) - { - GlobalFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, true); - MessageBox.Show("Outfit Saved!"); - } - - void TextBox1TextChanged(object sender, EventArgs e) - { - GlobalVars.UserCustomization.CharacterID = textBox1.Text; - } - #endregion + } + + void Button40Click(object sender, EventArgs e) + { + GlobalVars.UserCustomization.HeadColorID = 24; + GlobalVars.UserCustomization.TorsoColorID = 23; + GlobalVars.UserCustomization.LeftArmColorID = 24; + GlobalVars.UserCustomization.RightArmColorID = 24; + GlobalVars.UserCustomization.LeftLegColorID = 119; + GlobalVars.UserCustomization.RightLegColorID = 119; + GlobalVars.UserCustomization.CharacterID = ""; + GlobalVars.UserCustomization.HeadColorString = "Color [A=255, R=245, G=205, B=47]"; + GlobalVars.UserCustomization.TorsoColorString = "Color [A=255, R=13, G=105, B=172]"; + GlobalVars.UserCustomization.LeftArmColorString = "Color [A=255, R=245, G=205, B=47]"; + GlobalVars.UserCustomization.RightArmColorString = "Color [A=255, R=245, G=205, B=47]"; + GlobalVars.UserCustomization.LeftLegColorString = "Color [A=255, R=164, G=189, B=71]"; + GlobalVars.UserCustomization.RightLegColorString = "Color [A=255, R=164, G=189, B=71]"; + button1.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.HeadColorString); + button2.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.TorsoColorString); + button3.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightArmColorString); + button4.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftArmColorString); + button5.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.RightLegColorString); + button6.BackColor = ConvertStringtoColor(GlobalVars.UserCustomization.LeftLegColorString); + } + + public void ApplyPreset(int head, int torso, int larm, int rarm, int lleg, int rleg) + { + ChangeColorOfPart("Head", head, PartColorList.Find(x => x.ColorID == head).ButtonColor); + ChangeColorOfPart("Torso", torso, PartColorList.Find(x => x.ColorID == torso).ButtonColor); + ChangeColorOfPart("Left Arm", larm, PartColorList.Find(x => x.ColorID == larm).ButtonColor); + ChangeColorOfPart("Right Arm", rarm, PartColorList.Find(x => x.ColorID == rarm).ButtonColor); + ChangeColorOfPart("Left Leg", lleg, PartColorList.Find(x => x.ColorID == lleg).ButtonColor); + ChangeColorOfPart("Right Leg", rleg, PartColorList.Find(x => x.ColorID == rleg).ButtonColor); + } + + private void button61_Click(object sender, EventArgs e) + { + ApplyPreset(24, 194, 24, 24, 119, 119); + } + + private void button62_Click(object sender, EventArgs e) + { + ApplyPreset(24, 101, 24, 24, 9, 9); + } + + private void button63_Click(object sender, EventArgs e) + { + ApplyPreset(24, 23, 24, 24, 119, 119); + } + + private void button64_Click(object sender, EventArgs e) + { + ApplyPreset(24, 101, 24, 24, 119, 119); + } + + private void button68_Click(object sender, EventArgs e) + { + ApplyPreset(24, 45, 24, 24, 119, 119); + } + + private void button67_Click(object sender, EventArgs e) + { + ApplyPreset(106, 194, 106, 106, 119, 119); + } + + private void button66_Click(object sender, EventArgs e) + { + ApplyPreset(106, 119, 106, 106, 119, 119); + } + + private void button65_Click(object sender, EventArgs e) + { + ApplyPreset(9, 194, 9, 9, 119, 119); } #endregion + + #region Icon + void Button52Click(object sender, EventArgs e) + { + GlobalVars.UserCustomization.Icon = "BC"; + label5.Text = GlobalVars.UserCustomization.Icon; + } + + void Button53Click(object sender, EventArgs e) + { + GlobalVars.UserCustomization.Icon = "TBC"; + label5.Text = GlobalVars.UserCustomization.Icon; + } + + void Button54Click(object sender, EventArgs e) + { + GlobalVars.UserCustomization.Icon = "OBC"; + label5.Text = GlobalVars.UserCustomization.Icon; + } + + void Button55Click(object sender, EventArgs e) + { + GlobalVars.UserCustomization.Icon = "NBC"; + label5.Text = GlobalVars.UserCustomization.Icon; + } + + private void button60_Click(object sender, EventArgs e) + { + IconLoader icon = new IconLoader(); + try + { + icon.LoadImage(); + } + catch (Exception) + { + } + + if (!string.IsNullOrWhiteSpace(icon.getInstallOutcome())) + { + MessageBox.Show(icon.getInstallOutcome()); + } + + Image icon1 = CustomizationFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png", GlobalPaths.extradir + "\\NoExtra.png"); + pictureBox10.Image = icon1; + } + #endregion + + #region Navigation + private void button72_Click(object sender, EventArgs e) + { + tabControl1.SelectedTab = tabPage1; + } + + private void button73_Click(object sender, EventArgs e) + { + tabControl1.SelectedTab = tabPage2; + } + + private void button74_Click(object sender, EventArgs e) + { + tabControl1.SelectedTab = tabPage8; + } + + private void button75_Click(object sender, EventArgs e) + { + tabControl1.SelectedTab = tabPage3; + } + + private void button76_Click(object sender, EventArgs e) + { + tabControl1.SelectedTab = tabPage4; + } + + private void button77_Click(object sender, EventArgs e) + { + tabControl1.SelectedTab = tabPage5; + } + + private void button78_Click(object sender, EventArgs e) + { + tabControl1.SelectedTab = tabPage6; + } + + private void button79_Click(object sender, EventArgs e) + { + tabControl1.SelectedTab = tabPage9; + } + + private void button80_Click(object sender, EventArgs e) + { + tabControl1.SelectedTab = tabPage7; + } + + private void button81_Click(object sender, EventArgs e) + { + tabControl2.SelectedTab = tabPage10; + } + + private void button82_Click(object sender, EventArgs e) + { + tabControl2.SelectedTab = tabPage11; + } + + private void button83_Click(object sender, EventArgs e) + { + tabControl2.SelectedTab = tabPage12; + } + #endregion + + void Button43Click(object sender, EventArgs e) + { + CustomizationFuncs.Launch3DView(); + } + + private void button71_Click(object sender, EventArgs e) + { + GlobalFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, true); + MessageBox.Show("Outfit Saved!"); + } + + void TextBox1TextChanged(object sender, EventArgs e) + { + GlobalVars.UserCustomization.CharacterID = textBox1.Text; + } + #endregion +} +#endregion diff --git a/Novetus/NovetusCore/Classes/Settings.cs b/Novetus/NovetusCore/Classes/Settings.cs index 74e845e..c7a8034 100644 --- a/Novetus/NovetusCore/Classes/Settings.cs +++ b/Novetus/NovetusCore/Classes/Settings.cs @@ -1,6 +1,8 @@ #region Settings using System; using System.IO; +using System.Linq; +using System.Xml.Serialization; public class Settings { @@ -239,5 +241,66 @@ public class Settings } } #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 diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs index 26d11db..c6b82b9 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs @@ -9,6 +9,7 @@ using System.ComponentModel; using System.Reflection; using Mono.Nat; using System.Globalization; +using System.Linq; #endregion namespace NovetusLauncher diff --git a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs index 08526ed..2a7ecc1 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs @@ -56,7 +56,11 @@ partial class ClientinfoEditor this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toDirectoryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toClientToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveAsTextFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.iNIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tagsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.clientToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -149,8 +153,6 @@ partial class ClientinfoEditor this.label9 = new System.Windows.Forms.Label(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.label10 = new System.Windows.Forms.Label(); - this.textToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.iNIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -330,10 +332,26 @@ partial class ClientinfoEditor // // saveToolStripMenuItem // + this.saveToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toDirectoryToolStripMenuItem, + this.toClientToolStripMenuItem}); this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveToolStripMenuItem.Text = "Save"; - this.saveToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItemClick); + // + // toDirectoryToolStripMenuItem + // + this.toDirectoryToolStripMenuItem.Name = "toDirectoryToolStripMenuItem"; + this.toDirectoryToolStripMenuItem.Size = new System.Drawing.Size(192, 22); + this.toDirectoryToolStripMenuItem.Text = "To client directory..."; + this.toDirectoryToolStripMenuItem.Click += new System.EventHandler(this.SaveToClientToolStripMenuItemClick); + // + // toClientToolStripMenuItem + // + this.toClientToolStripMenuItem.Name = "toClientToolStripMenuItem"; + this.toClientToolStripMenuItem.Size = new System.Drawing.Size(192, 22); + this.toClientToolStripMenuItem.Text = "To separate directory..."; + this.toClientToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItemClick); // // saveAsTextFileToolStripMenuItem // @@ -344,6 +362,20 @@ partial class ClientinfoEditor this.saveAsTextFileToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveAsTextFileToolStripMenuItem.Text = "Save As"; // + // textToolStripMenuItem + // + this.textToolStripMenuItem.Name = "textToolStripMenuItem"; + this.textToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.textToolStripMenuItem.Text = "Text"; + this.textToolStripMenuItem.Click += new System.EventHandler(this.saveAsTextFileToolStripMenuItem_Click); + // + // iNIToolStripMenuItem + // + this.iNIToolStripMenuItem.Name = "iNIToolStripMenuItem"; + this.iNIToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.iNIToolStripMenuItem.Text = "INI"; + this.iNIToolStripMenuItem.Click += new System.EventHandler(this.saveAsINIFileToolStripMenuItem_Click); + // // addToolStripMenuItem // this.addToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -1110,20 +1142,6 @@ partial class ClientinfoEditor this.label10.TabIndex = 33; this.label10.Text = "When applying the settings:"; // - // textToolStripMenuItem - // - this.textToolStripMenuItem.Name = "textToolStripMenuItem"; - this.textToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.textToolStripMenuItem.Text = "Text"; - this.textToolStripMenuItem.Click += new System.EventHandler(this.saveAsTextFileToolStripMenuItem_Click); - // - // iNIToolStripMenuItem - // - this.iNIToolStripMenuItem.Name = "iNIToolStripMenuItem"; - this.iNIToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.iNIToolStripMenuItem.Text = "INI"; - this.iNIToolStripMenuItem.Click += new System.EventHandler(this.saveAsINIFileToolStripMenuItem_Click); - // // ClientinfoEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1281,4 +1299,6 @@ partial class ClientinfoEditor private System.Windows.Forms.Label label10; private System.Windows.Forms.ToolStripMenuItem textToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem iNIToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toDirectoryToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toClientToolStripMenuItem; } diff --git a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs index 07a46a1..dc11b25 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs @@ -338,6 +338,8 @@ public partial class ClientinfoEditor : Form }; File.WriteAllText(sfd.FileName, SecurityFuncs.Base64Encode(string.Join("|", lines))); SelectedClientInfoPath = Path.GetDirectoryName(sfd.FileName); + + MessageBox.Show(sfd.FileName + " saved!", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); } } @@ -346,6 +348,38 @@ public partial class ClientinfoEditor : Form textBox3.BackColor = System.Drawing.SystemColors.Control; } + void SaveToClientToolStripMenuItemClick(object sender, EventArgs e) + { + if (!string.IsNullOrWhiteSpace(SelectedClientInfoPath)) + { + string[] lines = { + SecurityFuncs.Base64Encode(SelectedClientInfo.UsesPlayerName.ToString()), + SecurityFuncs.Base64Encode(SelectedClientInfo.UsesID.ToString()), + SecurityFuncs.Base64Encode(SelectedClientInfo.Warning.ToString()), + SecurityFuncs.Base64Encode(SelectedClientInfo.LegacyMode.ToString()), + SecurityFuncs.Base64Encode(SelectedClientInfo.ClientMD5.ToString()), + SecurityFuncs.Base64Encode(SelectedClientInfo.ScriptMD5.ToString()), + SecurityFuncs.Base64Encode(SelectedClientInfo.Description.ToString()), + SecurityFuncs.Base64Encode(Locked.ToString()), + SecurityFuncs.Base64Encode(SelectedClientInfo.Fix2007.ToString()), + SecurityFuncs.Base64Encode(SelectedClientInfo.AlreadyHasSecurity.ToString()), + SecurityFuncs.Base64Encode(Settings.GraphicsOptions.GetIntForClientLoadOptions(SelectedClientInfo.ClientLoadOptions).ToString()), + SecurityFuncs.Base64Encode(SelectedClientInfo.CommandLineArgs.ToString()) + }; + File.WriteAllText(SelectedClientInfoPath + "\\clientinfo.nov", SecurityFuncs.Base64Encode(string.Join("|", lines))); + + label9.Text = "v2 (v" + GlobalVars.ProgramInformation.Version + ")"; + textBox2.BackColor = System.Drawing.SystemColors.Control; + textBox3.BackColor = System.Drawing.SystemColors.Control; + + MessageBox.Show(SelectedClientInfoPath + "\\clientinfo.nov saved!", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + MessageBox.Show("You must save the into a seperate directory with a client in it, generate the IDs, then use this option.", "Novetus Launcher - Error when saving to client.", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void saveAsTextFileToolStripMenuItem_Click(object sender, EventArgs e) { using (var sfd = new SaveFileDialog()) diff --git a/batch/github_scripts.bat b/batch/github_scripts.bat index 1feecd9..2e5b047 100644 --- a/batch/github_scripts.bat +++ b/batch/github_scripts.bat @@ -25,4 +25,5 @@ XCOPY Novetus\clients\2009L\content\scripts\CSMPFunctions.lua %basedir%/2009L XCOPY Novetus\clients\2010L\content\scripts\CSMPFunctions.lua %basedir%/2010L XCOPY Novetus\clients\2011E\content\scripts\CSMPFunctions.lua %basedir%/2011E XCOPY Novetus\clients\2011M\content\scripts\CSMPFunctions.lua %basedir%/2011M -XCOPY Novetus\bin\preview\content\scripts\CSView.lua %basedir%/3DView \ No newline at end of file +XCOPY Novetus\bin\preview\content\scripts\CSView.lua %basedir%/3DView +XCOPY Novetus\config\ContentProviders.xml %CD% \ No newline at end of file diff --git a/scripts/2007M-Shaders/CSMPFunctions.lua b/scripts/2007M-Shaders/CSMPFunctions.lua index 8880024..f292b61 100644 --- a/scripts/2007M-Shaders/CSMPFunctions.lua +++ b/scripts/2007M-Shaders/CSMPFunctions.lua @@ -83,11 +83,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (newVal.Name == "T-Shirt") then pcall(function() local newTShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newTShirt = Instance.new("ShirtGraphic") - newTShirt.Graphic = newVal.Value - newTShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newTShirt = Instance.new("ShirtGraphic") newTShirt.Graphic = newVal.Value newTShirt.Parent = newChar diff --git a/scripts/2007M/CSMPFunctions.lua b/scripts/2007M/CSMPFunctions.lua index f5aa705..169b57e 100644 --- a/scripts/2007M/CSMPFunctions.lua +++ b/scripts/2007M/CSMPFunctions.lua @@ -83,11 +83,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (newVal.Name == "T-Shirt") then pcall(function() local newTShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newTShirt = Instance.new("ShirtGraphic") - newTShirt.Graphic = newVal.Value - newTShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newTShirt = Instance.new("ShirtGraphic") newTShirt.Graphic = newVal.Value newTShirt.Parent = newChar diff --git a/scripts/2008M/CSMPFunctions.lua b/scripts/2008M/CSMPFunctions.lua index 0daaaf2..90ea74d 100644 --- a/scripts/2008M/CSMPFunctions.lua +++ b/scripts/2008M/CSMPFunctions.lua @@ -84,11 +84,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 3) then pcall(function() local newTShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newTShirt = Instance.new("ShirtGraphic") - newTShirt.Graphic = newVal.Value - newTShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newTShirt = Instance.new("ShirtGraphic") newTShirt.Graphic = newVal.Value newTShirt.Parent = newChar @@ -106,11 +102,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 4) then pcall(function() local newShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newShirt = Instance.new("Shirt") - newShirt.ShirtTemplate = newVal.Value - newShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newShirt = Instance.new("Shirt") newShirt.ShirtTemplate = newVal.Value newShirt.Parent = newChar @@ -128,11 +120,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 5) then pcall(function() local newPants = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newPants = Instance.new("Pants") - newPants.PantsTemplate = newVal.Value - newPants.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newPants = Instance.new("Pants") newPants.PantsTemplate = newVal.Value newPants.Parent = newChar diff --git a/scripts/2009E/CSMPFunctions.lua b/scripts/2009E/CSMPFunctions.lua index 2d4d457..c065fbb 100644 --- a/scripts/2009E/CSMPFunctions.lua +++ b/scripts/2009E/CSMPFunctions.lua @@ -84,11 +84,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 3) then pcall(function() local newTShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newTShirt = Instance.new("ShirtGraphic") - newTShirt.Graphic = newVal.Value - newTShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newTShirt = Instance.new("ShirtGraphic") newTShirt.Graphic = newVal.Value newTShirt.Parent = newChar @@ -106,11 +102,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 4) then pcall(function() local newShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newShirt = Instance.new("Shirt") - newShirt.ShirtTemplate = newVal.Value - newShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newShirt = Instance.new("Shirt") newShirt.ShirtTemplate = newVal.Value newShirt.Parent = newChar @@ -128,11 +120,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 5) then pcall(function() local newPants = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newPants = Instance.new("Pants") - newPants.PantsTemplate = newVal.Value - newPants.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newPants = Instance.new("Pants") newPants.PantsTemplate = newVal.Value newPants.Parent = newChar @@ -150,13 +138,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 6) then pcall(function() local newFace = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newWaitForChild(charparts[1],"face"):remove() - newFace = Instance.new("Decal") - newFace.Texture = newVal.Value - newFace.Face = "Front" - newFace.Parent = charparts[1] - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newWaitForChild(charparts[1],"face"):remove() newFace = Instance.new("Decal") newFace.Texture = newVal.Value diff --git a/scripts/2009L/CSMPFunctions.lua b/scripts/2009L/CSMPFunctions.lua index fd60dbf..0a4b13a 100644 --- a/scripts/2009L/CSMPFunctions.lua +++ b/scripts/2009L/CSMPFunctions.lua @@ -88,11 +88,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 3) then pcall(function() local newTShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newTShirt = Instance.new("ShirtGraphic") - newTShirt.Graphic = newVal.Value - newTShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newTShirt = Instance.new("ShirtGraphic") newTShirt.Graphic = newVal.Value newTShirt.Parent = newChar @@ -110,11 +106,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 4) then pcall(function() local newShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newShirt = Instance.new("Shirt") - newShirt.ShirtTemplate = newVal.Value - newShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newShirt = Instance.new("Shirt") newShirt.ShirtTemplate = newVal.Value newShirt.Parent = newChar @@ -132,11 +124,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 5) then pcall(function() local newPants = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newPants = Instance.new("Pants") - newPants.PantsTemplate = newVal.Value - newPants.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newPants = Instance.new("Pants") newPants.PantsTemplate = newVal.Value newPants.Parent = newChar @@ -154,13 +142,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 6) then pcall(function() local newFace = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newWaitForChild(charparts[1],"face"):remove() - newFace = Instance.new("Decal") - newFace.Texture = newVal.Value - newFace.Face = "Front" - newFace.Parent = charparts[1] - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newWaitForChild(charparts[1],"face"):remove() newFace = Instance.new("Decal") newFace.Texture = newVal.Value diff --git a/scripts/2010L/CSMPFunctions.lua b/scripts/2010L/CSMPFunctions.lua index 0adfd80..a41b341 100644 --- a/scripts/2010L/CSMPFunctions.lua +++ b/scripts/2010L/CSMPFunctions.lua @@ -88,11 +88,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 3) then pcall(function() local newTShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newTShirt = Instance.new("ShirtGraphic") - newTShirt.Graphic = newVal.Value - newTShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newTShirt = Instance.new("ShirtGraphic") newTShirt.Graphic = newVal.Value newTShirt.Parent = newChar @@ -110,11 +106,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 4) then pcall(function() local newShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newShirt = Instance.new("Shirt") - newShirt.ShirtTemplate = newVal.Value - newShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newShirt = Instance.new("Shirt") newShirt.ShirtTemplate = newVal.Value newShirt.Parent = newChar @@ -132,11 +124,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 5) then pcall(function() local newPants = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newPants = Instance.new("Pants") - newPants.PantsTemplate = newVal.Value - newPants.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newPants = Instance.new("Pants") newPants.PantsTemplate = newVal.Value newPants.Parent = newChar @@ -154,13 +142,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 6) then pcall(function() local newFace = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newWaitForChild(charparts[1],"face"):remove() - newFace = Instance.new("Decal") - newFace.Texture = newVal.Value - newFace.Face = "Front" - newFace.Parent = charparts[1] - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newWaitForChild(charparts[1],"face"):remove() newFace = Instance.new("Decal") newFace.Texture = newVal.Value diff --git a/scripts/2011E/CSMPFunctions.lua b/scripts/2011E/CSMPFunctions.lua index 270f4df..b13b327 100644 --- a/scripts/2011E/CSMPFunctions.lua +++ b/scripts/2011E/CSMPFunctions.lua @@ -105,11 +105,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 3) then pcall(function() local newTShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newTShirt = Instance.new("ShirtGraphic") - newTShirt.Graphic = newVal.Value - newTShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newTShirt = Instance.new("ShirtGraphic") newTShirt.Graphic = newVal.Value newTShirt.Parent = newChar @@ -127,11 +123,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 4) then pcall(function() local newShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newShirt = Instance.new("Shirt") - newShirt.ShirtTemplate = newVal.Value - newShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newShirt = Instance.new("Shirt") newShirt.ShirtTemplate = newVal.Value newShirt.Parent = newChar @@ -149,11 +141,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 5) then pcall(function() local newPants = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newPants = Instance.new("Pants") - newPants.PantsTemplate = newVal.Value - newPants.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newPants = Instance.new("Pants") newPants.PantsTemplate = newVal.Value newPants.Parent = newChar @@ -171,13 +159,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 6) then pcall(function() local newFace = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newWaitForChild(charparts[1],"face"):remove() - newFace = Instance.new("Decal") - newFace.Texture = newVal.Value - newFace.Face = "Front" - newFace.Parent = charparts[1] - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newWaitForChild(charparts[1],"face"):remove() newFace = Instance.new("Decal") newFace.Texture = newVal.Value diff --git a/scripts/2011M/CSMPFunctions.lua b/scripts/2011M/CSMPFunctions.lua index 6168b5a..5b78997 100644 --- a/scripts/2011M/CSMPFunctions.lua +++ b/scripts/2011M/CSMPFunctions.lua @@ -96,11 +96,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 3) then pcall(function() local newTShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newTShirt = Instance.new("ShirtGraphic") - newTShirt.Graphic = newVal.Value - newTShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newTShirt = Instance.new("ShirtGraphic") newTShirt.Graphic = newVal.Value newTShirt.Parent = newChar @@ -118,11 +114,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 4) then pcall(function() local newShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newShirt = Instance.new("Shirt") - newShirt.ShirtTemplate = newVal.Value - newShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newShirt = Instance.new("Shirt") newShirt.ShirtTemplate = newVal.Value newShirt.Parent = newChar @@ -140,11 +132,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 5) then pcall(function() local newPants = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newPants = Instance.new("Pants") - newPants.PantsTemplate = newVal.Value - newPants.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newPants = Instance.new("Pants") newPants.PantsTemplate = newVal.Value newPants.Parent = newChar @@ -162,13 +150,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 6) then pcall(function() local newFace = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newWaitForChild(charparts[1],"face"):remove() - newFace = Instance.new("Decal") - newFace.Texture = newVal.Value - newFace.Face = "Front" - newFace.Parent = charparts[1] - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newWaitForChild(charparts[1],"face"):remove() newFace = Instance.new("Decal") newFace.Texture = newVal.Value diff --git a/scripts/3DView/CSView.lua b/scripts/3DView/CSView.lua index 0263fe0..e771030 100644 --- a/scripts/3DView/CSView.lua +++ b/scripts/3DView/CSView.lua @@ -36,11 +36,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 3) then pcall(function() local newTShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newTShirt = Instance.new("ShirtGraphic") - newTShirt.Graphic = newVal.Value - newTShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newTShirt = Instance.new("ShirtGraphic") newTShirt.Graphic = newVal.Value newTShirt.Parent = newChar @@ -58,11 +54,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 4) then pcall(function() local newShirt = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newShirt = Instance.new("Shirt") - newShirt.ShirtTemplate = newVal.Value - newShirt.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newShirt = Instance.new("Shirt") newShirt.ShirtTemplate = newVal.Value newShirt.Parent = newChar @@ -80,11 +72,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 5) then pcall(function() local newPants = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newPants = Instance.new("Pants") - newPants.PantsTemplate = newVal.Value - newPants.Parent = newChar - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newPants = Instance.new("Pants") newPants.PantsTemplate = newVal.Value newPants.Parent = newChar @@ -102,13 +90,7 @@ function LoadCharacterNew(playerApp,newChar) elseif (customtype == 6) then pcall(function() local newFace = ""; - if (string.match(newVal.Value, "finobe") == "finobe") then - newWaitForChild(charparts[1],"face"):remove() - newFace = Instance.new("Decal") - newFace.Texture = newVal.Value - newFace.Face = "Front" - newFace.Parent = charparts[1] - elseif (string.match(newVal.Value, "epicgamers") == "epicgamers") then + if (string.match(newVal.Value, "http") == "http") then newWaitForChild(charparts[1],"face"):remove() newFace = Instance.new("Decal") newFace.Texture = newVal.Value