Ejemplo n.º 1
0
 void CharacterFilter_ChangeSpellbar(object sender, ChangeSpellbarEventArgs e)
 {
     // DO STUFF HERE
 }
Ejemplo n.º 2
0
 void CharacterFilter_ChangeSpellbar(object sender, ChangeSpellbarEventArgs e)
 {
 }
Ejemplo n.º 3
0
 private void CharacterFilter_ChangeSpellbar(object sender, ChangeSpellbarEventArgs e)
 {
     // DO STUFF HERE
 }
Ejemplo n.º 4
0
        private void CharacterFilter_ChangeSpellbar(object sender, ChangeSpellbarEventArgs e)
        {
            try
            {
                MyClasses.MetaViewWrappers.IList list = lstSpells[e.Tab];
                switch (e.Type)
                {
                case AddRemoveEventType.Add:
                    // Update spellbar structure
                    Spell spell = mFS.SpellTable.GetById(e.SpellId);
                    if (spell != null)
                    {
                        try
                        {
                            mSpellTabs[e.Tab].Insert(e.Slot, spell);
                        }
                        catch (Exception ex)
                        {
                            Util.Debug("List size: " + mSpellTabs[e.Tab] + "; Slot: " + e.Slot + "; Spell: " + spell.Name);
                            throw;
                        }

                        // Update spell list if <Current> is selected
                        if (IsDisplayingCurrentChar)
                        {
                            if (mSpellTabs[e.Tab].Count == 1)
                            {
                                // This was the first spell added to this tab
                                list.Clear();
                            }

                            InsertSpellRow(list, e.Slot, spell);

                            // Update the slot numbers on all of the following spells
                            for (int r = e.Slot + 1; r < list.RowCount; r++)
                            {
                                UpdateSpellRow(list[r], r);
                            }
                        }
                    }
                    break;

                case AddRemoveEventType.Delete:
                    // Update spellbar structure
                    for (int i = 0; i < mSpellTabs[e.Tab].Count; i++)
                    {
                        if (mSpellTabs[e.Tab][i].Id == e.SpellId)
                        {
                            mSpellTabs[e.Tab].RemoveAt(i);

                            // Update spell list if <Current> is selected
                            if (IsDisplayingCurrentChar)
                            {
                                list.Delete(i);

                                if (mSpellTabs[e.Tab].Count == 0)
                                {
                                    InsertEmptyTabRow(list);
                                }
                                else
                                {
                                    for (int r = i; r < list.RowCount; r++)
                                    {
                                        // Update the slot numbers on all of the following spells
                                        UpdateSpellRow(list[r], r);
                                    }
                                }
                            }
                            break;
                        }
                    }
                    break;
                }
            }
            catch (Exception ex) { Util.HandleException(ex); }
        }