From 78db9372ac6fe691ba0ca35437291027a6d2b59c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 27 一月 2026 20:38:27 +0800
Subject: [PATCH] 422 子 【内政】命格系统 / 【内政】命格系统-客户端

---
 Main/System/FuncPreset/FuncPresetChooseCell.cs     |   14 ++++--
 Main/System/FuncPreset/FuncPresetChooseCells.cs    |    5 ++
 Main/System/FuncPreset/FuncPresetChooseMoreCell.cs |    2 +
 Main/System/Mingge/MinggeManager.cs                |   19 +++++++++
 Main/System/FuncPreset/FuncPresetManager.cs        |   43 ++++++++++++++++++++-
 5 files changed, 76 insertions(+), 7 deletions(-)

diff --git a/Main/System/FuncPreset/FuncPresetChooseCell.cs b/Main/System/FuncPreset/FuncPresetChooseCell.cs
index a78667d..7dbc9f8 100644
--- a/Main/System/FuncPreset/FuncPresetChooseCell.cs
+++ b/Main/System/FuncPreset/FuncPresetChooseCell.cs
@@ -17,6 +17,7 @@
     [SerializeField] Button foldBtn;    //鎶樺彔
 
     [SerializeField] FuncPresetChooseCells pareant;
+    [SerializeField] Image redImg;
 
     int curBattleType;
     public void Display(int battleType, int funcType, int id, bool isUnFold)
@@ -35,14 +36,16 @@
 
             caseNameText.text = data.PresetName;
             numUnFoldText.text = id.ToString();
-            changeNameBtn.AddListener(()=>ChangeName(funcType, id));
-            foldBtn.AddListener(()=>Fold(funcType, id));
+            changeNameBtn.AddListener(() => ChangeName(funcType, id));
+            foldBtn.AddListener(() => Fold(funcType, id));
+            
         }
         else
         {
             unFoldObj.SetActive(false);
             foldObj.SetActive(true);
 
+            redImg.SetActive(FuncPresetManager.Instance.ShowRed(funcType, id));
             unFoldBtn.AddListener(() =>
             {
                 if (id == selectID && pareant.unFoldID == 0)
@@ -62,16 +65,17 @@
                     }
                 }
             });
-                
+
             lockImg.SetActive(!data.unLock);
-            numText.text = !data.unLock ? "" :id.ToString();
+            numText.text = !data.unLock ? "" : id.ToString();
             selectImg.SetActive(selectID == id);
         }
 
-        
+
     }
 
 
+
     void ChangeName(int funcType, int id)
     {
         UIManager.Instance.OpenWindow<FuncPresetChangeNameWin>(funcType*100 + id);
diff --git a/Main/System/FuncPreset/FuncPresetChooseCells.cs b/Main/System/FuncPreset/FuncPresetChooseCells.cs
index 3bd43e9..23f94a1 100644
--- a/Main/System/FuncPreset/FuncPresetChooseCells.cs
+++ b/Main/System/FuncPreset/FuncPresetChooseCells.cs
@@ -17,6 +17,8 @@
     [SerializeField] HorizontalLayoutGroup layoutGroup;
     [SerializeField] FuncPresetChooseCell[] cells;
     [SerializeField] Button unFoldBtn;   //灞曞紑鏇村
+    [SerializeField] Image redImg;
+    
     //琚�変腑鐨勬柟妗堜細鏄剧ず鍦ㄥ灞傦紝濡傛灉涓嶆槸绗洓涓垯绗洓涓細鏄剧ず鍦ㄦ渶涓婇潰
 
     [SerializeField] Transform moreCellObj;
@@ -91,6 +93,9 @@
             }
         }
 
+
+        redImg.SetActive(FuncPresetManager.Instance.GetNeedShowRedID(funcType) > 4);
+
         UIUtility.ForceRefreshLayout(this.transform).Forget();
     }
 
diff --git a/Main/System/FuncPreset/FuncPresetChooseMoreCell.cs b/Main/System/FuncPreset/FuncPresetChooseMoreCell.cs
index e55a177..deee07c 100644
--- a/Main/System/FuncPreset/FuncPresetChooseMoreCell.cs
+++ b/Main/System/FuncPreset/FuncPresetChooseMoreCell.cs
@@ -12,6 +12,7 @@
     [SerializeField] Transform selectObj;   //娴佹淳鍚嶆墠鏈夐�変腑锛屾柟妗堝悕閫変腑鍚庡氨鏄剧ず鍦ㄥ灞傜鍥涗釜
     [SerializeField] FuncPresetChooseCells pareant; //璁板綍灞曞紑鐨勬柟妗圛D鐢ㄤ簬琛ㄧ幇
     [SerializeField] Transform moreCellObj;
+    [SerializeField] Image redImg;
     
     public void Display(int battleType, int funcType, int id)
     {
@@ -52,6 +53,7 @@
             });
             changeNameBtn.SetActive(false);
             chooseBtn.RemoveAllListeners();
