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

---
 Main/System/Hero/HeroInfo.cs                       |    6 +-
 Main/System/Mingge/MinggeWin.cs                    |   15 ++++-
 Main/System/HeroUI/HeroPosWin.cs                   |  100 ++++++---------------------------
 Main/System/FuncPreset/FuncPresetChooseCells.cs    |   17 +++++
 Main/System/FuncPreset/FuncPresetChooseMoreCell.cs |    8 +-
 Main/System/FuncPreset/FuncPresetManager.cs        |    4 
 6 files changed, 56 insertions(+), 94 deletions(-)

diff --git a/Main/System/FuncPreset/FuncPresetChooseCells.cs b/Main/System/FuncPreset/FuncPresetChooseCells.cs
index 9b360a0..fc0ff1e 100644
--- a/Main/System/FuncPreset/FuncPresetChooseCells.cs
+++ b/Main/System/FuncPreset/FuncPresetChooseCells.cs
@@ -14,13 +14,17 @@
 
 public class FuncPresetChooseCells : MonoBehaviour
 {
+    [SerializeField] HorizontalLayoutGroup layoutGroup;
     [SerializeField] FuncPresetChooseCell[] cells;
     [SerializeField] Button unFoldBtn;   //灞曞紑鏇村
     //琚�変腑鐨勬柟妗堜細鏄剧ず鍦ㄥ灞傦紝濡傛灉涓嶆槸绗洓涓垯绗洓涓細鏄剧ず鍦ㄦ渶涓婇潰
+
+    [SerializeField] Transform moreCellObj;
     [SerializeField] FuncPresetChooseMoreCell[] moreCells;
     bool forceUnFold = false; //寮哄埗灞曞紑锛屼笉鑳芥敹缂�; 娴佹淳鐣岄潰鐨勯渶姹�
     [NonSerialized] public int unFoldID = 0;    //褰撳墠灞曞紑鐨勬柟妗圛D锛屽湪閫変腑鐨勬儏鍐典笅鎵嶇敓鏁�
     int curBattleType;
+
 
     /// <summary>
     /// 鏄剧ず鏂规棰勮
@@ -37,6 +41,10 @@
         var selectID = FuncPresetManager.Instance.GetFuncPresetIDByBattleType(battleType, funcType);
         var showCount = FuncPresetManager.Instance.GetShowFuncPresetCount(funcType);
         unFoldBtn.SetActive(showCount > 4);
+        unFoldBtn.AddListener(() =>
+        {
+            moreCellObj.SetActive(true);
+        });
 
         for (int i = 0; i < cells.Length; i++)
         {
@@ -62,7 +70,7 @@
         }
 
         var showMoreCount = showCount - 4;
-        for (int i = 0; i < showMoreCount; i++)
+        for (int i = 0; i < moreCells.Length; i++)
         {
             if (i < showMoreCount)
             {
@@ -98,4 +106,11 @@
     {
         Display(curBattleType, funcType, forceUnFold);
     }
+
+    //榛樿鏄眳涓潬鍙�
+    public void ChangeAlignment(TextAnchor type)
+    {
+        layoutGroup.childAlignment = type;
+    }
+
 }
diff --git a/Main/System/FuncPreset/FuncPresetChooseMoreCell.cs b/Main/System/FuncPreset/FuncPresetChooseMoreCell.cs
index 38b4284..5c1eb03 100644
--- a/Main/System/FuncPreset/FuncPresetChooseMoreCell.cs
+++ b/Main/System/FuncPreset/FuncPresetChooseMoreCell.cs
@@ -10,8 +10,8 @@
     [SerializeField] Button chooseBtn;
 
     [SerializeField] Transform selectObj;   //娴佹淳鍚嶆墠鏈夐�変腑锛屾柟妗堝悕閫変腑鍚庡氨鏄剧ず鍦ㄥ灞傜鍥涗釜
-    [SerializeField] FuncPresetChooseCells pareant;
-
+    [SerializeField] FuncPresetChooseCells pareant; //璁板綍灞曞紑鐨勬柟妗圛D鐢ㄤ簬琛ㄧ幇
+    [SerializeField] Transform moreCellObj;
     
     public void Display(int battleType, int funcType, int id)
     {
@@ -21,7 +21,8 @@
             return;
         }
         var selectID = FuncPresetManager.Instance.GetFuncPresetIDByBattleType(battleType, funcType);
-        caseNameText.text = Language.Get("FuncPreset11", id, UIHelper.AppendColor(selectID == id ? TextColType.titleSelectColor : TextColType.titleUnSelectColor, data.PresetName));
+        caseNameText.text = UIHelper.AppendColor(selectID == id ? TextColType.titleSelectColor : TextColType.titleUnSelectColor,
+                            Language.Get("FuncPreset11", id, data.PresetName));
         if (data.unLock)
         {
             lockBtn.SetActive(false);
@@ -37,6 +38,7 @@
                     pareant.unFoldID = id;
                 }
                 FuncPresetManager.Instance.ClickFuncPreset(battleType, funcType, id);
+                moreCellObj.SetActive(false);
             });
         }
         else
