private void PantsIDBox_TextChanged(object sender, EventArgs e) { listBox7.SelectedItem = "NoPants.rbxm"; if (!string.IsNullOrWhiteSpace(PantsIDBox.Text)) { GlobalVars.UserCustomization.Pants = characterCustomizationForm.Custom_Pants_URL + PantsIDBox.Text; PantsIDBox.Focus(); } else { GlobalVars.UserCustomization.Pants = listBox7.SelectedItem.ToString(); } characterCustomizationForm.ChangeItem( GlobalVars.UserCustomization.Pants, GlobalPaths.pantsdir, "NoPants", pictureBox7, textBox9, listBox7, false, PantsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()) : null ); }
private void PantsTypeBox_SelectedIndexChanged(object sender, EventArgs e) { Provider pantsProvider = null; if (PantsTypeBox.SelectedItem != null) { pantsProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()); characterCustomizationForm.Custom_Pants_URL = pantsProvider.URL; } if (!string.IsNullOrWhiteSpace(PantsIDBox.Text)) { GlobalVars.UserCustomization.Pants = characterCustomizationForm.Custom_Pants_URL + PantsIDBox.Text; characterCustomizationForm.ChangeItem( GlobalVars.UserCustomization.Pants, GlobalPaths.pantsdir, "NoPants", pictureBox7, textBox9, listBox7, false, pantsProvider ); } }
private void ShirtsTypeBox_SelectedIndexChanged(object sender, EventArgs e) { Provider shirtProvider = null; if (ShirtsTypeBox.SelectedItem != null) { shirtProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()); characterCustomizationForm.Custom_Shirt_URL = shirtProvider.URL; } if (!string.IsNullOrWhiteSpace(ShirtsIDBox.Text)) { GlobalVars.UserCustomization.Shirt = characterCustomizationForm.Custom_Shirt_URL + ShirtsIDBox.Text; characterCustomizationForm.ChangeItem( GlobalVars.UserCustomization.Shirt, GlobalPaths.shirtdir, "NoShirt", pictureBox6, textBox8, listBox6, false, shirtProvider ); } }
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 + "\\" + GlobalPaths.ContentProviderXMLName)) { PantsTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; } } listBox7.SelectedItem = previtem; GlobalVars.UserCustomization.Pants = previtem; characterCustomizationForm.ChangeItem( GlobalVars.UserCustomization.Pants, GlobalPaths.pantsdir, "NoPants", pictureBox7, textBox9, listBox7, false, PantsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, PantsTypeBox.SelectedItem.ToString()) : null ); } }
private void FaceTypeBox_SelectedIndexChanged(object sender, EventArgs e) { Provider faceProvider = null; if (FaceTypeBox.SelectedItem != null) { faceProvider = OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()); characterCustomizationForm.Custom_Face_URL = faceProvider.URL; } if (!string.IsNullOrWhiteSpace(FaceIDBox.Text)) { GlobalVars.UserCustomization.Face = characterCustomizationForm.Custom_Face_URL + FaceIDBox.Text; characterCustomizationForm.ChangeItem( GlobalVars.UserCustomization.Face, GlobalPaths.facedir, "DefaultFace", pictureBox4, textBox6, listBox4, false, faceProvider ); } }
private void ShirtsIDBox_TextChanged(object sender, EventArgs e) { listBox6.SelectedItem = "NoShirt.rbxm"; if (!string.IsNullOrWhiteSpace(ShirtsIDBox.Text)) { GlobalVars.UserCustomization.Shirt = characterCustomizationForm.Custom_Shirt_URL + ShirtsIDBox.Text; ShirtsIDBox.Focus(); } else { GlobalVars.UserCustomization.Shirt = listBox6.SelectedItem.ToString(); } characterCustomizationForm.ChangeItem( GlobalVars.UserCustomization.Shirt, GlobalPaths.shirtdir, "NoShirt", pictureBox6, textBox8, listBox6, false, ShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null ); }
private void FaceIDBox_TextChanged(object sender, EventArgs e) { listBox4.SelectedItem = "DefaultFace.rbxm"; if (!string.IsNullOrWhiteSpace(FaceIDBox.Text)) { GlobalVars.UserCustomization.Face = characterCustomizationForm.Custom_Face_URL + FaceIDBox.Text; FaceIDBox.Focus(); } else { GlobalVars.UserCustomization.Face = listBox4.SelectedItem.ToString(); } characterCustomizationForm.ChangeItem( GlobalVars.UserCustomization.Face, GlobalPaths.facedir, "DefaultFace", pictureBox4, textBox6, listBox4, false, FaceTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()) : null ); }
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 + "\\" + GlobalPaths.ContentProviderXMLName)) { FaceTypeBox.SelectedItem = characterCustomizationForm.contentProviders.FirstOrDefault().Name; } } listBox4.SelectedItem = previtem; GlobalVars.UserCustomization.Face = previtem; characterCustomizationForm.ChangeItem( GlobalVars.UserCustomization.Face, GlobalPaths.facedir, "DefaultFace", pictureBox4, textBox6, listBox4, false, FaceTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(characterCustomizationForm.contentProviders, FaceTypeBox.SelectedItem.ToString()) : null ); } }
public void InitForm() { if (GlobalFuncs.HasColorsChanged()) { GlobalVars.ColorsLoaded = GlobalFuncs.InitColors(); closeOnLaunch = !GlobalVars.ColorsLoaded; } if (closeOnLaunch) { MessageBox.Show("The part colors cannot be loaded. The character customization will now close.", "Novetus - Cannot load part colors.", MessageBoxButtons.OK, MessageBoxIcon.Error); Parent.Close(); return; } if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName)) { contentProviders = 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://") || GlobalVars.UserCustomization.Face.Contains("https://")) { Provider faceProvider = 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://") || GlobalVars.UserCustomization.TShirt.Contains("https://")) { Provider tShirtProvider = OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.TShirt); TShirtsIDBox.Text = GlobalVars.UserCustomization.TShirt.Replace(tShirtProvider.URL, ""); TShirtsTypeBox.SelectedItem = tShirtProvider.Name; } if (GlobalVars.UserCustomization.Shirt.Contains("http://") || GlobalVars.UserCustomization.Shirt.Contains("https://")) { Provider shirtProvider = OnlineClothing.FindContentProviderByURL(contentProviders, GlobalVars.UserCustomization.Shirt); ShirtsIDBox.Text = GlobalVars.UserCustomization.Shirt.Replace(shirtProvider.URL, ""); ShirtsTypeBox.SelectedItem = shirtProvider.Name; } if (GlobalVars.UserCustomization.Pants.Contains("http://") || GlobalVars.UserCustomization.Pants.Contains("https://")) { Provider pantsProvider = 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; } int imgsize = (FormStyle == Settings.Style.Extended) ? 28 : 18; PartColorLoader.AddPartColorsToListView(GlobalVars.PartColorList, ColorView, imgsize); //body SelectedPartLabel.Text = SelectedPart; ReloadColors(); //icon if (GlobalVars.UserCustomization.Icon.Contains("http://") || GlobalVars.UserCustomization.Icon.Contains("https://")) { IconLabel.Text = "NBC"; } else { IconLabel.Text = GlobalVars.UserCustomization.Icon; } //charid CharacterIDBox.Text = GlobalVars.UserCustomization.CharacterID; ShowHatsInExtraBox.Checked = GlobalVars.UserCustomization.ShowHatsInExtra; if (GlobalVars.UserConfiguration.LauncherStyle == Settings.Style.Stylish) { Color robBlue = Color.FromArgb(110, 152, 200); if (FormStyle == Settings.Style.Extended) { AestheticPanel1.BorderStyle = BorderStyle.None; AestheticPanel1.BackColor = robBlue; foreach (Control C in AestheticPanel1.Controls) { if (C is Button) { Button button = (Button)C; button.FlatStyle = FlatStyle.Flat; button.FlatAppearance.BorderColor = Color.White; button.ForeColor = Color.White; button.Font = new Font("Comic Sans MS", 7.8f, FontStyle.Bold); button.BackColor = robBlue; button.Location = new Point(button.Location.X + 1, button.Location.Y); } } AestheticPanel2.BorderStyle = BorderStyle.FixedSingle; AestheticDivider.BorderStyle = BorderStyle.None; AestheticDivider.Size = new Size(AestheticDivider.Size.Width + 3, AestheticDivider.Size.Height); } string backgroundImage = GlobalPaths.DataDir + @"\\CharacterBackdrop.png"; if (File.Exists(backgroundImage)) { Image im = GlobalFuncs.LoadImage(backgroundImage); CharBackground.Image = im; } } //discord GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InCustomization); GlobalFuncs.ReloadLoadoutValue(); }
public void ChangeTabs() { ColorView.SelectedIndices.Clear(); switch (CharacterTabControl.SelectedTab) { case TabPage pg1 when pg1 == CharacterTabControl.TabPages["tabPage1"]: if (FormStyle == Settings.Style.Extended) { OrganizationPanel.Location = new Point(110, 359); } Hat1List.Items.Clear(); Hat2List.Items.Clear(); Hat3List.Items.Clear(); HeadList.Items.Clear(); TShirtList.Items.Clear(); ShirtList.Items.Clear(); PantsList.Items.Clear(); FaceList.Items.Clear(); ExtraItemList.Items.Clear(); break; case TabPage pg7 when pg7 == CharacterTabControl.TabPages["tabPage7"]: if (FormStyle == Settings.Style.Extended) { OrganizationPanel.Location = new Point(110, 359); } Hat1List.Items.Clear(); Hat2List.Items.Clear(); Hat3List.Items.Clear(); HeadList.Items.Clear(); TShirtList.Items.Clear(); ShirtList.Items.Clear(); PantsList.Items.Clear(); FaceList.Items.Clear(); ExtraItemList.Items.Clear(); if (GlobalVars.UserCustomization.Icon.Contains("http://") || GlobalVars.UserCustomization.Icon.Contains("https://")) { IconURLBox.Text = GlobalVars.UserCustomization.Icon; LoadRemoteIcon(); } else { LoadLocalIcon(); } break; case TabPage pg2 when pg2 == CharacterTabControl.TabPages["tabPage2"]: //hats if (FormStyle == Settings.Style.Extended) { OrganizationPanel.Location = new Point(110, 239); } HeadList.Items.Clear(); TShirtList.Items.Clear(); ShirtList.Items.Clear(); PantsList.Items.Clear(); FaceList.Items.Clear(); ExtraItemList.Items.Clear(); ChangeItem( GlobalVars.UserCustomization.Hat1, GlobalPaths.hatdir, "NoHat", Hat1Image, Hat1Desc, Hat1List, true ); ChangeItem( GlobalVars.UserCustomization.Hat2, GlobalPaths.hatdir, "NoHat", Hat2Image, Hat2Desc, Hat2List, true ); ChangeItem( GlobalVars.UserCustomization.Hat3, GlobalPaths.hatdir, "NoHat", Hat3Image, Hat3Desc, Hat3List, true ); break; case TabPage pg3 when pg3 == CharacterTabControl.TabPages["tabPage3"]: //faces if (FormStyle == Settings.Style.Extended) { OrganizationPanel.Location = new Point(110, 359); } Hat1List.Items.Clear(); Hat2List.Items.Clear(); Hat3List.Items.Clear(); HeadList.Items.Clear(); TShirtList.Items.Clear(); ShirtList.Items.Clear(); PantsList.Items.Clear(); ExtraItemList.Items.Clear(); ChangeItem( GlobalVars.UserCustomization.Face, GlobalPaths.facedir, "DefaultFace", FaceImage, FaceDesc, FaceList, true, FaceTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(contentProviders, FaceTypeBox.SelectedItem.ToString()) : null ); break; case TabPage pg4 when pg4 == CharacterTabControl.TabPages["tabPage4"]: //faces if (FormStyle == Settings.Style.Extended) { OrganizationPanel.Location = new Point(110, 359); } Hat1List.Items.Clear(); Hat2List.Items.Clear(); Hat3List.Items.Clear(); HeadList.Items.Clear(); ShirtList.Items.Clear(); PantsList.Items.Clear(); FaceList.Items.Clear(); ExtraItemList.Items.Clear(); ChangeItem( GlobalVars.UserCustomization.TShirt, GlobalPaths.tshirtdir, "NoTShirt", TShirtImage, TShirtDesc, TShirtList, true, TShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(contentProviders, TShirtsTypeBox.SelectedItem.ToString()) : null ); break; case TabPage pg5 when pg5 == CharacterTabControl.TabPages["tabPage5"]: //faces if (FormStyle == Settings.Style.Extended) { OrganizationPanel.Location = new Point(110, 359); } Hat1List.Items.Clear(); Hat2List.Items.Clear(); Hat3List.Items.Clear(); HeadList.Items.Clear(); TShirtList.Items.Clear(); PantsList.Items.Clear(); FaceList.Items.Clear(); ExtraItemList.Items.Clear(); ChangeItem( GlobalVars.UserCustomization.Shirt, GlobalPaths.shirtdir, "NoShirt", ShirtImage, ShirtDesc, ShirtList, true, ShirtsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(contentProviders, ShirtsTypeBox.SelectedItem.ToString()) : null ); break; case TabPage pg6 when pg6 == CharacterTabControl.TabPages["tabPage6"]: //faces if (FormStyle == Settings.Style.Extended) { OrganizationPanel.Location = new Point(110, 359); } Hat1List.Items.Clear(); Hat2List.Items.Clear(); Hat3List.Items.Clear(); HeadList.Items.Clear(); TShirtList.Items.Clear(); ShirtList.Items.Clear(); FaceList.Items.Clear(); ExtraItemList.Items.Clear(); ChangeItem( GlobalVars.UserCustomization.Pants, GlobalPaths.pantsdir, "NoPants", PantsImage, PantsDesc, PantsList, true, PantsTypeBox.SelectedItem != null ? OnlineClothing.FindContentProviderByName(contentProviders, PantsTypeBox.SelectedItem.ToString()) : null ); break; case TabPage pg8 when pg8 == CharacterTabControl.TabPages["tabPage8"]: //faces if (FormStyle == Settings.Style.Extended) { OrganizationPanel.Location = new Point(110, 359); } Hat1List.Items.Clear(); Hat2List.Items.Clear(); Hat3List.Items.Clear(); TShirtList.Items.Clear(); ShirtList.Items.Clear(); PantsList.Items.Clear(); FaceList.Items.Clear(); ExtraItemList.Items.Clear(); ChangeItem( GlobalVars.UserCustomization.Head, GlobalPaths.headdir, "DefaultHead", HeadImage, HeadDesc, HeadList, true ); break; case TabPage pg9 when pg9 == CharacterTabControl.TabPages["tabPage9"]: //faces if (FormStyle == Settings.Style.Extended) { OrganizationPanel.Location = new Point(110, 359); } Hat1List.Items.Clear(); Hat2List.Items.Clear(); Hat3List.Items.Clear(); HeadList.Items.Clear(); TShirtList.Items.Clear(); ShirtList.Items.Clear(); PantsList.Items.Clear(); FaceList.Items.Clear(); ChangeItem( GlobalVars.UserCustomization.Extra, GlobalPaths.extradir, "NoExtra", ExtraItemImage, ExtraItemDesc, ExtraItemList, true ); if (GlobalVars.UserCustomization.ShowHatsInExtra) { ChangeItem( GlobalVars.UserCustomization.Extra, GlobalPaths.hatdir, "NoHat", ExtraItemImage, ExtraItemDesc, ExtraItemList, true, GlobalVars.UserCustomization.ShowHatsInExtra ); } break; default: if (FormStyle == Settings.Style.Extended) { OrganizationPanel.Location = new Point(110, 359); } Hat1List.Items.Clear(); Hat2List.Items.Clear(); Hat3List.Items.Clear(); HeadList.Items.Clear(); TShirtList.Items.Clear(); ShirtList.Items.Clear(); PantsList.Items.Clear(); FaceList.Items.Clear(); ExtraItemList.Items.Clear(); break; } }
private void LoadXML(XMLContentType type) { loaderList.Clear(); switch (type) { case XMLContentType.ContentProviders: if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName)) { contentProviders = OnlineClothing.GetContentProviders(); } else { MessageBox.Show("Cannot load the Content Provider list because the Content Provider XML file does not exist.", "XML Content Editor - Content Provider Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } loaderList.AddRange(contentProviders); break; case XMLContentType.PartColors: if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.PartColorXMLName)) { XMLPartColorList = PartColorLoader.GetPartColors(); } else { MessageBox.Show("Cannot load the Part Color list because the Part Color XML file does not exist.", "XML Content Editor - Part Color Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } loaderList.AddRange(XMLPartColorList); break; default: break; } XMLView.Rows.Clear(); XMLView.Columns.Clear(); if (loaderList.Count > 0) { if (loaderList.OfType <Provider>().Any()) { XMLView.ColumnCount = 3; XMLView.Columns[0].Name = "Name"; XMLView.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable; XMLView.Columns[1].Name = "URL"; XMLView.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable; XMLView.Columns[2].Name = "Icon File"; XMLView.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable; ListType = XMLContentType.ContentProviders; } else if (loaderList.OfType <PartColor>().Any()) { XMLView.ColumnCount = 3; XMLView.Columns[0].Name = "Name"; XMLView.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable; XMLView.Columns[1].Name = "ID"; XMLView.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable; XMLView.Columns[2].Name = "RGB Value"; XMLView.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable; ListType = XMLContentType.PartColors; } foreach (var obj in loaderList) { if (obj is Provider) { Provider pro = obj as Provider; string[] providerRow = new string[] { pro.Name, pro.URL, pro.Icon }; XMLView.Rows.Add(providerRow); } else if (obj is PartColor) { PartColor pc = obj as PartColor; string[] partColorRow = new string[] { pc.ColorRawName, pc.ColorID.ToString(), pc.ColorRGB }; XMLView.Rows.Add(partColorRow); } } } else { MessageBox.Show("Unable to load XML file information because no information exists in the XML file.", "XML Content Editor - File Read Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }