From cd5c1d2c732e41082b0228deadf52df91c50ffbe Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 23 九月 2024 14:06:12 +0800
Subject: [PATCH] 10261 【越南】【砍树】【英文】仙盟徽章,头像框,头像(动态),聊天气泡,聊天表情-表情在聊天界面上的显示大小由(richtext的)FaceSize决定,当配置0取图片原大小

---
 Core/GameEngine/Model/Config/FaceConfig.cs     |   10 ++++++++--
 System/Role/TitleStarUpWin.cs                  |    2 +-
 System/Chat/UIFrame.cs                         |    2 +-
 System/CelestialPalace/CelestialPalaceModel.cs |    2 +-
 UI/HUD/HeadUpName.cs                           |    2 +-
 System/Role/RoleTitleCell.cs                   |    2 +-
 System/Role/WorshipInfoListWin.cs              |    2 +-
 System/Message/ImgAnalysis.cs                  |   21 +++++++++++++++++++--
 System/Chat/UIFrameMgr.cs                      |    6 +++---
 9 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/Core/GameEngine/Model/Config/FaceConfig.cs b/Core/GameEngine/Model/Config/FaceConfig.cs
index 3484a4a..dd004f3 100644
--- a/Core/GameEngine/Model/Config/FaceConfig.cs
+++ b/Core/GameEngine/Model/Config/FaceConfig.cs
@@ -1,6 +1,6 @@
 锘�//--------------------------------------------------------
 //    [Author]:           Fish
-//    [  Date ]:           2024骞�5鏈�17鏃�
+//    [  Date ]:           2024骞�9鏈�22鏃�
 //--------------------------------------------------------
 
 using System.Collections.Generic;
@@ -16,6 +16,8 @@
     public readonly string name;
 	public readonly int frameCnt;
 	public readonly int speed;
+	public readonly int frameType;
+	public readonly int EmojiPackID;
 	public readonly string folder;
 
 	public FaceConfig()
@@ -34,7 +36,11 @@
 
 			int.TryParse(tables[2],out speed); 
 