diff --git a/Main/System/FuncPreset/FuncPresetManager.cs b/Main/System/FuncPreset/FuncPresetManager.cs
index 70045fb..94498a4 100644
--- a/Main/System/FuncPreset/FuncPresetManager.cs
+++ b/Main/System/FuncPreset/FuncPresetManager.cs
@@ -249,14 +249,14 @@
     {
         var unlockCnt = GetUnlockCnt(funcType);
         var maxCount = PresetUnlockConfig.GetFuncPresetMaxCount(funcType);
-        var unlockType = PresetUnlockConfig.GetUnlockType((int)FuncPresetType.Mingge);
+        var unlockType = PresetUnlockConfig.GetUnlockType(funcType);
         if (unlockType == 2)
         {
             //鍛芥牸鎸夋帹婕斿鐣岃В閿�
             //鍙湁1涓柟妗堝垯涓嶆樉绀猴紝澶т簬1涓垯鍏ㄦ樉绀�
             if (unlockCnt == 1)
             {
-                var config = PresetUnlockConfig.GetPresetUnlockConfig((int)FuncPresetType.Mingge, 2);
+                var config = PresetUnlockConfig.GetPresetUnlockConfig(funcType, 2);
                 if (MinggeManager.Instance.m_GanwuLV >= config.UnlockValue)
                 {
                     return maxCount;
diff --git a/Main/System/Hero/HeroInfo.cs b/Main/System/Hero/HeroInfo.cs
index 1a83b6c..ce68229 100644
--- a/Main/System/Hero/HeroInfo.cs
+++ b/Main/System/Hero/HeroInfo.cs
@@ -125,7 +125,7 @@
     //鏄惁涓婁换浣曢樀瀹�
     public bool IsInAnyTeam()
     {
-        var maxCnt = FuncPresetManager.Instance.GetUnlockCnt((int)FuncPresetType.Mingge);
+        var maxCnt = FuncPresetManager.Instance.GetUnlockCnt((int)FuncPresetType.Team);
         for (int i = 1; i < maxCnt + 1; i++)
         {
             if (TeamManager.Instance.GetTeam(i).HasHeroInServer(itemHero.guid))
@@ -139,7 +139,7 @@
     //鏄惁涓婁换浣曢樀瀹癸紝涓斿彧鏈変竴鍙�
     public bool IsInAnyTeamJustOne()
     {
-        var maxCnt = FuncPresetManager.Instance.GetUnlockCnt((int)FuncPresetType.Mingge);
+        var maxCnt = FuncPresetManager.Instance.GetUnlockCnt((int)FuncPresetType.Team);
         for (int i = 1; i < maxCnt + 1; i++)
         {
             var team = TeamManager.Instance.GetTeam(i);
@@ -155,7 +155,7 @@
     //涓嬮樀鎵�鏈夐樀瀹�
     public void LeaveAllTeam()
     {
-        var maxCnt = FuncPresetManager.Instance.GetUnlockCnt((int)FuncPresetType.Mingge);
+        var maxCnt = FuncPresetManager.Instance.GetUnlockCnt((int)FuncPresetType.Team);
         for (int i = 1; i < maxCnt + 1; i++)
         {
             int pos;
diff --git a/Main/System/HeroUI/HeroPosWin.cs b/Main/System/HeroUI/HeroPosWin.cs
index e0c3eb5..1f8054f 100644
--- a/Main/System/HeroUI/HeroPosWin.cs
+++ b/Main/System/HeroUI/HeroPosWin.cs
@@ -20,9 +20,6 @@
     [SerializeField] List<Image> scenePosImgs;  //鍦烘櫙甯冮樀浣嶇疆
     [SerializeField] HeroScenePosCell[] sceneHero;
 
-    [SerializeField] GroupButtonEx attackTeamBtn;
-    [SerializeField] GroupButtonEx defendTeamBtn;
-
     [SerializeField] Text fightPowerText;   //鐢卞鎴风鑷繁棰勭畻鐨勬垬鍔�
     [SerializeField] ScrollerController heroListScroller;
     [SerializeField] Transform heroListEmpty;
@@ -34,8 +31,6 @@
     [SerializeField] Button oneKeyOnBtn;     //涓�閿笂闃�
     [SerializeField] Button saveBtn;        //淇濆瓨闃靛瀷
     [SerializeField] Button backBtn;      //閫�鍑虹晫闈�
-    [SerializeField] GroupButtonEx jjcBtn;       //绔炴妧鍦�
-    // [SerializeField] GroupButtonEx tttBtn;        //閫氬ぉ濉�
     [SerializeField] GroupButtonEx mainFBBtn;     //涓荤嚎鍓湰
 
     //缇佺粖
@@ -43,8 +38,10 @@
     [SerializeField] HeroHeadBaseCell flyHead;
     [SerializeField] CanvasGroup flyAlphaTween;
 
-
     [SerializeField] ButtonEx lineupRecommendBtn; //闃靛鎺ㄨ崘
+
+    [SerializeField] Transform caseesObj;
+    FuncPresetChooseCells presetChooseCells;
 
     Sequence sequence;
     CancellationTokenSource _cts;
@@ -66,20 +63,6 @@
 
     protected override void InitComponent()
     {
-
-        mainFBBtn.AddListener(() =>
-        {
-            SelectTeamFunc(TeamManager.Instance.GetMainTeamID());
-        });
-
-        jjcBtn.AddListener(() =>
-        {
-            SelectTeamFunc(TeamManager.Instance.GetTeamID((int)BattlePreSetType.Arena));
-        });
-        // tttBtn.AddListener(() =>
-        // {
-        //     SelectTeamFunc(TeamType.Tower);
-        // });
 
         showConnTipToggleBtn.AddListener((value) =>
         {
@@ -107,6 +90,11 @@
 
         m_IsToggleOn = LocalSave.GetBool("ShowConn" + PlayerDatas.Instance.baseData.PlayerID, false);
         fiterManager = HeroSelectBehaviour.Create(heroSelectBehaviour);
+
+        var presetObj = UIUtility.CreateWidget("FuncPresetChooseCells", "FuncPresetChooseCells");
+        presetObj.transform.SetParentEx(caseesObj, Vector3.zero, Quaternion.identity, Vector3.one);
+        presetChooseCells = presetObj.GetComponent<FuncPresetChooseCells>();
+        presetChooseCells.ChangeAlignment(TextAnchor.MiddleCenter);
     }
 
 
@@ -117,9 +105,8 @@
         HeroUIManager.Instance.OnTeamPosChangeEvent += TeamChangeEvent;
         TeamManager.Instance.OnTeamChange += OnTeamChange;
         FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
-        ShowFuncBtn();
+        FuncPresetManager.Instance.OnFuncPresetUseDataEvent += OnFuncPresetUseDataEvent;
         SelectTiltleBtn();
-        // CreateScroller();
         Display();
         DisplayLineupRecommend();
     }
@@ -131,6 +118,7 @@
         HeroUIManager.Instance.OnTeamPosChangeEvent -= TeamChangeEvent;
         TeamManager.Instance.OnTeamChange -= OnTeamChange;
         FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
+        FuncPresetManager.Instance.OnFuncPresetUseDataEvent -= OnFuncPresetUseDataEvent;
         TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType).RestoreTeam();
     }
 
@@ -147,44 +135,32 @@
         lineupRecommendBtn.SetActive(isOpen);
     }
 
-    void ShowFuncBtn()
-    {
-        jjcBtn.SetActive(FuncOpen.Instance.IsFuncOpen(ArenaManager.Instance.DeployTroopsFuncId));
-    }
-
 
     void SelectTiltleBtn()
     {
-        if (functionOrder == 0)
-        {
-            mainFBBtn.SelectBtn();
-        }
-        else if (functionOrder == 1)
-        {
-            jjcBtn.SelectBtn();
-        }
+        //鏂规鍙樻洿 鍙湁涓绘垬
+        mainFBBtn.SelectBtn();
+    }
+    void OnFuncPresetUseDataEvent()
+    {
+        Display();
     }
 
 
     public void Display()
     {
-        OnBattleTeamAttrPer();
         RefreshOnTeamCountry();
         RefreshOnTeamBtn();
         RefreshTeamHero();
         RefreshFlyHead();
         RefreshConn();
-
         RefreshEmptyTip();
 
         showConnTipToggleBtn.isOn = isToggleOn;
-
         fiterManager.Display(0, SelectJobCountry);
-
-
         fightPowerText.text = UIHelper.ReplaceLargeArtNum(FightPowerManager.Instance.GetTeamFightPower(HeroUIManager.Instance.selectTeamType, true));
 
-
+        presetChooseCells.Display((int)BattlePreSetType.Story, (int)FuncPresetType.Team);
     }
 
     void RefreshFlyHead()
@@ -247,33 +223,7 @@
         heroListScroller.Restart();
     }
 
-    //涓婇樀鍔犳垚
-    void OnBattleTeamAttrPer()
-    {
-        var valuePer = 0;
-        var team = TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType);
-        if (team != null)
-        {
-            for (int i = 0; i < team.tempHeroes.Length; i++)
-            {
-                if (team.tempHeroes[i] == null)
-                    continue;
-                var hero = HeroManager.Instance.GetHero(team.tempHeroes[i].guid);
-                if (hero != null)
-                {
-                    valuePer += hero.GetAddPer();
-                }
-            }
-
-        }
-        // //涓婇樀灞炴��
-        // for (int i = 0; i < attrOnList.Length; i++)
-        // {
-        //     string format = valuePer == 0 ? "{0}+{1}" : "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}", false);
-        //     attrOnList[i].text = PlayerPropertyConfig.GetFullDescription(PlayerPropertyConfig.basePerAttrs[i], valuePer, format);
-        // }
-    }
-
+    
     //涓婇樀姝﹀皢鍥藉鍏夌幆婵�娲�
     void RefreshOnTeamCountry(bool playEffect = false)
     {
@@ -374,7 +324,6 @@
         RefreshPosScale();
         heroListScroller.m_Scorller.RefreshActiveCellViews();
         RefreshOnTeamCountry(true);
-        OnBattleTeamAttrPer();
 
         //琛ㄧ幇椋炲叆锛岃繛缁偣鍑讳笉鍚屽ご鍍忚Е鍙戠殑璇濆垯閲嶇疆
         if (flyFrom > -1)
@@ -499,19 +448,6 @@
     {
         var team = TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType);
         team.SaveTeam();
-    }
-
-    void SelectTeamFunc(int type)
-    {
-        if (HeroUIManager.Instance.selectTeamType == type)
-        {
-            return;
-        }
-
-        HeroUIManager.Instance.selectTeamType = type;
-        HeroUIManager.Instance.SortHeroOnTeamList();
-        Display();
-        heroListScroller.m_Scorller.RefreshActiveCellViews();
     }
 
     protected void OnTeamChange(int teamType)
diff --git a/Main/System/Mingge/MinggeWin.cs b/Main/System/Mingge/MinggeWin.cs
index 2f3da22..954cddc 100644
--- a/Main/System/Mingge/MinggeWin.cs
+++ b/Main/System/Mingge/MinggeWin.cs
@@ -37,6 +37,7 @@
         var presetObj = UIUtility.CreateWidget("FuncPresetChooseCells", "FuncPresetChooseCells");
         presetObj.transform.SetParentEx(caseesObj, Vector3.zero, Quaternion.identity, Vector3.one);
         presetChooseCells = presetObj.GetComponent<FuncPresetChooseCells>();
+        presetChooseCells.ChangeAlignment(TextAnchor.MiddleCenter);
         seeAttrBtn.AddListener(() =>
         {
             AttributeManager.Instance.OpenTotalAttributeWin(MinggeManager.Instance.minggeAttrDict);
@@ -50,15 +51,17 @@
                 ClickSuite(index);
             });
         }
-        prayBtn.AddListener(()=>
+        prayBtn.AddListener(() =>
         {
             UIManager.Instance.OpenWindow<MinggePrayWin>();
         });
+
+        autoBtn.AddListener(AutoTY);
     }
 
     protected override void OnPreOpen()
     {
-        MinggeManager.Instance.RefrehMinggeAttrs();
+       
         PackManager.Instance.RefreshItemEvent += RefreshItemEvent;
         PackManager.Instance.DeleteItemEvent += DeleteDropItem;
         MinggeManager.Instance.OnMinggeInfoUpdate += OnMinggeInfoUpdate;
@@ -135,6 +138,7 @@
 
     void DisplaySlotEquip()
     {
+        MinggeManager.Instance.RefrehMinggeAttrs();
         for (int i = 0; i < equipCells.Length; i++)
         {
             equipCells[i].Display();
@@ -261,8 +265,13 @@
         keys.Sort();
         if (index >= keys.Count)
             return;
-        
+
         ItemTipUtility.Show(dict[keys[index]][0]);
     }
+
+    void AutoTY()
+    {
+        
+    }
 }
 

--
Gitblit v1.8.0