Exemplo n.º 1
0
        protected override void CreateSubItem(Hotfix_LT.Data.TimeLimitActivityStageTemplate stage)
        {
            int       stageid  = stage.stage;
            var       rewards  = stage.reward_items;
            Transform itemRoot = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}", stageid));

            if (itemRoot == null)
            {
                var     item = UIControllerHotfix.InstantiateEx(RewardTemplate, RewardTemplate.transform.parent, stageid.ToString());
                UILabel hint = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/HintLabel", stageid)).GetComponent <UILabel>();
                hint.text = EB.Localizer.GetString(string.Format("ID_ACTIVITY_TURNTABLE_{0}", stageid));
            }
            UIGrid    GiftGrid = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/GiftGrid", stageid)).GetComponent <UIGrid>();
            Hashtable activityData;

            DataLookupsCache.Instance.SearchDataByID("tl_acs." + activity_id, out activityData);
            int hasGet = EB.Dot.Integer(string.Format("stages.{0}", stage.id), activityData, 0);

            for (var i = 0; i < rewards.Count; i++)
            {
                var rewardItem = UIControllerHotfix.InstantiateEx <LTShowItem>(ItemTemplate, GiftGrid.transform, stage.id.ToString());
                rewardItem.LTItemData = new LTShowItemData(rewards[i].id, rewards[i].quantity, rewards[i].type, false);
                rewardItem.mDMono.transform.Find("HasGet").gameObject.CustomSetActive(hasGet > 0);
            }
            GiftGrid.Reposition();
        }
Exemplo n.º 2
0
        public void OnFill(Hashtable hash, string timeStr = null)
        {
            if (hash == null || hash.Count == 0)
            {
                EmptyObj.CustomSetActive(true);
                PlayerInfoObj.CustomSetActive(false);
                InfoLabel.text = EB.Localizer.GetString("ID_PASS_INFO_NOBODY_IN_RANK");
                TimeLabel.text = string.Format("{0}{1}", timeStr, EB.Localizer.GetString("ID_NATION_BATTLE_BUFF_FULL_CALL"));
            }
            else
            {
                if (hash.Values != null)
                {
                    foreach (Hashtable Temp in hash.Values)
                    {
                        EmptyObj.CustomSetActive(false);
                        PlayerInfoObj.CustomSetActive(true);
                        string Tid = EB.Dot.String("userTeam.normal.userInfo.leaderId", Temp, null);
                        Tid = (Tid == null) ? "10011" : Tid;
                        int    skin        = EB.Dot.Integer("userTeam.normal.userInfo.skin", Temp, 0);
                        string characterid = Hotfix_LT.Data.CharacterTemplateManager.Instance.TemplateidToCharacterid(Tid);
                        var    charTpl     = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(characterid, skin);

                        PlayerIcon.spriteName = charTpl.icon;
                        string frameStr = EB.Dot.String("userTeam.normal.userInfo.headFrame", Temp, null);
                        PlayerFrame.spriteName = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetHeadFrame(frameStr).iconId;
                        PlayerLevel.text       = EB.Dot.String("userTeam.normal.userInfo.level", Temp, null);

                        InfoLabel.text = EB.Dot.String("userTeam.normal.userInfo.name", Temp, null);
                        TimeLabel.text = timeStr;

                        var teamInfo = LTFormationDataManager.Instance.GetOtherPalyerPartnerDataList("normal", Temp);
                        for (int i = 0; i < 6; ++i)
                        {
                            if (teamInfo.Count > i)//有数据
                            {
                                if (ItemList.Count > i)
                                {
                                    ItemList[i].Fill(teamInfo[i]);
                                }
                                else
                                {
                                    FormationPartnerItem item = UIControllerHotfix.InstantiateEx <FormationPartnerItem>(ItemPrefab, ItemGrid.transform);
                                    item.Fill(teamInfo[i]);
                                    ItemList.Add(item);
                                }
                            }
                            else//无数据
                            {
                                if (ItemList.Count > i)
                                {
                                    ItemList[i].Fill(null);
                                }
                            }
                        }
                        ItemGrid.repositionNow = true;
                    }
                }
            }
        }
