예제 #1
0
 public void Draw(Gump g, int x, int y, bool player)
 {
     if (!player)
         g.AddBackground(x, y, 90, 115, 3000);
     g.AddHtml(x, y + 5, 32, 25, String.Format("<BODY TEXT='{0}'><center>{1}</center></BODY>", GetHue(), GetValueString(false)), false, false);
     g.AddHtml(x, y + 25, 32, 25, String.Format("<BODY TEXT='{0}'><center>{1}</center></BODY>", GetHue(), String.Format("{0}", (char)GetSymbol())), false, false);
 }
예제 #2
0
파일: Dialog.cs 프로젝트: jasegiffin/JustUO
		public DialogGump(
			PlayerMobile user,
			Gump parent = null,
			int? x = null,
			int? y = null,
			string title = null,
			string html = null,
			int icon = -1,
			Action<GumpButton> onAccept = null,
			Action<GumpButton> onCancel = null)
			: base(user, parent, x, y)
		{
			Modal = true;
			CanDispose = false;
			HtmlBackground = false;
			HtmlColor = DefaultHtmlColor;

			Width = Defaultwidth;
			Height = DefaultHeight;

			Title = title ?? DefaultTitle;
			Html = html;
			Icon = (icon >= 0) ? icon : DefaultIcon;

			AcceptHandler = onAccept;
			CancelHandler = onCancel;
		}
 public CentralGumpInformationUI(PlayerMobile user, Gump parent, string msg)
     : base(user, parent, 115, 0)
 {
     CanMove = true;
     Modal = false;
     HTML = msg;
 }
예제 #4
0
		public DonationTransactionOverviewGump(
			PlayerMobile user, Gump parent, DonationProfile profile, DonationTransaction trans)
			: base(user, parent)
		{
			Profile = profile;
			Transaction = trans;
		}
예제 #5
0
        void IHTMLBookGump.DrawToSurface(Gump gump, int x, int y, string page1Text, string page2Text, int page)
        {
            /*gump.AddImage(x, y, m_Book.GumpID);

            gump.AddHtml( 29 + x + m_Book.HTMLOffset.X, 23 + y + m_Book.HTMLOffset.Y, 147, 167, page1Text, (bool)false, (bool)false);
            gump.AddHtml( 186 + x + m_Book.HTMLOffset.X, 23 + y + m_Book.HTMLOffset.Y, 147, 167, page2Text, (bool)false, (bool)false);*/
            gump.AddBackground(x-22+22, y+4, 646, 362, 5120);
            gump.AddBackground(x+22, y+13, 606, 343, 9300);
            if ( page + 2 < m_Book.HTMLContent.CachedHTMLContent.Length )
                gump.AddButton(x+576, y+0, 2469, 2471, (int)Buttons.NextPage, GumpButtonType.Reply, 0);
            if ( page - 2 >= 0 )
                gump.AddButton(x+492, y+0, 2466, 2468, (int)Buttons.PreviousPage, GumpButtonType.Reply, 0);

            gump.AddHtml( x+31, y+26, 274, 314, page1Text, (bool)false, (bool)false);
            gump.AddHtml( x+343, y+26, 274, 314, page2Text, (bool)false, (bool)false);
            gump.AddImage(x+316, y+341, 10204);
            gump.AddImageTiled(x+316, y+28, 17, 318, 10201);
            gump.AddImage(x+316, y+13, 10202);
            gump.AddHtml( x+31, y+333, 274, 20, "<CENTER><SMALL><B>" + (page+1), (bool)false, (bool)false);
            gump.AddHtml( x+343, y+333, 274, 20, "<CENTER><SMALL><B>" + (page+2), (bool)false, (bool)false);

            /*if ( page + 2 < m_Book.HTMLContent.CachedHTMLContent.Length )
                gump.AddButton(294 + x + m_Book.NextPageButtonOffset.X, 4 + y + m_Book.NextPageButtonOffset.Y, 2236, 2236, (int)Buttons.NextPage, GumpButtonType.Reply, 0);

            if ( page - 2 >= 0 )
                gump.AddButton(23 + x + m_Book.PrevPageButtonOffset.X, 5 + y + m_Book.PrevPageButtonOffset.Y, 2235, 2235, (int)Buttons.PreviousPage, GumpButtonType.Reply, 0);
            */
        }
예제 #6
0
		public override void WriteToGump( Gump g, ref int y )
		{
			if ( ShowDetailed )
			{
				string amount = m_DesiredAmount.ToString();

				g.AddHtmlLocalized( 98, y, 350, 16, 1072205, 0x15F90, false, false ); // Obtain
				g.AddLabel( 143, y, 0x481, amount );

				if ( m_Name.Number > 0 )
				{
					g.AddHtmlLocalized( 143 + amount.Length * 15, y, 190, 18, m_Name.Number, 0x77BF, false, false );
					g.AddItem( 350, y, LabelToItemID( m_Name.Number ) );
				}
				else if ( m_Name.String != null )
				{
					g.AddLabel( 143 + amount.Length * 15, y, 0x481, m_Name.String );
				}
			}
			else
			{
				if ( m_Name.Number > 0 )
					g.AddHtmlLocalized( 98, y, 312, 32, m_Name.Number, 0x15F90, false, false );
				else if ( m_Name.String != null )
					g.AddLabel( 98, y, 0x481, m_Name.String );
			}

			y += 32;
		}
