Ejemplo n.º 1
0
        public FuncTemplate GetFunc(int id)
        {
            FuncTemplate result = null;

            if (!mFuncTbl.TryGetValue(id, out result))
            {
                EB.Debug.LogWarning("GetFunc: func not found, id = {0}", id);
            }
            return(result);
        }
Ejemplo n.º 2
0
        //检查所有图鉴
        public bool HasHandBookRedPoint()
        {
            Hotfix_LT.Data.FuncTemplate m_FuncTpl = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(10049);
            if (!m_FuncTpl.IsConditionOK())
            {
                return(false);
            }

            return(IsHandBookCanLevelUp() || IsHandBookCanBreakUp() || IsHandPartnerCanUp(eRoleAttr.Feng) ||
                   IsHandPartnerCanUp(eRoleAttr.Shui) || IsHandPartnerCanUp(eRoleAttr.Huo) || IsCanGetScore());
        }
Ejemplo n.º 3
0
        void PrepareData()
        {
            m_Functions.Clear();

            if (!string.IsNullOrEmpty(npc) && !string.IsNullOrEmpty(scene))
            {
                Hotfix_LT.Data.MainLandEncounterTemplate met = Hotfix_LT.Data.SceneTemplateManager.GetMainLandsNPCData(scene, npc);

                if (met != null)
                {
                    if (met.func_id_1 > 0)
                    {
                        Hotfix_LT.Data.FuncTemplate func = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(met.func_id_1);
                        if (func != null)//红点设置
                        {
                            m_Functions.Add(func);
                            SetRP();
                        }
                    }
                    if (met.func_id_2 > 0)
                    {
                        Hotfix_LT.Data.FuncTemplate func = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(met.func_id_2);
                        if (func != null)
                        {
                            m_Functions.Add(func);
                            SetRP2();
                        }
                    }
                    if (met.func_id_3 > 0)
                    {
                        Hotfix_LT.Data.FuncTemplate func = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(met.func_id_3);
                        if (func != null)
                        {
                            m_Functions.Add(func);
                        }
                    }

                    if (taskData != null)
                    {
                        Hotfix_LT.Data.FuncTemplate func = new Hotfix_LT.Data.FuncTemplate();
                        func.ui_model = "task";
                        string displayName = EB.Dot.String("taskName", taskData, string.Empty);
                        func.display_name = string.Format("[{0}]", EB.Localizer.GetString("ID_MAIN_LINE")) + displayName;
                        m_Functions.Add(func);
                    }
                }
                else
                {
                    EB.Debug.LogError("Tabel did not have npc={0} in scene={1}", npc, scene);
                }
            }
        }
