當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。