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


C# Spawner.CountSpawns方法代码示例

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


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

示例1: SpawnerGump

		public SpawnerGump( Spawner spawner, SpawnerEntry focusentry, int page ) : base( 50, 50 )
		{
			m_Spawner = spawner;
			m_Entry = focusentry;
			m_Page = page;

			AddPage( 0 );

			AddBackground( 0, 0, 343, 371 + ( m_Entry != null ? 44 : 0 ), 5054 );

			AddHtml( 95, 1, 250, 20, "<BASEFONT COLOR=#F4F4F4>Creatures List</BASEFONT>", false, false );
			AddHtml( 245, 1, 250, 20, "<BASEFONT COLOR=#F4F4F4>#</BASEFONT>", false, false );
			AddHtml( 282, 1, 250, 20, "<BASEFONT COLOR=#F4F4F4>Prb</BASEFONT>", false, false );

			//AddLabel( 95, 1, 0, "Creatures List" );

			int offset = 0;

			for ( int i = 0; i < 13; i++ )
			{
				int textindex = i * 5;
				int entryindex = ( m_Page * 13 ) + i;

				SpawnerEntry entry = null;

				if ( entryindex < spawner.Entries.Count )
					entry = m_Spawner.Entries[entryindex];

				if ( entry == null || m_Entry != entry )
					AddButton( 5, ( 22 * i ) + 21 + offset, entry != null ? 0xFBA : 0xFA5, entry != null ? 0xFBC : 0xFA7, GetButtonID( 2, (i * 2) ), GumpButtonType.Reply, 0 ); //Expand
				else
					AddButton( 5, ( 22 * i ) + 21 + offset, entry != null ? 0xFBB : 0xFA5, entry != null ? 0xFBC : 0xFA7, GetButtonID( 2, (i * 2) ), GumpButtonType.Reply, 0 ); //Unexpand

				AddButton( 38, ( 22 * i ) + 21 + offset, 0xFA2, 0xFA4, GetButtonID( 2, 1 + (i * 2) ), GumpButtonType.Reply, 0 ); //Delete

				AddImageTiled( 71, (22 * i) + 20 + offset, 161, 23, 0xA40 ); //creature text box
				AddImageTiled( 72, (22 * i) + 21 + offset, 159, 21, 0xBBC ); //creature text box

				AddImageTiled( 235, (22 * i) + 20 + offset, 35, 23, 0xA40 ); //maxcount text box
				AddImageTiled( 236, (22 * i) + 21 + offset, 33, 21, 0xBBC ); //maxcount text box

				AddImageTiled( 273, (22 * i) + 20 + offset, 35, 23, 0xA40 ); //probability text box
				AddImageTiled( 274, (22 * i) + 21 + offset, 33, 21, 0xBBC ); //probability text box

				string name = "";
				string probability = "";
				string maxcount = "";
				EntryFlags flags = EntryFlags.None;

				if ( entry != null )
				{
					name = (string)entry.SpawnedName;
					probability = entry.SpawnedProbability.ToString();
					maxcount = entry.SpawnedMaxCount.ToString();
					flags = entry.Valid;

					AddLabel( 315, (22 * i) + 20 + offset, 0, spawner.CountSpawns( entry ).ToString() );
				}

				AddTextEntry( 75, (22 * i) + 21 + offset, 156, 21, ( ( flags & EntryFlags.InvalidType ) != 0 ) ? 33 : 0, textindex, name ); //creature
				AddTextEntry( 239, (22 * i) + 21 + offset, 30, 21, 0, textindex + 1, maxcount); //max count
				AddTextEntry( 277, (22 * i) + 21 + offset, 30, 21, 0, textindex + 2, probability); //probability

				if ( entry != null && m_Entry == entry )
				{
					AddLabel( 5, (22 * i) + 42, 0x384, "Params" );
					AddImageTiled( 55, (22 * i) + 42, 253, 23, 0xA40 ); //Parameters
					AddImageTiled( 56, (22 * i) + 43, 251, 21, 0xBBC ); //Parameters

					AddLabel( 5, (22 * i) + 64, 0x384, "Props" );
					AddImageTiled( 55, (22 * i) + 64, 253, 23, 0xA40 ); //Properties
					AddImageTiled( 56, (22 * i) + 65, 251, 21, 0xBBC ); //Properties

					AddTextEntry( 59, (22 * i) + 42, 248, 21, ( ( flags & EntryFlags.InvalidParams ) != 0 ) ? 33 : 0, textindex + 3, entry.Parameters ); //parameters
					AddTextEntry( 59, (22 * i) + 62, 248, 21, ( ( flags & EntryFlags.InvalidProps ) != 0 ) ? 33 : 0, textindex + 4, entry.Properties ); //properties

					offset += 44;
				}
			}

			AddButton( 5, 347 + offset, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0 );
			AddLabel( 38, 347 + offset, 0x384, "Cancel" );

			AddButton( 5, 325 + offset, 0xFB7, 0xFB9, GetButtonID( 1, 2 ), GumpButtonType.Reply, 0 );
			AddLabel( 38, 325 + offset, 0x384, "Okay" );

			AddButton( 110, 325 + offset, 0xFB4, 0xFB6, GetButtonID( 1, 3 ), GumpButtonType.Reply, 0 );
			AddLabel( 143, 325 + offset, 0x384, "Bring to Home" );

			AddButton( 110, 347 + offset, 0xFA8, 0xFAA, GetButtonID( 1, 4 ), GumpButtonType.Reply, 0 );
			AddLabel( 143, 347 + offset, 0x384, "Total Respawn" );

			AddButton( 253, 325 + offset, 0xFB7, 0xFB9, GetButtonID( 1, 5 ), GumpButtonType.Reply, 0 );
			AddLabel( 286, 325 + offset, 0x384, "Apply" );

			if ( m_Page > 0 )
				AddButton( 276, 308 + offset, 0x15E3, 0x15E7, GetButtonID( 1, 0 ), GumpButtonType.Reply, 0 );
			else
				AddImage( 276, 308 + offset, 0x25EA );

//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:101,代码来源:SpawnerGump.cs


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