Exemple #1
0
        private void imgNotes_Click(object sender, EventArgs e)
        {
            frmNotes frmContactNotes = new frmNotes();

            frmContactNotes.Notes = _objContact.Notes;
            frmContactNotes.ShowDialog(this);

            if (frmContactNotes.DialogResult == DialogResult.OK)
            {
                _objContact.Notes = frmContactNotes.Notes;
            }

            string strTooltip = "";

            if (_objContact.EntityType == ContactType.Enemy)
            {
                strTooltip = LanguageManager.Instance.GetString("Tip_Enemy_EditNotes");
            }
            else
            {
                strTooltip = LanguageManager.Instance.GetString("Tip_Contact_EditNotes");
            }
            if (_objContact.Notes != string.Empty)
            {
                strTooltip += "\n\n" + _objContact.Notes;
            }
            tipTooltip.SetToolTip(imgNotes, functions.WordWrap(strTooltip, 100));
        }
Exemple #2
0
        private void imgNotes_Click(object sender, EventArgs e)
        {
            frmNotes frmSpritNotes = new frmNotes
            {
                Notes = _objSpirit.Notes
            };

            frmSpritNotes.ShowDialog(this);

            if (frmSpritNotes.DialogResult == DialogResult.OK)
            {
                _objSpirit.Notes = frmSpritNotes.Notes;
            }

            string strTooltip = string.Empty;

            if (_objSpirit.EntityType == SpiritType.Spirit)
            {
                strTooltip = LanguageManager.GetString("Tip_Spirit_EditNotes");
            }
            else
            {
                strTooltip = LanguageManager.GetString("Tip_Sprite_EditNotes");
            }
            if (!string.IsNullOrEmpty(_objSpirit.Notes))
            {
                strTooltip += "\n\n" + _objSpirit.Notes;
            }
            tipTooltip.SetToolTip(imgNotes, CommonFunctions.WordWrap(strTooltip, 100));
        }
        /// <summary>
        /// Clears and updates the treeview for Critter Powers. Typically called as part of AddQuality or UpdateCharacterInfo.
        /// </summary>
        /// <param name="treCritterPowers">Treenode that will be cleared and populated.</param>
        /// <param name="cmsCritterPowers">ContextMenuStrip that will be added to each power.</param>
        protected void RefreshCritterPowers(TreeView treCritterPowers, ContextMenuStrip cmsCritterPowers)
        {
            //Clear the default nodes of entries.
            foreach (TreeNode objNode in treCritterPowers.Nodes)
            {
                objNode.Nodes.Clear();
            }
            //Add the Critter Powers that exist.
            foreach (CritterPower objPower in _objCharacter.CritterPowers)
            {
                TreeNode objNode = new TreeNode();
                objNode.Text             = objPower.DisplayName;
                objNode.Tag              = objPower.InternalId;
                objNode.ContextMenuStrip = cmsCritterPowers;
                if (!string.IsNullOrEmpty(objPower.Notes))
                {
                    objNode.ForeColor = Color.SaddleBrown;
                }
                objNode.ToolTipText = CommonFunctions.WordWrap(objPower.Notes, 100);

                if (objPower.Category != "Weakness")
                {
                    treCritterPowers.Nodes[0].Nodes.Add(objNode);
                    treCritterPowers.Nodes[0].Expand();
                }
                else
                {
                    treCritterPowers.Nodes[1].Nodes.Add(objNode);
                    treCritterPowers.Nodes[1].Expand();
                }
            }
        }
        public static void Add(this TreeView treView, Quality input, ContextMenuStrip strip)
        {
            if (treView == null)
            {
                return;
            }
            TreeNode nodeToAddTo = treView.Nodes[(int)input.Type];
            string   strName     = input.DisplayName;

            if (!nodeToAddTo.Nodes.ContainsKey(strName))
            {
                TreeNode newNode = new TreeNode();
                newNode.Text             = strName;
                newNode.Tag              = input.InternalId;
                newNode.ContextMenuStrip = strip;

                if (!string.IsNullOrEmpty(input.Notes))
                {
                    newNode.ForeColor = Color.SaddleBrown;
                }
                else if (input.OriginSource == QualitySource.Metatype || input.OriginSource == QualitySource.MetatypeRemovable || input.OriginSource == QualitySource.Improvement)
                {
                    newNode.ForeColor = SystemColors.GrayText;
                }
                if (!input.Implemented)
                {
                    newNode.ForeColor = Color.Red;
                }
                newNode.ToolTipText = CommonFunctions.WordWrap(input.Notes, 100);

                nodeToAddTo.Nodes.Add(newNode);
                nodeToAddTo.Expand();
            }
        }
        public static void Add(this TreeView treView, MartialArt input, ContextMenuStrip strip)
        {
            if (treView == null)
            {
                return;
            }
            TreeNode objTargetNode = treView.Nodes[input.IsQuality ? 1 : 0];

            if (objTargetNode != null)
            {
                TreeNode newNode = new TreeNode();
                newNode.Text             = input.DisplayName;
                newNode.Tag              = input.InternalId;
                newNode.ContextMenuStrip = strip;
                if (!string.IsNullOrEmpty(input.Notes))
                {
                    newNode.ForeColor = Color.SaddleBrown;
                }
                newNode.ToolTipText = CommonFunctions.WordWrap(input.Notes, 100);

                foreach (MartialArtAdvantage objAdvantage in input.Advantages)
                {
                    TreeNode objAdvantageNode = new TreeNode();
                    objAdvantageNode.Text = objAdvantage.DisplayName;
                    objAdvantageNode.Tag  = objAdvantage.InternalId;
                    newNode.Nodes.Add(objAdvantageNode);
                    newNode.Expand();
                }

                objTargetNode.Nodes.Add(newNode);
                objTargetNode.Expand();
            }
        }
        /// <summary>
        /// Refreshes the list of qualities into the selected TreeNode. If the same number of
        /// </summary>
        /// <param name="treQualities">Treeview to insert the qualities into.</param>
        /// <param name="cmsQuality">ContextMenuStrip to add to each Quality node.</param>
        /// <param name="blnForce">Forces a refresh of the TreeNode despite a match.</param>
        protected void RefreshQualities(TreeView treQualities, ContextMenuStrip cmsQuality, bool blnForce = false)
        {
            //Count the child nodes in each treenode.
            int intQualityCount = 0;

            foreach (TreeNode objTreeNode in treQualities.Nodes)
            {
                intQualityCount += objTreeNode.Nodes.Count;
            }

            //If the node count is the same as the quality count, there's no need to do anything.
            if (intQualityCount != _objCharacter.Qualities.Count || blnForce)
            {
                foreach (TreeNode objTreeNode in treQualities.Nodes)
                {
                    objTreeNode.Nodes.Clear();
                }
                // Populate the Qualities list.
                foreach (Quality objQuality in _objCharacter.Qualities)
                {
                    TreeNode objNode = new TreeNode();
                    objNode.Text             = objQuality.DisplayName;
                    objNode.Tag              = objQuality.InternalId;
                    objNode.ContextMenuStrip = cmsQuality;

                    if (!string.IsNullOrEmpty(objQuality.Notes))
                    {
                        objNode.ForeColor = Color.SaddleBrown;
                    }
                    else
                    {
                        if (objQuality.OriginSource == QualitySource.Metatype ||
                            objQuality.OriginSource == QualitySource.MetatypeRemovable)
                        {
                            objNode.ForeColor = SystemColors.GrayText;
                        }
                    }
                    objNode.ToolTipText = CommonFunctions.WordWrap(objQuality.Notes, 100);

                    switch (objQuality.Type)
                    {
                    case QualityType.Positive:
                        treQualities.Nodes[0].Nodes.Add(objNode);
                        treQualities.Nodes[0].Expand();
                        break;

                    case QualityType.Negative:
                        treQualities.Nodes[1].Nodes.Add(objNode);
                        treQualities.Nodes[1].Expand();
                        break;

                    case QualityType.LifeModule:
                        treQualities.Nodes[2].Nodes.Add(objNode);
                        treQualities.Nodes[2].Expand();
                        break;
                    }
                }
            }
        }
        public static void Add(this TreeView treView, Spell input, ContextMenuStrip strip)
        {
            if (treView == null)
            {
                return;
            }
            TreeNode objNode = new TreeNode
            {
                Text             = input.DisplayName,
                Tag              = input.InternalId,
                ContextMenuStrip = strip
            };

            if (!string.IsNullOrEmpty(input.Notes))
            {
                objNode.ForeColor = Color.SaddleBrown;
            }
            objNode.ToolTipText = CommonFunctions.WordWrap(input.Notes, 100);

            TreeNode objSpellTypeNode = null;

            switch (input.Category)
            {
            case "Combat":
                objSpellTypeNode = treView.Nodes[0];
                break;

            case "Detection":
                objSpellTypeNode = treView.Nodes[1];
                break;

            case "Health":
                objSpellTypeNode = treView.Nodes[2];
                break;

            case "Illusion":
                objSpellTypeNode = treView.Nodes[3];
                break;

            case "Manipulation":
                objSpellTypeNode = treView.Nodes[4];
                break;

            case "Rituals":
                objSpellTypeNode = treView.Nodes[5];
                break;

            case "Enchantments":
                objSpellTypeNode = treView.Nodes[6];
                break;
            }
            objSpellTypeNode.Nodes.Add(objNode);
            objSpellTypeNode.Expand();
        }
        public static void Add(this TreeView treView, Improvement input, ContextMenuStrip strip)
        {
            if (treView == null)
            {
                return;
            }
            TreeNode nodeToAddTo = treView.Nodes[(int)Enum.Parse(typeof(LimitType), input.ImprovedName)];
            string   strName     = input.UniqueName + ": ";

            if (input.Value > 0)
            {
                strName += "+";
            }
            strName += input.Value.ToString();
            if (!string.IsNullOrEmpty(input.Condition))
            {
                strName += ", " + input.Condition;
            }
            if (!nodeToAddTo.Nodes.ContainsKey(strName))
            {
                TreeNode newNode = new TreeNode();
                newNode.Text = newNode.Name = strName;
                newNode.Tag  = input.SourceName;
                if (!string.IsNullOrEmpty(input.Notes))
                {
                    newNode.ForeColor = Color.SaddleBrown;
                }
                newNode.ToolTipText      = CommonFunctions.WordWrap(input.Notes, 100);
                newNode.ContextMenuStrip = strip;
                if (string.IsNullOrEmpty(input.ImprovedName))
                {
                    if (input.ImproveType == Improvement.ImprovementType.SocialLimit)
                    {
                        input.ImprovedName = "Social";
                    }
                    else if (input.ImproveType == Improvement.ImprovementType.MentalLimit)
                    {
                        input.ImprovedName = "Mental";
                    }
                    else
                    {
                        input.ImprovedName = "Physical";
                    }
                }

                nodeToAddTo.Nodes.Add(newNode);
                nodeToAddTo.Expand();
            }
        }