예제 #7
0
		public AnalogClock(
			PlayerMobile user, Gump parent = null, int? x = null, int? y = null, int radius = -1, TimeSpan? time = null)
			: base(user, parent, x, y)
		{
			Radius = radius <= 0 ? DefaultRadius : radius;

			RomanNumerals = false;

			DisplayNumerals = true;
			DisplayHourHand = true;
			DisplayMinuteHand = true;
			DisplaySecondHand = true;

			ColorNumerals = DefaultNumeralsColor;
			ColorHourHand = DefaultHourHandColor;
			ColorMinuteHand = DefaultMinuteHandColor;
			ColorSecondHand = DefaultSecondHandColor;

			if (time != null)
			{
				Time = time.Value;
				RealTime = false;
			}
			else
			{
				Time = DateTime.Now.TimeOfDay;
				RealTime = true;
			}

			ForceRecompile = true;

			AutoRefresh = RealTime;
		}
예제 #8
0
		public override void WriteToGump( Gump g, ref int y )
		{
			string amount = m_DesiredAmount.ToString();

			g.AddHtmlLocalized( 98, y, 312, 16, 1072204, 0x15F90, false, false ); // Slay
			g.AddLabel( 133, y, 0x481, amount );

			if ( m_Name.Number > 0 )
				g.AddHtmlLocalized( 133 + amount.Length * 15, y, 190, 18, m_Name.Number, 0x77BF, false, false );
			else if ( m_Name.String != null )
				g.AddLabel( 133 + amount.Length * 15, y, 0x481, m_Name.String );

			y += 16;

			#region Location
			if ( m_Area != null )
			{
				g.AddHtmlLocalized( 103, y, 312, 20, 1018327, 0x15F90, false, false ); // Location

				if ( m_Area.Name.Number > 0 )
					g.AddHtmlLocalized( 223, y, 312, 20, m_Area.Name.Number, 0xFFFFFF, false, false );
				else if ( m_Area.Name.String != null )
					g.AddLabel( 223, y, 0x481, m_Area.Name.String );

				y += 16;
			}
			#endregion
		}
예제 #9
0
		public CloseGumpTimer( Mobile from, Gump g, TimeSpan delay )
			: base( delay )
		{
			m_From = from;
			m_Gump = g;

			Priority = TimerPriority.OneSecond;
		}
예제 #10
0
		public DonationGiftGump(
			PlayerMobile user, Gump parent, DonationProfile profile, DonationTransaction trans, PlayerMobile to = null)
			: base(user, parent)
		{
			Profile = profile;
			Transaction = trans;
			To = to;
		}
예제 #11
0
 public PokerWebsiteGump(PlayerMobile user, int handid, Gump parent = null)
     : base(user, parent, 200, 270)
 {
     Closable = true;
     Disposable = false;
     Dragable = true;
     Resizable = false;
     HandId = handid;
 }
예제 #12
0
		/// <summary>
		/// Constructor 1
		/// </summary>
		/// <param name="Page">The gump to which the list will be added.</param>
		/// <param name="Style">The style of the GumpList.</param>
		/// <param name="Skin">The skinning parameters of the list.</param>
		public GumpList( Gump Page, string Style, BaseSkin Skin )
		{			
			sk = Skin;
			page = Page;
			numperpage = sk.NumPerPage;
			style = Style;
			topbar = new GumpListEntry(sk.ListStartX, sk.ListStartY, this, sk.EntryDefaultWidth, sk.EntryDefaultHeight);
			listEntries.Add( topbar.GetHashCode(), topbar);
			DebugWrite("Constructor sans title end.");
		}
예제 #13
0
		public TrashHandlerAcceptListGump(Mobile user, BaseTrashHandler handler, Gump parent = null)
			: base(
				user,
				parent,
				list: handler.Accepted,
				title: handler.GetType().Name + " Accept List",
				emptyText: "There are no Types in the list.")
		{
			TrashHandler = handler;
		}
예제 #14
0
        public InvasionDetailsUI(PlayerMobile user, Gump parent = null, Invasion invasion = null)
            : base(user, parent, 0, 0)
        {
            CanMove = true;
            Modal = false;

            ForceRecompile = true;

            Invasion = invasion;
        }
예제 #15
0
		public ScheduleDaysMenuGump(
			PlayerMobile user, Schedule schedule, Gump parent = null, GumpButton clicked = null, bool useConfirm = true)
			: base(user, parent, clicked: clicked)
		{
			Schedule = schedule;
			UseConfirmDialog = useConfirm;

			CanMove = false;
			CanResize = false;
		}
예제 #16
0
		public TrashHandlerIgnoreListGump(PlayerMobile user, BaseTrashHandler handler, Gump parent = null)
			: base(
				user,
				parent,
				list: handler.Ignored,
				title: handler.GetType().Name + " Ignore List",
				emptyText: "There are no Types in the list.")
		{
			TrashHandler = handler;
		}
