当前位置: 首页>>代码示例>>C#>>正文


C# Gump.AddButton方法代码示例

本文整理汇总了C#中Server.Gumps.Gump.AddButton方法的典型用法代码示例。如果您正苦于以下问题:C# Gump.AddButton方法的具体用法?C# Gump.AddButton怎么用?C# Gump.AddButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Gumps.Gump的用法示例。


在下文中一共展示了Gump.AddButton方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1:

        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);
            */
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:28,代码来源:OffsetableBookGump.cs

示例2: AppendToGump

 public void AppendToGump(Gump g, int x, int y)
 {
     g.AddLabel(x, y, 1150, Name);
     g.AddButton(x - 18, y + 5, 5032, 2361, ItemID, GumpButtonType.Reply, 0);
 }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:5,代码来源:YardRegistry.cs

示例3: AddLabelledButton

        public static void AddLabelledButton( Gump gump, KeyValuePair<string, int> kvp, int index )
        {
            if( kvp.Key == null )
                return;

            gump.AddButton( gump.X, gump.Y, 1209, 1210, index, GumpButtonType.Reply, 0 );
            gump.AddLabel( gump.X + 18, gump.Y - 1, 0, kvp.Key );
            gump.Y += 23;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:9,代码来源:NPCCustomizationGump.cs

示例4: Gump

		public override void Gump( Mobile from, Gump gump, object[] subParams )
		{
			gump.AddButton( 190, 40, 2445, 2445, 101, GumpButtonType.Reply, 0 );
			gump.AddLabel(  204, 42, 1153, "List Mobiles" );
			gump.AddButton( 310, 40, 2445, 2445, 102, GumpButtonType.Reply, 0 );
			gump.AddLabel(  331, 42, 1153, "List Items" );
			gump.AddButton( 430, 40, 2445, 2445, 103, GumpButtonType.Reply, 0 );
			gump.AddLabel(  450, 42, 1153, "List Types" );
//			gump.AddButton( 190, 70, 2445, 2445, 104, GumpButtonType.Reply, 0 );
//			gump.AddLabel(  208, 72, 1153, "Add Module" );
//			gump.AddButton( 310, 70, 2445, 2445, 105, GumpButtonType.Reply, 0 );
//			gump.AddLabel(  326, 72, 1153, "Edit Module" );
//			gump.AddButton( 430, 70, 2445, 2445, 106, GumpButtonType.Reply, 0 );
//			gump.AddLabel(  439, 72, 1153, "Delete Module" );

			if( subParams == null )
			{
				gump.AddHtml( 215, 15, 300,  25, "<basefont size=7 color=white><center>Central Memory</center></font>", false, false );
				gump.AddHtml( 140, 95, 450, 250, "<basefont color=white><center>Welcome to the Central Memory Admin Gump!</center><br>With this gump, you can see a list of all entries that the CM contains.  You can add new Modules or modify or delete existing Modules.<br><br>Make your selection from the top buttons, either List Mobiles or Items.  This will bring up a list of all Mobiles or Items that the CM is keeping track of.<br><br>You may then select one of the entries to list the Modules that are stored to that entry.  You can then add, modify or remove modules to that entry.</font>", false, false );
				return;
			}

			Params = subParams;

			if( subParams[0] is int && (int)subParams[0] == -2 )
			{//Mobiles
				gump.AddLabel( 120, 95, 1153, "Listing all Mobiles:" );

				e_List = GetMobiles();
				if( e_List == null || e_List.Count == 0 )
					return;

				int p = 0;
				if( subParams.Length == 2 && subParams[1] is int )
					p = (int)subParams[1];

				if( p < 0 )
					p = 0;


				if( p > 0 )
					gump.AddButton( 120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0 );
				if( (p+1)*21 <= e_List.Count )
					gump.AddButton( 540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0 );

				for( int i = p*21, r = 0, c = 0; i < e_List.Count; i++ )
				{
					Mobile m = (Mobile)e_List[i];
					if( m == null )
						continue;
					gump.AddButton( 120+c*155, 125+r*30, 2501, 2501, 1000+i, GumpButtonType.Reply, 0 );
					gump.AddLabel(  130+c*155, 126+r*30, 1153, (m.Name==null?m.Serial.ToString():m.Name) );
				}
			}

			else if( subParams[0] is int && (int)subParams[0] == -3 )
			{//Items
				gump.AddLabel( 120, 95, 1153, "Listing all Items:" );

				e_List = GetItems();
				if( e_List == null || e_List.Count == 0 )
					return;

				int p = 0;
				if( subParams.Length == 2 && subParams[1] is int )
					p = (int)subParams[1];

				if( p < 0 )
					p = 0;

				if( p > 0 )
					gump.AddButton( 120, 332, 4014, 4015, 104, GumpButtonType.Reply, 0 );
				if( (p+1)*21 <= e_List.Count )
					gump.AddButton( 540, 332, 4005, 4006, 105, GumpButtonType.Reply, 0 );

				for( int i = p*21, r = 0, c = 0; i < e_List.Count; i++ )
				{
					Item m = (Item)e_List[i];
					if( m == null )
						continue;
					gump.AddButton( 120+c*155, 125+r*30, 2501, 2501, 1000+i, GumpButtonType.Reply, 0 );
					gump.AddLabel(  130+c*155, 126+r*30, 1153, (m.Name==null?m.Serial.ToString():m.Name) );
				}
			}

			else if( subParams[0] is Serial )
			{//List the Modules for that serial
				Serial s = (Serial)subParams[0];
				if( !m_Modules.Contains( s ) )
				{
					gump.AddLabel( 120, 95, 1153, "This entity no longer exists in the Central Memory!" );
					return;
				}

				ModuleList ml = (ModuleList)m_Modules[s];
				if( ml == null || ml.Count == 0 )
				{
					gump.AddLabel( 120, 95, 1153, "This entity has no Modules!" );
					Remove( s );
					return;
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:101,代码来源:CentralMemory.cs

示例5: Gump

        public override void Gump(Mobile from, Gump gump, ACCGumpParams subParams)
        {
            gump.AddButton(195, 40, 2445, 2445, 101, GumpButtonType.Reply, 0);
            gump.AddLabel(200, 41, 1153, "Manage System");
            gump.AddButton(310, 40, 2445, 2445, 102, GumpButtonType.Reply, 0);
            gump.AddLabel(342, 41, 1153, "Import");

            if (subParams == null || !(subParams is PGGumpParams))
            {
                gump.AddHtml(215, 65, 300, 25, "<basefont size=7 color=white><center>Public Gates</center></font>", false, false);
                gump.AddHtml(140, 95, 450, 250, "<basefont color=white><center>Welcome to the Public Gate Admin Gump!</center><br>With this gump, you can manage the entire system and import and export locations or full categories.  Please choose an option from the top bar.<br><br>Manage System allows you to add/change/delete locations and categories from anywhere in the world.<br><br>Im/Ex port allows you to import or export categories and locations to files that you can distribute to other servers that use this system.</font>", false, false);
                return;
            }

            Params = subParams as PGGumpParams;

            switch ((int)Params.Page)
            {
                #region Manage Gump Code
                case (int)Pages.Manage:
                    {
                        gump.AddBackground(640, 0, 160, 400, 5120);
                        gump.AddButton(425, 40, 2445, 2445, 123, GumpButtonType.Reply, 0);
                        gump.AddLabel(456, 41, 1153, "Export");

                        for (int i = 0; i < m_CategoryList.Count && i < 50; i++)
                        {
                            PGCategory PGC = m_CategoryList[i];
                            if (PGC != null)
                            {
                                gump.AddButton(650, 10 + i * 30, 2501, 2501, 150 + i, GumpButtonType.Reply, 0);
                                gump.AddButton(655, 12 + i * 30, (Params.SelectedCategory.Key == PGC ? 5401 : 5402), (Params.SelectedCategory.Key == PGC ? 5402 : 5401), 150 + i, GumpButtonType.Reply, 0);
                                gump.AddLabel(675, 10 + i * 30, 1153, PGC.Name);
                            }
                        }

                        if (Params.SelectedCategory.Key != null)
                        {
                            gump.AddBackground(425, 75, 170, 285, 5120);
                            gump.AddButton(195, 65, 2445, 2445, 121, GumpButtonType.Reply, 0);
                            gump.AddLabel(206, 66, 1153, "Add Category");
                            gump.AddButton(310, 65, 2445, 2445, 122, GumpButtonType.Reply, 0);
                            gump.AddLabel(322, 66, 1153, "Add Location");

                            for (int i = 0, c = 0, r = 0; i < Params.SelectedCategory.Key.Locations.Count; i++)
                            {
                                PGLocation PGL = Params.SelectedCategory.Key.Locations[i];
                                if (PGL != null)
                                {
                                    gump.AddButton(120 + c * 150, 100 + r * 30, 2501, 2501, 200 + i, GumpButtonType.Reply, 0);
                                    gump.AddButton(125 + c * 150, 102 + r * 30, (Params.SelectedLocation.Key == PGL ? 5401 : 5402), (Params.SelectedLocation.Key == PGL ? 5402 : 5401), 200 + i, GumpButtonType.Reply, 0);
                                    gump.AddLabel(145 + c * 150, 100 + r * 30, 1153, PGL.Name);
                                    r += (c == 1 ? 1 : 0);
                                    c += (c == 1 ? -1 : 1);
                                }
                            }

                            if (Params.SelectedLocation.Key != null)
                            {
                                gump.AddButton(550, 265, 2642, 2643, 103, GumpButtonType.Reply, 0); //Apply Location

                                gump.AddImage(440, 85, 2501);
                                gump.AddTextEntry(446, 85, 130, 20, 0, 105, Params.SelectedLocation.Key.Name);

                                gump.AddImage(445, 110, 2443);
                                gump.AddImage(513, 110, 2443);
                                gump.AddImage(445, 135, 2443);
                                gump.AddImage(513, 135, 2443);
                                gump.AddImage(445, 160, 2443);

                                gump.AddTextEntry(450, 110, 53, 20, 0, 106, Params.SelectedLocation.Key.Location.X.ToString());
                                gump.AddTextEntry(518, 110, 53, 20, 0, 107, Params.SelectedLocation.Key.Location.Y.ToString());
                                gump.AddTextEntry(450, 135, 53, 20, 0, 108, Params.SelectedLocation.Key.Location.Z.ToString());
                                gump.AddTextEntry(518, 135, 53, 20, 0, 109, Params.SelectedLocation.Key.Hue.ToString());
                                gump.AddTextEntry(450, 160, 53, 20, 0, 110, Params.SelectedLocation.Key.Cost.ToString());

                                gump.AddLabel(435, 112, 1153, "X");
                                gump.AddLabel(578, 112, 1153, "Y");
                                gump.AddLabel(435, 137, 1153, "Z");
                                gump.AddLabel(578, 137, 1153, "H");
                                gump.AddLabel(435, 162, 1153, "C");

                                gump.AddRadio(435, 190, 208, 209, (Params.SelectedLocation.Key.Map == Map.Trammel), 111);
                                gump.AddRadio(570, 190, 208, 209, (Params.SelectedLocation.Key.Map == Map.Malas), 112);
                                gump.AddRadio(435, 215, 208, 209, (Params.SelectedLocation.Key.Map == Map.Felucca), 113);
                                gump.AddRadio(570, 215, 208, 209, (Params.SelectedLocation.Key.Map == Map.Ilshenar), 114);
                                gump.AddRadio(435, 240, 208, 209, (Params.SelectedLocation.Key.Map == Map.Tokuno), 115);

                                gump.AddLabel(460, 192, 1153, "Tram");
                                gump.AddLabel(530, 192, 1153, "Malas");
                                gump.AddLabel(460, 217, 1153, "Fel");
                                gump.AddLabel(542, 217, 1153, "Ilsh");
                                gump.AddLabel(460, 242, 1153, "Tokuno");

                                gump.AddLabel(465, 282, 1153, "Young?");
                                gump.AddCheck(440, 280, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.Young), 120);
                                gump.AddLabel(465, 307, 1153, "Gen?");
                                gump.AddCheck(440, 305, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.Generate), 116);
                                gump.AddLabel(515, 307, 1153, "Staff?");
                                gump.AddCheck(565, 305, 210, 211, Params.SelectedLocation.Key.GetFlag(EntryFlag.StaffOnly), 117);
//.........这里部分代码省略.........
开发者ID:FreeReign,项目名称:realmofdarkness,代码行数:101,代码来源:PGSystem.cs


注:本文中的Server.Gumps.Gump.AddButton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。