CraftItem() public method

public CraftItem ( CraftItem item ) : void
item CraftItem
return void
Beispiel #1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int typeId = info.ButtonID / 1000;
            int index  = info.ButtonID % 1000;

            CraftContext context = m_CraftSystem.GetContext(m_From);

            if (context == null)
            {
                return;
            }

            if (info.ButtonID == 9999)               // Back Button
            {
                CraftGump craftGump = new CraftGump(m_From, m_CraftSystem, m_Tool, null);
                m_From.SendGump(craftGump);
            }
            else if (typeId == 10)               // Make Number
            {
                m_From.Prompt = new MakeAmountPrompt(m_CraftSystem, m_CraftItem, m_Tool);
            }
            else
            {
                if (typeId == 11)                   // Make Max
                {
                    context.Total = 9999;
                }

                if (info.ButtonID != 0)                   // Make Button
                {
                    CraftGump.CraftItem(m_CraftItem, m_CraftSystem, m_From, m_Tool);
                }
            }
        }
Beispiel #2
0
        public override void OnResponse(Mobile from, string text)
        {
            int          amount  = Utility.ToInt32(text);
            CraftContext context = m_CraftSystem.GetContext(from);

            if (amount < 1 || amount > 100)
            {
                from.SendLocalizedMessage(1112587);                  // Invalid entry.
                from.SendLocalizedMessage(501806);                   // Request cancelled.

                context.Total = 1;

                from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, null));
            }
            else
            {
                context.Total = amount;

                context.Making = m_CraftItem;
                CraftGump.CraftItem(m_CraftItem, m_CraftSystem, from, m_Tool);
            }
        }