Server.Mobiles.ChangeHairstyleGump.ChangeHairstyleGump C# (CSharp) Méthode

ChangeHairstyleGump() public méthode

public ChangeHairstyleGump ( Mobile from, Mobile vendor, int price, bool facialHair, ChangeHairstyleEntry entries ) : System
from Mobile
vendor Mobile
price int
facialHair bool
entries ChangeHairstyleEntry
Résultat System
        public ChangeHairstyleGump( Mobile from, Mobile vendor, int price, bool facialHair, ChangeHairstyleEntry[] entries )
            : base(50, 50)
        {
            m_From = from;
            m_Vendor = vendor;
            m_Price = price;
            m_FacialHair = facialHair;
            m_Entries = entries;

            from.CloseGump( typeof( HairstylistBuyGump ) );
            from.CloseGump( typeof( ChangeHairHueGump ) );
            from.CloseGump( typeof( ChangeHairstyleGump ) );

            int tableWidth = ( m_FacialHair ? 2 : 3 );
            int tableHeight = ( (entries.Length + tableWidth - ( m_FacialHair ? 1 : 2 )) / tableWidth );
            int offsetWidth = 123;
            int offsetHeight = ( m_FacialHair ? 70 : 65 );

            AddPage( 0 );

            AddBackground( 0, 0, 81 + (tableWidth * offsetWidth), 105 + (tableHeight * offsetHeight), 2600 );

            AddButton( 45, 45 + (tableHeight * offsetHeight), 4005, 4007, 1, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 77, 45 + (tableHeight * offsetHeight), 90, 35, 1006044, false, false ); // Ok

            AddButton( 81 + (tableWidth * offsetWidth) - 180, 45 + (tableHeight * offsetHeight), 4005, 4007, 0, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 81 + (tableWidth * offsetWidth) - 148, 45 + (tableHeight * offsetHeight), 90, 35, 1006045, false, false ); // Cancel

            if ( !facialHair )
                AddHtmlLocalized( 50, 15, 350, 20, 1018353, false, false ); // <center>New Hairstyle</center>
            else
                AddHtmlLocalized( 55, 15, 200, 20, 1018354, false, false ); // <center>New Beard</center>

            for ( int i = 0; i < entries.Length; ++i )
            {
                int xTable = i % tableWidth;
                int yTable = i / tableWidth;

                if ( entries[i].GumpID != 0 )
                {
                    AddRadio( 40 + (xTable * offsetWidth), 70 + (yTable * offsetHeight), 208, 209, false, i );
                    AddBackground( 87 + (xTable * offsetWidth), 50 + (yTable * offsetHeight), 50, 50, 2620 );
                    AddImage( 87 + (xTable * offsetWidth) + entries[i].X, 50 + (yTable * offsetHeight) + entries[i].Y, entries[i].GumpID );
                }
                else if ( !facialHair )
                {
                    AddRadio( 40 + ((xTable + 1) * offsetWidth), 240, 208, 209, false, i );
                    AddHtmlLocalized( 60 + ((xTable + 1) * offsetWidth), 240, 85, 35, 1011064, false, false ); // Bald
                }
                else
                {
                    AddRadio( 40 + (xTable * offsetWidth), 70 + (yTable * offsetHeight), 208, 209, false, i );
                    AddHtmlLocalized( 60 + (xTable * offsetWidth), 70 + (yTable * offsetHeight), 85, 35, 1011064, false, false ); // Bald
                }
            }
        }