예제 #17
0
 public PokerBetGump(PlayerMobile user, PokerGame game, PokerPlayer player, Gump parent = null)
     : base(user, parent, 526, 449)
 {
     Closable = false;
     Disposable = false;
     Dragable = true;
     Resizable = false;
     _Player = player;
     _Game = game;
 }
예제 #18
0
		public override void WriteToGump( Gump g, ref int y )
		{
			g.AddHtmlLocalized( 98, y, 312, 16, 1072206, 0x15F90, false, false ); // Escort to

			if ( m_Destination.Name.Number > 0 )
				g.AddHtmlLocalized( 173, y, 312, 20, m_Destination.Name.Number, 0xFFFFFF, false, false );
			else if ( m_Destination.Name.String != null )
				g.AddLabel( 173, y, 0x481, m_Destination.Name.String );

			y += 16;
		}
예제 #19
0
파일: Confirm.cs 프로젝트: Ravenwolfe/Core
		public ConfirmDialogGump(
			Mobile user,
			Gump parent = null,
			int? x = null,
			int? y = null,
			string title = null,
			string html = null,
			int icon = 7022,
			Action<GumpButton> onAccept = null,
			Action<GumpButton> onCancel = null)
			: base(user, parent, x, y, title, html, icon, onAccept, onCancel)
		{ }
예제 #20
0
		public OffsetSelectorGump(
			PlayerMobile user, Gump parent = null, Point? value = null, Action<OffsetSelectorGump, Point> valueChanged = null)
			: base(user, parent, 0, 0)
		{
			ForceRecompile = true;
			CanMove = false;
			CanClose = true;
			CanDispose = true;

			_Value = value ?? DefaultOffset;
			ValueChanged = valueChanged;
		}
예제 #21
0
		public NoticeDialogGump(
			PlayerMobile user,
			Gump parent = null,
			int? x = null,
			int? y = null,
			string title = null,
			string html = null,
			int icon = 7004,
			Action<GumpButton> onAccept = null,
			Action<GumpButton> onCancel = null)
			: base(user, parent, x, y, title, html, icon, onAccept, onCancel)
		{ }
 public InitialHammer120Skill(
     PlayerMobile user,
     Gump parent = null,
     int? x = null,
     int? y = null,
     string title = null)
     : base(user, parent, 0, 0, title)
 {
     CanMove = true;
     Closable = true;
     Modal = false;
 }
예제 #23
0
		public override void WriteToGump( Gump g, ref int y )
		{
			int skillLabel = AosSkillBonuses.GetLabel( m_Skill );
			string args;

			if ( m_ThresholdFixed % 10 == 0 )
				args = String.Format( "#{0}\t{1}", skillLabel, m_ThresholdFixed / 10 ); // as seen on OSI
			else
				args = String.Format( "#{0}\t{1:0.0}", skillLabel, (double)m_ThresholdFixed / 10 ); // for non-integer skill levels

			g.AddHtmlLocalized( 98, y, 312, 16, 1077485, args, 0x15F90, false, false ); // Increase ~1_SKILL~ to ~2_VALUE~
			y += 16;
		}
예제 #24
0
 public SoulForgeFinished(
     PlayerMobile user,
     Gump parent = null,
     int? x = null,
     int? y = null,
     string title = null,
     Action<GumpButton> onAccept = null)
     : base(user, parent, 0, 0, title, null, 0, onAccept)
 {
     CanMove = true;
     Closable = true;
     Modal = false;
 }
예제 #25
0
        // same as above but with two entries side by side and label included
        public static void AddTextEntryMinMaxLabel( Gump g, string s, int imageid, int x, int y, int hue, int entryIdMin, int entryIdMax, string initialText, int size, string name = "")
        {
            //Label
            g.AddLabel(x, y, hue, s);

            // Min
            g.AddImageTiled( (x + 10 -  (StringWitdth(s) / 2)) + 35 , y -1 , /*height*/ 52, /*width*/ 20, imageid);
            g.AddTextEntry( (x + 10 - (StringWitdth(s) / 2))+ 35 , y- 1 , 52, 20, hue, entryIdMin, "Min", size);

            // Max
            g.AddImageTiled( (x + 10 - (StringWitdth(s) / 2)) + 97 , y -1 , 52, 20, imageid);
            g.AddTextEntry( (x + 10 - (StringWitdth(s) / 2)) + 97 , y -1 , 52, 20, hue, entryIdMax, "Max", size );
        }
예제 #26
0
		public ObjectPropertyList(IEntity e, Gump g = null)
			: base(0xD6)
		{
			EnsureCapacity(128);

			m_Entity = e;
            m_Gump = g;

            m_Stream.Write((short)1);
			m_Stream.Write(e.Serial);
			m_Stream.Write((byte)0);
			m_Stream.Write((byte)0);
			m_Stream.Write(e.Serial);
		}
예제 #27
0
		public ErrorDialogGump(
			PlayerMobile user,
			Gump parent = null,
			int? x = null,
			int? y = null,
			string title = null,
			Exception error = null,
			int icon = 7019,
			Action<GumpButton> onAccept = null,
			Action<GumpButton> onCancel = null)
			: base(user, parent, x, y, title, String.Empty, icon, onAccept, onCancel)
		{
			Error = error;
		}
