You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
771 B
C#

using FairyGUI;
using FairyGUI.Utils;
public class EmojiParser : UBBParser
{
static EmojiParser _instance;
public new static EmojiParser inst
{
get
{
if (_instance == null)
_instance = new EmojiParser();
return _instance;
}
}
private static string[] TAGS = new string[]
{ "88","am","bs","bz","ch","cool","dhq","dn","fd","gz","han","hx","hxiao","hxiu" };
public EmojiParser ()
{
foreach (string ss in TAGS)
{
this.handlers[":"+ss] = OnTag_Emoji;
}
}
string OnTag_Emoji(string tagName, bool end, string attr)
{
return "<img src='" + UIPackage.GetItemURL("Emoji", tagName.Substring(1).ToLower()) + "'/>";
}
}