Beispiel #1
0
        private void SetDrawCardState()
        {
            string tipstr    = "";
            bool   isshowtip = false;

            if (starttime > EB.Time.Now)
            {
                tipstr    = string.Format("[ff6699]{0}[-]", EB.Localizer.GetString("ID_ACTIVITY_NOTSTARTED"));
                isshowtip = true;
            }
            else if (fintime < EB.Time.Now)
            {
                tipstr    = EB.Localizer.GetString("ID_uifont_in_LTLegionWarQualify_End_4");
                isshowtip = true;
            }
            if (!isshowtip)
            {
                AddCountDownTimer();
                DrawCardrp10.CustomSetActive(BalanceResourceUtil.GetUserDiamond() >= tenDrawcardcost);
            }
            actEndtip.text = actEndtipshadow.text = tipstr;
            endtipobj.CustomSetActive(isshowtip);
            drawcard1.CustomSetActive(!isshowtip);
            drawcard10.CustomSetActive(!isshowtip);
            SetScoreRewardRPState();
            SetDiamondCostLabel();
        }
Beispiel #2
0
        private void OnClickURDrawCardBtn(int times)
        {
            if (!isCouldClick)
            {
                return;
            }
            isCouldClick = false;
            LTHotfixApi.GetInstance().ExceptionFunc = (EB.Sparx.Response response) =>
            {
                if (response.error != null)
                {
                    string   strObjects = (string)response.error;
                    string[] strObject  = strObjects.Split(",".ToCharArray(), 2);
                    switch (strObject[0])
                    {
                    case "event is not running":
                    {
                        MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_uifont_in_LTLegionWarQualify_End_4"));    //活动已结束
                        return(true);
                    }

                    case "nsf":
                    {
                        MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_4, EB.Localizer.GetString("ID_codefont_in_NationBattleSelectTeamController_8317"), delegate(int result)
                            {
                                if (result == 0)
                                {
                                    InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);
                                    GlobalMenuManager.Instance.Open("LTChargeStoreHud", null);
                                }
                            });
                        return(true);
                    }
                    }
                }
                return(false);
            };
            EB.Sparx.Request request = LTHotfixApi.GetInstance().Post("/specialactivity/urbuddylottery");
            request.AddData("activityId", activityId);
            request.AddData("times", times);
            LTHotfixApi.GetInstance().BlockService(request, delegate(Hashtable data)
            {
                DataLookupsCache.Instance.CacheData(data);
                DrawCardrp10.CustomSetActive(BalanceResourceUtil.GetUserDiamond() >= tenDrawcardcost);//跳过抽卡动画时,不会走setdata(),需要此处刷新
                SetDiamondCostLabel();
                if (scoreredtimer == 0)
                {
                    scoreredtimer = ILRTimerManager.instance.AddTimer(1000, 1, SetScoreRewardRPState);
                }
                if (freedrawtimer == 0)
                {
                    AddCountDownTimer();
                }
                LTDrawCardDataManager.Instance.InitAllDrawPartner(data);
                object[] i = { (int)DrawCardType.ur, 1, "" };
                GlobalMenuManager.Instance.Open("LTGetItemUI", i);
                isCouldClick = true;
            });
        }