예제 #28
0
        public SkillScrollUI(
			PlayerMobile user,
			Gump parent = null,
			SkillScroll scroll = null,
			Action<GumpButton> onAccept = null,
			Action<GumpButton> onCancel = null)
			: base(user, parent, null, 100, null, null, 23001, onAccept, onCancel)
		{
            _SkillScroll = scroll;

			CanMove = true;
			Modal = false;

		}
예제 #29
0
		public ScrollConfirmGump(
			PlayerMobile user,
			Gump parent = null,
			TitleObject value = null,
			Action<GumpButton> onAccept = null,
			Action<GumpButton> onCancel = null)
			: base(user, parent, null, 100, null, null, 23001, onAccept, onCancel)
		{
			_Value = value;

			CanMove = true;
			Modal = false;

			Title = String.Empty;
		}
예제 #30
0
        public SFScrollUI(
            PlayerMobile user,
            Gump parent = null,
            int? x = null,
            int? y = null,
            string title = null,
            string html = null)
            : base(user, parent, 0, 0, title, html)
        {
            CanMove = true;
            Closable = true;
            Modal = false;

            _Html = html;
        }
        public override void OnClick(Mobile from, int page, int index, Gump gump)
        {
            if (this.m_Type == null)
            {
                from.SendMessage("That is an invalid type name.");
            }
            else
            {
                if (gump is XmlAddGump)
                {
                    XmlAddGump xmladdgump = (XmlAddGump)gump;

                    //Commands.Handle( from, String.Format( "{0}Add {1}", Commands.CommandPrefix, m_Type.Name ) );
                    if (xmladdgump != null && xmladdgump.defs != null && xmladdgump.defs.NameList != null &&
                        index >= 0 && index < xmladdgump.defs.NameList.Length)
                    {
                        xmladdgump.defs.NameList[index] = this.m_Type.Name;
                        XmlAddGump.Refresh(from, true);
                    }
                    from.SendGump(new XmlCategorizedAddGump(from, this.m_Parent, page, index, xmladdgump));
                }
                else if (gump is XmlSpawnerGump)
                {
                    XmlSpawner m_Spawner = ((XmlSpawnerGump)gump).m_Spawner;

                    if (m_Spawner != null)
                    {
                        XmlSpawnerGump xg = m_Spawner.SpawnerGump;

                        if (xg != null)
                        {
                            xg.Rentry          = new XmlSpawnerGump.ReplacementEntry();
                            xg.Rentry.Typename = this.m_Type.Name;
                            xg.Rentry.Index    = index;
                            xg.Rentry.Color    = 0x1436;

                            Timer.DelayCall(TimeSpan.Zero, new TimerStateCallback(XmlSpawnerGump.Refresh_Callback), new object[] { from });
                            //from.CloseGump(typeof(XmlSpawnerGump));
                            //from.SendGump( new XmlSpawnerGump(xg.m_Spawner, xg.X, xg.Y, xg.m_ShowGump, xg.xoffset, xg.page, xg.Rentry) );
                        }
                    }
                }
            }
        }
예제 #32
0
 public GumpTimer(Mobile Staff, Mobile From, byte RetryCount, byte MaxRetries, int TotalSeconds, int MaxSeconds, string userphrase, bool Kick, bool Jail, Point3D MoveTo, Map MoveToMap, string Website, string passphrase, Gump afkgump, byte seconds, TimeSpan delay)
     : base(delay)
 {
     Priority       = TimerPriority.OneSecond;
     m_Staff        = Staff;
     m_From         = From;
     m_afkgump      = afkgump;
     m_RetryCount   = RetryCount;
     m_MaxRetries   = MaxRetries;
     m_TotalSeconds = TotalSeconds;
     m_MaxSeconds   = MaxSeconds;
     m_Kick         = Kick;
     m_Jail         = Jail;
     m_MoveTo       = MoveTo;
     m_MoveToMap    = MoveToMap;
     m_Website      = Website;
     m_passphrase   = passphrase;
     m_seconds      = seconds;
 }
예제 #33
0
        public virtual void AddHyperLinkBackingButton(Gump gump)
        {
            if (NewIdMethodInfo == null)
            {
                Console.WriteLine("Can't back hyperlink, underlying server core has changed.");
                return;
            }

            int displayTextLengthInPixels = LabelWidthInPixels;

            int x = Location.X;
            int y = Location.Y + 1;

            for (int gumpIdx = 0; gumpIdx < HYPERLINK_BACK_GUMP_WIDTHS.Length; ++gumpIdx)
            {
                int  gumpWidth       = HYPERLINK_BACK_GUMP_WIDTHS[gumpIdx];
                int  gumpId          = HYPERLINK_BACK_GUMP_IDS[gumpIdx];
                bool continueLooping = true;

                while (displayTextLengthInPixels - gumpWidth >= 0)
                {
                    gump.AddGumpEntryFirst(new GumpButton(x, y, gumpId, gumpId, (int)NewIdMethodInfo.Invoke(gump, new object[] { }), GumpButtonType.Reply, CallbackParam, Callback));
                    displayTextLengthInPixels -= gumpWidth;


                    if (displayTextLengthInPixels >= 0 && displayTextLengthInPixels - gumpWidth < 0)
                    {
                        gump.AddGumpEntryFirst(new GumpButton(x + displayTextLengthInPixels, y, gumpId, gumpId, (int)NewIdMethodInfo.Invoke(gump, new object[] { }), GumpButtonType.Reply, CallbackParam, Callback, ""));
                        x += displayTextLengthInPixels;
                        displayTextLengthInPixels = 0;
                        continueLooping           = false;
                    }

                    x += gumpWidth;
                }

                if (!continueLooping)
                {
                    break;
                }
            }
        }
