public RewardConfirmGump(Mobile from, RewardEntry entry) : base(0, 0)
        {
            m_From  = from;
            m_Entry = entry;

            from.CloseGump(typeof(RewardConfirmGump));

            AddPage(0);

            AddBackground(10, 10, 500, 300, 2600);

            AddHtmlLocalized(30, 55, 300, 35, 1006000, false, false); // You have selected:

            if (entry.NameString != null)
            {
                AddHtml(335, 55, 150, 35, entry.NameString, false, false);
            }
            else
            {
                AddHtmlLocalized(335, 55, 150, 35, entry.Name, false, false);
            }

            AddHtmlLocalized(30, 95, 300, 35, 1006001, false, false); // This will be assigned to this character:
            AddLabel(335, 95, 0, from.Name);

            AddHtmlLocalized(35, 160, 450, 90, 1006002, true, true); // Are you sure you wish to select this reward for this character?  You will not be able to transfer this reward to another character on another shard.  Click 'ok' below to confirm your selection or 'cancel' to go back to the selection screen.

            AddButton(60, 265, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(95, 266, 150, 35, 1006044, false, false); // Ok

            AddButton(295, 265, 4017, 4019, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(330, 266, 150, 35, 1006045, false, false); // Cancel
        }
예제 #2
0
        public static bool HasAccess(Mobile mob, RewardEntry entry)
        {
            if (Core.Expansion < entry.RequiredExpansion)
            {
                return(false);
            }

            TimeSpan ts;

            return(HasAccess(mob, entry.List, out ts));
        }
예제 #3
0
        private void RenderCategory(RewardCategory category, int index, ref int page)
        {
            AddPage(page);

            List <RewardEntry> entries = category.Entries;

            int i = 0;

            for (int j = 0; j < entries.Count; ++j)
            {
                RewardEntry entry = entries[j];

                if (!RewardSystem.HasAccess(m_From, entry))
                {
                    continue;
                }

                if (i == 24)
                {
                    AddButton(305, 415, 0xFA5, 0xFA7, 0, GumpButtonType.Page, ++page);
                    AddHtmlLocalized(340, 415, 200, 20, 1011066, false, false); // Next page

                    AddPage(page);

                    AddButton(270, 415, 0xFAE, 0xFB0, 0, GumpButtonType.Page, page - 1);
                    AddHtmlLocalized(185, 415, 200, 20, 1011067, false, false); // Previous page

                    i = 0;
                }

                AddButton(55 + ((i / 12) * 250), 80 + ((i % 12) * 25), 5540, 5541, GetButtonID(index, j), GumpButtonType.Reply, 0);

                if (entry.NameString != null)
                {
                    AddHtml(80 + ((i / 12) * 250), 80 + ((i % 12) * 25), 250, 20, entry.NameString, false, false);
                }
                else
                {
                    AddHtmlLocalized(80 + ((i / 12) * 250), 80 + ((i % 12) * 25), 250, 20, entry.Name, false, false);
                }
                ++i;
            }

            page += 1;
        }
예제 #4
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int buttonID = info.ButtonID - 1;

            if (buttonID == 0)
            {
                int cur, max;

                RewardSystem.ComputeRewardInfo(m_From, out cur, out max);

                if (cur < max)
                {
                    m_From.SendGump(new RewardNoticeGump(m_From));
                }
            }
            else
            {
                --buttonID;

                int type  = (buttonID % 20);
                int index = (buttonID / 20);

                RewardCategory[] categories = RewardSystem.Categories;

                if (type >= 0 && type < categories.Length)
                {
                    RewardCategory category = categories[type];

                    if (index >= 0 && index < category.Entries.Count)
                    {
                        RewardEntry entry = category.Entries[index];

                        if (!RewardSystem.HasAccess(m_From, entry))
                        {
                            return;
                        }

                        m_From.SendGump(new RewardConfirmGump(m_From, entry));
                    }
                }
            }
        }