少年修仙传客户端代码仓库
lcy
2024-12-17 82643eeecc0a9467d42583e132751c3eb01f2e81
10296 修复轮回殿索引和AwardIndex索引混用问题
4个文件已修改
85 ■■■■ 已修改文件
System/LoopAct/CycleHall/CycleHallActModel.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/LoopAct/CycleHall/CycleHallMissionCell.cs 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/LoopAct/CycleHall/CycleHallWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/LoopAct/CycleHall/OperationCycleHall.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/LoopAct/CycleHall/CycleHallActModel.cs
@@ -201,18 +201,18 @@
        }
        //0 不可领取 1 可领取  2 已领取
        public int GetAwardState(int roundType, int index)
        public int GetAwardState(int roundType, int awardIndex)
        {
            if (playerInfoDict == null || !playerInfoDict.TryGetValue((byte)roundType, out var playerInfo) || playerInfo == null)
                return 0;
            OperationCycleHall act;
            OperationTimeHepler.Instance.TryGetOperation(operaType, out act);
            if (act == null || !act.TryGetRoundInfoByIndex(roundType, index, out var awardInfo))
            if (act == null || !act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex))
                return 0;
            if (playerInfo.CurValue >= awardInfo.NeedValue)
            {
                return (playerInfo.AwardRecord & (1 << index)) != 0 ? 2 : 1;
                return (playerInfo.AwardRecord & (1 << awardIndex)) != 0 ? 2 : 1;
            }
            else
            {
@@ -257,6 +257,7 @@
                {
                    var award = round.AwardList[j];
                    int index = award.AwardIndex;
                    int state = GetAwardState(roundType, index);//0 不可领取 1 可领取  2 已领取
                    if (state == 1)
                        redPointDict[id].state = RedPointState.Simple;
System/LoopAct/CycleHall/CycleHallMissionCell.cs
@@ -18,7 +18,7 @@
        int roundType;
        int tabType;
        int mIndex;
        int awardIndex;
        CycleHallActModel model { get { return ModelCenter.Instance.GetModel<CycleHallActModel>(); } }
        private void OnEnable()
@@ -29,26 +29,22 @@
                missionTweens[i].Stop();
                missionTweens[i].SetStartState();
            }
            if (tabType == 1)
            var act = model.GetOperationInfo();
            if (act == null || !act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null)
                return;
            int state = model.GetAwardState(roundType, awardIndex);
            for (int i = 0; i < missionTweens.Count; i++)
            {
                int state = model.GetAwardState(roundType, mIndex);//0 不可领取 1 可领取  2 已领取
                for (int i = 0; i < missionTweens.Count; i++)
                if (i < awardInfo.AwardItemList.Length)
                {
                    var act = model.GetOperationInfo();
                    if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= mIndex || mIndex < 0)
                        return;
                    var award = round.AwardList[mIndex];
                    if (award.AwardItemList == null)
                        return;
                    if (i < award.AwardItemList.Length)
                    if (state == 1)
                    {
                        if (state == 1)
                        {
                            missionTweens[i].Play();
                        }
                        missionTweens[i].Play();
                    }
                }
            }
        }
        private void OnDisable()