예제 #34
0
        private void OnThirst(ThirstChangedEventArgs e)
        {
            //if (eventUpdate)
            //    return;

            //eventUpdate = true;
            //RefreshGump();

            Gump hungerGump = User.FindGump(typeof(gumpfaim)) as Gump;

            if (hungerGump != null)
            {
                User.CloseGump(typeof(gumpfaim));
                User.SendGump(new gumpfaim(User));
            }
            else
            {
                User.SendGump(new gumpfaim(User, this.X, this.Y));
            }
        }
예제 #35
0
        public static void AddGumpEntryFirst(this Gump gump, IGumpComponent g)
        {
            if (g is GumpEntry)
            {
                if (!gump.Entries.Contains((GumpEntry)g))
                {
                    if (AssignIdMethodInfo != null)
                    {
                        AssignIdMethodInfo.Invoke((GumpEntry)g, new object[] { });
                    }
                    gump.Entries.Insert(0, (GumpEntry)g);
                    gump.Invalidate();
                }
            }

            if (g.Container == null)
            {
                g.Container = gump;
            }
        }
예제 #36
0
        public override void OnClick(Mobile from, int page, int index, Gump gump)
        {
            if (m_Type == null)
            {
                from.SendMessage("That is an invalid type name.");
            }
            else
            {
                if (gump is XmlAddGump xmladdgump)
                {
                    //Commands.Handle( from, String.Format( "{0}Add {1}", Commands.CommandPrefix, m_Type.Name ) );
                    if (xmladdgump.defs?.NameList != null && index >= 0 && index < xmladdgump.defs.NameList.Length)
                    {
                        xmladdgump.defs.NameList[index] = m_Type.Name;
                        XmlAddGump.Refresh(from, true);
                    }
                    from.SendGump(new XmlCategorizedAddGump(from, m_Parent, page, index, xmladdgump));
                }
                else if (gump is XmlSpawnerGump spawnerGump)
                {
                    XmlSpawner m_Spawner = spawnerGump.m_Spawner;

                    if (m_Spawner != null)
                    {
                        XmlSpawnerGump xg = m_Spawner.SpawnerGump;

                        if (xg != null)
                        {
                            xg.Rentry = new XmlSpawnerGump.ReplacementEntry
                            {
                                Typename = m_Type.Name,
                                Index    = index,
                                Color    = 0x1436
                            };

                            Timer.DelayCall(TimeSpan.Zero, new TimerStateCallback(XmlSpawnerGump.Refresh_Callback), new object[] { from });
                        }
                    }
                }
            }
        }
예제 #37
0
 public static void AddHtmlLabel(
     this Gump gump,
     int x,
     int y,
     FontHandling.FontSize size,
     bool bold,
     bool italicized,
     bool underlined,
     string webColor,
     string text)
 {
     gump.AddHtmlTextRectangle(
         x,
         y,
         size,
         bold,
         italicized,
         underlined,
         webColor,
         text,
         FontHandling.CalculateTextLengthInPixels(text, size, italicized, bold),
         FontHandling.FONT_LINE_HEIGHT);
 }
예제 #38
0
        public static Rectangle2D GetBounds(this Gump g)
        {
            int x = g.X, y = g.Y, w = 0, h = 0;

            if (g is SuperGump)
            {
                var sg = (SuperGump)g;

                x += sg.XOffset;
                y += sg.YOffset;

                if (sg.Modal)
                {
                    x += sg.ModalXOffset;
                    y += sg.ModalYOffset;
                }

                w = sg.OuterWidth;
                h = sg.OuterHeight;
            }
            else
            {
                foreach (var e in g.Entries)
                {
                    int ex, ey;
                    e.TryGetPosition(out ex, out ey);

                    int ew, eh;
                    e.TryGetSize(out ew, out eh);

                    w = Math.Max(ex + ew, w);
                    h = Math.Max(ey + eh, h);
                }
            }

            return(new Rectangle2D(x, y, w, h));
        }
예제 #39
0
 public XmlCategorizedAddGump(Mobile owner, int index, Gump gump) : this(owner, XmlAddCAGCategory.Root, 0, index, gump)
 {
 }
예제 #40
0
 // Methods
 static GumpButton()
 {
     GumpButton.m_LayoutName = Gump.StringToBuffer("button");
 }
 // Methods
 static GumpImageTiled()
 {
     GumpImageTiled.m_LayoutName = Gump.StringToBuffer("gumppictiled");
 }
예제 #42
0
 // Methods
 static GumpRadio()
 {
     GumpRadio.m_LayoutName = Gump.StringToBuffer("radio");
 }
