少年修仙传客户端代码仓库
client_Zxw
2018-09-12 51664895527b8415bf7b30f33980b46dfe3345ca
3488 【前端】【1.0.15】【1.1.0】功能预告优化
4个文件已修改
235 ■■■■■ 已修改文件
System/MainInterfacePanel/FeatureNoticeWin.cs 222 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/FeaturesType2.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/FunctionForecastTip.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/LowSettingTip.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/FeatureNoticeWin.cs
@@ -22,8 +22,15 @@
        [SerializeField] Text m_TextShowD;//显示内容4
        [SerializeField] ScrollerController m_ScrollerController;
        [SerializeField] Button m_CloseButton;
        [SerializeField] Text m_TextTurnedOn;//已开启
        [SerializeField] Text m_TextUnopened;//未开启
        [SerializeField] Text m_Textschedule;//进度
        [SerializeField] Button m_ButtonGoto;
        List<FunctionForecastConfig> FunctionList = new List<FunctionForecastConfig>();
        TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
        #region Built-in
        private int ClickFuncID = 0;
        protected override void BindController()
        {
        }
@@ -35,20 +42,55 @@
        protected override void OnPreOpen()
        {
            AddList();
            m_ScrollerController.OnRefreshCell += OnRefreshGridCell;
            AddList();//添加数组列表
            DefaultSelection();//获取默认选择
            m_ScrollerController.OnRefreshCell += OnRefreshGridCell;
            OnCreateGridLineCell(m_ScrollerController);
            ContentDisplay();
            m_ScrollerController.JumpIndex(JumpIndex());
        }
        protected override void OnAfterOpen()
        {
        }
            FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent += OnPlayersUpLV;
            treasureModel.treasureStateChangeEvent += treasureStateChangeEvent;
            treasureModel.treasureStageUpEvent += treasureStageUpEvent;
        }
        protected override void OnPreClose()
        {
            m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= OnPlayersUpLV;
            FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
            m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
            treasureModel.treasureStateChangeEvent -= treasureStateChangeEvent;
            treasureModel.treasureStageUpEvent -= treasureStageUpEvent;
        }
        private void treasureStageUpEvent(int obj)
        {
            ContentDisplay();
            m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
        }
        private void treasureStateChangeEvent(int obj)
        {
            ContentDisplay();
            m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
        }
        private void OnFuncStateChangeEvent(int obj)
        {
            ContentDisplay();
            m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
        }
        private void OnPlayersUpLV(PlayerDataRefresh obj)
        {
            if (obj == PlayerDataRefresh.LV)
            {
                ContentDisplay();
                m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
            }
        }
        void OnCreateGridLineCell(ScrollerController gridCtrl)
        {
            gridCtrl.Refresh();
@@ -72,11 +114,45 @@
            {
                FeaturesType1 featuresType1 = cell.GetComponent<FeaturesType1>();
                featuresType1.GetTheFeatureID(funcId);
                if (funcId == ClickFuncID)
                {
                    featuresType1.ImageSelected.SetActive(true);
                }
                else
                {
                    featuresType1.ImageSelected.SetActive(false);
                }
                featuresType1.Button.SetListener(()=>
                {
                    if (funcId != ClickFuncID)
                    {
                        ClickFuncID = funcId;
                        ContentDisplay();
                        m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
                    }
                });
            }
            else if (type == ScrollerDataType.Normal)
            {
                FeaturesType2 featuresType2 = cell.GetComponent<FeaturesType2>();
                featuresType2.GetTheFeatureID(funcId);
                if (funcId == ClickFuncID)
                {
                    featuresType2.ImageSelected.SetActive(true);
                }
                else
                {
                    featuresType2.ImageSelected.SetActive(false);
                }
                featuresType2.Button.SetListener(() =>
                {
                    if (funcId != ClickFuncID)
                    {
                        ClickFuncID = funcId;
                        ContentDisplay();
                        m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
                    }
                });
            }
        }