Exemple #9
0
        private void imgNotes_Click(object sender, EventArgs e)
        {
            frmNotes frmContactNotes = new frmNotes();

            frmContactNotes.Notes = _objContact.Notes;
            frmContactNotes.ShowDialog(this);

            if (frmContactNotes.DialogResult == DialogResult.OK)
            {
                _objContact.Notes = frmContactNotes.Notes;
            }

            string strTooltip = LanguageManager.GetString("Tip_Contact_EditNotes");

            if (!string.IsNullOrEmpty(_objContact.Notes))
            {
                strTooltip += "\n\n" + _objContact.Notes;
            }
            tipTooltip.SetToolTip(imgNotes, CommonFunctions.WordWrap(strTooltip, 100));
        }
Exemple #10
0
        private void imgNotes_Click(object sender, EventArgs e)
        {
            frmNotes frmPowerNotes = new frmNotes();

            frmPowerNotes.Notes = _objPower.Notes;
            frmPowerNotes.ShowDialog(this);

            if (frmPowerNotes.DialogResult == DialogResult.OK)
            {
                _objPower.Notes = frmPowerNotes.Notes;
            }

            string strTooltip = LanguageManager.Instance.GetString("Tip_Power_EditNotes");

            if (_objPower.Notes != string.Empty)
            {
                strTooltip += "\n\n" + _objPower.Notes;
            }
            tipTooltip.SetToolTip(imgNotes, functions.WordWrap(strTooltip, 100));
        }
