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


C# CraftItem.IsMarkable方法代码示例

本文整理汇总了C#中Server.Engines.Craft.CraftItem.IsMarkable方法的典型用法代码示例。如果您正苦于以下问题:C# CraftItem.IsMarkable方法的具体用法?C# CraftItem.IsMarkable怎么用?C# CraftItem.IsMarkable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Engines.Craft.CraftItem的用法示例。


在下文中一共展示了CraftItem.IsMarkable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CraftGumpItem

        public CraftGumpItem( Mobile from, CraftSystem craftSystem, CraftItem craftItem, BaseTool tool )
            : base(50, 50)
        {
            m_From = from;
            m_CraftSystem = craftSystem;
            m_CraftItem = craftItem;
            m_Tool = tool;

            from.CloseGump( typeof( CraftGump ) );
            from.CloseGump( typeof( CraftGumpItem ) );

            AddPage( 0 );
            AddBackground( 0, 0, 530, 417, 5054 );
            AddImageTiled( 10, 10, 510, 22, 2624 );
            AddImageTiled( 10, 37, 150, 148, 2624 );
            AddImageTiled( 165, 37, 355, 90, 2624 );
            AddImageTiled( 10, 190, 155, 22, 2624 );
            AddImageTiled( 10, 237, 155, 53, 2624 );
            AddImageTiled( 165, 132, 355, 80, 2624 );
            AddImageTiled( 10, 275, 155, 22, 2624 );
            AddImageTiled( 10, 322, 155, 53, 2624 );
            AddImageTiled( 165, 217, 355, 80, 2624 );
            AddImageTiled( 10, 360, 155, 22, 2624 );
            AddImageTiled( 165, 302, 355, 80, 2624 );
            AddImageTiled( 10, 387, 510, 22, 2624 );
            AddAlphaRegion( 10, 10, 510, 397 );

            AddHtmlLocalized( 170, 40, 150, 20, 1044053, LabelColor, false, false ); // ITEM
            AddHtmlLocalized( 10, 215, 150, 22, 1044055, LabelColor, false, false ); // <CENTER>MATERIALS</CENTER>
            AddHtmlLocalized( 10, 300, 150, 22, 1044056, LabelColor, false, false ); // <CENTER>OTHER</CENTER>

            if ( craftSystem.GumpTitleNumber > 0 )
                AddHtmlLocalized( 10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false );
            else
                AddHtml( 10, 12, 510, 20, craftSystem.GumpTitleString, false, false );

            AddButton( 15, 387, 4014, 4016, 9999, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 50, 390, 150, 18, 1044150, LabelColor, false, false ); // BACK

            // Draw Item
            Type type = m_CraftItem.ItemType;

            if ( m_CraftItem.IsMarkable( type ) )
            {
                AddHtmlLocalized( 170, 302 + ( m_OtherCount++ * 20 ), 310, 18, 1044059, LabelColor, false, false ); // This item may hold its maker's mark
                m_ShowExceptionalChance = true;
            }

            if ( craftItem.NameNumber > 0 )
                AddHtmlLocalized( 330, 40, 180, 18, craftItem.NameNumber, LabelColor, false, false );
            else
                AddLabel( 330, 40, LabelHue, craftItem.NameString );

            AddItem( 20, 50, CraftItem.ItemIDOf( type ) );
            // ***********************************

            // Draw Skills
            for ( int i = 0; i < m_CraftItem.Skills.Count; i++ )
            {
                CraftSkill skill = m_CraftItem.Skills.GetAt( i );
                double minSkill = skill.MinSkill;

                if ( minSkill < 0 )
                    minSkill = 0;

                AddHtmlLocalized( 170, 132 + ( i * 20 ), 200, 18, 1044060 + (int) skill.SkillToMake, LabelColor, false, false );
                AddLabel( 430, 132 + ( i * 20 ), LabelHue, String.Format( "{0:F1}", minSkill ).Replace( ",", "." ) );
            }
            // ***********************************

            // Draw Ressource
            bool retainedColor = false;

            CraftContext context = m_CraftSystem.GetContext( m_From );

            CraftSubResCol res = ( m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
            int resIndex = -1;

            if ( context != null )
                resIndex = ( m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex );

            bool cropScroll = ( m_CraftItem.Ressources.Count > 1 ) && m_CraftItem.Ressources.GetAt( m_CraftItem.Ressources.Count - 1 ).ItemType == typeofBlankScroll && typeofSpellScroll.IsAssignableFrom( m_CraftItem.ItemType );

            for ( int i = 0; i < m_CraftItem.Ressources.Count - ( cropScroll ? 1 : 0 ) && i < 4; i++ )
            {
                Type _type;
                string nameString;
                int nameNumber;

                CraftRes craftResource = m_CraftItem.Ressources.GetAt( i );

                _type = craftResource.ItemType;
                nameString = craftResource.NameString;
                nameNumber = craftResource.NameNumber;
                int amount = craftResource.Amount;

                // Resource Mutation
                if ( _type == res.ResType && resIndex > -1 )
                {
                    CraftSubRes subResource = res.GetAt( resIndex );
//.........这里部分代码省略.........
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:101,代码来源:CraftGumpItem.cs


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