当前位置: 首页>>代码示例>>C#>>正文


C# Chummer.SpiritControl类代码示例

本文整理汇总了C#中Chummer.SpiritControl的典型用法代码示例。如果您正苦于以下问题:C# SpiritControl类的具体用法?C# SpiritControl怎么用?C# SpiritControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SpiritControl类属于Chummer命名空间,在下文中一共展示了SpiritControl类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: cmdAddSpirit_Click

        private void cmdAddSpirit_Click(object sender, EventArgs e)
        {
            int i = panSpirits.Controls.Count;

            // The number of bound Spirits cannot exeed the character's CHA.
            if (i >= _objCharacter.CHA.Value && !_objCharacter.IgnoreRules)
            {
                MessageBox.Show(LanguageManager.Instance.GetString("Message_BoundSpiritLimit"), LanguageManager.Instance.GetString("MessageTitle_BoundSpiritLimit"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            Spirit objSpirit = new Spirit(_objCharacter);
            _objCharacter.Spirits.Add(objSpirit);

            SpiritControl objSpiritControl = new SpiritControl();
            objSpiritControl.SpiritObject = objSpirit;
            objSpiritControl.EntityType = SpiritType.Spirit;

            // Attach an EventHandler for the ServicesOwedChanged Event.
            objSpiritControl.ServicesOwedChanged += objSpirit_ServicesOwedChanged;
            objSpiritControl.ForceChanged += objSpirit_ForceChanged;
            objSpiritControl.BoundChanged += objSpirit_BoundChanged;
            objSpiritControl.DeleteSpirit += objSpirit_DeleteSpirit;
            objSpiritControl.FileNameChanged += objSpirit_FileNameChanged;

            int intMAG = Convert.ToInt32(_objCharacter.MAG.TotalValue);
            if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
            {
                intMAG = _objCharacter.MAG.TotalValue;
            }
            if (_objOptions.SpiritForceBasedOnTotalMAG)
            {
                objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
                objSpiritControl.Force = _objCharacter.MAG.TotalValue;
            }
            else
            {
                if (intMAG == 0)
                    intMAG = 1;

                objSpiritControl.ForceMaximum = intMAG;
                objSpiritControl.Force = intMAG;
            }
            objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);

            objSpiritControl.Top = i * objSpiritControl.Height;
            panSpirits.Controls.Add(objSpiritControl);

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:51,代码来源:frmCreate.cs

示例2: cmdAddSprite_Click

        private void cmdAddSprite_Click(object sender, EventArgs e)
        {
            int i = panSprites.Controls.Count;

            // The number of registered Sprites cannot exceed the character's LOG.
            if (i >= _objCharacter.LOG.Value && !_objCharacter.IgnoreRules)
            {
                MessageBox.Show(LanguageManager.Instance.GetString("Message_RegisteredSpriteLimit"), LanguageManager.Instance.GetString("MessageTitle_RegisteredSpriteLimit"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            Spirit objSprite = new Spirit(_objCharacter);
            _objCharacter.Spirits.Add(objSprite);

            SpiritControl objSpriteControl = new SpiritControl();
            objSpriteControl.SpiritObject = objSprite;
            objSpriteControl.EntityType = SpiritType.Sprite;

            // Attach an EventHandler for the ServicesOwedChanged Event.
            objSpriteControl.ServicesOwedChanged += objSprite_ServicesOwedChanged;
            objSpriteControl.ForceChanged += objSprite_ForceChanged;
            objSpriteControl.BoundChanged += objSprite_BoundChanged;
            objSpriteControl.DeleteSpirit += objSprite_DeleteSpirit;
            objSpriteControl.FileNameChanged += objSprite_FileNameChanged;

            objSpriteControl.ForceMaximum = Convert.ToInt32(nudRES.Value);
            objSpriteControl.Force = Convert.ToInt32(nudRES.Value);
            objSpriteControl.RebuildSpiritList(_objCharacter.TechnomancerStream);

            objSpriteControl.Top = i * objSpriteControl.Height;
            panSprites.Controls.Add(objSpriteControl);

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
开发者ID:cormanater,项目名称:chummer5a,代码行数:35,代码来源:frmCreate.cs

示例3: frmCreate_Load


//.........这里部分代码省略.........
								}
								objPower.MaxLevels = intImprovedAbilityMaximum;
							}
							else
							{
								objPowerControl.MaxLevels = objPower.MaxLevels;
							}
					}
					else
					{
						objPowerControl.MaxLevels = objPower.MaxLevels;
					}
				}
                objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
                if (objPower.Rating < 1)
                    objPower.Rating = 1;
                objPowerControl.PowerLevel = Convert.ToInt32(objPower.Rating);
                if (objPower.DiscountedAdeptWay)
                    objPowerControl.DiscountedByAdeptWay = true;
                if (objPower.DiscountedGeas)
                    objPowerControl.DiscountedByGeas = true;

                objPowerControl.Top = i * objPowerControl.Height;
                panPowers.Controls.Add(objPowerControl);
            }

            // Populate Magician Spirits.
            i = -1;
            foreach (Spirit objSpirit in _objCharacter.Spirits)
            {
                if (objSpirit.EntityType == SpiritType.Spirit)
                {
                    i++;
                    SpiritControl objSpiritControl = new SpiritControl();
                    objSpiritControl.SpiritObject = objSpirit;

                    // Attach an EventHandler for the ServicesOwedChanged Event.
                    objSpiritControl.ServicesOwedChanged += objSpirit_ServicesOwedChanged;
                    objSpiritControl.ForceChanged += objSpirit_ForceChanged;
                    objSpiritControl.BoundChanged += objSpirit_BoundChanged;
                    objSpiritControl.DeleteSpirit += objSpirit_DeleteSpirit;
                    objSpiritControl.FileNameChanged += objSpirit_FileNameChanged;

                    objSpiritControl.SpiritName = objSpirit.Name;
                    objSpiritControl.ServicesOwed = objSpirit.ServicesOwed;
                    if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
                    {
                        if (_objOptions.SpiritForceBasedOnTotalMAG)
                            objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
                        else
                            objSpiritControl.ForceMaximum = _objCharacter.MAGMagician;
                    }
                    else
                        objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
                    objSpiritControl.CritterName = objSpirit.CritterName;
                    objSpiritControl.Force = objSpirit.Force;
                    objSpiritControl.Bound = objSpirit.Bound;
                    objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);

                    objSpiritControl.Top = i * objSpiritControl.Height;
                    panSpirits.Controls.Add(objSpiritControl);
                }
            }

            // Populate Technomancer Sprites.
            i = -1;
开发者ID:cormanater,项目名称:chummer5a,代码行数:67,代码来源:frmCreate.cs

示例4: AddPACKSKit


//.........这里部分代码省略.........
                                break;
                            case "Illusion":
                                treSpells.Nodes[3].Nodes.Add(objNode);
                                treSpells.Nodes[3].Expand();
                                break;
                            case "Manipulation":
                                treSpells.Nodes[4].Nodes.Add(objNode);
                                treSpells.Nodes[4].Expand();
                                break;
                            case "Rituals":
                                int intNode = 5;
                                if (_objCharacter.AdeptEnabled && !_objCharacter.MagicianEnabled)
                                    intNode = 0;
                                treSpells.Nodes[intNode].Nodes.Add(objNode);
                                treSpells.Nodes[intNode].Expand();
                                break;
                        }

                        treSpells.SortCustom();
                    }
                }
            }

            // Update Spirits.
            if (objXmlKit["spirits"] != null)
            {
                foreach (XmlNode objXmlSpirit in objXmlKit.SelectNodes("spirits/spirit"))
                {
                    int i = panSpirits.Controls.Count;

                    Spirit objSpirit = new Spirit(_objCharacter);
                    _objCharacter.Spirits.Add(objSpirit);

                    SpiritControl objSpiritControl = new SpiritControl();
                    objSpiritControl.SpiritObject = objSpirit;
                    objSpiritControl.EntityType = SpiritType.Spirit;

                    // Attach an EventHandler for the ServicesOwedChanged Event.
                    objSpiritControl.ServicesOwedChanged += objSpirit_ServicesOwedChanged;
                    objSpiritControl.ForceChanged += objSpirit_ForceChanged;
                    objSpiritControl.BoundChanged += objSpirit_BoundChanged;
                    objSpiritControl.DeleteSpirit += objSpirit_DeleteSpirit;

                    objSpiritControl.Name = objXmlSpirit["name"].InnerText;
                    objSpiritControl.Force = Convert.ToInt32(objXmlSpirit["force"].InnerText);
                    objSpiritControl.ServicesOwed = Convert.ToInt32(objXmlSpirit["services"].InnerText);

                    objSpiritControl.Top = i * objSpiritControl.Height;
                    panSpirits.Controls.Add(objSpiritControl);
                }
            }

            // Update Lifestyles.
            if (objXmlKit["lifestyles"] != null)
            {
                XmlDocument objXmlLifestyleDocument = XmlManager.Instance.Load("lifestyles.xml");

                foreach (XmlNode objXmlLifestyle in objXmlKit.SelectNodes("lifestyles/lifestyle"))
                {
                    string strName = objXmlLifestyle["name"].InnerText;
                    int intMonths = Convert.ToInt32(objXmlLifestyle["months"].InnerText);

                    // Create the Lifestyle.
                    TreeNode objNode = new TreeNode();
                    Lifestyle objLifestyle = new Lifestyle(_objCharacter);
开发者ID:cormanater,项目名称:chummer5a,代码行数:66,代码来源:frmCreate.cs

示例5: frmCreate_Load


//.........这里部分代码省略.........

            // Populate Adept Powers.
            i = -1;
            foreach (Power objPower in _objCharacter.Powers)
            {
                i++;
                PowerControl objPowerControl = new PowerControl();
                objPowerControl.PowerObject = objPower;

                // Attach an EventHandler for the PowerRatingChanged Event.
                objPowerControl.PowerRatingChanged += objPower_PowerRatingChanged;
                objPowerControl.DeletePower += objPower_DeletePower;

                objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
                if (objPower.Rating < 1)
                    objPower.Rating = 1;
                objPowerControl.PowerLevel = Convert.ToInt32(objPower.Rating);
                if (objPower.DiscountedAdeptWay)
                    objPowerControl.DiscountedByAdeptWay = true;
                if (objPower.DiscountedGeas)
                    objPowerControl.DiscountedByGeas = true;

                objPowerControl.Top = i * objPowerControl.Height;
                panPowers.Controls.Add(objPowerControl);
            }

            // Populate Magician Spirits.
            i = -1;
            foreach (Spirit objSpirit in _objCharacter.Spirits)
            {
                if (objSpirit.EntityType == SpiritType.Spirit)
                {
                    i++;
                    SpiritControl objSpiritControl = new SpiritControl();
                    objSpiritControl.SpiritObject = objSpirit;

                    // Attach an EventHandler for the ServicesOwedChanged Event.
                    objSpiritControl.ServicesOwedChanged += objSpirit_ServicesOwedChanged;
                    objSpiritControl.ForceChanged += objSpirit_ForceChanged;
                    objSpiritControl.BoundChanged += objSpirit_BoundChanged;
                    objSpiritControl.DeleteSpirit += objSpirit_DeleteSpirit;
                    objSpiritControl.FileNameChanged += objSpirit_FileNameChanged;

                    objSpiritControl.SpiritName = objSpirit.Name;
                    objSpiritControl.ServicesOwed = objSpirit.ServicesOwed;
                    if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
                        objSpiritControl.ForceMaximum = _objCharacter.MAGMagician;
                    else
                        objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
                    objSpiritControl.CritterName = objSpirit.CritterName;
                    objSpiritControl.Force = objSpirit.Force;
                    objSpiritControl.Bound = objSpirit.Bound;
                    objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);

                    objSpiritControl.Top = i * objSpiritControl.Height;
                    panSpirits.Controls.Add(objSpiritControl);
                }
            }

            // Populate Technomancer Sprites.
            i = -1;
            foreach (Spirit objSpirit in _objCharacter.Spirits)
            {
                if (objSpirit.EntityType == SpiritType.Sprite)
                {
                    i++;
开发者ID:janhelke,项目名称:chummer2,代码行数:67,代码来源:frmCreate.cs

示例6: cmdAddSprite_Click

        private void cmdAddSprite_Click(object sender, EventArgs e)
        {
            int i = panSprites.Controls.Count;

            Spirit objSprite = new Spirit(_objCharacter);
            _objCharacter.Spirits.Add(objSprite);

            SpiritControl objSpriteControl = new SpiritControl(true);
            objSpriteControl.SpiritObject = objSprite;
            objSpriteControl.EntityType = SpiritType.Sprite;

            // Attach an EventHandler for the ServicesOwedChanged Event.
            objSpriteControl.ServicesOwedChanged += objSprite_ServicesOwedChanged;
            objSpriteControl.ForceChanged += objSprite_ForceChanged;
            objSpriteControl.BoundChanged += objSprite_BoundChanged;
            objSpriteControl.DeleteSpirit += objSprite_DeleteSpirit;
            objSpriteControl.FileNameChanged += objSprite_FileNameChanged;

            objSpriteControl.ForceMaximum = _objCharacter.RES.TotalValue * 2;
            objSpriteControl.Force = Convert.ToInt32(_objCharacter.RES.Value);
            objSpriteControl.RebuildSpiritList(_objCharacter.TechnomancerStream);

            objSpriteControl.Top = i * objSpriteControl.Height;
            panSprites.Controls.Add(objSpriteControl);

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:28,代码来源:frmCareer.cs

示例7: cmdAddSpirit_Click

        private void cmdAddSpirit_Click(object sender, EventArgs e)
        {
            int i = panSpirits.Controls.Count;

            Spirit objSpirit = new Spirit(_objCharacter);
            _objCharacter.Spirits.Add(objSpirit);

            SpiritControl objSpiritControl = new SpiritControl(true);
            objSpiritControl.SpiritObject = objSpirit;
            objSpiritControl.EntityType = SpiritType.Spirit;

            // Attach an EventHandler for the ServicesOwedChanged Event.
            objSpiritControl.ServicesOwedChanged += objSpirit_ServicesOwedChanged;
            objSpiritControl.ForceChanged += objSpirit_ForceChanged;
            objSpiritControl.BoundChanged += objSpirit_BoundChanged;
            objSpiritControl.DeleteSpirit += objSpirit_DeleteSpirit;
            objSpiritControl.FileNameChanged += objSpirit_FileNameChanged;

            int intMAG = Convert.ToInt32(_objCharacter.MAG.TotalValue);
            if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
            {
                intMAG = _objCharacter.MAGMagician;
            }
            if (_objOptions.SpiritForceBasedOnTotalMAG)
            {
                objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue * 2;
                objSpiritControl.Force = _objCharacter.MAG.TotalValue;
            }
            else
            {
                if (intMAG == 0)
                    intMAG = 1;
                objSpiritControl.ForceMaximum = intMAG * 2;
                objSpiritControl.Force = intMAG;
            }
            objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);

            objSpiritControl.Top = i * objSpiritControl.Height;
            panSpirits.Controls.Add(objSpiritControl);

            _blnIsDirty = true;
            UpdateWindowTitle();
        }
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:43,代码来源:frmCareer.cs

示例8: frmCareer_Load


//.........这里部分代码省略.........
                objPowerControl.PowerObject = objPower;

                // Attach an EventHandler for the PowerRatingChanged Event.
                objPowerControl.PowerRatingChanged += objPower_PowerRatingChanged;
                objPowerControl.DeletePower += objPower_DeletePower;

                objPowerControl.PowerName = objPower.Name;
                objPowerControl.Extra = objPower.Extra;
                objPowerControl.PointsPerLevel = objPower.PointsPerLevel;
                objPowerControl.AdeptWayDiscount = objPower.AdeptWayDiscount;
                objPowerControl.LevelEnabled = objPower.LevelsEnabled;
                if (objPower.MaxLevels > 0)
                    objPowerControl.MaxLevels = objPower.MaxLevels;
                objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
                if (objPower.Rating < 1)
                    objPower.Rating = 1;
                objPowerControl.PowerLevel = Convert.ToInt32(objPower.Rating);
                if (objPower.DiscountedAdeptWay)
                    objPowerControl.DiscountedByAdeptWay = true;
                if (objPower.DiscountedGeas)
                    objPowerControl.DiscountedByGeas = true;

                objPowerControl.Top = i * objPowerControl.Height;
                panPowers.Controls.Add(objPowerControl);
            }

            // Populate Magician Spirits.
            i = -1;
            foreach (Spirit objSpirit in _objCharacter.Spirits)
            {
                if (objSpirit.EntityType == SpiritType.Spirit)
                {
                    i++;
                    SpiritControl objSpiritControl = new SpiritControl(true);
                    objSpiritControl.SpiritObject = objSpirit;

                    // Attach an EventHandler for the ServicesOwedChanged Event.
                    objSpiritControl.ServicesOwedChanged += objSpirit_ServicesOwedChanged;
                    objSpiritControl.ForceChanged += objSpirit_ForceChanged;
                    objSpiritControl.BoundChanged += objSpirit_BoundChanged;
                    objSpiritControl.DeleteSpirit += objSpirit_DeleteSpirit;
                    objSpiritControl.FileNameChanged += objSpirit_FileNameChanged;

                    objSpiritControl.SpiritName = objSpirit.Name;
                    objSpiritControl.ServicesOwed = objSpirit.ServicesOwed;
                    if (_objOptions.SpiritForceBasedOnTotalMAG)
                        objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue * 2;
                    else
                        objSpiritControl.ForceMaximum = intCharacterMAG * 2;
                    objSpiritControl.CritterName = objSpirit.CritterName;
                    objSpiritControl.Force = objSpirit.Force;
                    objSpiritControl.Bound = objSpirit.Bound;
                    objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);

                    objSpiritControl.Top = i * objSpiritControl.Height;
                    panSpirits.Controls.Add(objSpiritControl);
                }
            }

            // Populate Technomancer Sprites.
            i = -1;
            foreach (Spirit objSpirit in _objCharacter.Spirits)
            {
                if (objSpirit.EntityType == SpiritType.Sprite)
                {
                    i++;
开发者ID:Althalusdlg,项目名称:chummer5a,代码行数:67,代码来源:frmCareer.cs

示例9: frmCreate_Load


//.........这里部分代码省略.........
                            }
                            objPower.MaxLevels = intImprovedAbilityMaximum;
                        }
                        else
                        {
                            objPowerControl.MaxLevels = objPower.MaxLevels;
                        }
                    }
                    else
                    {
                        objPowerControl.MaxLevels = objPower.MaxLevels;
                    }
                }
                objPowerControl.RefreshMaximum(_objCharacter.MAG.TotalValue);
                if (objPower.Rating < 1)
                    objPower.Rating = 1;
                objPowerControl.PowerLevel = Convert.ToInt32(objPower.Rating);
                if (objPower.DiscountedAdeptWay)
                    objPowerControl.DiscountedByAdeptWay = true;
                if (objPower.DiscountedGeas)
                    objPowerControl.DiscountedByGeas = true;

                objPowerControl.Top = i * objPowerControl.Height;
                panPowers.Controls.Add(objPowerControl);
            }

            // Populate Magician Spirits.
            i = -1;
            foreach (Spirit objSpirit in _objCharacter.Spirits)
            {
                if (objSpirit.EntityType == SpiritType.Spirit)
                {
                    i++;
                    SpiritControl objSpiritControl = new SpiritControl();
                    objSpiritControl.SpiritObject = objSpirit;

                    // Attach an EventHandler for the ServicesOwedChanged Event.
                    objSpiritControl.ServicesOwedChanged += objSpirit_ServicesOwedChanged;
                    objSpiritControl.ForceChanged += objSpirit_ForceChanged;
                    objSpiritControl.BoundChanged += objSpirit_BoundChanged;
                    objSpiritControl.DeleteSpirit += objSpirit_DeleteSpirit;
                    objSpiritControl.FileNameChanged += objSpirit_FileNameChanged;

                    objSpiritControl.SpiritName = objSpirit.Name;
                    objSpiritControl.ServicesOwed = objSpirit.ServicesOwed;
                    if (_objCharacter.AdeptEnabled && _objCharacter.MagicianEnabled)
                    {
                        if (_objOptions.SpiritForceBasedOnTotalMAG)
                            objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
                        else
                            objSpiritControl.ForceMaximum = _objCharacter.MAGMagician;
                    }
                    else
                        objSpiritControl.ForceMaximum = _objCharacter.MAG.TotalValue;
                    objSpiritControl.CritterName = objSpirit.CritterName;
                    objSpiritControl.Force = objSpirit.Force;
                    objSpiritControl.Bound = objSpirit.Bound;
                    objSpiritControl.RebuildSpiritList(_objCharacter.MagicTradition);

                    objSpiritControl.Top = i * objSpiritControl.Height;
                    panSpirits.Controls.Add(objSpiritControl);
                }
            }

            // Populate Technomancer Sprites.
            i = -1;
开发者ID:argo2445,项目名称:chummer5a,代码行数:67,代码来源:frmCreate.cs


注:本文中的Chummer.SpiritControl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。