Exemple #11
0
        private void imgNotes_Click(object sender, EventArgs e)
        {
            frmNotes frmPowerNotes = new frmNotes
            {
                Notes = _objPower.Notes
            };

            frmPowerNotes.ShowDialog(this);

            if (frmPowerNotes.DialogResult == DialogResult.OK)
            {
                _objPower.Notes = frmPowerNotes.Notes;
            }

            string strTooltip = LanguageManager.GetString("Tip_Power_EditNotes", GlobalOptions.Language);

            if (_objPower.Notes != "")
            {
                strTooltip += "\n\n" + _objPower.Notes;
            }
            tipTooltip.SetToolTip(imgNotes, CommonFunctions.WordWrap(strTooltip, 100));
        }
        public static void Add(this TreeView treView, LimitModifier input, ContextMenuStrip strip)
        {
            if (treView == null)
            {
                return;
            }
            TreeNode nodeToAddTo = treView.Nodes[(int)Enum.Parse(typeof(LimitType), input.Limit)];

            if (!nodeToAddTo.Nodes.ContainsKey(input.DisplayName))
            {
                TreeNode newNode = new TreeNode();
                newNode.Text = newNode.Name = input.DisplayName;
                newNode.Tag  = input.InternalId;
                if (!string.IsNullOrEmpty(input.Notes))
                {
                    newNode.ForeColor = Color.SaddleBrown;
                }
                newNode.ToolTipText      = CommonFunctions.WordWrap(input.Notes, 100);
                newNode.ContextMenuStrip = strip;

                nodeToAddTo.Nodes.Add(newNode);
                nodeToAddTo.Expand();
            }
        }