@@ -84,7 +160,7 @@
        {
        }
        #endregion
        private void AddList()
        private void AddList()//添加列表信息
        {
            if (FunctionList.Count <= 0)
            {
@@ -96,8 +172,142 @@
                    {
                        FunctionList.Add(functionForecastConfig);
                    }
                }
            }
        }
        private void DefaultSelection()//获取默认选择
        {
            var configs = Config.Instance.GetAllValues<FunctionForecastConfig>();
            foreach (var config in configs)
            {
                int openTag = config.FuncId;
                if (!FuncOpen.Instance.IsFuncOpen(openTag))
                {
                    ClickFuncID = openTag;
                    return;
                }
            }
            if (ClickFuncID == 0)
            {
                ClickFuncID = FunctionList[0].FuncId;
            }
        }
        private int JumpIndex()//Jump选中
        {
            int Index = 0;
            Index = FunctionList.FindIndex((x)=>
            {
                return x.FuncId == ClickFuncID;
            });
            return Index;
        }
        private void ContentDisplay()//内容显示
        {
            var functionForecastConfig = Config.Instance.Get<FunctionForecastConfig>(ClickFuncID);
            if (functionForecastConfig == null)
            {
                return;
            }
            m_TextAdvanceName.text = functionForecastConfig.FuncName;
            m_FeaturesImage.SetSprite(functionForecastConfig.Icon);
            string[] StrList = ConfigParse.GetMultipleStr(functionForecastConfig.Content);
            if (StrList.Length > 0)
            {
                m_Text_ShowA.text = StrList[0];
                m_TextShowB.text = StrList[1];
                m_TextShowC.text = StrList[2];
                m_TextShowD.text = StrList[3];
            }
            if (FuncOpen.Instance.IsFuncOpen(ClickFuncID))
            {
                m_TextTurnedOn.gameObject.SetActive(true);
                m_TextUnopened.gameObject.SetActive(false);
                m_Textschedule.gameObject.SetActive(false);
                m_ButtonGoto.gameObject.SetActive(false);
            }
            else
            {
                TrailerClassification(ClickFuncID);
            }
        }
        void TrailerClassification(int funcID)//预告分类
        {
            m_TextTurnedOn.gameObject.SetActive(false);
            m_TextUnopened.gameObject.SetActive(false);
            m_Textschedule.gameObject.SetActive(false);
            m_ButtonGoto.gameObject.SetActive(false);
            FuncOpenLVConfig funcoPenConfig = Config.Instance.Get<FuncOpenLVConfig>(funcID);
            if (funcoPenConfig.LimitMagicWeapon != 0 || funcoPenConfig.LimitMissionID != 0)
            {
                if (funcoPenConfig.LimitMagicWeapon != 0)//法宝
                {
                    int faBaoID = funcoPenConfig.LimitMagicWeapon / 100;
                    MagicWeapon(faBaoID);
                }
                else if (funcoPenConfig.LimitMissionID != 0)//任务
                {
                    m_TextUnopened.gameObject.SetActive(true);
                    m_TextUnopened.text= string.Format(Language.Get("TaskFuncOpen"), funcoPenConfig.LimitLV);
                    return;
                }
            }
            else//等级
            {
                m_TextUnopened.gameObject.SetActive(true);
                m_TextUnopened.text= string.Format(Language.Get("FuncLevelOpen"), funcoPenConfig.LimitLV);
                return;
            }
        }
        private void MagicWeapon(int fabaoID)
        {
            m_ButtonGoto.gameObject.SetActive(true);
            Treasure treasure;
            TreasureConfig _treasure = Config.Instance.Get<TreasureConfig>(fabaoID);
            m_ButtonGoto.SetListener(()=>
            {
                var config = Config.Instance.Get<TreasureConfig>(fabaoID);
                treasureModel.selectedTreasure = fabaoID;
                treasureModel.currentCategory = (TreasureCategory)config.Category;
                WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.TreasureCollectSoul);
            });
            if (treasureModel.TryGetTreasure(fabaoID, out treasure)
                && treasure.state == TreasureState.Collected)
            {
                m_Textschedule.gameObject.SetActive(true);
                var list = treasure.treasureStages;
                var funcStage = 0;
                for (int i = 0; i < list.Count; i++)
                {
                    if (list[i].unlockType == TreasureStageUnlock.Func &&
                        list[i].func == ClickFuncID)
                    {
                        funcStage = i;
                        break;
                    }
                }
                if (treasure.stage < funcStage)
                {
                    if (treasure.stage == funcStage - 1 || funcStage == 0)
                    {
                        m_Textschedule.text = (float)treasure.exp / treasure.treasureStages[funcStage].exp+"%";
                    }
                    else
                    {
                        m_Textschedule.text = 0+" %";
                    }
                }
            }
            else
            {
                m_TextUnopened.gameObject.SetActive(true);
                m_TextUnopened.text = string.Format(Language.Get("FuncFBOpen"), _treasure.Name);
            }
        }
    }
System/MainInterfacePanel/FeaturesType2.cs
@@ -38,6 +38,14 @@
            m_FunctionName.text = functionForecastConfig.FuncName;
            m_FunctionalLevel.text = functionForecastConfig.DisplayLevel.ToString();
            m_FeaturesTypeIcon.SetSprite(functionForecastConfig.FuncIconKey);
            if (FuncOpen.Instance.IsFuncOpen(funcId))
            {
                m_SelectedBar.SetActive(true);
            }
            else
            {
                m_SelectedBar.SetActive(false);
            }
        }
System/MainInterfacePanel/FunctionForecastTip.cs
@@ -115,7 +115,6 @@
       
        void FunctionIconBtn()//面板开启
        {
            // WindowCenter.Instance.Open<FunctionForecastWin>();
            WindowCenter.Instance.Open<FeatureNoticeWin>();
        }
    }
System/MainInterfacePanel/LowSettingTip.cs
@@ -88,8 +88,8 @@
        }
        private void GodBeastBtn()
        {
            SysNotifyMgr.Instance.ShowTip("FuncNextVersion");//信息提示
            return;
            //SysNotifyMgr.Instance.ShowTip("FuncNextVersion");//信息提示
            //return;
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<DogzWin>();
        }