yyl
2025-06-09 b9751b2f076ee050fe5b685e91ae4fc4469b1015
Main/System/Chat/ChatFriendCell.cs
@@ -2,47 +2,43 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using vnxbqy.UI;
namespace EnhancedUI.EnhancedScroller
{
    // public class ChatFriendCell : ScrollerUI
    // {
    //     [SerializeField] RichText m_ChatText;
    //     [SerializeField] Text m_VipText;
    //     [SerializeField] Text m_NameText;
    //     [SerializeField] AvatarCell m_ChatIcon;
    //     [SerializeField] ImageFitterText m_ImageFitter;
    //     public override void Refresh(CellView cell)
    //     {
    //         var _index = cell.index;
    //         int _playerId = ChatCtrl.Inst.PteChatID;
    //         var _list = ChatCtrl.Inst.GetChatInfo(_playerId);
    //         if (_list != null && _index < _list.Count)
    //         {
    //             ChatFriendData chat = _list[_index];
    //             m_ChatText.text = chat.content;
    //             if (type == ScrollerDataType.Header)
    //             {
    //                 m_ChatText.AutoNewLine = false;
    //                 if (m_ChatText.preferredWidth > m_ChatText.rectTransform.rect.width)
    //                 {
    //                     m_ChatText.alignment = TextAnchor.UpperLeft;
    //                 }
    //                 else
    //                 {
    //                     m_ChatText.alignment = TextAnchor.UpperRight;
    //                 }
    //                 m_ChatText.AutoNewLine = true;
    //             }
    //             m_ImageFitter.FiterRealTxtWidth = m_ChatText.alignment == TextAnchor.UpperRight;
    //             m_VipText.text = chat.vipLv > 0 ? StringUtility.Contact("V", chat.vipLv) : string.Empty;
    //             m_NameText.text = chat.name;
    //             m_ChatIcon.InitUI(AvatarHelper.GetAvatarModel(chat.player, chat.face, chat.facePic, chat.job));
    //             m_ChatText.text = chat.content;
    //         }
    //     }
    // }
}
//public class ChatFriendCell : ScrollerUI
//{
//    [SerializeField] RichText m_ChatText;
//    [SerializeField] Text m_VipText;
//    [SerializeField] Text m_NameText;
//    [SerializeField] AvatarCell m_ChatIcon;
//    [SerializeField] ImageFitterText m_ImageFitter;
//    public override void Refresh(CellView cell)
//    {
//        var _index = cell.index;
//        int _playerId = ChatCtrl.Inst.PteChatID;
//        var _list = ChatCtrl.Inst.GetChatInfo(_playerId);
//        if (_list != null && _index < _list.Count)
//        {
//            ChatFriendData chat = _list[_index];
//            m_ChatText.text = chat.content;
//            if (type == ScrollerDataType.Header)
//            {
//                m_ChatText.AutoNewLine = false;
//                if (m_ChatText.preferredWidth > m_ChatText.rectTransform.rect.width)
//                {
//                    m_ChatText.alignment = TextAnchor.UpperLeft;
//                }
//                else
//                {
//                    m_ChatText.alignment = TextAnchor.UpperRight;
//                }
//                m_ChatText.AutoNewLine = true;
//            }
//            m_ImageFitter.FiterRealTxtWidth = m_ChatText.alignment == TextAnchor.UpperRight;
//            m_VipText.text = chat.vipLv > 0 ? StringUtility.Contact("V", chat.vipLv) : string.Empty;
//            m_NameText.text = chat.name;
//            m_ChatIcon.InitUI(AvatarHelper.GetAvatarModel(chat.player, chat.face, chat.facePic, chat.job));
//            m_ChatText.text = chat.content;
//        }
//    }
//}