From f4a702e212d1853735f8dae399da69d23bfa510e Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 26 三月 2026 18:16:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into h5version

---
 Main/System/PhantasmPavilion/PhantasmPavilionManager.Redpoint.cs |  142 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 114 insertions(+), 28 deletions(-)

diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionManager.Redpoint.cs b/Main/System/PhantasmPavilion/PhantasmPavilionManager.Redpoint.cs
index 923a788..e1cd0d9 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionManager.Redpoint.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionManager.Redpoint.cs
@@ -73,13 +73,22 @@
                 continue;
             int unlockWay = GetUnlockWay(type, id);
             int unlockValue = GetUnlockValue(type, id);
-            if (unlockWay != 3)
+            if (unlockWay != 3 && unlockWay != 4)
                 continue;
-            bool hasNewHero = HasNewHero(type, unlockValue);
-            if (hasNewHero)
+            if (unlockWay == 3)
             {
-                tabRedPointDict[redType].state = RedPointState.Simple;
+                bool hasNewHero = HasNewHero(type, unlockValue);
+                if (hasNewHero)
+                {
+                    tabRedPointDict[redType].state = RedPointState.Simple;
+                }
             }
+            else if (unlockWay == 4)
+            {
+                if (HasNewSkin(type, unlockValue))
+                    tabRedPointDict[redType].state = RedPointState.Simple;
+            }
+
         }
     }
 
@@ -102,15 +111,21 @@
         }
 
         int unlockWay = GetUnlockWay(type, id);
-        if (unlockWay != 3)
+        if (unlockWay != 3 && unlockWay != 4)
             return;
 
         int unlockValue = GetUnlockValue(type, id);
-        bool hasNewHero = HasNewHero(type, unlockValue);
-        if (hasNewHero)
+        if (unlockWay == 3)
         {
-            imgRed.SetActive(true);
+            if (HasNewHero(type, unlockValue))
+                imgRed.SetActive(true);
         }
+        else if (unlockWay == 4)
+        {
+            if (HasNewSkin(type, unlockValue))
+                imgRed.SetActive(true);
+        }
+
     }
     readonly int funcId = 3;//鍐呮斂
     //鍐呮斂娌″紑涓嶅埛绾㈢偣
@@ -165,21 +180,68 @@
         }
     }
 
-    public List<int> newHeroIDModelList = new List<int>();
-    public List<int> newHeroIDFaceList = new List<int>();
-    public void AddNewHero(int heroID)
+    private HashSet<int> UpdateRedPointItemSet = new HashSet<int>();
+    public HashSet<int> GetUpdateRedPointItemSet()
     {
-        AddNewHero(newHeroIDModelList, heroID);
-        AddNewHero(newHeroIDFaceList, heroID);
+        if (UpdateRedPointItemSet.Count > 0)
+            return UpdateRedPointItemSet;
+
+        var types = (PhantasmPavilionType[])System.Enum.GetValues(typeof(PhantasmPavilionType));
+        foreach (var type in types)
+        {
+            List<int> keys = GetTableKeys(type);
+            if (keys == null)
+                continue;
+
+            foreach (var id in keys)
+            {
+                if (GetUnlockWay(type, id) != 2)
+                    continue;
+
+                int itemId = GetUnlockValue(type, id);
+                UpdateRedPointItemSet.Add(itemId);
+            }
+        }
+
+        return UpdateRedPointItemSet;
     }
 
