RetainsColor() публичный статический Метод

public static RetainsColor ( Type type ) : bool
type System.Type
Результат bool
Пример #1
0
        public void DrawItem()
        {
            Type type = m_CraftItem.ItemType;

            int itemID      = CraftItem.ItemIDOf(type);
            int originalHue = 0;

            Item itemCopy = null;

            try { itemCopy = Activator.CreateInstance(type) as Item; }
            catch { }

            if (itemCopy != null)
            {
                originalHue = itemCopy.Hue;
                itemCopy.Delete();
            }

            int itemHue = originalHue;

            if (CraftItem.RetainsColor(type))
            {
                CraftContext context = m_CraftSystem.GetContext(m_From);

                if (context != null)
                {
                    CraftSubResCol craftSubRes = (m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);

                    int resIndex = -1;

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

                    if (resIndex == -1)
                    {
                        resIndex = 0;
                    }

                    CraftSubRes resource = craftSubRes.GetAt(resIndex);

                    //Apply Different Material Color
                    if (resIndex > 0)
                    {
                        itemHue = CraftItem.BaseHueOf(resource.ItemType);
                    }
                }
            }

            AddItem(20, 50, itemID, itemHue);

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