예제 #43
0
 // Methods
 static GumpLabel()
 {
     GumpLabel.m_LayoutName = Gump.StringToBuffer("text");
 }
 // Methods
 static GumpLabelCropped()
 {
     GumpLabelCropped.m_LayoutName = Gump.StringToBuffer("croppedtext");
 }
예제 #45
0
 public ObjectPropertyListTooltip(Gump gump)
 {
     m_Gump = gump;
 }
예제 #46
0
 public static void AddHyperlink(this Gump gump, HyperLink link)
 {
     link.AddHyperLinkBackingButton(gump);
     link.AddText(gump);
 }
예제 #47
0
 // Methods
 static GumpBackground()
 {
     GumpBackground.m_LayoutName = Gump.StringToBuffer("resizepic");
 }
예제 #48
0
 // Methods
 static GumpPage()
 {
     GumpPage.m_LayoutName = Gump.StringToBuffer("page");
 }
예제 #49
0
 public override void OnClick(Mobile from, int page, int index, Gump gump)
 {
     from.SendGump(new XmlCategorizedAddGump(from, this, 0, index, gump));
 }
예제 #50
0
 // text entry with tiled image background
 public static void AddTextEntryPreFab(Gump g, int imageid, int x, int y, int width, int height, int hue, int entryID, string initialText, int size, string name = "")
 {
     g.AddImageTiled(x - 1, y - 1, width + 2, height + 2, 9204);
     g.AddImageTiled(x, y, width, height, imageid);
     g.AddTextEntry(x, y, width, height, hue, entryID, initialText, size);
 }
예제 #51
0
        /// <summary>
        /// The main method for putting the entry on the page. This method is accessed from the GumpList class when CommitList() is called.
        /// </summary>
        /// <param name="page">The gump to which the entry should be appended.</param>
        public void AppendTo(Gump page)
        {
            m_ColCount = columnValues.Count < m_ParentList.columns? columnValues.Count: m_ParentList.columns;
            if (m_ColCount == 0)
            {
                return;
            }
            if (m_Background)
            {
                GumpImageTiled b = new GumpImageTiled(m_X, m_Y, m_Width, m_Height, m_BackgroundID);
                page.Add(b);
            }
            if (m_Style == "details")
            {
                m_ParentList.DebugWrite("Details mode.");
                int i = 0;
                //int columnval = -1;

                int colWidth = Width / m_ColCount;
                int xbase    = m_X;
                while (i < columnValues.Count && i < m_ParentList.columns)
                {
                    colWidth = getWidthOfColumn(i);
                    xbase    = m_X + getCurrentXLocation(i + 1);
                    m_ParentList.DebugWrite("Appending Columns.");
                    try
                    {
                        object o = columnValues[i];
                        if (o is GumpButton)
                        {
                            GumpButton btn = (GumpButton)o;
                            btn.X = xbase + skin.ListColumnIndent;
                            btn.Y = m_Y;
                            page.Add(btn);
                        }
                        else if (o is GumpCheck)
                        {
                            GumpCheck c = (GumpCheck)o;
                            c.X = xbase + skin.ListColumnIndent;
                            c.Y = m_Y;
                            page.Add(c);
                        }
                        else if (o is GumpTextEntry)
                        {
                            GumpTextEntry t = (GumpTextEntry)o;
                            t.X      = xbase + skin.ListColumnIndent;
                            t.Y      = m_Y;
                            t.Width  = colWidth;
                            t.Height = m_Height;
                            page.Add(t);
                        }
                        else if (o is string)
                        {
                            string s = (string)o;
                            m_ParentList.DebugWrite("stringy! " + s);
                            if (s.Contains("</"))
                            {
                                GumpHtml h = new GumpHtml(xbase + skin.ListColumnIndent, m_Y, colWidth, m_Height, s, false, false);
                                h.Parent = page;
                                page.Add(h);
                            }
                            else
                            {
                                m_ParentList.DebugWrite("text");
                                GumpLabel g = new GumpLabel(xbase + skin.ListColumnIndent, m_Y, skin.NormalText, s);
                                g.Parent = page;
                                page.Add(g);
                            }
                        }
                        i++;
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Problem in AppendTo - " + e);
                        i = columnValues.Count;
                    }
                    if (m_Dividers)
                    {
                        GumpImageTiled t = new GumpImageTiled(xbase + colWidth, m_Y, skin.EntryDividerWidth, skin.EntryDividerHeight, skin.EntryDividerID);
                        page.Add(t);
                    }
                }
                m_ParentList.DebugWrite("Done, details.");
            }
            else if (m_Style == "icons")
            {
                m_ParentList.DebugWrite("Icons mode.");
                Hashtable table = (Hashtable)columnValues[0];
                string    s     = (string)table["caption"];
                if (m_Background)
                {
                    GumpImageTiled t = new GumpImageTiled(m_X, m_Y, m_Width, m_Height, m_BackgroundID);
                    page.Add(t);
                }
                GumpButton button;
                if (arguments.ContainsKey("button"))
                {
                    button = (GumpButton)arguments["button"];
                    page.Add(button);
                }
                else
                {
                    return;
                }

                int       icon = arguments["icon"] != null ? (int)arguments["icon"] : skin.EntryDefaultIcon;
                GumpImage im   = new GumpImage((skin.EntryCaptionWidth - m_X) - skin.EntryIconWidth / 2, m_Y + skin.EntryIconY, icon);
                page.Add(im);
                if (s.Contains("</"))
                {
                    GumpHtml h = new GumpHtml(m_X, m_Y, m_Width, m_Height, s, false, false);
                    h.Parent = page;
                    page.Add(h);
                }
                else
                {
                    GumpLabel g = new GumpLabel(m_X, m_Y + skin.EntryCaptionPositionY, skin.NormalText, s);
                    g.Parent = page;
                    page.Add(g);
                }
            }
            else
            {
                Console.WriteLine("Unknown style: " + m_Style);
            }
        }
