少年修仙传客户端代码仓库
9935 子 【BT0.1】【主干】人族法宝(任务 进度)给予奖励 / 【BT0.1】【主干】人族法宝 - 主界面奖励显示
6个文件已修改
87 ■■■■■ 已修改文件
System/Role/RoleModel.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/HumanTreasureTaskCell.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/HumanTreasureWin.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureCollectBriefInfoBehaviour.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureModel.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/ComponentExtersion.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Role/RoleModel.cs
@@ -167,7 +167,7 @@
        public void GetCustomAward(int awardID)
        {
            CA504_tagCMPlayerGetReward pak = new CA504_tagCMPlayerGetReward();
            pak.RewardType = 62;
            pak.RewardType = 61;
            pak.DataEx = (uint)awardID;
            GameNetSystem.Instance.SendInfo(pak);
        }
System/Treasure/HumanTreasureTaskCell.cs
@@ -145,7 +145,7 @@
                getAwardImg.SetActive(state == 2);
                getAward.SetActive(state != 2);
                getAward.SetColorful(getAward.GetComponentInChildren<Text>(), state == 1);
                getAward.SetColorful(getAward.GetComponentInChildren<Text>(), state == 1, 2);
                getAward.interactable = state == 1;
                getAward.SetListener(() => { 
                    roleModel.GetCustomAward(awardTaskConfig.AwardID);
System/Treasure/HumanTreasureWin.cs
@@ -211,7 +211,12 @@
                        m_TaskController.AddCell(ScrollerDataType.Header, clue);
                        lastClue = clue;
                        if (clueState != 0)
                        if (model.gotoAwardClue != -1)
                        {
                            if (clue == model.gotoAwardClue)
                                jumpIndex = index;
                        }
                        else if (clueState != 0)
                        {
                            jumpIndex = index;
                        }
@@ -244,6 +249,7 @@
                    m_TaskController.JumpIndex(jumpIndex);
                }
            }
            model.gotoAwardClue = -1;
        }
        void DisplayAnimation()
System/Treasure/TreasureCollectBriefInfoBehaviour.cs
@@ -34,6 +34,8 @@
        [SerializeField] UIEffect m_ProgressEffect;
        [SerializeField] Button m_Goto;
        [SerializeField] Button m_GotoAward;
        [SerializeField] UIEffect m_AwardEffect;
        bool dirty = false;
