private void ShowDataElementDescription(Pox.Diff.DifferenceLink link, Pox.Diff.DifferenceLink.ItemType it) { RuneDescription.TracerClear(); if (link == null) { return; } Pox.DataElement elem = null; if (it == Pox.Diff.DifferenceLink.ItemType.PREVIOUS) { if (link.PreviousElement == null) { return; } RuneDescription.database_ref = diff_calculator.PreviousDatabase; elem = link.PreviousElement; } else { if (link.CurrentElement == null) { return; } RuneDescription.database_ref = diff_calculator.CurrentDatabase_ref; elem = link.CurrentElement; } switch (link.ElemType) { case Pox.DataElement.ElementType.CHAMPION: RuneDescription.SetChampionRune(RuneDescription.database_ref.Champions[elem.ID]); break; case Pox.DataElement.ElementType.ABILITY: RuneDescription.SetAbility(RuneDescription.database_ref.Abilities[elem.ID]); break; case Pox.DataElement.ElementType.SPELL: RuneDescription.SetSpellRune(RuneDescription.database_ref.Spells[elem.ID]); break; case Pox.DataElement.ElementType.RELIC: RuneDescription.SetRelicRune(RuneDescription.database_ref.Relics[elem.ID]); break; case Pox.DataElement.ElementType.EQUIPMENT: RuneDescription.SetEquipmentRune(RuneDescription.database_ref.Equipments[elem.ID]); break; default: RuneDescription.ClearDescription(); break; } }
private void LoadDataElementChangeInfo(Pox.DataElement prev_elem, Pox.DataElement curr_elem) { int prev_changes = PanelChangeList.Controls.Count; if (prev_elem.Name != curr_elem.Name) { PushChangeInfo(string.Format("Name changed from {0} to {1}", prev_elem.Name, curr_elem.Name)); } if (prev_elem.Description != curr_elem.Description) { PushChangeInfo(string.Format("Description changed\r\nOld:\r\n {0}\r\nNew:\r\n {1}", prev_elem.Description, curr_elem.Description)); } if (!(prev_elem is Pox.Champion)) { if (prev_elem.NoraCost < curr_elem.NoraCost) { PushChangeInfo(string.Format("Nora cost increased by {0}", curr_elem.NoraCost - prev_elem.NoraCost)); } if (prev_elem.NoraCost > curr_elem.NoraCost) { PushChangeInfo(string.Format("Nora cost decreased by {0}", prev_elem.NoraCost - curr_elem.NoraCost)); } } else { if (((Pox.Champion)prev_elem).BaseNoraCost < ((Pox.Champion)curr_elem).BaseNoraCost) { PushChangeInfo(string.Format("Nora cost increased by {0}", ((Pox.Champion)curr_elem).BaseNoraCost - ((Pox.Champion)prev_elem).BaseNoraCost)); } if (((Pox.Champion)prev_elem).BaseNoraCost > ((Pox.Champion)curr_elem).BaseNoraCost) { PushChangeInfo(string.Format("Nora cost decreased by {0}", ((Pox.Champion)prev_elem).BaseNoraCost - ((Pox.Champion)curr_elem).BaseNoraCost)); } } if (prev_changes != PanelChangeList.Controls.Count) { PushChangeInfo(""); } }
private void LoadChangeInfo(Pox.Diff.DifferenceLink diff_link) { ButtonPrevious.Show(); ButtonCurrent.Show(); Pox.DataElement prev = diff_link.PreviousElement; Pox.DataElement curr = diff_link.CurrentElement; if (prev == null) { if (curr == null) { PanelChangeList.Controls.Add(new Label() { Text = "<!!!INVALID!!!>" }); ButtonCurrent.Hide(); } else { PanelChangeList.Controls.Add(new Label() { Text = "Added" }); } ButtonPrevious.Hide(); return; } else if (curr == null) { PanelChangeList.Controls.Add(new Label() { Text = "Removed" }); ButtonCurrent.Hide(); return; } // load data element change info switch (diff_link.ElemType) { case Pox.DataElement.ElementType.CHAMPION: LoadChampionChangeInfo((Pox.Champion)prev, (Pox.Champion)curr); break; case Pox.DataElement.ElementType.ABILITY: LoadAbilityChangeInfo((Pox.Ability)prev, (Pox.Ability)curr); break; case Pox.DataElement.ElementType.SPELL: LoadSpellChangeInfo((Pox.Spell)prev, (Pox.Spell)curr); break; case Pox.DataElement.ElementType.EQUIPMENT: LoadEquipmentChangeInfo((Pox.Equipment)prev, (Pox.Equipment)curr); break; case Pox.DataElement.ElementType.RELIC: LoadRelicChangeInfo((Pox.Relic)prev, (Pox.Relic)curr); break; default: break; } }
private bool ElementPassesFilter(Pox.DataElement elem) { return((!DatabaseFilter.ApplyFilters) || (DatabaseFilter.SearchFilter == null) || (DatabaseFilter.SearchFilter.Satisfies(elem))); }