Inheritance: Packet, IGumpWriter
Exemplo 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;
		}
Exemplo n.º 2
0
        public override void AppendTo( DisplayGumpFast disp )
        {
            disp.AppendLayout( m_Hue == 0 ? m_LayoutName : m_LayoutNameHue );
            disp.AppendLayout( m_X );
            disp.AppendLayout( m_Y );
            disp.AppendLayout( m_ItemID );

            if ( m_Hue != 0 )
                disp.AppendLayout( m_Hue );
        }
Exemplo 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;
		}
 public override void AppendTo( DisplayGumpFast disp )
 {
     disp.AppendLayout( m_LayoutName );
     disp.AppendLayout( m_X );
     disp.AppendLayout( m_Y );
     disp.AppendLayout( m_Width );
     disp.AppendLayout( m_Height );
     disp.AppendLayout( m_Hue );
     disp.AppendLayout( Parent.Intern( m_Text ) );
 }
Exemplo n.º 5
0
		public abstract void AppendTo(DisplayGumpFast disp);
Exemplo n.º 6
0
 public override void AppendTo( DisplayGumpFast disp )
 {
     disp.AppendLayout( m_LayoutName );
     disp.AppendLayout( m_Page );
 }
Exemplo n.º 7
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;
		}
Exemplo n.º 8
0
		public override void AppendTo(DisplayGumpFast disp)
		{
			disp.AppendLayout(m_LayoutName);
			disp.AppendLayout(m_X);
			disp.AppendLayout(m_Y);
			disp.AppendLayout(m_ID1);
			disp.AppendLayout(m_ID2);
			disp.AppendLayout(m_InitialState);
			disp.AppendLayout(m_SwitchID);

			disp.Switches++;
		}
        public override void AppendTo( DisplayGumpFast disp )
        {
            disp.AppendLayout( m_UseColor ? m_LayoutNameColor : m_LayoutName );
            disp.AppendLayout( m_X );
            disp.AppendLayout( m_Y );
            disp.AppendLayout( m_Width );
            disp.AppendLayout( m_Height );
            disp.AppendLayout( m_Number );
            disp.AppendLayout( m_Background );
            disp.AppendLayout( m_Scrollbar );

            if ( m_UseColor )
                disp.AppendLayout( m_Color );
        }
Exemplo n.º 10
0
		public override void AppendTo(DisplayGumpFast disp)
		{
			disp.AppendLayout(m_LayoutName);
			disp.AppendLayout(m_X);
			disp.AppendLayout(m_Y);
			disp.AppendLayout(m_GumpID);

			if (m_Hue != 0)
			{
				disp.AppendLayout(m_HueEquals);
				disp.AppendLayoutNS(m_Hue);
			}
		}
Exemplo n.º 11
0
		private Packet Compile()
		{
			if ( m_Packet == null )
			{
				DisplayGumpFast 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 = (GumpEntry)m_Entries[i];

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

				disp.WriteText( m_Strings );

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

				m_Packet = disp;
			}

			return m_Packet;
		}
Exemplo n.º 12
0
 public override void AppendTo( DisplayGumpFast disp )
 {
     disp.AppendLayout( m_LayoutName );
     disp.AppendLayout( m_X );
     disp.AppendLayout( m_Y );
     disp.AppendLayout( m_GumpID );
     disp.AppendLayout( m_Width );
     disp.AppendLayout( m_Height );
 }
Exemplo n.º 13
0
        public void Invalidate()
        {
            if ( m_Packet != null )
            {
                m_Packet = null;

                if ( m_Strings.Count > 0 )
                    m_Strings.Clear();
            }
        }
Exemplo n.º 14
0
		public override void AppendTo(DisplayGumpFast disp)
		{
			disp.AppendLayout(m_LayoutName);
			disp.AppendLayout(m_X);
			disp.AppendLayout(m_Y);
			disp.AppendLayout(m_Width);
			disp.AppendLayout(m_Height);
			disp.AppendLayout(m_Hue);
			disp.AppendLayout(m_EntryID);
			disp.AppendLayout(Parent.Intern(m_InitialText));

			disp.TextEntries++;
		}
Exemplo n.º 15
0
		public override void AppendTo(DisplayGumpFast disp)
		{
			disp.AppendLayout(m_LayoutName);
			disp.AppendLayout(m_X);
			disp.AppendLayout(m_Y);
			disp.AppendLayout(m_ID1);
			disp.AppendLayout(m_ID2);
			disp.AppendLayout((int)m_Type);
			disp.AppendLayout(m_Param);
			disp.AppendLayout(m_ButtonID);
		}
Exemplo n.º 16
0
            public override void AppendTo( DisplayGumpFast disp )
            {
                base.AppendTo( disp );

                disp.AppendLayout( m_Class );
            }