Exemplo n.º 3
0
        public override void SetData(object data)
        {
            base.SetData(data);

            if (NavString[0] == "P")
            {
                var payouts = SparxHub.Instance.GetManager <WalletManager>().Payouts;
                BuyLimit.text = "";
                for (int i = 0; i < payouts.Length; i++)
                {
                    if (payouts[i].payoutId == int.Parse(NavString[1]))
                    {
                        BuyLimit.text = string.Format(EB.Localizer.GetString("ID_PURCHASE_LIMIT"), payouts[i].buyLimit);//限购次数
                        for (var j = 0; j < payouts[i].redeemers.Count; j++)
                        {
                            var itemdata = payouts[i].redeemers[j];
                            var item     = UIControllerHotfix.InstantiateEx(ItemTemplate, ItemTemplate.mDMono.transform.parent, (j + 1).ToString());
                            item.LTItemData = new LTShowItemData(itemdata.Data, itemdata.Quantity, itemdata.Type, false);
                        }
                        break;
                    }
                }
            }
            else
            {
                BuyLimit.text = "";
            }
            if (string.IsNullOrEmpty(BuyLimit.text))
            {
                NavLabel.transform.localPosition = new Vector3(0, 18, 0);
            }
            GiftGrid.Reposition();
        }
Exemplo n.º 4
0
        public override void SetData(object data)
        {
            base.SetData(data);

            if (desc != null && desc.text.Contains("{0}"))
            {
                int count = (int)Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("FreeNormalDice");
                desc.text = string.Format(desc.text, count);
            }

            CountLabel.text = LTInstanceMapModel.Instance.GetMonopolyDiceTotleCount().ToString();
            int aid      = EB.Dot.Integer("activity_id", data, 0);
            var activity = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivity(aid);

            if (!string.IsNullOrEmpty(activity.parameter1))
            {
                ArrayList             aList         = EB.JSON.Parse(activity.parameter1) as ArrayList;
                List <LTShowItemData> showItemsList = new List <LTShowItemData>();
                if (aList != null)
                {
                    for (int i = 0; i < aList.Count; i++)
                    {
                        string id    = EB.Dot.String("data", aList[i], string.Empty);
                        int    count = EB.Dot.Integer("quantity", aList[i], 0);
                        string type  = EB.Dot.String("type", aList[i], string.Empty);
                        if (!string.IsNullOrEmpty(id))
                        {
                            LTShowItemData showItemData = new LTShowItemData(id, count, type);
                            showItemsList.Add(showItemData);
                        }
                    }
                }
                for (var i = 0; i < showItemsList.Count; ++i)
                {
                    var item = UIControllerHotfix.InstantiateEx(ItemTemplate, ItemTemplate.mDMono.transform.parent, (i + 1).ToString());
                    item.LTItemData = showItemsList[i];
                }

                GiftGrid.Reposition();
            }

            if (!state.Equals("running") || EB.Time.Now > fintime)
            {
                NavButton.gameObject.CustomSetActive(false);
                CountLabel.gameObject.CustomSetActive(false);
                return;
            }
            else
            {
                NavButton.gameObject.FindEx("RedPoint").CustomSetActive(LTMainHudManager.Instance.CheckEventRedPoint(data));
            }
        }