@@ -67,6 +69,7 @@
        TreasureModel model { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
        TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
        RoleModel roleModel { get { return ModelCenter.Instance.GetModel<RoleModel>(); } }
        public void Display()
        {
@@ -83,12 +86,41 @@
            DisplayBase();
            m_Goto.SetListener(OnGoto);
            m_GotoAward.SetActive(model.m_jumpAwardID != -1);
            m_GotoAward.AddListener(() => {
                if (model.m_jumpAwardID == -1)
                    return;
                if (model.quickGetAward)
                {
                    roleModel.GetCustomAward(model.m_jumpAwardID);
                    m_AwardEffect.Play();
                    return;
                }
                var info = model.GetFabaoAwardInfo(model.m_jumpAwardID);
                model.gotoAwardClue = info.y;
                model.selectedTreasure = info.x;
                model.currentCategory = TreasureCategory.Human;
                WindowCenter.Instance.Open<TreasureBaseWin>(true);
                model.quickGetAward = true;
            });
        }
        private void OnEnable()
        {
            m_ContainerDisplay.SetActive(false);
            StartCoroutine(Co_Display());
            roleModel.OnCustomAwardsEvent += RoleModel_OnCustomAwardsEvent;
        }
        private void RoleModel_OnCustomAwardsEvent()
        {
            m_GotoAward.SetActive(model.m_jumpAwardID != -1);
        }
        private void OnDisable()
        {
            roleModel.OnCustomAwardsEvent -= RoleModel_OnCustomAwardsEvent;
        }
        IEnumerator Co_Display()
System/Treasure/TreasureModel.cs
@@ -27,7 +27,8 @@
        Dictionary<int, List<int>> treasureInductionTasks = new Dictionary<int, List<int>>();
        List<int> eightFurnacesAchievements = new List<int>();
        List<int> treasureUnOpens = new List<int>();
        Dictionary<int, Int2> awardsToFaboClue = new Dictionary<int, Int2>();   //奖励对应的法宝和线索
        List<int> awardsSort = new List<int>(); // 奖励排序
        public const int CLIENTDATAMAP = 4000;
        public const int TREASURE_DATAMAPID = 41110;
        public const int TREASURE_MAPID = 41110;
@@ -150,6 +151,7 @@
        public int displayInductionId { get; private set; }
        TaskModel taskModel { get { return ModelCenter.Instance.GetModel<TaskModel>(); } }
        RoleModel roleModel { get { return ModelCenter.Instance.GetModel<RoleModel>(); } }
        VIPKillNPCTreasure m_VIPKillNPCTreasure;
        public VIPKillNPCTreasure vipKillNPCTreasure
@@ -168,6 +170,9 @@
        bool playerLevelRefresh = false;
        bool needDisplayReguluLevelUp = false;
        public int m_jumpAwardID;   //跳转奖励ID ,快速领取的奖励ID
        public int gotoAwardClue;   //跳转奖励线索
        public bool quickGetAward = false;  //是否快速领取奖励
        public override void Init()
        {
@@ -180,6 +185,7 @@
            StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
            GlobalTimeEvent.Instance.secondEvent += PerSecond;
            TaskModel.Event_MainlineTask += OnTaskRefresh;
            roleModel.OnCustomAwardsEvent += OnCustomAwardsEvent;
        }
        public void OnBeforePlayerDataInitialize()
@@ -198,6 +204,9 @@
            {
                treasureDungeon.currentLevel = 0;
            }
            m_jumpAwardID = -1;
            gotoAwardClue = -1;
            quickGetAward = false;
        }
        public void OnAfterPlayerDataInitialize()
@@ -221,6 +230,7 @@
            StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
            GlobalTimeEvent.Instance.secondEvent -= PerSecond;
            TaskModel.Event_MainlineTask -= OnTaskRefresh;
            roleModel.OnCustomAwardsEvent -= OnCustomAwardsEvent;
        }
        private void PerSecond()
@@ -351,6 +361,9 @@
                        treasureTasks.Add(config.FabaoID, tasks);
                    }
                    tasks.Add(config.TaskID);
                    awardsToFaboClue[config.AwardID] = new Int2(config.FabaoID, config.clue);
                    awardsSort.Add(config.AwardID);
                }
@@ -854,6 +867,31 @@
            RefreshTreasureCollectState();
        }
        void OnCustomAwardsEvent()
        {
            m_jumpAwardID = -1;
            foreach (var awardID in awardsSort)
            {
                if (roleModel.GetCustomAwardState(awardID) == 1)
                {
                    m_jumpAwardID = awardID;
                    break;
                }
            }
        }
        public Int2 GetFabaoAwardInfo(int awardID)
        {
            Int2 fabaoInfo;
            if (awardsToFaboClue.TryGetValue(awardID, out fabaoInfo))
            {
                return fabaoInfo;
            }
            return new Int2(0, 0);
        }
        private void OnTaskRefresh(int MissionID, int MissionState)
        {
            RefreshTreasureCollectState(TreasureCategory.Human);
Utility/ComponentExtersion.cs
@@ -231,6 +231,9 @@
                case 1:
                    _btnTxt.color = UIHelper.GetUIColor(_colorful ? TextColType.LightYellow : TextColType.White);
                    break;
                case 2:
                    _btnTxt.color = UIHelper.GetUIColor(_colorful ? TextColType.Green : TextColType.White);
                    break;
                default:
                    _btnTxt.color = UIHelper.GetUIColor(_colorful ? TextColType.NavyBrown : TextColType.White);
                    break;