예제 #52
0
 // Methods
 static GumpGroup()
 {
     GumpGroup.m_LayoutName = Gump.StringToBuffer("group");
 }
예제 #53
0
        public XmlPartialCategorizedAddGump(Mobile from, string searchString, int page, ArrayList searchResults, bool explicitSearch, int entryindex, Gump gump) : base(50, 50)
        {
            if (gump is XmlSpawnerGump)
            {
                // keep track of the spawner for xmlspawnergumps
                m_Spawner = ((XmlSpawnerGump)gump).m_Spawner;
            }

            // keep track of the gump
            m_Gump = gump;


            m_SearchString  = searchString;
            m_SearchResults = searchResults;
            m_Page          = page;

            m_EntryIndex = entryindex;

            from.CloseGump(typeof(XmlPartialCategorizedAddGump));

            AddPage(0);

            AddBackground(0, 0, 420, 280, 5054);

            AddImageTiled(10, 10, 400, 20, 2624);
            AddAlphaRegion(10, 10, 400, 20);
            AddImageTiled(41, 11, 184, 18, 0xBBC);
            AddImageTiled(42, 12, 182, 16, 2624);
            AddAlphaRegion(42, 12, 182, 16);

            AddButton(10, 9, 4011, 4013, 1, GumpButtonType.Reply, 0);
            AddTextEntry(44, 10, 180, 20, 0x480, 0, searchString);

            AddHtmlLocalized(230, 10, 100, 20, 3010005, 0x7FFF, false, false);

            AddImageTiled(10, 40, 400, 200, 2624);
            AddAlphaRegion(10, 40, 400, 200);

            if (searchResults.Count > 0)
            {
                for (int i = (page * 10); i < ((page + 1) * 10) && i < searchResults.Count; ++i)
                {
                    int index = i % 10;

                    SearchEntry se = (SearchEntry)searchResults[i];

                    string labelstr = se.EntryType.Name;

                    if (se.Parameters.Length > 0)
                    {
                        for (int j = 0; j < se.Parameters.Length; j++)
                        {
                            labelstr += ", " + se.Parameters[j].Name;
                        }
                    }

                    AddLabel(44, 39 + (index * 20), 0x480, labelstr);
                    AddButton(10, 39 + (index * 20), 4023, 4025, 4 + i, GumpButtonType.Reply, 0);
                }
            }
            else
            {
                AddLabel(15, 44, 0x480, explicitSearch ? "Nothing matched your search terms." : "No results to display.");
            }

            AddImageTiled(10, 250, 400, 20, 2624);
            AddAlphaRegion(10, 250, 400, 20);

            if (m_Page > 0)
            {
                AddButton(10, 249, 4014, 4016, 2, GumpButtonType.Reply, 0);
            }
            else
            {
                AddImage(10, 249, 4014);
            }

            AddHtmlLocalized(44, 250, 170, 20, 1061028, m_Page > 0 ? 0x7FFF : 0x5EF7, false, false);               // Previous page

            if (((m_Page + 1) * 10) < searchResults.Count)
            {
                AddButton(210, 249, 4005, 4007, 3, GumpButtonType.Reply, 0);
            }
            else
            {
                AddImage(210, 249, 4005);
            }

            AddHtmlLocalized(244, 250, 170, 20, 1061027, ((m_Page + 1) * 10) < searchResults.Count ? 0x7FFF : 0x5EF7, false, false);               // Next page
        }
예제 #54
0
 // Methods
 static GumpItem()
 {
     GumpItem.m_LayoutName    = Gump.StringToBuffer("tilepic");
     GumpItem.m_LayoutNameHue = Gump.StringToBuffer("tilepichue");
 }
 // Methods
 static GumpAlphaRegion()
 {
     GumpAlphaRegion.m_LayoutName = Gump.StringToBuffer("checkertrans");
 }
예제 #56
0
 public override void AddText(Gump gump)
 {
     gump.AddHtmlTextRectangle(Location.X, Location.Y, Size, Bold, Italicized, Underlined, HtmlColor, DisplayText, LabelWidthInPixels, FontHandling.FONT_LINE_HEIGHT);
 }
예제 #57
0
 public abstract void OnClick(Mobile from, int page, int index, Gump gump);