@@ -56,35 +52,38 @@
            model.PlayAnimationSync -= OnPlaySyncAnimation;
        }
        public void Display(int index, CellView cellView)
        public void Display(int awardIndex, CellView cellView)
        {
            this.mIndex = index;
            this.awardIndex = awardIndex;
            roundType = cellView.info.Value.infoInt1;
            tabType = cellView.info.Value.infoInt2;
            btnMissionHave.enabled = false;
            var act = model.GetOperationInfo();
            if (act == null || !act.TryGetRound(roundType, out var round))
                return;
            if (!act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null)
                return;
            if (model.playerInfoDict == null || !model.playerInfoDict.TryGetValue((byte)roundType, out var playerInfo) || playerInfo == null)
                return;
            var act = model.GetOperationInfo();
            if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= index || index < 0)
                return;
            var award = round.AwardList[index];
            int state = model.GetAwardState(roundType, index);//0 不可领取 1 可领取  2 已领取
            int state = model.GetAwardState(roundType, awardIndex);
            imgFinish.SetActive(state == 2);
            txtTitle.text = Language.Get(StringUtility.Contact("CycleHallMissionTitle", "_", round.AwardType, "_", round.AwardTypeValue), award.NeedValue);
            buyCountGiftSlider.value = playerInfo.CurValue / (float)award.NeedValue;
            buyCountGiftSliderText.text = string.Format("{0}/{1}", playerInfo.CurValue, award.NeedValue);
            txtTitle.text = Language.Get(StringUtility.Contact("CycleHallMissionTitle", "_", round.AwardType, "_", round.AwardTypeValue), awardInfo.NeedValue);
            buyCountGiftSlider.value = playerInfo.CurValue / (float)awardInfo.NeedValue;
            buyCountGiftSliderText.text = string.Format("{0}/{1}", playerInfo.CurValue, awardInfo.NeedValue);
            btnMissionHave.enabled = true;
            btnMissionHave.SetListener(() =>
            {
                HaveMissionAward();
                if (state == 1)
                {
                    HaveMissionAward();
                }
            });
            for (int i = 0; i < missionItemCells.Count; i++)
            {
                var itemBaisc = missionItemCells[i];
                if (i < award.AwardItemList.Length)
                if (i < awardInfo.AwardItemList.Length)
                {
                    var itemInfo = award.AwardItemList[i];
                    var itemInfo = awardInfo.AwardItemList[i];
                    itemBaisc.SetActive(true);
                    missionHaves[i].SetActive(state == 2);
                    missionGreys[i].SetActive(state == 2);
@@ -115,12 +114,12 @@
        public void HaveMissionAward()
        {
            var act = model.GetOperationInfo();
            if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= mIndex || mIndex < 0)
            if (act == null || !act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null)
                return;
            int state = model.GetAwardState(roundType, mIndex);//0 不可领取 1 可领取  2 已领取
            int state = model.GetAwardState(roundType, awardIndex);
            if (state != 1)
                return;
            model.SendGetAward(roundType, (int)round.AwardList[mIndex].NeedValue);
            model.SendGetAward(roundType, (int)awardInfo.NeedValue);
        }
        private void OnPlaySyncAnimation()
@@ -132,7 +131,10 @@
                missionTweens[i].Stop();
                missionTweens[i].SetStartState();
            }
            int state = model.GetAwardState(roundType, mIndex);//0 不可领取 1 可领取  2 已领取
            var act = model.GetOperationInfo();
            if (act == null || !act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null)
                return;
            int state = model.GetAwardState(roundType, awardIndex);
            for (int i = 0; i < missionTweens.Count; i++)
            {
                if (missionTweens[i].isActiveAndEnabled && state == 1)
System/LoopAct/CycleHall/CycleHallWin.cs
@@ -211,7 +211,7 @@
                {
                    for (int i = 0; i < round.AwardList.Length; i++)
                    {
                        missionScroller.AddCell(ScrollerDataType.Header, i, cellInfo);
                        missionScroller.AddCell(ScrollerDataType.Header, round.AwardList[i].AwardIndex, cellInfo);
                    }
                }
                missionScroller.Restart();
System/LoopAct/CycleHall/OperationCycleHall.cs
@@ -13,20 +13,22 @@
            return roundInfoDict.TryGetValue(roundType, out round);
        }
        public bool TryGetRoundInfoByIndex(int roundType, int index, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward awardInfo)
        public bool TryGetRoundInfoByIndex(int roundType, int awardIndex, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward awardInfo, out int listIndex)
        {
            listIndex = 0;
            awardInfo = new HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward { };
            if (!TryGetRound(roundType, out var round) || round.AwardList == null)
                return false;
            for (int i = 0; i < round.AwardList.Length; i++)
            {
                if (round.AwardList[i].AwardIndex == index)
                if (round.AwardList[i].AwardIndex == awardIndex)
                {
                    awardInfo = round.AwardList[i];
                    listIndex = i;
                    return true;
                }
            }
            return true;
            return false;
        }
        public bool TryGetRoundInfoByNeedValue(int roundType, int needValue, out HAA88_tagMCActLunhuidianInfo.tagMCActLunhuidianAward awardInfo)