Пример #1
0
		public RewardList( int index, RewardEntry[] entries )
		{
			m_Entries = entries;

			for ( int i = 0; i < entries.Length; ++i )
				entries[i].List = this;
		}
Пример #2
0
        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
        }
Пример #3
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int buttonID = info.ButtonID - 1;

            if (buttonID == 0)
            {
                m_From.CloseGump(typeof(RewardChoiceGump));
            }
            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 = (RewardEntry)category.Entries[index];

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

                        m_From.SendGump(new RewardConfirmGump(m_From, entry));
                    }
                }
            }
        }
Пример #4
0
		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
		}
Пример #5
0
        public void DrawItem(RewardEntry entry, int x, int y)
        {
            if (entry != null)
            {
                Item item = Activator.CreateInstance(entry.ItemType, entry.Args) as Item;

                AddItem(x, y, item.ItemID);
                item.Delete();
            }
        }
Пример #6
0
		public void DrawItem( RewardEntry entry, int x, int y )
		{
			if ( entry != null )
			{
				Item item = Activator.CreateInstance( entry.ItemType, entry.Args ) as Item;

				AddItem( x, y, item.ItemID );
				item.Delete();
			}
		}
Пример #7
0
        private void RenderCategory(RewardCategory category, int index)
        {
            AddPage(1);

            ArrayList entries = category.Entries;

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

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

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

                DrawItem(entry, 250 + ((i / 4) * 250), 50 + ((i % 4) * 50));
            }
        }