Ejemplo n.º 4
0
        public static FuncTemplate Parse(GM.DataCache.FunctionInfo obj)
        {
            FuncTemplate tpl = new FuncTemplate();

            if (obj != null)
            {
                tpl.id           = obj.Id;
                tpl.ui_model     = obj.UiModel;
                tpl.display_name = EB.Localizer.GetTableString(string.Format("ID_guide_functions_{0}_display_name", tpl.id), obj.DisplayName);// ;
                tpl.condition    = obj.Condition;
                tpl.parameter    = obj.Parameter;
                tpl.iconName     = obj.Icon;
                tpl.discript     = EB.Localizer.GetTableString(string.Format("ID_guide_functions_{0}_discript", tpl.id), obj.Discript);// ;
                tpl.notice       = obj.Notice == 1;
            }
            string t_condition = tpl.condition;

            if (string.IsNullOrEmpty(t_condition))
            {
                tpl.openType       = FuncOpenType.none;
                tpl.conditionParam = 0;
            }
            else if (int.TryParse(t_condition, out int level))
            {
                if (level >= 999)
                {
                    tpl.openType = FuncOpenType.locked;
                }
                else
                {
                    tpl.openType = FuncOpenType.level;
                }
                tpl.conditionParam = level;
            }
            else if (t_condition.Contains("d-"))
            {
                tpl.openType = FuncOpenType.time;
                int.TryParse(t_condition.Replace("d-", string.Empty), out int t_day);
                tpl.conditionParam = t_day;
            }
            else if (t_condition.Contains("m-"))
            {
                tpl.openType = FuncOpenType.maincampaign;
                int.TryParse(t_condition.Replace("m-", string.Empty), out int t_campaign);
                tpl.conditionParam = t_campaign;
            }
            return(tpl);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 判断是否显示合成按钮,以及相关处理
 /// </summary>
 /// <param name="isShow"></param>
 public void ShowSynthesis(DetailedEquipmentInfo data)
 {
     if (data.EquipLevel >= MaxLevel && data.QualityLevel == 6)
     {
         //获取创建账号登录时间
         Hotfix_LT.Data.FuncTemplate tempFun = new Hotfix_LT.Data.FuncTemplate();
         tempFun = Hotfix_LT.Data.FuncTemplateManager.Instance.GetFunc(10086);
         bool isUnLock = false;
         if (tempFun == null)
         {
             isUnLock = true;
         }
         else
         {
             isUnLock = tempFun.IsConditionOK();
         }
         UpLevelBtnRoot.CustomSetActive(false);
         SynthesisBtn.CustomSetActive(true);
         ///先做修改进行测试
         if (isUnLock)
         {
             SynthesisLabelTop.transform.localPosition = new Vector3(0, 14, 0);
             SynthesisLabelTop.transform.localScale    = Vector3.one;
             SynthesisReflashTip.text = "";
             SynthesisBtnBG.GetComponent <BoxCollider>().enabled = isUnLock;
             SynthesisBtnBG.GetComponent <UISprite>().color      = new Color(1, 1, 1, 1);
             SynthesisBtnBG.GetComponent <UISprite>().spriteName = "Ty_Button_3";
         }
         else
         {
             SynthesisLabelTop.transform.localPosition = new Vector3(0, 50, 0);
             SynthesisLabelTop.transform.localScale    = Vector3.one;
             SynthesisReflashTip.text = tempFun.GetConditionStr();
             SynthesisBtnBG.GetComponent <BoxCollider>().enabled = false;
             SynthesisBtnBG.GetComponent <UISprite>().color      = new Color(1, 0, 1, 1);
             SynthesisBtnBG.GetComponent <UISprite>().spriteName = "Ty_Button_1";
         }
     }
     else
     {
         UpLevelBtnRoot.CustomSetActive(true);
         SynthesisBtn.CustomSetActive(false);
     }
 }
Ejemplo n.º 6
0
        public List <int> GetUnlockFuncIdLists()
        {
            // if (mUnlockFuncIdLists!=null)
            // {
            //     return mUnlockFuncIdLists;
            // }
            mUnlockFuncIdLists = new List <int>();

            var enumerator = mFuncTbl.Values.GetEnumerator();

            while (enumerator.MoveNext())
            {
                FuncTemplate obj = enumerator.Current;
                if (!obj.IsConditionOK())
                {
                    mUnlockFuncIdLists.Add(obj.id);
                }
            }
            return(mUnlockFuncIdLists);
        }
Ejemplo n.º 7
0
        //初始化预告列表
        public void InitNotice()
        {
            if (mFuncTbl == null)
            {
                return;
            }
            if (mNoticeFuncTbl == null)
            {
                mNoticeFuncTbl = new List <FuncTemplate>();
            }
            else
            {
                mNoticeFuncTbl.Clear();
            }
            var enumerator = mFuncTbl.Values.GetEnumerator();

            while (enumerator.MoveNext())
            {
                FuncTemplate funTemp = enumerator.Current;
                if (funTemp.notice && !funTemp.IsConditionOK())
                {
                    mNoticeFuncTbl.Add(funTemp);
                }
            }
            mNoticeFuncTbl.Sort((x, y) =>
            {
                int flagx = 0;
                int flagy = 0;
                flagx     = x.condition.Contains("m-") ? 0 : 1;
                flagy     = y.condition.Contains("m-") ? 0 : 1;
                if (flagx != flagy)
                {
                    return(flagx - flagy);
                }
                int.TryParse(x.condition.Replace("m-", string.Empty), out flagx);
                int.TryParse(y.condition.Replace("m-", string.Empty), out flagy);
                return(flagx - flagy);
            });
        }
Ejemplo n.º 8
0
        public bool InitFromDataCache(GM.DataCache.ConditionGuide tbls)
        {
            if (tbls == null)
            {
                EB.Debug.LogError("InitFromDataCache: tbls is null");
                return(false);
            }

            var conditionSet = tbls;

            mFuncTbl = new Dictionary <int, FuncTemplate>(conditionSet.FunctionsLength);
            for (int i = 0; i < conditionSet.FunctionsLength; ++i)
            {
                var tpl = FuncTemplate.Parse(conditionSet.GetFunctions(i));
                if (mFuncTbl.ContainsKey(tpl.id))
                {
                    EB.Debug.LogError("InitFuncTbl: {0} exists", tpl.id);
                    mFuncTbl.Remove(tpl.id);
                }
                mFuncTbl.Add(tpl.id, tpl);
            }
            return(true);
        }
Ejemplo n.º 9
0
 private void OpenFunc(Hotfix_LT.Data.FuncTemplate func)
 {
     if (func.ui_model == "SpecialActivity")
     {
         if (func.parameter == "9001")
         {
             if (!ActivityUtil.IsTimeOk(9001))
             {
                 MessageTemplateManager.ShowMessage(902139);
                 return;
             }
         }
         else if (func.parameter == "9002")
         {
             if (!ActivityUtil.IsTimeOk(9002))
             {
                 MessageTemplateManager.ShowMessage(902140);
                 return;
             }
         }
     }
     //Close();
     if (func.ui_model.Equals("TaskChase"))
     {
         EnemyController ec = MainLandLogic.GetInstance().GetEnemyController(npc);
         if (ec != null)
         {
             NpcTaskDataLookup task_datalookup = ec.GetComponentInChildren <NpcTaskDataLookup>();
             if (task_datalookup != null && task_datalookup.mDL.DefaultDataID != null)
             {
                 var ht = Johny.HashtablePool.Claim();
                 ht.Add("taskid", task_datalookup.mDL.DefaultDataID);
                 Hotfix_LT.Data.FuncTemplateManager.OpenFunc(func.id, ht);
             }
             else
             {
                 MessageTemplateManager.ShowMessage(902015, null, null);
             }
         }
     }
     else if (func.ui_model.Equals("task"))
     {
         System.Action callback = taskData["callback"] as System.Action;
         if (callback != null)
         {
             callback();
         }
     }
     else if (func.ui_model.Equals("DeliveryDart"))
     {
         DeliveryDart();
     }
     else
     {
         if (string.IsNullOrEmpty(func.parameter))
         {
             Hotfix_LT.Data.FuncTemplateManager.OpenFunc(func.id, null);
         }
         else
         {
             Hotfix_LT.Data.FuncTemplateManager.OpenFunc(func.id, func.parameter);
         }
     }
 }
Ejemplo n.º 10
0
        public static void OpenFunc(int func_id, object _param = null, bool isqueued = false)
        {
            if (sInstance == null)
            {
                return;
            }
            FuncTemplate func = sInstance.GetFunc(func_id);

            if (func != null)
            {
                if (func.IsConditionOK())
                {
                    if (func.ui_model.Equals("TaskChase"))
                    {
                        GlobalMenuManager.Instance.Open(func.ui_model, _param);
                    }
                    else if (func.ui_model.Equals("PartnerHandbookHudView"))
                    {
                        GlobalMenuManager.Instance.Open("PartnerHandbookHudView");
                    }
                    else if (func.ui_model.Equals("ArenaView"))
                    {
                        GlobalMenuManager.Instance.Open("ArenaHudUI");
                    }
                    else if (func.ui_model.Equals("HonorArenaView"))
                    {
                        GlobalMenuManager.Instance.Open("HonorArenaView");
                    }
                    else if (func.ui_model.Equals("AllianceView"))
                    {
                        //AllianceHudUI.OpenHud(null);
                    }
                    else if (func.ui_model.Equals("ExpeditionHud"))
                    {
                        GlobalMenuManager.Instance.Open("ExpeditionUI");
                    }
                    else if (func.ui_model.Equals("GoldBuyView"))
                    {
                        GlobalMenuManager.Instance.Open("GoldNormalBuy");
                    }
                    else if (func.ui_model.Equals("LadderView"))
                    {
                        GlobalMenuManager.Instance.Open("LadderUI");
                    }
                    else if (func.ui_model.Equals("LTRuleUIView"))
                    {
                        if (_param != null)
                        {
                            string id   = _param as string;
                            string text = EB.Localizer.GetString(EB.Symbols.LocIdPrefix + id.ToUpper());
                            GlobalMenuManager.Instance.Open(func.ui_model, text);
                        }
                        else
                        {
                            GlobalMenuManager.Instance.Open(func.ui_model);
                        }
                    }
                    else if (func.ui_model.Equals("LTLegionWarJoinView"))
                    {
                        if (!AllianceUtil.IsJoinedAlliance)
                        {
                            MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_2, EB.Localizer.GetString("ID_codefont_in_FuncTemplateManager_5098"), delegate(int r)
                            {
                                if (r == 0)
                                {
                                    GlobalMenuManager.Instance.Open("LTSearchJTMenu");
                                    if ((LegionModel.GetInstance().searchItemDatas == null || LegionModel.GetInstance().searchItemDatas.Length == 0) || Time.unscaledTime - LegionModel.GetInstance().searchListTime > 10)  //无军团列表数据或最近一次不是自动搜索或拉取数据超过CD10秒
                                    {
                                        LegionModel.GetInstance().searchListTime = Time.unscaledTime;
                                        AlliancesManager.Instance.RequestAllianceList();
                                    }
                                }
                            });
                        }
                        else
                        {
                            GlobalMenuManager.Instance.Open(func.ui_model);
                            FusionTelemetry.GamePlayData.PostEvent(FusionTelemetry.GamePlayData.alliance_war_topic,
                                                                   FusionTelemetry.GamePlayData.alliance_war_event_id, FusionTelemetry.GamePlayData.alliance_war_umengId, "open");
                        }
                    }
                    else if (func.ui_model.Equals("LTWorldBossHud"))
                    {
                        //var activitytmp = EventTemplateManager.Instance.GetSpecialActivity(LTWorldBossDataManager.ActivityId);//满足条件才进入无需再次判断
                        //if (activitytmp != null)
                        //{
                        //    if (BalanceResourceUtil.GetUserLevel() < activitytmp.level)
                        //    {
                        //        var data = Johny.HashtablePool.Claim();
                        //        data.Add("0", activitytmp.level);
                        //        MessageTemplateManager.ShowMessage(902009, data, null);
                        //        Johny.HashtablePool.Release(data);
                        //        return;
                        //    }
                        //}

                        //注掉判断使在非活动时间内依然可以打开世界boos活动界面需要在后面加限制
                        if (!LTWorldBossDataManager.Instance.IsLive())
                        {
                            //MessageTemplateManager.ShowMessage(902185);
                            //return;
                        }

                        if (!LTWorldBossDataManager.Instance.IsWorldBossStart())
                        {
                            //MessageTemplateManager.ShowMessage(902090);
                            //return;
                        }

                        GlobalMenuManager.Instance.Open("LTWorldBossHud");
                        FusionTelemetry.GamePlayData.PostEvent(FusionTelemetry.GamePlayData.worldboss_topic,
                                                               FusionTelemetry.GamePlayData.worldboss_event_id, FusionTelemetry.GamePlayData.worldboss_umengId, "open");
                    }
                    else
                    {
                        if (func.ui_model.Equals("LTAllianceEscortHud"))
                        {
                            if (!EventTemplateManager.Instance.IsTimeOK("escort_start", "escort_stop"))
                            {
                                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_AllianceEscortUtil_4329"));
                                return;
                            }

                            if (!AllianceUtil.IsJoinedAlliance)
                            {
                                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_AllianceEscortUtil_4483"));
                                return;
                            }

                            if (AlliancesManager.Instance.DartData.State == eAllianceDartCurrentState.Transfering)
                            {
                                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_FuncTemplateManager_7841"));
                                return;
                            }
                            FusionTelemetry.GamePlayData.PostEsortEvent("open", "esort");
                            //现在没有这种限制
                            //if (AlliancesManager.Instance.DartData.DartState == eAllianceDartState.Robed)
                            //{
                            //	MessageTemplateManager.ShowMessage(902055);  //已劫掠过,不能接受运镖任务。
                            //	return;
                            //}
                        }
                        else if (func.ui_model.Equals("LTNationBattleEntryUI"))
                        {
                            if (string.IsNullOrEmpty(NationManager.Instance.Account.NationName))
                            {
                                GlobalMenuManager.Instance.Open("LTNationHudUI");
                                return;
                            }
                        }

                        if (_param != null)
                        {
                            GlobalMenuManager.Instance.Open(func.ui_model, _param);
                        }
                        else
                        {
                            GlobalMenuManager.Instance.Open(func.ui_model);
                        }
                    }
                }
                else
                {
                    if (func.openType != FuncOpenType.level)
                    {
                        MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, func.GetConditionStr());
                    }
                    else
                    {
                        var ht = Johny.HashtablePool.Claim();
                        ht.Add("0", func.condition);
                        MessageTemplateManager.ShowMessage(902014, ht, null);
                        Johny.HashtablePool.Release(ht);
                    }
                }
            }
        }
