public WarningGump( int header, int headerColor, object content, int contentColor, int width, int height, WarningGumpCallback callback, object state ) : base( (640 - width) / 2, (480 - height) / 2 )
		{
			m_Callback = callback;
			m_State = state;

			Closable = false;

			AddPage( 0 );

			AddBackground( 0, 0, width, height, 5054 );

			AddImageTiled( 10, 10, width - 20, 20, 2624 );
			AddAlphaRegion( 10, 10, width - 20, 20 );
			AddHtmlLocalized( 10, 10, width - 20, 20, header, headerColor, false, false );

			AddImageTiled( 10, 40, width - 20, height - 80, 2624 );
			AddAlphaRegion( 10, 40, width - 20, height - 80 );

			if ( content is int )
				AddHtmlLocalized( 10, 40, width - 20, height - 80, (int)content, contentColor, false, true );
			else if ( content is string )
				AddHtml( 10, 40, width - 20, height - 80, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", contentColor, content ), false, true );

			AddImageTiled( 10, height - 30, width - 20, 20, 2624 );
			AddAlphaRegion( 10, height - 30, width - 20, 20 );

			AddButton( 10, height - 30, 4005, 4007, 1, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 40, height - 30, 170, 20, 1011036, 32767, false, false ); // OKAY

			AddButton( 10 + ((width - 20) / 2), height - 30, 4005, 4007, 0, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 40 + ((width - 20) / 2), height - 30, 170, 20, 1011012, 32767, false, false ); // CANCEL
		}
Example #2
0
        public WarningGump( int header, int headerColor, object content, int contentColor, int width, int height, WarningGumpCallback callback, object state, bool cancelButton )
            : base(String.Format("{1}", header, content is int ? "" : (string)content), null)
        {
            m_Callback = callback;
            m_State = state;
            m_CancelButton = cancelButton;

            List<String> mAnswers = new List<String>();

            mAnswers.Add("Okay");
            mAnswers.Add("Cancel");

            Answers = mAnswers.ToArray();
        }
Example #3
0
 public static void SendWarning( Mobile m, string header, string baseWarning, Map map, Point3D start, Point3D end, WarningGumpCallback callback )
 {
     m.SendGump( new WarningGump( 1060635, 30720, String.Format( baseWarning, String.Format( header, map ) ), 0xFFC000, 420, 400, callback, new StateInfo( map, start, end ) ) );
 }
Example #4
0
 public WarningGump(int header, int headerColor, object content, int contentColor, int width, int height, WarningGumpCallback callback, object state)
     : this(header, headerColor, content, contentColor, width, height, callback, state, true)
 {
 }
Example #5
0
		public WarningGump( int header, int headerColor, object content, int contentColor, int width, int height, WarningGumpCallback callback, object state, bool cancelButton ) : base( (640 - width) / 2, (480 - height) / 2 )
		{
			m_Callback = callback;
			m_State = state;
			m_CancelButton = cancelButton;

			Closable = false;

            // throw the warning gump up in the top left hand corner
            if (state is Mobile)
            {
                Mobile mob = (Mobile)state;
                if (mob.Combatant != null)
                {
                    this.X = 0;
                    this.Y = 0;
                }
            }
            else if (state is object[])
            {
                object[] stateobjs = (object[])state;
                for (int i = 0; i < stateobjs.Length; i++)
                {
                    if (stateobjs[i] is Mobile)
                    {
                        Mobile mob = (Mobile)stateobjs[i];
                        if (mob.Combatant != null)
                        {
                            this.X = 0;
                            this.Y = 0;
                        }
                        break;
                    }
                }
            }

			AddPage( 0 );

			AddBackground( 0, 0, width, height, 5054 );

			AddImageTiled( 10, 10, width - 20, 20, 2624 );
			AddAlphaRegion( 10, 10, width - 20, 20 );
			AddHtmlLocalized( 10, 10, width - 20, 20, header, headerColor, false, false );

			AddImageTiled( 10, 40, width - 20, height - 80, 2624 );
			AddAlphaRegion( 10, 40, width - 20, height - 80 );

			if ( content is int )
				AddHtmlLocalized( 10, 40, width - 20, height - 80, (int)content, contentColor, false, true );
			else if ( content is string )
				AddHtml( 10, 40, width - 20, height - 80, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", contentColor, content ), false, true );

			AddImageTiled( 10, height - 30, width - 20, 20, 2624 );
			AddAlphaRegion( 10, height - 30, width - 20, 20 );

			AddButton( 10, height - 30, 4005, 4007, 1, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 40, height - 30, 170, 20, 1011036, 32767, false, false ); // OKAY

			if( m_CancelButton )
			{
				AddButton( 10 + ((width - 20) / 2), height - 30, 4005, 4007, 0, GumpButtonType.Reply, 0 );
				AddHtmlLocalized( 40 + ((width - 20) / 2), height - 30, 170, 20, 1011012, 32767, false, false ); // CANCEL
			}
		}
Example #6
0
 public static void SendWarning(Mobile m, string header, string baseWarning, Map map, Point3D start, Point3D end, WarningGumpCallback callback)
 {
     m.SendGump(new WarningGump(1060635, 30720, String.Format(baseWarning, String.Format(header, map)), 0xFFC000, 420, 400, callback, new StateInfo(map, start, end)));
 }
        public WarningGump(int header, int headerColor, object content, int contentColor, int width, int height, WarningGumpCallback callback, object state, bool cancelButton) : base((640 - width) / 2, (480 - height) / 2)
        {
            m_Callback     = callback;
            m_State        = state;
            m_CancelButton = cancelButton;

            Closable = false;

            AddPage(0);

            AddBackground(0, 0, width, height, 9270);

            AddImageTiled(10, 10, width - 20, 20, 2624);
            //AddAlphaRegion( 10, 10, width - 20, 20 );
            AddHtmlLocalized(10, 10, width - 20, 20, header, headerColor, false, false);

            AddImageTiled(10, 40, width - 20, height - 80, 2624);
            //AddAlphaRegion( 10, 40, width - 20, height - 80 );

            if (content is int)
            {
                AddHtmlLocalized(10, 40, width - 20, height - 80, (int)content, contentColor, false, true);
            }
            else if (content is string)
            {
                AddHtml(10, 40, width - 20, height - 80, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", contentColor, content), false, true);
            }

            AddImageTiled(10, height - 30, width - 20, 20, 2624);
            //AddAlphaRegion( 10, height - 30, width - 20, 20 );

            AddButton(10, height - 30, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtml(40, height - 30, 170, 20, "Confirmar", false, false);               // OKAY

            if (m_CancelButton)
            {
                AddButton(10 + ((width - 20) / 2), height - 30, 4005, 4007, 0, GumpButtonType.Reply, 0);
                AddHtml(40 + ((width - 20) / 2), height - 30, 170, 20, "Cancelar", false, false); // CANCEL
            }
        }
 public WarningGump(int header, int headerColor, object content, int contentColor, int width, int height, WarningGumpCallback callback, object state)
     : this(header, headerColor, content, contentColor, width, height, callback, state, true)
 {
 }
Example #9
0
        public WarningGump(TextDefinition header, int headerColor, TextDefinition content, int contentColor, int width, int height, WarningGumpCallback callback, object state, bool cancelButton, int ok = 1011036, int cancel = 1011012)
            : base((640 - width) / 2, (480 - height) / 2)
        {
            m_Callback     = callback;
            m_State        = state;
            m_CancelButton = cancelButton;

            Closable = false;

            AddPage(0);

            AddBackground(0, 0, width, height, 5054);

            AddImageTiled(10, 10, width - 20, 20, 2624);
            AddAlphaRegion(10, 10, width - 20, 20);

            if (header.Number > 0)
            {
                AddHtmlLocalized(10, 10, width - 20, 20, header.Number, headerColor, false, false);
            }
            else if (header.String != null)
            {
                AddHtml(10, 10, width - 20, height - 80, string.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", headerColor, header.String), false, true);
            }

            AddImageTiled(10, 40, width - 20, height - 80, 2624);
            AddAlphaRegion(10, 40, width - 20, height - 80);

            if (content.Number > 0)
            {
                AddHtmlLocalized(10, 40, width - 20, height - 80, content.Number, contentColor, false, true);
            }
            else if (content.String != null)
            {
                AddHtml(10, 40, width - 20, height - 80, string.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", contentColor, content.String), false, true);
            }

            AddImageTiled(10, height - 30, width - 20, 20, 2624);
            AddAlphaRegion(10, height - 30, width - 20, 20);

            AddButton(10, height - 30, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(40, height - 30, 170, 20, ok, 32767, false, false); // OKAY

            if (m_CancelButton)
            {
                AddButton(10 + ((width - 20) / 2), height - 30, 4005, 4007, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(40 + ((width - 20) / 2), height - 30, 170, 20, cancel, 32767, false, false); // CANCEL
            }
        }
        public WarningGump(int header, int headerColor, object content, int contentColor, int width, int height, WarningGumpCallback callback = null, bool cancelButton = true) : base((640 - width) / 2, (480 - height) / 2)
        {
            m_Callback = callback;

            Closable = false;

            AddPage(0);

            AddBackground(0, 0, width, height, 5054);

            AddImageTiled(10, 10, width - 20, 20, 2624);
            AddAlphaRegion(10, 10, width - 20, 20);
            AddHtmlLocalized(10, 10, width - 20, 20, header, headerColor);

            AddImageTiled(10, 40, width - 20, height - 80, 2624);
            AddAlphaRegion(10, 40, width - 20, height - 80);

            if (content is int i)
            {
                AddHtmlLocalized(10, 40, width - 20, height - 80, i, contentColor, false, true);
            }
            else if (content is string)
            {
                AddHtml(10, 40, width - 20, height - 80, $"<BASEFONT COLOR=#{contentColor:X6}>{content}</BASEFONT>", false, true);
            }

            AddImageTiled(10, height - 30, width - 20, 20, 2624);
            AddAlphaRegion(10, height - 30, width - 20, 20);

            AddButton(10, height - 30, 4005, 4007, 1);
            AddHtmlLocalized(40, height - 30, 170, 20, 1011036, 32767); // OKAY

            if (cancelButton)
            {
                AddButton(10 + (width - 20) / 2, height - 30, 4005, 4007, 0);
                AddHtmlLocalized(40 + (width - 20) / 2, height - 30, 170, 20, 1011012, 32767); // CANCEL
            }
        }