hch
2026-01-26 d613ac4b9deae55e86dfef5f5b971f8314029ddb
422 子 【内政】命格系统 / 【内政】命格系统-客户端
6个文件已修改
150 ■■■■■ 已修改文件
Main/System/FuncPreset/FuncPresetChooseCells.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/FuncPreset/FuncPresetChooseMoreCell.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/FuncPreset/FuncPresetManager.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Hero/HeroInfo.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/HeroUI/HeroPosWin.cs 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Mingge/MinggeWin.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;    //当前展开的方案ID,在选中的情况下才生效
    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;
    }
}
Main/System/FuncPreset/FuncPresetChooseMoreCell.cs
@@ -10,8 +10,8 @@
    [SerializeField] Button chooseBtn;
    [SerializeField] Transform selectObj;   //流派名才有选中,方案名选中后就显示在外层第四个
    [SerializeField] FuncPresetChooseCells pareant;
    [SerializeField] FuncPresetChooseCells pareant; //记录展开的方案ID用于表现
    [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
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;
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;
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)
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()
    {
    }
}