Ejemplo n.º 1
0
        private void comboCharms_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (comboCharms.SelectedIndex > -1)
            {
                _thisCharm               = new TH1CharmExt(charmCollection.findCharmByLongName((string)comboCharms.SelectedItem));
                imgCharm.Source          = _thisCharm.image;
                lblCharm.Content         = _thisCharm.charmLongName;
                comboQuests.ItemsSource  = null;
                comboQuests.ItemsSource  = _thisCharm.questsLongNameArray;
                comboQuests.SelectedItem = _thisCharm.questLongName;

                int maxRunes = _thisCharm.charm.runeList.Count;
                _thisCharm.runesReq = new List <bool>(new bool[8]);

                foreach (Control ctrl in ((Grid)groupRunes.Content).Children)
                {
                    CheckBox _check = ctrl as CheckBox;
                    if (_check != null)
                    {
                        try
                        {
                            int _tag = int.Parse((string)_check.Tag);
                            _check.Visibility = (_tag < maxRunes) ? Visibility.Visible : Visibility.Hidden;
                            _check.IsChecked  = false;
                        }
                        catch { }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void comboQuest_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            EditorWindow ewin   = (EditorWindow)Window.GetWindow(this);
            ComboBox     _combo = sender as ComboBox;

            if ((_combo != null) && (_combo.SelectedIndex > -1))
            {
                int         val        = int.Parse((string)_combo.Tag);
                int         index      = _combo.SelectedIndex;
                TH1CharmExt _thisCharm = ewin._save.charmsActive[val];
                if (_thisCharm.isEquip)
                {
                    _thisCharm.activeQuestId = (uint)_thisCharm.charm.questList[index].questID;
                }
                if (val == 0)
                {
                    sliderProgA.Maximum = _thisCharm.target;
                    sliderProgA.Value   = _thisCharm.progress;
                }
                else
                {
                    sliderProgB.Maximum = _thisCharm.target;
                    sliderProgB.Value   = _thisCharm.progress;
                }
            }
        }
Ejemplo n.º 3
0
        private void setupForm(bool initial)
        {
            if (charmIndex == -1)
            {
                comboTier.SelectedIndex = 0;                    // New Charm
            }
            if (initial)
            {
                _originalCharm = _thisCharm;
            }
            lblCharm.ToolTip         = _originalCharm.exDataString; // temp
            comboTier.SelectedIndex  = _originalCharm.charmLevel - 1;
            comboCharms.SelectedItem = _originalCharm.charmLongName;
            comboQuests.SelectedItem = _originalCharm.activeQuest.questLongName;
            txtValue.Text            = _originalCharm.valueModifier.ToString();
            sliderProgress.Maximum   = _originalCharm.target;
            sliderProgress.Value     = _originalCharm.progress;

            foreach (Control ctrl in ((Grid)groupBeta.Content).Children)
            {
                TextBox _text = ctrl as TextBox;
                if (_text != null)
                {
                    try
                    {
                        int _tag = int.Parse((string)_text.Tag);
                        switch (_tag)
                        {
                        case 2:
                            _text.Text = _originalCharm.val2.ToString();
                            break;

                        case 8:
                            _text.Text = _originalCharm.val8.ToString();
                            break;
                        }
                    }
                    catch { }
                }
            }

            if (initial)
            {
                _thisCharm.runesReq = _originalCharm.runesReq;
            }
            foreach (Control ctrl in ((Grid)groupRunes.Content).Children)
            {
                CheckBox _check = ctrl as CheckBox;
                if (_check != null)
                {
                    try
                    {
                        int _tag = int.Parse((string)_check.Tag);
                        _check.IsChecked = _originalCharm.runesReq[_tag];
                    }
                    catch { }
                }
            }
        }
Ejemplo n.º 4
0
        private void mnuEquip(object sender, RoutedEventArgs e)
        {
            EditorWindow ewin = (EditorWindow)Window.GetWindow(this);

            if (ewin == null)
            {
                return;
            }
            var _save = ewin._save;

            if (_save == null)
            {
                return;
            }

            MenuItem _menu = sender as MenuItem;

            if (_menu != null && dataInventry.SelectedItem != null)
            {
                try {
                    int         activeCharm = int.Parse((string)_menu.Tag);
                    TH1CharmExt _selected   = (TH1CharmExt)dataInventry.SelectedItem;
                    TH1CharmExt _tmpCharm   = _save.charmsActive[activeCharm];

                    _save.charmsActive[activeCharm] = _selected;
                    _save.charmsActive[activeCharm].inActiveSlot = true; // Now Active
                    _save.charmsInventry.Remove(_selected);
                    if (_tmpCharm.isEquip)
                    {
                        _tmpCharm.inActiveSlot = false; // No Longer Active
                        _save.charmsInventry.Add(_tmpCharm);
                    }

                    dataInventry.ItemsSource = null;
                    dataInventry.ItemsSource = _save.charmsInventry;

                    recountCharms();
                    loadCharmsInPlace();
                } catch { MessageBox.Show("Unable To Equip That Charm", "Charm Equip Error", MessageBoxButton.OK, MessageBoxImage.Warning); }
            }
        }