Ejemplo n.º 11
0
        public List <FuncTemplate> GetLevelUpFunc(int curLevel)//返回升级显示功能列表,现在返回主线副本和等级条件
        {
            List <FuncTemplate> temp = new List <FuncTemplate>();

            var enumerator = mFuncTbl.Values.GetEnumerator();

            while (enumerator.MoveNext())
            {
                FuncTemplate obj = enumerator.Current;
                if (obj.condition == null || string.IsNullOrEmpty(obj.discript) || obj.discript.Equals("0"))
                {
                    continue;
                }
                switch (obj.openType)
                {
                case FuncOpenType.none:
                    break;

                case FuncOpenType.locked:
                    break;

                case FuncOpenType.time:
                    break;

                case FuncOpenType.level:
                    if (obj.conditionParam > curLevel)
                    {
                        temp.Add(obj);
                    }
                    break;

                case FuncOpenType.maincampaign:
                    if (!obj.IsConditionOK())
                    {
                        temp.Add(obj);
                    }
                    break;

                default:
                    break;
                }
            }
            temp.Sort((a, b) =>
            {
                int flagx;
                int flagy;
                flagx = a.IsConditionOK() ? 0 : 1;
                flagy = b.IsConditionOK() ? 0 : 1;
                if (flagx != flagy)
                {
                    return(flagx - flagy);
                }
                else
                {
                    flagx = a.openType == FuncOpenType.maincampaign ? 0 : 1;
                    flagy = b.openType == FuncOpenType.maincampaign ? 0 : 1;
                    if (flagx != flagy)
                    {
                        return(flagx - flagy);
                    }
                    else
                    {
                        return(a.conditionParam - b.conditionParam);
                    }
                }
            });
            return(temp);
        }