From 2636bf475c8b4b03ee869a5db2f5fdd891ed9f97 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 04 十二月 2025 09:19:35 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/System/Chat/ChatPlayerOtherCell.cs |  105 ++++++++++++++++++++--------------------------------
 1 files changed, 40 insertions(+), 65 deletions(-)

diff --git a/Main/System/Chat/ChatPlayerOtherCell.cs b/Main/System/Chat/ChatPlayerOtherCell.cs
index 51d6da2..318c586 100644
--- a/Main/System/Chat/ChatPlayerOtherCell.cs
+++ b/Main/System/Chat/ChatPlayerOtherCell.cs
@@ -1,81 +1,56 @@
 锘縰sing System.Collections;
 using UnityEngine;
 using UnityEngine.UI;
-using EnhancedUI.EnhancedScroller;
 
-    public class ChatPlayerOtherCell : ScrollerUI
+public class ChatPlayerOtherCell : MonoBehaviour
+{
+    [SerializeField] AvatarCell avatarCell;
+    [SerializeField] RectTransform m_avatarRect;
+    [SerializeField] OfficialTitleCell title;
+    [SerializeField] Text m_PlayerName;
+    [SerializeField] ChatBubbleBehaviour m_ChatBubble;
+    [SerializeField] float spacing = 5.0f;
+    ChatManager manager { get { return ChatManager.Instance; } }
+    public void Refresh(CellView cell)
     {
-        // [SerializeField] AvatarCell avatarCell;
-        [SerializeField] RectTransform m_avatarRect;
-        [SerializeField] Text m_VipLv;
-        [SerializeField] Text m_PlayerName;
-        [SerializeField] Text m_ChatTime;
-        [SerializeField] ChatBubbleBehaviour m_ChatBubble;
-        [SerializeField] float spacing = 5.0f;
-
-        // PhantasmPavilionModel phantasmPavilionModel { get { return ModelCenter.Instance.GetModel<PhantasmPavilionModel>(); } }
-        public override void Refresh(CellView cell)
+        if (!manager.TryGetChatData(ChatManager.Instance.nowChatChannel, cell.index, out TalkData data))
+            return;
+        avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)data.PlayerID, (int)data.Face, (int)data.PlayerID, data.Job));
+        avatarCell.button.SetListener(() =>
         {
-            var data = ChatCenter.Instance.GetChatData(ChatManager.Instance.presentChatType, cell.index);
-            if (data == null)
-            {
-                return;
-            }
-            var chatUserData = data as ChatUeseData;
+
+        });
+        title.InitUI(data.RealmLV, (int)data.TitleID);
 
 
-            // AvatarModel avatarModel = AvatarHelper.GetOtherAvatarModel(chatUserData.face, chatUserData.facePic, chatUserData.job);
-            // avatarCell.InitUI(avatarModel);
-            // avatarCell.button.SetListener(() =>
-            // {
-            //     OnFunc(cell);
-            // });
 
-            m_PlayerName.text = chatUserData.name;
-            m_ChatTime.text = data.createTime.ToString("yyyy-MM-dd HH:mm");
-            if (chatUserData.vipLv > 0)
-            {
-                m_VipLv.text = "VIP";//string.Format("V{0}", chatUserData.vipLv);
-            }
-            else
-            {
-                m_VipLv.text = string.Empty;
-            }
-            m_ChatBubble.DisplayContent(data.content, true);
-            // int bubbleID = phantasmPavilionModel.GetNowOtherChatBubbleID(chatUserData.bubbleId);
-            // m_ChatBubble.DisplayBubble(bubbleID);
+        m_ChatBubble.DisplayContent(data.Content, true);
+
+        int bubbleID = ChatBubbleHelper.GetOtherChatBubbleID(data.Job, (int)data.BubbleBox);
+        m_ChatBubble.DisplayBubble(bubbleID, (int)data.PlayerID);
+
+        if (manager.nowChatTab == ChatTab.World)
+        {
+            string serverName = ServerListCenter.Instance.GetServerName((int)data.ServerID);
+            m_PlayerName.text = Language.Get("Chat08", serverName, data.Name);
         }
-
-        private void OnFunc(CellView cell)
+        else
         {
-            int index = cell.index;
-            ChatData _data = ChatCenter.Instance.GetChatData(ChatManager.Instance.presentChatType, index);
-            if (_data == null)
+            FairyMember fairyMember = PlayerDatas.Instance.fairyData.GetMember((int)data.PlayerID);
+            int fmlv = 0;
+            if (fairyMember != null)
             {
-                return;
+                fmlv = fairyMember.FmLV;
             }
-            ChatUeseData user = _data as ChatUeseData;
-            if (user.player == PlayerDatas.Instance.baseData.PlayerID)
-            {
-                return;
-            }
-            if (user.serverGroupId == 0 || user.serverGroupId == PlayerDatas.Instance.baseData.ServerGroupId)
-            {
-                // TODO YYL
-                // PlayerDetails.ShowPlayerDetails(user.player, null);
-            }
-            else
-            {
-                // TODO YYL
-                // PlayerDetails.ShowCrossServerChatPlayer(user);
-            }
-        }
-
-        public float GetHeight(string content, ArrayList list)
-        {
-            var minHeight = m_avatarRect.sizeDelta.y;
-            var chatHeight = m_ChatBubble.GetBubbleHeight(content, list) + Mathf.Abs(m_ChatBubble.transform.localPosition.y);
-            return (chatHeight > minHeight ? chatHeight : minHeight) + spacing;
+            m_PlayerName.text = Language.Get("Chat08", RichTextMsgReplaceConfig.GetRichReplace("FAMILY", fmlv), data.Name);
         }
     }
 
+    public float GetHeight(string content, ArrayList list)
+    {
+        var minHeight = m_avatarRect.sizeDelta.y;
+        var chatHeight = m_ChatBubble.GetBubbleHeight(content, list) + Mathf.Abs(m_ChatBubble.transform.localPosition.y);
+        return (chatHeight > minHeight ? chatHeight : minHeight) + spacing;
+    }
+}
+

--
Gitblit v1.8.0