本文整理汇总了C#中GamePlayer.TryTranslateOrDefault方法的典型用法代码示例。如果您正苦于以下问题:C# GamePlayer.TryTranslateOrDefault方法的具体用法?C# GamePlayer.TryTranslateOrDefault怎么用?C# GamePlayer.TryTranslateOrDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GamePlayer
的用法示例。
在下文中一共展示了GamePlayer.TryTranslateOrDefault方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTitle
public String GetTitle(GamePlayer player, int skillLevel)
{
string profession = player.TryTranslateOrDefault("!Profession!", Profession);
try
{
return player.TryTranslateOrDefault("!None {0}!", GetTitleFormat(skillLevel), profession);
}
catch
{
return "<you may want to check your Crafting.txt language file>";
}
}
示例2: GetValue
/// <summary>
/// The title value, shown over player's head.
/// </summary>
/// <param name="source">The player looking.</param>
/// <param name="player">The title owner.</param>
/// <returns>The title value.</returns>
public override string GetValue(GamePlayer source, GamePlayer player)
{
if (player.Champion && player.ChampionLevel > 0)
return source.TryTranslateOrDefault(string.Format("!CL Title {0}!", player.ChampionLevel), string.Format("Titles.CL.Level{0}", player.ChampionLevel));
return string.Empty;
}
示例3: GetValue
/// <summary>
/// The title value, shown over player's head.
/// </summary>
/// <param name="source">The player looking.</param>
/// <param name="player">The title owner.</param>
/// <returns>The title value.</returns>
public override string GetValue(GamePlayer source, GamePlayer player)
{
if (player.CraftingPrimarySkill == eCraftingSkill.NoCrafting || !player.CraftingSkills.ContainsKey(player.CraftingPrimarySkill))
return string.Format(source.TryTranslateOrDefault("!BasicCrafting!", "Crafting.Name.BasicCrafting"));
var craftingSkill = CraftingMgr.getSkillbyEnum(player.CraftingPrimarySkill);
var profession = craftingSkill as AbstractProfession;
if (profession == null)
return craftingSkill.Name;
return profession.GetTitle(source, player.CraftingSkills[player.CraftingPrimarySkill]);
}
示例4: GetValue
/// <summary>
/// The title value, shown over player's head.
/// </summary>
/// <param name="source">The player looking.</param>
/// <param name="player">The title owner.</param>
/// <returns>The title value.</returns>
public override string GetValue(GamePlayer source, GamePlayer player)
{
if (player.MLGranted && player.MLLevel > 0)
{
// try get player ML Number
int mlline = GetPlayerMLLine(player);
return source.TryTranslateOrDefault(string.Format("!ML Title {0}!", mlline), string.Format("Titles.ML.Line{0}", mlline));
}
return source.TryTranslateOrDefault("!None!", "DetailDisplayHandler.HandlePacket.None");
}
示例5: GetTitle
public virtual string GetTitle(GamePlayer player, int level)
{
// Clamp level in 5 by 5 steps - 50 is the max available translation for now
int clamplevel = Math.Min(50, (level / 5) * 5);
string none = player.TryTranslateOrDefault("!None!", "PlayerClass.GetTitle.none");
if (clamplevel > 0)
return player.TryTranslateOrDefault(string.Format("!{0}!", m_name), string.Format("PlayerClass.{0}.GetTitle.{1}", m_name, clamplevel));
return none;
}
示例6: GetValue
/// <summary>
/// The title value, shown over player's head.
/// </summary>
/// <param name="source">The player looking.</param>
/// <param name="player">The title owner.</param>
/// <returns>The title value.</returns>
public override string GetValue(GamePlayer source, GamePlayer player)
{
return source.TryTranslateOrDefault("!Level {0}!", "Titles.Level.Level20", player.Level);
}
示例7: GetDescription
/// <summary>
/// The title description, shown in "Titles" window.
/// </summary>
/// <param name="player">The title owner.</param>
/// <returns>The title description.</returns>
public override string GetDescription(GamePlayer player)
{
return player.TryTranslateOrDefault("!Level 20+!", "Titles.Level.Level20Info");
}
示例8: TryTranslate
protected static string TryTranslate(string value, GamePlayer source)
{
return source.TryTranslateOrDefault(string.Format("!{0}!", value), value);
}