From 853fca9637124fcc2d172115b113da88d8591fb3 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 26 一月 2026 01:58:53 +0800
Subject: [PATCH] 419 【内政】命格系统

---
 Main/System/FuncPreset/FuncPresetChooseCell.cs |   45 +++++++++++++++++++++++++++++----------------
 1 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/Main/System/FuncPreset/FuncPresetChooseCell.cs b/Main/System/FuncPreset/FuncPresetChooseCell.cs
index 66db8d2..fbd7f5b 100644
--- a/Main/System/FuncPreset/FuncPresetChooseCell.cs
+++ b/Main/System/FuncPreset/FuncPresetChooseCell.cs
@@ -9,12 +9,14 @@
     [SerializeField] Image lockImg;
     [SerializeField] Text numText;
     [SerializeField] Image selectImg;
-    [SerializeField] Button unFoldBtn;    //瑙i攣鎴栬�呭睍寮�
+    [SerializeField] Button unFoldBtn;    //瑙i攣 鎴栭�変腑
 
     [SerializeField] Text caseNameText;
     [SerializeField] Button changeNameBtn;
     [SerializeField] Text numUnFoldText;
     [SerializeField] Button foldBtn;    //鎶樺彔
+
+    [SerializeField] FuncPresetChooseCells pareant;
 
     
     public void Display(int battleType, int funcType, int id, bool isUnFold)
@@ -32,7 +34,7 @@
 
             caseNameText.text = data.PresetName;
             numUnFoldText.text = id.ToString();
-            changeNameBtn.AddListener(ChangeName);
+            changeNameBtn.AddListener(()=>ChangeName(funcType, id));
             foldBtn.AddListener(()=>Fold(funcType, id));
         }
         else
@@ -40,9 +42,28 @@
             unFoldObj.SetActive(false);
             foldObj.SetActive(true);
 
-            unFoldBtn.AddListener(() => UnFold(funcType, id));
+            unFoldBtn.AddListener(() =>
+            {
+                if (id == selectID && pareant.unFoldID == 0)
+                {
+                    //閫変腑鐘舵�佷笅鐐瑰嚮鎶樺彔锛屽垯涓嶆姌鍙�
+                    pareant.unFoldID = id;
+                }
+                if (pareant.unFoldID == id)
+                {
+                    FuncPresetManager.Instance.OnSelectPresetEvent?.Invoke(funcType, id, true);
+                }
+                else
+                {
+                    if (FuncPresetManager.Instance.ClickFuncPreset(battleType, funcType, id))
+                    {
+                        pareant.unFoldID = id;
+                    }
+                }
+            });
+                
             lockImg.SetActive(!data.unLock);
-            numText.text = id.ToString();
+            numText.text = !data.unLock ? "" :id.ToString();
             selectImg.SetActive(selectID == id);
         }
 
@@ -50,24 +71,16 @@
     }
 
 
-    void ChangeName()
+    void ChangeName(int funcType, int id)
     {
-        // UIManager.Instance.OpenWindow<FuncPresetChangeNameWin>();
+        UIManager.Instance.OpenWindow<FuncPresetChangeNameWin>(funcType*100 + id);
     }
 
     void Fold(int funcType, int id)
     {
+        pareant.unFoldID = 0;
         FuncPresetManager.Instance.OnSelectPresetEvent?.Invoke(funcType, id, false);
     }
 
-    void UnFold(int funcType, int id)
-    {
-        var data = FuncPresetManager.Instance.GetFuncPreset(funcType, id);
-        if (!data.unLock)
-        {
-            // 鏈В閿� 鍒欒喘涔�
-            return;
-        }
-        FuncPresetManager.Instance.OnSelectPresetEvent?.Invoke(funcType, id, true);
-    } 
+    
 }

--
Gitblit v1.8.0