Пример #1
0
        public int CreateGroupList()
        {
            CraftGroupCol craftGroupCol = m_CraftSystem.CraftGroups;

            CraftContext context = m_CraftSystem.GetContext(m_From);

            AddButton(15, 60, 4005, 4007, GetButtonID(6, 3), GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 63, 150, 18, 1044014, LabelColor, false, false);               // LAST TEN

            for (int a = 0; a < craftGroupCol.Count; a++)
            {
                CraftGroup craftGroup = craftGroupCol.GetAt(a);

                bool skillGainPossible = false;
                bool allRequiredSkills = true;

                if (context != null)
                {
                    CraftItemCol craftItemCol = craftGroup.CraftItems;
                    Type         resourceType = m_CraftSystem.CraftSubRes.ResType;

                    for (int b = 0; b < craftItemCol.Count; ++b)
                    {
                        CraftItem craftItem = craftItemCol.GetAt(b);

                        if (craftItem.SkillGainPossible(m_From, resourceType, m_CraftSystem, false, ref allRequiredSkills))
                        {
                            skillGainPossible = true;
                        }
                    }

                    if (!context.HighlightSkillGainItems)
                    {
                        skillGainPossible = false;
                    }
                }

                int textHue = LabelHue;

                if (skillGainPossible)
                {
                    textHue = skillGainPossibleHue;
                }

                AddButton(15, 80 + (a * 20), 4005, 4007, GetButtonID(0, a), GumpButtonType.Reply, 0);
                AddLabel(50, 80 + (a * 20), textHue, craftGroup.NameString);
            }

            return(craftGroupCol.Count);
        }
Пример #2
0
        public void CreateItemList(int selectedGroup)
        {
            if (selectedGroup == 501) // 501 : Last 10
            {
                CreateMakeLastList();
                return;
            }

            CraftGroupCol craftGroupCol = m_CraftSystem.CraftGroups;
            CraftGroup    craftGroup    = craftGroupCol.GetAt(selectedGroup);
            CraftItemCol  craftItemCol  = craftGroup.CraftItems;

            CraftContext context = m_CraftSystem.GetContext(m_From);

            for (int i = 0; i < craftItemCol.Count; ++i)
            {
                int index = i % 10;

                CraftItem craftItem = craftItemCol.GetAt(i);

                if (index == 0)
                {
                    if (i > 0)
                    {
                        AddButton(395, 265, 4005, 4007, 0, GumpButtonType.Page, (i / 10) + 1);
                        AddHtmlLocalized(430, 268, 100, 18, 1044045, LabelColor, false, false); // NEXT PAGE
                    }

                    AddPage((i / 10) + 1);

                    if (i > 0)
                    {
                        AddButton(245, 265, 4014, 4015, 0, GumpButtonType.Page, i / 10);
                        AddHtmlLocalized(280, 268, 100, 18, 1044044, LabelColor, false, false); // PREV PAGE
                    }
                }

                AddButton(220, 60 + (index * 20), 4005, 4007, GetButtonID(1, i), GumpButtonType.Reply, 0);

                bool skillGainPossible = false;
                bool allRequiredSkills = true;

                if (context != null)
                {
                    Type resourceType = m_CraftSystem.CraftSubRes.ResType;

                    skillGainPossible = craftItem.SkillGainPossible(m_From, resourceType, m_CraftSystem, false, ref allRequiredSkills);

                    if (!context.HighlightSkillGainItems)
                    {
                        skillGainPossible = false;
                    }
                }

                string nameText = "";

                nameText += craftItem.NameString;

                if (craftItem.Count > 1)
                {
                    nameText += " (" + craftItem.Count.ToString() + ")";
                }

                if (skillGainPossible)
                {
                    AddLabel(255, 60 + (index * 20), skillGainPossibleHue, nameText);
                }

                else
                {
                    AddLabel(255, 60 + (index * 20), LabelHue, nameText);
                }

                AddButton(480, 60 + (index * 20), 4011, 4012, GetButtonID(2, i), GumpButtonType.Reply, 0);
            }
        }
Пример #3
0
        public void CreateMakeLastList()
        {
            CraftContext context = m_CraftSystem.GetContext(m_From);

            if (context == null)
            {
                return;
            }

            List <CraftItem> items = context.Items;

            if (items.Count > 0)
            {
                for (int i = 0; i < items.Count; ++i)
                {
                    int index = i % 10;

                    CraftItem craftItem = items[i];

                    if (index == 0)
                    {
                        if (i > 0)
                        {
                            AddButton(395, 265, 4005, 4007, 0, GumpButtonType.Page, (i / 10) + 1);
                            AddHtmlLocalized(430, 268, 100, 18, 1044045, LabelColor, false, false);                               // NEXT PAGE
                        }

                        AddPage((i / 10) + 1);

                        if (i > 0)
                        {
                            AddButton(245, 265, 4014, 4015, 0, GumpButtonType.Page, i / 10);
                            AddHtmlLocalized(280, 268, 100, 18, 1044044, LabelColor, false, false);                               // PREV PAGE
                        }
                    }

                    AddButton(220, 60 + (index * 20), 4005, 4007, GetButtonID(3, i), GumpButtonType.Reply, 0);


                    bool skillGainPossible = false;
                    bool allRequiredSkills = true;

                    if (context != null)
                    {
                        Type resourceType = m_CraftSystem.CraftSubRes.ResType;

                        skillGainPossible = craftItem.SkillGainPossible(m_From, resourceType, m_CraftSystem, false, ref allRequiredSkills);

                        if (!context.HighlightSkillGainItems)
                        {
                            skillGainPossible = false;
                        }
                    }

                    int textHue = LabelHue;

                    if (skillGainPossible)
                    {
                        textHue = skillGainPossibleHue;
                    }

                    string nameText = "";

                    nameText += craftItem.NameString;

                    if (craftItem.Count > 1)
                    {
                        nameText += " (" + craftItem.Count.ToString() + ") ";
                    }

                    AddLabel(255, 60 + (index * 20), textHue, nameText);
                    AddButton(480, 60 + (index * 20), 4011, 4012, GetButtonID(4, i), GumpButtonType.Reply, 0);
                }
            }

            else
            {
                AddHtmlLocalized(230, 62, 200, 22, 1044165, LabelColor, false, false);                   // You haven't made anything yet.
            }
        }