Exemplo n.º 5
0
        protected override void CreateSubItem(Hotfix_LT.Data.TimeLimitActivityStageTemplate stage)
        {
            int    stageid  = stage.id;
            var    rewards  = stage.reward_items;
            var    item     = UIControllerHotfix.InstantiateEx(RewardTemplate, RewardTemplate.transform.parent, stageid.ToString());
            UIGrid GiftGrid = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/GiftGrid", stageid)).GetComponent <UIGrid>();

            Hashtable activityData;

            DataLookupsCache.Instance.SearchDataByID("tl_acs." + activity_id, out activityData);

            for (var i = 0; i < rewards.Count; i++)
            {
                var rewardItem = UIControllerHotfix.InstantiateEx <LTShowItem>(ItemTemplate, GiftGrid.transform, i.ToString());
                rewardItem.LTItemData = new LTShowItemData(rewards[i].id, rewards[i].quantity, rewards[i].type, false);
            }
            GiftGrid.Reposition();

            int score = EB.Dot.Integer("total", activityData, 0);

            UIButton btn           = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/ReceiveButton", stageid)).GetComponent <UIButton>();
            UILabel  hint          = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/HintLabel", stageid)).GetComponent <UILabel>();
            UILabel  progress      = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/ProgressLabel", stageid)).GetComponent <UILabel>();
            UILabel  realmNumLabel = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/TotleTimesLabel", stageid)).GetComponent <UILabel>();

            if (score >= stage.stage)
            {
                btn.gameObject.CustomSetActive(true);
                hint.gameObject.CustomSetActive(false);
                progress.gameObject.CustomSetActive(false);

                int rewardgot = 0;
                int selfgot   = EB.Dot.Integer(string.Format("stages.{0}", stageid), activityData, 0);
                int TotleNum  = 1;
                if (stage.realm_num > 0)//服务器公共可领取次数
                {
                    TotleNum  = stage.realm_num;
                    rewardgot = EB.Dot.Integer(string.Format("realm_num.{0}", stageid), activityData, 0);
                    realmNumLabel.gameObject.CustomSetActive(true);
                    realmNumLabel.text = string.Format(EB.Localizer.GetString("ID_ACTIVITY_REALM_CHALLENGE_NUM"), TotleNum - rewardgot);
                }
                else
                {
                    TotleNum  = stage.num;
                    rewardgot = selfgot;
                    realmNumLabel.gameObject.CustomSetActive(false);
                }

                if (rewardgot >= TotleNum || selfgot > 0)
                {
                    SetButtonToReceived(stageid, (selfgot > 0) ? null : EB.Localizer.GetString("ID_FINISHED"));
                }
                else
                {
                    UILabel btnlabel = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/ReceiveButton/Label", stageid)).GetComponent <UILabel>();
                    btnlabel.text = EB.Localizer.GetString("ID_BUTTON_LABEL_PULL");
                    int curRealmNum = stage.realm_num;
                    btn.onClick.Add(
                        new EventDelegate(GetReward(stageid,
                                                    delegate() { SetButtonToReceived(stageid); },
                                                    delegate()
                    {
                        UpdateAllSubItem(0);
                    })));
                }
            }
            else
            {
                btn.gameObject.CustomSetActive(false);
                hint.gameObject.CustomSetActive(true);
                progress.gameObject.CustomSetActive(true);
                Hotfix_LT.Data.TimeLimitActivityTemplate activity = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivity(activity_id);

                if (stage.activity_id == 2001 || stage.activity_id >= 6501 && stage.activity_id <= 6505)//累计充值
                {
                    if (activity.title != null)
                    {
                        hint.text = string.Format(activity.title, (float)stage.stage / 100);
                    }
                    progress.text = string.Format("({0}/{1})", (float)score / 100, (float)stage.stage / 100);
                }
                //else if (stage.activity_id == 6506)//副本活动//改用大层后不再需要处理
                //{
                //    var data = SceneTemplateManager.Instance.GetLostChallengeChapterById(stage.stage);
                //    var data2 = SceneTemplateManager.Instance.GetLostChallengeChapterById(score);
                //    if (activity.title != null) hint.text = string.Format(activity.title, data.CurChapter);
                //    progress.text = string.Format("({0}/{1})", (data2 == null ? 0 : (data2.CurChapter - (data2.IsBoss ? 0 : 1))), data.CurChapter);
                //}
                else
                {
                    if (activity.title != null)
                    {
                        hint.text = string.Format(activity.title, stage.stage);
                    }
                    progress.text = string.Format("({0}/{1})", score, stage.stage);
                }
                if (stage.realm_num > 0)//服务器公共可领取次数
                {
                    int rewardgot = 0;
                    int TotleNum  = 1;
                    TotleNum  = stage.realm_num;
                    rewardgot = EB.Dot.Integer(string.Format("realm_num.{0}", stageid), activityData, 0);
                    realmNumLabel.gameObject.CustomSetActive(true);
                    realmNumLabel.text = string.Format(EB.Localizer.GetString("ID_ACTIVITY_REALM_CHALLENGE_NUM"), TotleNum - rewardgot);
                }
            }
        }