-    void AddNewHero(List<int> list, int heroID)
+    public List<int> newSkinIDModelList = new List<int>();
+    public List<int> newSkinIDFaceList = new List<int>();
+    string modelSkinKey { get { return StringUtility.Concat("PhantasmPavilion_Redponit_ModelSkin_", PlayerDatas.Instance.PlayerId.ToString()); } }
+    string faceSkinKey { get { return StringUtility.Concat("PhantasmPavilion_Redponit_FaceSkin_", PlayerDatas.Instance.PlayerId.ToString()); } }
+    public void AddNewSkin(int skinID)
     {
-        if (list.Contains(heroID))
+        AddNew(newSkinIDModelList, skinID);
+        AddNew(newSkinIDFaceList, skinID);
+    }
+    // 鎶借薄娣诲姞閫昏緫
+    void AddNew(List<int> list, int id)
+    {
+        if (list.Contains(id))
             return;
-        list.Add(heroID);
+        list.Add(id);
         SaveLocal();
         UpdateRedPoint();
+    }
+
+    public bool HasNewSkin(PhantasmPavilionType type, int skinID)
+    {
+        switch (type)
+        {
+            case PhantasmPavilionType.Model: return newSkinIDModelList.Contains(skinID);
+            case PhantasmPavilionType.Face: return newSkinIDFaceList.Contains(skinID);
+            default: return false;
+        }
+    }
+
+    public List<int> newHeroIDModelList = new List<int>();
+    public List<int> newHeroIDFaceList = new List<int>();
+
+    public void AddNewHero(int heroID)
+    {
+        AddNew(newHeroIDModelList, heroID);
+        AddNew(newHeroIDFaceList, heroID);
     }
 
     public void RemoveAllNewHeroByTabType(PhantasmPavilionType type, int tabType = 0)
@@ -212,31 +274,29 @@
             return;
         int unlockWay = GetUnlockWay(type, id);
         int unlockValue = GetUnlockValue(type, id);
-        if (unlockWay != 3)
-            return;
+        if (unlockWay != 3 && unlockWay != 4) return;
 
         switch (type)
         {
             case PhantasmPavilionType.Model:
-                RemoveNewHero(newHeroIDModelList, unlockValue, isSave);
+                if (unlockWay == 3) RemoveNew(newHeroIDModelList, unlockValue, isSave);
+                else if (unlockWay == 4) RemoveNew(newSkinIDModelList, unlockValue, isSave); // 鐨偆
                 break;
             case PhantasmPavilionType.Face:
-                RemoveNewHero(newHeroIDFaceList, unlockValue, isSave);
+                if (unlockWay == 3) RemoveNew(newHeroIDFaceList, unlockValue, isSave);
+                else if (unlockWay == 4) RemoveNew(newSkinIDFaceList, unlockValue, isSave); // 鐨偆
                 break;
         }
     }
 
-    void RemoveNewHero(List<int> list, int heroID, bool isSave = true)
+    void RemoveNew(List<int> list, int id, bool isSave = true)
     {
-        if (!list.Contains(heroID))
-            return;
-        list.Remove(heroID);
-        if (isSave)
-        {
-            SaveLocal();
-        }
+        if (!list.Contains(id)) return;
+        list.Remove(id);
+        if (isSave) SaveLocal();
         UpdateRedPoint();
     }
+
 
     public bool HasNewHero(PhantasmPavilionType type, int heroID)
     {
@@ -258,11 +318,37 @@
     {
         LocalSave.SetIntArray(modelkey, newHeroIDModelList.ToArray());
         LocalSave.SetIntArray(facekey, newHeroIDFaceList.ToArray());
+        LocalSave.SetIntArray(modelSkinKey, newSkinIDModelList.ToArray());
+        LocalSave.SetIntArray(faceSkinKey, newSkinIDFaceList.ToArray());
     }
     public void LoadLocal()
     {
         LoadLocalModel();
         LoadLocalFace();
+        LoadLocalSkin();
+    }
+
+    void LoadLocalSkin()
+    {
+        if (LocalSave.HasKey(modelSkinKey))
+        {
+            int[] arr = LocalSave.GetIntArray(modelSkinKey);
+            newSkinIDModelList = arr.IsNullOrEmpty() ? new List<int>() : arr.ToList();
+        }
+        else
+        {
+            newSkinIDModelList = new List<int>();
+        }
+
+        if (LocalSave.HasKey(faceSkinKey))
+        {
+            int[] arr = LocalSave.GetIntArray(faceSkinKey);
+            newSkinIDFaceList = arr.IsNullOrEmpty() ? new List<int>() : arr.ToList();
+        }
+        else
+        {
+            newSkinIDFaceList = new List<int>();
+        }
     }
 
     void LoadLocalModel()

--
Gitblit v1.8.0