Exemple #13
0
        private void SetToolTips()
        {
            const int width = 50;
            var functions = new CommonFunctions();

            tipTooltip.SetToolTip(chkKnucks, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsKnucks"), width));
            tipTooltip.SetToolTip(chkIgnoreArt, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsIgnoreArt"), width));
            tipTooltip.SetToolTip(chkCyberlegMovement, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsCyberlegMovement"), width));
            tipTooltip.SetToolTip(chkDontDoubleQualities, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsDontDoubleQualities"), width));
            tipTooltip.SetToolTip(chkUsePointsOnBrokenGroups, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsUsePointsOnBrokenGroups"), width));
            tipTooltip.SetToolTip(chkAllowInitiation, functions.WordWrap(LanguageManager.Instance.GetString("Tip_OptionsAllowInitiation"), width));
        }
        /// <summary>
        /// Refreshes the list of qualities into the selected TreeNode. If the same number of
        /// </summary>
        /// <param name="treQualities">Treeview to insert the qualities into.</param>
        /// <param name="cmsQuality">ContextMenuStrip to add to each Quality node.</param>
        /// <param name="blnForce">Forces a refresh of the TreeNode despite a match.</param>
        protected void RefreshQualities(TreeView treQualities, ContextMenuStrip cmsQuality, bool blnForce = false)
        {
            //Count the child nodes in each treenode.
            int intQualityCount = 0;

            if (!blnForce)
            {
                foreach (TreeNode objTreeNode in treQualities.Nodes)
                {
                    intQualityCount += objTreeNode.Nodes.Count;
                }
            }

            //If the node count is the same as the quality count, there's no need to do anything.
            if (blnForce || intQualityCount != _objCharacter.Qualities.Count)
            {
                // Multiple instances of the same quality are combined into just one entry with a number next to it (e.g. 6 discrete entries of "Focused Concentration" become "Focused Concentration 6")
                HashSet <string> strQualitiesToPrint = new HashSet <string>();
                foreach (TreeNode objTreeNode in treQualities.Nodes)
                {
                    objTreeNode.Nodes.Clear();
                }
                foreach (Quality objQuality in _objCharacter.Qualities)
                {
                    strQualitiesToPrint.Add(objQuality.QualityId + " " + objQuality.SourceName + " " + objQuality.Extra);
                }
                // Populate the Qualities list.
                foreach (Quality objQuality in _objCharacter.Qualities)
                {
                    if (!strQualitiesToPrint.Remove(objQuality.QualityId + " " + objQuality.SourceName + " " + objQuality.Extra))
                    {
                        continue;
                    }
                    TreeNode objNode = new TreeNode();
                    objNode.Text             = objQuality.DisplayName;
                    objNode.Tag              = objQuality.InternalId;
                    objNode.ContextMenuStrip = cmsQuality;

                    if (!string.IsNullOrEmpty(objQuality.Notes))
                    {
                        objNode.ForeColor = Color.SaddleBrown;
                    }
                    else if (objQuality.OriginSource == QualitySource.Metatype ||
                             objQuality.OriginSource == QualitySource.MetatypeRemovable ||
                             objQuality.OriginSource == QualitySource.Improvement)
                    {
                        objNode.ForeColor = SystemColors.GrayText;
                    }
                    objNode.ToolTipText = CommonFunctions.WordWrap(objQuality.Notes, 100);

                    switch (objQuality.Type)
                    {
                    case QualityType.Positive:
                        treQualities.Nodes[0].Nodes.Add(objNode);
                        treQualities.Nodes[0].Expand();
                        break;

                    case QualityType.Negative:
                        treQualities.Nodes[1].Nodes.Add(objNode);
                        treQualities.Nodes[1].Expand();
                        break;

                    case QualityType.LifeModule:
                        treQualities.Nodes[2].Nodes.Add(objNode);
                        treQualities.Nodes[2].Expand();
                        break;
                    }
                }
            }
        }