Inheritance: Packet, IGumpWriter
Ejemplo n.º 1
0
		private Packet Compile( NetState ns )
		{
			IGumpWriter disp;

			if ( ns != null && ns.Version != null && ns.Version >= UnpackVersion )
				disp = new DisplayGumpPacked( this );
            // genova: suporte ao KR
            #region Suporte ao KR
            else if ( ns != null && ns.IsKRClient )
                disp = new DisplayGumpPacked(this);
            #endregion
            else
				disp = new DisplayGumpFast( this );

			if ( !m_Dragable )
				disp.AppendLayout( m_NoMove );

			if ( !m_Closable )
				disp.AppendLayout( m_NoClose );

			if ( !m_Disposable )
				disp.AppendLayout( m_NoDispose );

			if ( !m_Resizable )
				disp.AppendLayout( m_NoResize );

			int count = m_Entries.Count;
			GumpEntry e;

			for ( int i = 0; i < count; ++i )
			{
				e = m_Entries[i];

				disp.AppendLayout( m_BeginLayout );
				e.AppendTo( disp );
				disp.AppendLayout( m_EndLayout );
			}

			disp.WriteStrings( m_Strings );

			disp.Flush();

			m_TextEntries = disp.TextEntries;
			m_Switches = disp.Switches;

			return disp as Packet;
		}
Ejemplo n.º 2
0
		private Packet Compile( NetState ns )
		{
			IGumpWriter disp;

			if ( ns != null && ns.Unpack )
				disp = new DisplayGumpPacked( this );
			else
				disp = new DisplayGumpFast( this );

			if ( !m_Dragable )
				disp.AppendLayout( m_NoMove );

			if ( !m_Closable )
				disp.AppendLayout( m_NoClose );

			if ( !m_Disposable )
				disp.AppendLayout( m_NoDispose );

			if ( !m_Resizable )
				disp.AppendLayout( m_NoResize );

			int count = m_Entries.Count;
			GumpEntry e;

			for ( int i = 0; i < count; ++i )
			{
				e = m_Entries[i];

				disp.AppendLayout( m_BeginLayout );
				e.AppendTo( ns, disp );
				disp.AppendLayout( m_EndLayout );
			}

			disp.WriteStrings( m_Strings );

			disp.Flush();

			m_TextEntries = disp.TextEntries;
			m_Switches = disp.Switches;

			return disp as Packet;
		}
Ejemplo n.º 3
0
		protected Packet Compile(NetState ns, bool convertToViewer = false)
		{
			IGumpWriter disp;

			if (ns != null && ns.Unpack)
			{
				disp = new DisplayGumpPacked(this);
			}
			else
			{
				disp = new DisplayGumpFast(this);
			}

			if (!_Dragable)
			{
				disp.AppendLayout(_NoMove);
			}

			if (!_Closable)
			{
				disp.AppendLayout(_NoClose);
			}

			if (!_Disposable)
			{
				disp.AppendLayout(_NoDispose);
			}

			if (!_Resizable)
			{
				disp.AppendLayout(_NoResize);
			}

			int count = _Entries.Count;

			for (int i = 0; i < count; ++i)
			{
				GumpEntry e = _Entries[i];

				disp.AppendLayout(_BeginLayout);

				if (!convertToViewer)
				{
					e.AppendTo(disp);
				}
				else
				{
					GumpButton button = e as GumpButton;

					if (button != null)
					{
						new GumpImage(button.X, button.Y, button.NormalID).AppendTo(disp);
					}
					else
					{
						GumpImageTileButton tileButton = e as GumpImageTileButton;

						if (tileButton != null)
						{
							new GumpImageTiled(tileButton.X, tileButton.Y, tileButton.Width, tileButton.Height, tileButton.NormalID).AppendTo
								(disp);
						}
						else
						{
							GumpRadio radio = e as GumpRadio;

							if (radio != null)
							{
								new GumpImage(radio.X, radio.Y, radio.InitialState ? radio.ActiveID : radio.InactiveID).AppendTo(disp);
							}
							else
							{
								GumpCheck check = e as GumpCheck;

								if (check != null)
								{
									new GumpImage(check.X, check.Y, check.InitialState ? check.ActiveID : check.InactiveID).AppendTo(disp);
								}
								// Process text fields
							}
						}
					}
				}

				disp.AppendLayout(_EndLayout);
			}

			disp.WriteStrings(_Strings);

			disp.Flush();

			_TextEntries = disp.TextEntries;
			_Switches = disp.Switches;

			return disp as Packet;
		}
Ejemplo n.º 4
0
        protected Packet Compile()
        {
            IGumpWriter disp = new DisplayGumpPacked( this );

            if ( !m_Dragable )
                disp.AppendLayout( m_NoMove );

            if ( !m_Closable )
                disp.AppendLayout( m_NoClose );

            if ( !m_Disposable )
                disp.AppendLayout( m_NoDispose );

            if ( !m_Resizable )
                disp.AppendLayout( m_NoResize );

            int count = m_Entries.Count;
            GumpEntry e;

            for ( int i = 0; i < count; ++i )
            {
                e = m_Entries[i];

                disp.AppendLayout( m_BeginLayout );
                e.AppendTo( disp );
                disp.AppendLayout( m_EndLayout );
            }

            disp.WriteStrings( m_Strings );

            disp.Flush();

            m_TextEntries = disp.TextEntries;
            m_Switches = disp.Switches;

            return disp as Packet;
        }