예제 #1
0
    public string FormatPrivateAddCharHead(string channelHead, string extentedString, string srcText, string voicefileid = "")
    {
        //  Log.LogGroup("ZDY", "enter :FormatPrivateAddCharHead");
        if (srcText.FirstOrDefault() == '<')
        {
            return(RichXmlHelper.RemoveP(RichXmlHelper.RichXmlAdapt(srcText)));
        }

        //Log.LogGroup("ZDY", "普通文本转换成富文本:" + srcText + " " + srcText.Length);
        // 普通文本转换成富文本
        var color = string.Format("#{0:X8}", (uint)ConstDefine.GetChatColor(GameCmd.CHATTYPE.CHAT_PRIVATE));

        string xtext = new XText(srcText).ToString();

        return(RichXmlHelper.RichXmlAdapt(string.Format("<color value=\"{0}\">{1}{2}:{3}</color>",
                                                        color,
                                                        channelHead,
                                                        extentedString,
                                                        xtext))); // xml escape
    }
예제 #2
0
    public string FormatAddCharHead(string channelHead, string extentedString, string srcText)
    {
        if (srcText.FirstOrDefault() == '<')
        {
            return(RichXmlHelper.RemoveP(RichXmlHelper.RichXmlAdapt(srcText)));
        }
        // 普通文本转换成富文本
        var color = string.Format("#{0:X8}", (uint)ConstDefine.GetChatColor(ChannelType));

        // Debug.Log("FormatAddCharHead:" + srcText + " " + srcText.Length);

        string xtext = new XText(srcText).ToString();

        //Debug.Log("FormatAddCharHeadxtext:" + xtext);

        return(RichXmlHelper.RichXmlAdapt(string.Format("<color value=\"{0}\">{1}{2}:{3}</color>",
                                                        color,
                                                        channelHead,
                                                        extentedString,
                                                        xtext))); // xml escape
    }