-			folder = tables[3];
+			int.TryParse(tables[3],out frameType); 
+
+			int.TryParse(tables[4],out EmojiPackID); 
+
+			folder = tables[5];
         }
         catch (Exception ex)
         {
diff --git a/System/CelestialPalace/CelestialPalaceModel.cs b/System/CelestialPalace/CelestialPalaceModel.cs
index b25259c..c1d6288 100644
--- a/System/CelestialPalace/CelestialPalaceModel.cs
+++ b/System/CelestialPalace/CelestialPalaceModel.cs
@@ -708,7 +708,7 @@
         {
             DienstgradConfig config = DienstgradConfig.Get(titleId);
             UIFrame frame = imgTitle.GetComponent<UIFrame>();
-            if (UIFrameMgr.Inst.ContainsFace(config.Image))
+            if (UIFrameMgr.Inst.ContainsDynamicImage(config.Image))
             {
                 if (frame == null) frame = imgTitle.gameObject.AddComponent<UIFrame>();
                 imgTitle.raycastTarget = false;
diff --git a/System/Chat/UIFrame.cs b/System/Chat/UIFrame.cs
index ea778ee..22d922a 100644
--- a/System/Chat/UIFrame.cs
+++ b/System/Chat/UIFrame.cs
@@ -42,7 +42,7 @@
         if (!gameObject.activeInHierarchy) {
             return;
         }
-        sprites = UIFrameMgr.Inst.GetDynamicFace(frameKey);
+        sprites = UIFrameMgr.Inst.GetDynamicImage(frameKey);
         if (sprites == null||sprites.Count<1) {
             DebugEx.LogError(string.Format("娌℃湁{0}瀵瑰簲鐨勫抚鍔ㄧ敾", frameKey));
             enabled = false;
diff --git a/System/Chat/UIFrameMgr.cs b/System/Chat/UIFrameMgr.cs
index b17ca1f..5707bba 100644
--- a/System/Chat/UIFrameMgr.cs
+++ b/System/Chat/UIFrameMgr.cs
@@ -31,7 +31,7 @@
         var dic = FaceConfig.GetValues();
         foreach (var cfg in dic)
         {
-            if (cfg.folder.ToLower() == "frame" && !chatFaces.Contains(cfg.name))
+            if (cfg.frameType == 1 && !chatFaces.Contains(cfg.name))
             {
                 chatFaces.Add(cfg.name);
             }
@@ -69,14 +69,14 @@
         return chatFaces;
     }
 
-    public List<UnityEngine.Sprite> GetDynamicFace(string key)
+    public List<UnityEngine.Sprite> GetDynamicImage(string key)
     {
         List<UnityEngine.Sprite> list = null;
         allFrameDic.TryGetValue(key, out list);
         return list;
     }
 
-    public bool ContainsFace(string key)
+    public bool ContainsDynamicImage(string key)
     {
         return allFrameDic.ContainsKey(key);
     }
diff --git a/System/Message/ImgAnalysis.cs b/System/Message/ImgAnalysis.cs
index ceb56e8..a42a79e 100644
--- a/System/Message/ImgAnalysis.cs
+++ b/System/Message/ImgAnalysis.cs
@@ -137,7 +137,24 @@
                         presentImgInfo.IsFace = true;
                         if (RichTextMgr.Inst.presentRichText != null)
                         {
-                            presentImgInfo.height = RichTextMgr.Inst.presentRichText.FaceSize;
+                            int height = 0;
+                            if (RichTextMgr.Inst.presentRichText.FaceSize != 0)
+                            {
+                                height = (int)RichTextMgr.Inst.presentRichText.FaceSize;
+                            }
+                            else
+                            { 
+                                if (UIFrameMgr.Inst.ContainsDynamicImage(presentImgInfo.spriteName))
+                                {
+                                    var list = UIFrameMgr.Inst.GetDynamicImage(presentImgInfo.spriteName);
+                                    height = (int)list[0].rect.height;
+                                }
+                                else
+                                {
+                                    height = 40;
+                                }
+                            }
+                            presentImgInfo.height = height;
                             presentImgInfo.width = presentImgInfo.height;
                         }
                     }
@@ -213,7 +230,7 @@
             {
                 string result = match.Groups[1].Value.Replace("0", "");
                 m_StringBuilder.Append(msg.Substring(index, match.Index - index));
-                if (UIFrameMgr.Inst.ContainsFace(result))
+                if (UIFrameMgr.Inst.ContainsDynamicImage(result))
                 {
                     m_StringBuilder.Append(string.Format("<Img face={0}/>", result));
                 }
diff --git a/System/Role/RoleTitleCell.cs b/System/Role/RoleTitleCell.cs
index 6cf30b1..6bf540f 100644
--- a/System/Role/RoleTitleCell.cs
+++ b/System/Role/RoleTitleCell.cs
@@ -44,7 +44,7 @@
             //m_TitleIcon.SetNativeSize();
 
             UIFrame frame = m_TitleIcon.GetComponent<UIFrame>();
-            if (UIFrameMgr.Inst.ContainsFace(config.Image))
+            if (UIFrameMgr.Inst.ContainsDynamicImage(config.Image))
             {
                 if (frame == null) frame = m_TitleIcon.gameObject.AddComponent<UIFrame>();
                 m_TitleIcon.raycastTarget = false;
diff --git a/System/Role/TitleStarUpWin.cs b/System/Role/TitleStarUpWin.cs
index ebc160d..06e9d6e 100644
--- a/System/Role/TitleStarUpWin.cs
+++ b/System/Role/TitleStarUpWin.cs
@@ -105,7 +105,7 @@
             titleName.text = config.Name + Language.Get("EquipStar11", titleModel.GetTitleStar(titleModel.selectTitleId));
 
             UIFrame frame = titleImg.GetComponent<UIFrame>();
-            if (UIFrameMgr.Inst.ContainsFace(config.Image))
+            if (UIFrameMgr.Inst.ContainsDynamicImage(config.Image))
             {
                 titleImg.raycastTarget = false;
                 frame.enabled = true;
diff --git a/System/Role/WorshipInfoListWin.cs b/System/Role/WorshipInfoListWin.cs
index ada681e..1f99970 100644
--- a/System/Role/WorshipInfoListWin.cs
+++ b/System/Role/WorshipInfoListWin.cs
@@ -108,7 +108,7 @@
             }
             m_TitleIcon.SetActive(true);
             UIFrame frame = m_TitleIcon.GetComponent<UIFrame>();
-            if (UIFrameMgr.Inst.ContainsFace(config.Image))
+            if (UIFrameMgr.Inst.ContainsDynamicImage(config.Image))
             {
                 m_TitleIcon.raycastTarget = false;
                 frame.enabled = true;
diff --git a/UI/HUD/HeadUpName.cs b/UI/HUD/HeadUpName.cs
index 7d71d17..2b5b3f5 100644
--- a/UI/HUD/HeadUpName.cs
+++ b/UI/HUD/HeadUpName.cs
@@ -156,7 +156,7 @@
 
                 m_PlayerTitle.SetActive(true);
                 UIFrame frame = m_PlayerTitle.GetComponent<UIFrame>();
-                if (UIFrameMgr.Inst.ContainsFace(config.Image))
+                if (UIFrameMgr.Inst.ContainsDynamicImage(config.Image))
                 {
                     if (frame == null) frame = m_PlayerTitle.gameObject.AddComponent<UIFrame>();
                     m_PlayerTitle.raycastTarget = false;

--
Gitblit v1.8.0