Beispiel #1
0
        readonly string[] _words = new[] { "=====" }; // todo: more wodrs

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Compares two spells
        /// </summary>
        /// <param name="rtb1">RichTextBox 1 in left</param>
        /// <param name="rtb2">RichTextBox 2 in right</param>
        /// <param name="spell1">Compare Spell 1</param>
        /// <param name="spell2">Compare Spell 2</param>
        public SpellCompare(RichTextBox rtb1, RichTextBox rtb2, SpellEntry spell1, SpellEntry spell2)
        {
            new SpellInfo(rtb1, spell1);
            new SpellInfo(rtb2, spell2);

            var strsl = rtb1.Text.Split('\n');
            var strsr = rtb2.Text.Split('\n');

            var pos = 0;
            foreach (var str in strsl)
            {
                pos += str.Length + 1;
                rtb1.Select(pos - str.Length - 1, pos - 1);

                if (rtb2.Find(str, RichTextBoxFinds.WholeWord) != -1)
                    rtb1.SelectionBackColor = str.ContainsText(_words) ? rtb1.BackColor : Color.Cyan;
                else
                    rtb1.SelectionBackColor = Color.Salmon;
            }

            pos = 0;
            foreach (var str in strsr)
            {
                pos += str.Length + 1;
                rtb2.Select(pos - str.Length - 1, pos - 1);

                if (rtb1.Find(str, RichTextBoxFinds.WholeWord) != -1)
                    rtb2.SelectionBackColor = str.ContainsText(_words) ? rtb2.BackColor : Color.Cyan;
                else
                    rtb2.SelectionBackColor = Color.Salmon;
            }
        }
Beispiel #2
0
        public SpellInfo(RichTextBox rtb, SpellEntry spell)
        {
            _rtb = rtb;
            _spell = spell;

            ProcInfo.SpellProc = spell;

            ViewSpellInfo();
        }
Beispiel #3
0
        private void OkClick(object sender, EventArgs e)
        {
            if (_lvSpellList.SelectedIndices.Count <= 0)
                return;

            Spell = _spellList[_lvSpellList.SelectedIndices[0]];
            DialogResult = DialogResult.OK;
            Close();
        }
Beispiel #4
0
        private void SetProcAtribute(SpellEntry spell)
        {
            new SpellInfo(_rtbProcSpellInfo, spell);

            _cbProcSpellFamilyTree.SelectedValue = spell.SpellFamilyName;
            _clbProcFlags.SetCheckedItemFromFlag(spell.ProcFlags);
            _clbSchools.SetCheckedItemFromFlag(spell.SchoolMask);
            _cbProcFitstSpellFamily.SelectedValue = spell.SpellFamilyName;
            _tbPPM.Text = @"0"; // need correct value
            _tbChance.Text = spell.ProcChance.ToString();
            _tbCooldown.Text = (spell.RecoveryTime / 1000f).ToString();
        }
Beispiel #5
0
        private void GetProcAttribute(SpellEntry spell)
        {
            var spellFamilyFlags = _tvFamilyTree.GetMask();
            var statusproc =
                String.Format(
                    "Spell ({0}) {1}. Proc Event ==> SchoolMask 0x{2:X2}, SpellFamily {3}, 0x{4:X8} {5:X8} {6:X8}, procFlag 0x{7:X8}, procEx 0x{8:X8}, PPMRate {9}",
                    spell.ID, spell.SpellNameRank, _clbSchools.GetFlagsValue(), _cbProcFitstSpellFamily.ValueMember,
                    spellFamilyFlags[0], spellFamilyFlags[1], spellFamilyFlags[2], _clbProcFlags.GetFlagsValue(),
                    _clbProcFlagEx.GetFlagsValue(), _tbPPM.Text.ToFloat());

            _gSpellProcEvent.Text = @"Spell Proc Event    " + statusproc;
        }