예제 #58
0
        /// <summary>
        /// Honestly...I don't know why this is here.
        /// </summary>
        /// <param name="page">The gump to reference.</param>
        /// <returns>A string of the specially formatted gump entries.</returns>
        public string Compile(Gump page)
        {
            string ret = "";

            switch (m_Style)
            {
            case "details":
                if (m_Background)
                {
                    ret += String.Format("{{ gumppictiled {0} {1} {2} {3} {4} }}", m_X, m_Y, m_Width, m_Height, m_BackgroundID);
                }
                int colWidth = Width / m_ColCount;
                int i        = 0;
                int xbase    = m_X;
                while (i < columnValues.Count && i < m_ParentList.columns)
                {
                    xbase = m_X + (i * colWidth);
                    object obj = columnValues[i];
                    if (obj is string)
                    {
                        string caption = (string)obj;
                        if (caption.Contains("</"))
                        {
                            ret += String.Format("{{ htmlgump {0} {1} {2} {3} {4} {5} {6} }}", m_X + (i * colWidth), m_Y, colWidth, m_Height, page.Intern(caption), false, false);
                        }
                        else
                        {
                            ret += String.Format("{{ text {0} {1} {2} {3} }}", m_X + (i * colWidth), m_Y, skin.NormalText, page.Intern(caption));
                        }
                    }
                    else if (obj is GumpButton)
                    {
                        GumpButton btn = (GumpButton)obj;
                        ret += String.Format("{{ button {0} {1} {2} {3} {4} {5} {6} }}", xbase, m_Y, btn.NormalID, btn.PressedID, (int)btn.Type, btn.Param, btn.ButtonID);
                    }
                    else if (obj is GumpCheck)
                    {
                        GumpCheck chk = (GumpCheck)obj;
                        ret += String.Format("{{ checkbox {0} {1} {2} {3} {4} {5} }}", xbase, m_Y, chk.ActiveID, chk.InactiveID, chk.InitialState, chk.SwitchID);
                    }
                    ret += String.Format("{{gumppictiled {0} {1} {2} {3} {4} }}", m_X + (i * colWidth), m_Y, skin.EntryDividerWidth, skin.EntryDividerHeight, skin.EntryDividerID);
                    i++;
                }
                break;

            case "icons":
                string caption2 = (string)columnValues[captionID];
                if (caption2.Contains("</"))
                {
                    ret += String.Format("{{ htmlgump {0} {1} {2} {3} {4} {5} {6} }}", m_X, m_Y + skin.EntryCaptionPositionY, skin.EntryCaptionWidth, skin.EntryCaptionHeight, page.Intern(caption2), false, false);
                }
                else
                {
                    ret += String.Format("{{ text {0} {1} {2} {3} }}", m_X, m_Y + skin.EntryCaptionPositionY, skin.NormalText, page.Intern(caption2));
                }
                int id = skin.EntryDefaultIcon;
                ret += String.Format("{{ gumppictiled {0} {1} {2} {3} {4} }}", m_X, m_Y, m_Width, m_Height, m_BackgroundID);
                if (arguments.ContainsKey("icon"))
                {
                    id = (int)arguments["icon"];
                }
                ret += String.Format("{{ gumppictiled {0} {1} {2} {3} {4} }}", ((skin.EntryCaptionWidth - m_X) - skin.EntryIconWidth) / 2, m_Y + skin.EntryIconY, skin.EntryIconWidth, skin.EntryIconHeight, id);
                GumpButton btn2 = null;
                if (arguments.ContainsKey("button"))
                {
                    btn2 = (GumpButton)arguments["button"];
                    ret += String.Format("{{ buttontileart {0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} }}", m_X, m_Y, skin.EntryButtonUnderlay, skin.EntryButtonUnderlay, (int)btn2.Type, btn2.Param, btn2.ButtonID, skin.EntryButtonUnderlay, skin.DefaultBackgroundColor, skin.EntryIconWidth, skin.EntryIconHeight);
                }
                break;
            }
            if (m_Tooltip)
            {
                ret += String.Format("{{ tooltip {0} }}", TooltipID);
            }
            return(ret);
        }
예제 #59
0
        public XmlCategorizedAddGump(Mobile owner, XmlAddCAGCategory category, int page, int index, Gump gump) : base(GumpOffsetX, GumpOffsetY)
        {
            if (category == null)
            {
                category = XmlAddCAGCategory.Root;
                page     = 0;
            }

            owner.CloseGump(typeof(WhoGump));

            m_Owner    = owner;
            m_Category = category;

            m_Index = index;
            m_Gump  = gump;
            if (gump is XmlAddGump)
            {
                XmlAddGump xmladdgump = (XmlAddGump)gump;

                if (xmladdgump != null && xmladdgump.defs != null)
                {
                    xmladdgump.defs.CurrentCategory     = category;
                    xmladdgump.defs.CurrentCategoryPage = page;
                }
            }
            else
            if (gump is XmlSpawnerGump)
            {
                m_Spawner = ((XmlSpawnerGump)gump).m_Spawner;
            }

            Initialize(page);
        }
예제 #60
0
 // Methods
 static GumpTextEntry()
 {
     GumpTextEntry.m_LayoutName = Gump.StringToBuffer("textentry");
 }