Beispiel #1
0
        public override void SetData(object data)
        {
            base.SetData(data);
            activity_id = EB.Dot.Integer("activity_id", data, 0);
            Hotfix_LT.Data.TimeLimitActivityTemplate activity = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivity(activity_id);
            if (activity == null)
            {
                return;
            }
            List <Hotfix_LT.Data.TimeLimitActivityStageTemplate> stages = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivityStages(activity.id);

            for (var i = 0; i < stages.Count; ++i)
            {
                CreateSubItem(stages[i]);
            }
            ItemGrid.Reposition();
        }
Beispiel #2
0
        private void UpdateData()
        {
            List <Hotfix_LT.Data.TimeLimitActivityStageTemplate> stages = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivityStages(activity_id);

            Hotfix_LT.Data.TimeLimitActivityTemplate activity = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivity(activity_id);
            string[] rewardStrs = activity.parameter1.Split(';');
            if (rewardStrs.Length < stages.Count)
            {
                EB.Debug.LogError("LuckyCat Activity Error!Events TimeLimitActivity Parameter is lower");
                return;
            }

            Hashtable activityData;

            DataLookupsCache.Instance.SearchDataByID("tl_acs." + activity_id, out activityData);
            curIndex = -1;
            for (int i = 0; i < stages.Count; ++i)
            {
                int selfgot = EB.Dot.Integer(string.Format("stages.{0}", stages[i].id), activityData, 0);
                if (selfgot == 0)
                {
                    curIndex = i;
                    break;
                }
            }
            if (curIndex == -1)
            {
                //已领取完毕
                TimesLabel.text = "0";
                CostLabel.text  = GetLabel.text = EB.Localizer.GetString("ID_LEGION_MEDAL_NOT");
                CostLabel.color = LT.Hotfix.Utility.ColorUtility.GreenColor;
            }
            else
            {
                Cur             = stages[curIndex];
                TimesLabel.text = (VIPTemplateManager.Instance.GetTotalNum(VIPPrivilegeKey.LuckyCat) - curIndex).ToString();
                CostLabel.color = (BalanceResourceUtil.GetUserDiamond() < Cur.stage) ? LT.Hotfix.Utility.ColorUtility.RedColor : LT.Hotfix.Utility.ColorUtility.GreenColor;
                CostLabel.text  = Cur.stage.ToString();
                GetLabel.text   = rewardStrs[curIndex].Replace(",", " - ");
            }
        }
Beispiel #3
0
        private void CreateBodyItem(LTActivityTitleItem t)
        {
            object e = t.ActivityData;

            if (bodyItem != null && bodyItem.mDMono != null)
            {
                GameObject.DestroyImmediate(bodyItem.mDMono.gameObject);
            }

            int aid      = EB.Dot.Integer("activity_id", e, 0);
            int nav_type = EB.Dot.Integer("nav_type", e, 0);

            if (nav_type == 0)
            {
                Hotfix_LT.Data.TimeLimitActivityTemplate activity = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivity(aid);
                if (activity == null)
                {
                    return;
                }
                nav_type = (int)activity.nav_type;
            }

            switch (nav_type)
            {
            case 3:
                bodyItem = InstantiateEx <LTActivityBodyItem_Gift>(Template3, InsPartnerTransform, aid.ToString());
                break;

            case 4:
                bodyItem = InstantiateEx <LTActivityBodyItem>(Template4, InsPartnerTransform, aid.ToString());
                break;

            case 5:
                bodyItem = InstantiateEx <LTActivityBodyItem_ScoreRepeat>(Template5, InsPartnerTransform, aid.ToString());
                break;

            case 6:
                bodyItem = InstantiateEx <LTActivityBodyItem_ScoreOnce>(Template6, InsPartnerTransform, aid.ToString());
                break;

            case 7:
                bodyItem = InstantiateEx <LTActivityBodyItem>(Template8, InsPartnerTransform, aid.ToString());
                bodyItem.TimeParent.localPosition    = new Vector3(400, 440, 0);                                  //400,340,0
                bodyItem.ContenPartent.localPosition = new Vector3(0, -500, 0);                                   //zero
                bodyItem.desc.width = bodyItem.desc.transform.GetChild(0).GetComponent <UIWidget>().width = 1200; //1700
                break;

            case 8:
                bodyItem = InstantiateEx <LTActivityBodyItem>(Template8, InsPartnerTransform, aid.ToString());
                bodyItem.TimeParent.localPosition    = new Vector3(-800, 440, 0);                                 //400,340,0
                bodyItem.ContenPartent.localPosition = new Vector3(0, -500, 0);                                   //zero
                bodyItem.desc.width = bodyItem.desc.transform.GetChild(0).GetComponent <UIWidget>().width = 1200; //1700
                break;

            case 9:
                bodyItem = InstantiateEx(Template7, InsPartnerTransform, aid.ToString());
                break;

            case 10:
                bodyItem = InstantiateEx(Template9, InsPartnerTransform, aid.ToString());
                break;

            case 11:
                bodyItem = InstantiateEx(Template10, InsPartnerTransform, aid.ToString());
                break;

            case 12:
                bodyItem = InstantiateEx(Template11, InsPartnerTransform, aid.ToString());
                break;

            case 13:
                bodyItem = InstantiateEx(Template12, InsPartnerTransform, aid.ToString());
                break;

            case 14:
                bodyItem = InstantiateEx(Template13, InsPartnerTransform, aid.ToString());
                break;

            case 15:
                bodyItem = InstantiateEx(Template14, InsPartnerTransform, aid.ToString());
                break;

            case 16:
                bodyItem = InstantiateEx(Template15, InsPartnerTransform, aid.ToString());
                break;

            case 17:
                bodyItem = InstantiateEx(Template16, InsPartnerTransform, aid.ToString());
                break;

            default:
                return;
            }

            string desc = EB.Dot.String("desc", e, "");
            string bg   = EB.Dot.String("bg", e, "");

            if (bodyItem.desc != null)
            {
                bodyItem.desc.text = EB.Localizer.GetString(desc);
            }
            GlobalMenuManager.Instance.LoadRemoteUITexture(bg, bodyItem.BG);

            bodyItem.title      = t;
            bodyItem.controller = controller;
            bodyItem.SetData(e);
        }