本文整理汇总了C#中Server.Item.LabelTo方法的典型用法代码示例。如果您正苦于以下问题:C# Item.LabelTo方法的具体用法?C# Item.LabelTo怎么用?C# Item.LabelTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Item
的用法示例。
在下文中一共展示了Item.LabelTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LabelTo
public static void LabelTo( Item i, Mobile to, bool ascii, string label )
{
if ( ascii )
to.Send( new AsciiMessage( i.Serial, i.ItemID, MessageType.Label, 0x3B2, 3, "", label ) );
else
i.LabelTo( to, label );
}
示例2: OnSingleClickContained
public override void OnSingleClickContained( Mobile from, Item item )
{
if ( RootParent is PlayerVendor )
{
PlayerVendor vendor = (PlayerVendor)RootParent;
VendorItem vi = vendor.GetVendorItem( item );
if ( vi != null )
{
if ( !vi.IsForSale )
item.LabelTo( from, 1043307 ); // Price: Not for sale.
else if ( vi.IsForFree )
item.LabelTo( from, 1043306 ); // Price: FREE!
else
item.LabelTo( from, 1043304, vi.Price.ToString() ); // Price: ~1_COST~
if ( vi.Description != null && vi.Description != "" )
{
// The localized message (1043305) is no longer valid - <br>Seller's Description:<br>"~1_DESC~"
item.LabelTo( from, "Description: {0}", vi.Description );
}
}
}
base.OnSingleClickContained( from, item );
}
示例3: OnSingleClickContained
public override void OnSingleClickContained(Mobile from, Item item)
{
if (RootParent is PlayerVendor)
{
PlayerVendor vend = (PlayerVendor)RootParent;
VendorItem vi = (VendorItem)vend.SellItems[item];
//Pix: 9/24/04 - changed the following to NOT use the localized string
// so that we don't get the <B>...</B> tags with some client versions.
// erl: 03/22/04 - changed to use line buffer and cleared up excess
// commented code
if (vi != null)
{
ArrayList LineBuffer = new ArrayList();
if (vi.IsForSale)
LineBuffer.Add(string.Format("Price: {0}", vi.Price.ToString()));
else
LineBuffer.Add(string.Format("Price: Not for Sale"));
if (vi.Description != null && vi.Description != "")
LineBuffer.Add(string.Format("Seller's Description: \"{0}\"", vi.Description));
foreach (string line in LineBuffer)
item.LabelTo(from, line);
}
}
base.OnSingleClickContained(from, item);
}