コード例 #1
0
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            MainWindow _mwin = (MainWindow)((EditorWindow)this.Owner)._mainWindow;

            ;
            TH1PaintCollection _paintCollection = new TH1PaintCollection();

            string[] runeParts = ((string)comboBonus.SelectedItem).Split(':');
            TH1RuneM newRune   = runeCollection.findRune(new TH1Helper().getRuneColourID((string)comboColour.SelectedValue), int.Parse(runeParts[0]));

            thisRune = new TH1RuneMExt(newRune);
            try { thisRune.purchased = (uint)((bool)checkPurchased.IsChecked ? 1 : 0); } catch { thisRune.purchased = 0; }
            try { thisRune.dataB = (uint)((bool)chkUnknown.IsChecked ? 1 : 0); } catch { thisRune.purchased = 0; }
            try { thisRune.valueModifier = uint.Parse(txtBaseValue.Text); } catch { thisRune.valueModifier = 10000; }
            try { thisRune.dataD = uint.Parse(txtD.Text); } catch { thisRune.dataD = 0; }
            try { thisRune.paint = _paintCollection.findPaint((string)comboPaint.SelectedItem); } catch { thisRune.paint = new TH1Paint(); }

            this.DialogResult = true;
        }
コード例 #2
0
        private void comboBonus_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (comboBonus.SelectedItem != null)
            {
                MainWindow _mwin = (MainWindow)((EditorWindow)this.Owner)._mainWindow;

                string[] runeParts = ((string)comboBonus.SelectedItem).Split(':');
                TH1RuneM _rune     = runeCollection.findRune(new TH1Helper().getRuneColourID((string)comboColour.SelectedValue), int.Parse(runeParts[0]));

                imgRune.Source  = _rune.runeImage;
                lblRune.ToolTip = _rune.longName;
                lblRune.Content = lblRune.ToolTip;

                comboPaint.IsEnabled = comboBonus.SelectedItem.ToString().Contains("Colour Module");
                if (!comboPaint.IsEnabled)
                {
                    comboPaint.SelectedIndex = 0;
                }
            }
        }