示例#1
0
        private void pactSpellListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            syncPactSpellSelectionOrder();

            WarlockPact currentPact = (WarlockPact)pactListBox.SelectedItem;

            if (currentPact != null)
            {
                if (pactSpellListBox.SelectedIndices.Count > 0)
                {
                    if (pactSpellListBox.SelectedIndices.Count <= currentPact.SpellAmount)
                    {
                        int   lastSelectedIndex = pactSpellsOrderedSelection.ElementAt(pactSpellsOrderedSelection.Count - 1);
                        Spell currentSpell      = (Spell)pactSpellListBox.Items[lastSelectedIndex];
                        if (currentSpell != null)
                        {
                            pactSpellDescriptionLabel.Text = SpellFormatter.formatSpellDescription(currentSpell);
                        }
                    }
                    else
                    {
                        int lastSelectedIndex = pactSpellsOrderedSelection.ElementAt(pactSpellsOrderedSelection.Count - 1);
                        pactSpellListBox.SelectedIndices.Remove(lastSelectedIndex);
                    }

                    refreshInvocationList();
                    OnPactSpellChosen(null);
                }
            }
        }
示例#2
0
        private void spellListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (spellListBox.SelectedItems.Count > 0)
            {
                descriptionLabel.Text = SpellFormatter.formatSpellDescription((Spell)spellListBox.SelectedItem);

                OnSpellChosen(null);
            }
        }
示例#3
0
        private void spellListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            syncSpellSelectionOrder();
            if (spellListBox.SelectedItems.Count > 0)
            {
                if (spellListBox.SelectedIndices.Count <= spellAmount)
                {
                    int lastSelectedIndex = spellOrderedSelection.ElementAt(spellOrderedSelection.Count - 1);
                    descriptionLabel.Text = SpellFormatter.formatSpellDescription((Spell)spellListBox.Items[lastSelectedIndex]);
                }
                else
                {
                    int lastSelectedIndex = spellOrderedSelection.ElementAt(spellOrderedSelection.Count - 1);
                    spellListBox.SelectedIndices.Remove(lastSelectedIndex);
                }

                OnSpellChosen(null);
            }
        }
示例#4
0
        private void invocationSpellListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            syncInvocationSpellSelectionOrder();
            if (invocationSpellListBox.SelectedIndices.Count > 0)
            {
                if (invocationSpellListBox.SelectedIndices.Count <= invocationSpellsKnown)
                {
                    int   lastSelectedIndex = invocationSpellsOrderedSelection.ElementAt(invocationSpellsOrderedSelection.Count - 1);
                    Spell currentSpell      = (Spell)invocationSpellListBox.Items[lastSelectedIndex];
                    if (currentSpell != null)
                    {
                        invocationSpellDescriptionLabel.Text = SpellFormatter.formatSpellDescription(currentSpell);
                    }
                }
                else
                {
                    int lastSelectedIndex = invocationSpellsOrderedSelection.ElementAt(invocationSpellsOrderedSelection.Count - 1);
                    invocationSpellListBox.SelectedIndices.Remove(lastSelectedIndex);
                }

                OnInvocationSpellChosen(null);
            }
        }