Exemplo n.º 6
0
        protected override void CreateSubItem(Hotfix_LT.Data.TimeLimitActivityStageTemplate stage)
        {
            int    stageid  = stage.id;
            var    rewards  = stage.reward_items;
            var    item     = UIControllerHotfix.InstantiateEx(RewardTemplate, RewardTemplate.transform.parent, stageid.ToString());
            UIGrid GiftGrid = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/GiftGrid", stageid)).GetComponent <UIGrid>();

            Hashtable activityData;

            DataLookupsCache.Instance.SearchDataByID("tl_acs." + activity_id, out activityData);

            for (var i = 0; i < rewards.Count; i++)
            {
                var rewardItem = UIControllerHotfix.InstantiateEx <LTShowItem>(ItemTemplate, GiftGrid.transform, i.ToString());
                rewardItem.LTItemData = new LTShowItemData(rewards[i].id, rewards[i].quantity, rewards[i].type, false);
            }
            GiftGrid.Reposition();

            int score = EB.Dot.Integer("current", activityData, 0);

            UIButton   btn      = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/ReceiveButton", stageid)).GetComponent <UIButton>();
            LTShowItem Source   = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/Source", stageid)).GetMonoILRComponent <LTShowItem>();
            UILabel    progress = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/Source/Count", stageid)).GetComponent <UILabel>();

            Source.LTItemData = new LTShowItemData(activity_id.ToString(), 1, "act", false);

            int     rewardgot = EB.Dot.Integer(string.Format("stages.{0}", stageid), activityData, 0);
            UILabel gotLabel  = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/ReceiveButton/Count", stageid)).GetComponent <UILabel>();

            gotLabel.text = string.Format("({0}/{1})", rewardgot, stage.num);

            if (score >= stage.stage)
            {
                btn.isEnabled = true;
                progress.text = string.Format("{0}/{1}", score, stage.stage);


                if (rewardgot >= stage.num)
                {
                    SetButtonToReceived(stageid, EB.Localizer.GetString("ID_EXCHANGE"));
                }
                else
                {
                    UILabel btnlabel = mDMono.transform.Find(string.Format("ScrollView/Placeholder/Grid/{0}/ReceiveButton/Label", stageid)).GetComponent <UILabel>();

                    btnlabel.text = EB.Localizer.GetString("ID_EXCHANGE");
                    btn.onClick.Add(new EventDelegate(GetReward(stageid, delegate()
                    {
                        DataLookupsCache.Instance.SearchDataByID("tl_acs." + activity_id, out activityData);
                        score     = EB.Dot.Integer("current", activityData, 0);
                        rewardgot = EB.Dot.Integer(string.Format("stages.{0}", stageid), activityData, 0);
                        UpdateAllSubItem(score);
                        gotLabel.text = string.Format("({0}/{1})", rewardgot, stage.num);
                        if (rewardgot >= stage.num)
                        {
                            SetButtonToReceived(stageid, EB.Localizer.GetString("ID_EXCHANGE"));
                        }
                        progress.text = string.Format("{0}/{1}", score, stage.stage);
                    })));
                }
            }
            else
            {
                SetButtonToNotReach(stageid, EB.Localizer.GetString("ID_EXCHANGE"));
                progress.text = string.Format("{0}/{1}", score, stage.stage);
            }
        }