+            redImg.SetActive(FuncPresetManager.Instance.ShowRed(funcType, id));
         }
         selectObj?.SetActive(selectID == id);
         
diff --git a/Main/System/FuncPreset/FuncPresetManager.cs b/Main/System/FuncPreset/FuncPresetManager.cs
index a5c661b..503e904 100644
--- a/Main/System/FuncPreset/FuncPresetManager.cs
+++ b/Main/System/FuncPreset/FuncPresetManager.cs
@@ -343,10 +343,49 @@
         }
         else
         {
-			UIManager.Instance.OpenWindow<FuncPresetWin>(battleType);
-		}
+            UIManager.Instance.OpenWindow<FuncPresetWin>(battleType);
+        }
     }
 
+    //鍔熻兘绫荤殑婊¤冻鏉′欢鍚庯紝鎻愮ず绾㈢偣鎵嬪姩瑙i攣
+    // 鏌愪釜鏂规鏄惁瑕佺孩鐐规彁绀�
+    public bool ShowRed(int funcType, int id)
+    {
+        if (funcType == (int)FuncPresetType.Mingge)
+        {
+            var presetData = GetFuncPreset(funcType, id);
+            if (presetData.unLock)
+            {
+                return false;
+            }
+            var config = PresetUnlockConfig.GetPresetUnlockConfig(funcType, id);
+            if (config != null && config.UnlockType == 2 && MinggeManager.Instance.m_GanwuLV < config.UnlockValue)
+            {
+                return false;
+            }
+            return true;
+        }
+
+        return false;
+    }
+
+    public int GetNeedShowRedID(int funcType)
+    {
+        if (funcType == (int)FuncPresetType.Mingge)
+        {
+            var maxCnt = PresetUnlockConfig.GetFuncPresetMaxCount(funcType); ;
+            for (int i = 1; i <= maxCnt; i++)
+            {
+                if (ShowRed(funcType, i))
+                {
+                    return i;
+                }
+            }
+        }
+        return 0;
+    }
+
+
 }
 
 
diff --git a/Main/System/Mingge/MinggeManager.cs b/Main/System/Mingge/MinggeManager.cs
index 02c1557..3cc689d 100644
--- a/Main/System/Mingge/MinggeManager.cs
+++ b/Main/System/Mingge/MinggeManager.cs
@@ -43,6 +43,7 @@
         PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
         DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent += OnEquipResult;
         DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOK;
+        FuncPresetManager.Instance.OnFuncPresetUseDataEvent += OnFuncPresetUseDataEvent;
         ParseConfig();
     }
 
@@ -52,6 +53,7 @@
         PackManager.Instance.RefreshItemEvent -= RefreshItemEvent;
         DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent -= OnEquipResult;
         DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOK;
+        FuncPresetManager.Instance.OnFuncPresetUseDataEvent -= OnFuncPresetUseDataEvent;
     }
 
 
@@ -139,11 +141,22 @@
 
     public void UpdateMinggeInfo(HB132_tagSCMinggeInfo netPack)
     {
+        var beforeLV= m_GanwuLV;
         m_GanwuLV = netPack.GanwuLV;
         m_GanwuExp = (int)netPack.GanwuExp;
         m_Lingying = (int)netPack.Lingying;
 
+        if (beforeLV != m_GanwuLV)
+        {
+            UpdateRedPoint();
+            beforeLV = m_GanwuLV;
+        }
         OnMinggeInfoUpdate?.Invoke();
+    }
+
+    void OnFuncPresetUseDataEvent(int type)
+    {
+        UpdateRedPoint();
     }
 
 
@@ -319,12 +332,14 @@
     Redpoint tmpRP = new Redpoint(MainRedDot.MainAffairsRedpoint, MainRedDot.RedPoint_Mingge);
     Redpoint redpointMG = new Redpoint(MainRedDot.RedPoint_Mingge, MainRedDot.RedPoint_Mingge * 10 + 1);
     Redpoint redpointPray = new Redpoint(MainRedDot.RedPoint_Mingge, MainRedDot.RedPoint_Mingge * 10 + 2);
+    Redpoint redpointPreset = new Redpoint(MainRedDot.RedPoint_Mingge, MainRedDot.RedPoint_Mingge * 10 + 3);
     
     void UpdateRedPoint()
     {
 
         redpointMG.state = RedPointState.None;
         redpointPray.state = RedPointState.None;
+        redpointPreset.state = RedPointState.None;
         if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Mingge))
         {
             return;
@@ -338,6 +353,10 @@
         {
             redpointPray.state = RedPointState.Simple;
         }
+        if (FuncPresetManager.Instance.GetNeedShowRedID((int)FuncPresetType.Mingge) != 0)
+        {
+            redpointPreset.state = RedPointState.Simple;
+        }
     }
 
     #endregion

--
Gitblit v1.8.0