public MyCheckBox(Enums.Enum_Classe _EnumType, ListOfChampion _ListOfChampion) { this.InitializeComponent(); this.ActualOnType = 0; this.EnumType = _EnumType; this.ListOfChampionRef = _ListOfChampion; this.ChangeMeCheck(true); if (this.EnumType == Enums.Enum_Classe.None) { this.Bonus.Visibility = Visibility.Collapsed; this.Icon.Source = new BitmapImage(new Uri("/Antize TFT;component/Ressources/All.png", UriKind.Relative)); } else { this.BonusNeed = new int[3] { -1, -1, -1 }; this.Icon.Source = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Classes/{this.EnumType}.png", UriKind.Relative)); foreach (OrigineClasse Classe in TacheFond.ListOrigineClasse) { if (Classe.GetClasseType == this.EnumType) { this.SelfOriginClass = Classe; int Local_Index = 0; foreach (int item1 in Classe.GetBonus.Keys) { this.BonusNeed[Local_Index] = item1; Local_Index++; } if (this.BonusNeed[2] >= 0) { this.Max.Text = this.BonusNeed[2].ToString(); this.NmbrPalier = 2; } else if (this.BonusNeed[1] >= 0) { this.Max.Text = this.BonusNeed[1].ToString(); this.NmbrPalier = 1; } else { this.Max.Text = this.BonusNeed[0].ToString(); this.NmbrPalier = 0; } break; } } this.ImageForMouse.ToolTip = TacheFond.GetLocalizationRef.MyCheckBox_IconToolTip + this.EnumType; } }
/*****************************/ /*** Fonctions ***************/ /*****************************/ public void AddOrRemoveChampion(Champion _Champion, bool _ByUser) { this.ChampionOnSlot = _Champion; this.OrigineClasseOne = null; this.OrigineClasseTwo = null; this.OrigineClasseThree = null; int Local_Number = int.Parse(TacheFond.GetMainRef.GetSetActualNumber); if (_Champion != null) { if (_ByUser) { Local_Number++; TacheFond.GetMainRef.GetSetActualNumber = Local_Number.ToString(); } this.Champion_Icon.Source = _Champion.GetIcon; this.Name_Champion.Text = _Champion.GetName; this.Classe_1.Source = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Classes/{_Champion.GetClasse_One}.png", UriKind.Relative)); this.Classe_2.Source = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Classes/{_Champion.GetClasse_Two}.png", UriKind.Relative)); this.Classe_3.Source = new BitmapImage(new Uri($"/Antize TFT;component/Ressources/Classes/{_Champion.GetClasse_Three}.png", UriKind.Relative)); //Recupere les Origines et Classes bool Local_MakeOne = true; bool Local_MakeTwo = true; bool Local_MakeThree = true; if (_Champion.GetClasse_One == Enums.Enum_Classe.None) { Local_MakeOne = false; } if (_Champion.GetClasse_Two == Enums.Enum_Classe.None) { Local_MakeTwo = false; } if (_Champion.GetClasse_Three == Enums.Enum_Classe.None) { Local_MakeThree = false; } if (Local_MakeOne == true || Local_MakeTwo == true || Local_MakeThree == true) { foreach (OrigineClasse item in TacheFond.ListOrigineClasse) { if (Local_MakeOne == true && _Champion.GetClasse_One == item.GetClasseType) { this.OrigineClasseOne = item; Local_MakeOne = false; } else if (Local_MakeTwo == true && _Champion.GetClasse_Two == item.GetClasseType) { this.OrigineClasseTwo = item; Local_MakeTwo = false; } else if (Local_MakeThree == true && _Champion.GetClasse_Three == item.GetClasseType) { this.OrigineClasseThree = item; Local_MakeThree = false; } } } //Met la couleur par le tier this.Name_Champion.Foreground = TacheFond.GetColorTier(_Champion.GetTier); } else { if (_ByUser) { Local_Number--; TacheFond.GetMainRef.GetSetActualNumber = Local_Number.ToString(); } this.Champion_Icon.Source = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Empty.png", UriKind.Relative)); this.Name_Champion.Text = ""; this.Classe_1.Source = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Classes/Invisible.png", UriKind.Relative)); this.Classe_2.Source = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Classes/Invisible.png", UriKind.Relative)); this.Classe_3.Source = new BitmapImage(new Uri("/Antize TFT;component/Ressources/Classes/Invisible.png", UriKind.Relative)); this.Name_Champion.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#8C9095")); } }
public void UpdateDetailOrigineClasse(OrigineClasse _Classe) { this.Reset(); if (_Classe != null) { if (_Classe.GetIsClasse) { this.Classe_Type.Text = "Classe"; } else { this.Classe_Type.Text = "Origin"; } if (_Classe.GetDescription.Replace(" ", "").Length <= 0) { this.Main.RowDefinitions[0].Height = new GridLength(45); this.Classe_Description.Text = ""; } else { this.Main.RowDefinitions[0].Height = new GridLength(70); this.Classe_Description.Text = _Classe.GetDescription; } //Attribue les informations this.Classe_Name.Text = _Classe.GetName; this.Classe_Icon.Source = _Classe.GetIcon; if (_Classe.GetBonus.ElementAt(1).Key < 0) { this.Need_1.Text = _Classe.GetBonus.ElementAt(0).Key.ToString(); this.Effect_1.Text = _Classe.GetBonus.ElementAt(0).Value; } else if (_Classe.GetBonus.ElementAt(2).Key < 0) { this.Need_1.Text = _Classe.GetBonus.ElementAt(0).Key.ToString(); this.Effect_1.Text = _Classe.GetBonus.ElementAt(0).Value; this.Need_2.Text = _Classe.GetBonus.ElementAt(1).Key.ToString(); this.Effect_2.Text = _Classe.GetBonus.ElementAt(1).Value; } else { this.Need_1.Text = _Classe.GetBonus.ElementAt(0).Key.ToString(); this.Effect_1.Text = _Classe.GetBonus.ElementAt(0).Value; this.Need_2.Text = _Classe.GetBonus.ElementAt(1).Key.ToString(); this.Effect_2.Text = _Classe.GetBonus.ElementAt(1).Value; this.Need_3.Text = _Classe.GetBonus.ElementAt(2).Key.ToString(); this.Effect_3.Text = _Classe.GetBonus.ElementAt(2).Value; } this.WrapPanel_Champions.Children.Clear(); this.NumberChamp = 0; foreach (Champion Champ in TacheFond.ListChampions) { bool Local_AlreadyTake = false; if (_Classe.GetClasseType == Champ.GetClasse_One || _Classe.GetClasseType == Champ.GetClasse_Two || _Classe.GetClasseType == Champ.GetClasse_Three) { foreach (SlotChampion SlotChamp in TacheFond.GetMainRef.SlotChampion) { if (SlotChamp.ChampionOnSlot != null) { if (SlotChamp.ChampionOnSlot == Champ) { Local_AlreadyTake = true; break; } } } this.WrapPanel_Champions.Children.Add(new ChampionOnClasseOrigine(Champ, Local_AlreadyTake) { Height = 70, Width = 72 }); this.NumberChamp++; } } this.RefreshSize(); } }