Ejemplo n.º 1
0
        private void showNextStep()
        {
            Debug.Assert(currentStepIndex != null);
            Debug.Assert(stack != null);

            currentStepIndex++;

            if (currentStepIndex < steps.Count)
            {
                var nextScreen = (Screen)Activator.CreateInstance(steps[currentStepIndex.Value]);

                loadingShowDelegate        = Scheduler.AddDelayed(() => loading.Show(), 200);
                nextScreen.OnLoadComplete += _ =>
                {
                    loadingShowDelegate?.Cancel();
                    loading.Hide();
                };

                stack.Push(nextScreen);
            }
            else
            {
                showFirstRunSetup.Value = false;
                currentStepIndex        = null;
                Hide();
            }

            updateButtons();
        }
Ejemplo n.º 2
0
        private void OnBuyTimes()
        {
            if (BuyTimes >= Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("worldBossBuyChallengeMaxTimes"))
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTResourceShopController_3145"));   //��������
                return;
            }
            float cost = Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("worldBossBuyChallengeTimesBase") + Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("worldBossBuyChallengeTimes") * BuyTimes;

            if (BalanceResourceUtil.GetUserDiamond() < cost)//��ʯ����
            {
                BalanceResourceUtil.HcLessMessage();
                return;
            }

            var ht = Johny.HashtablePool.Claim();

            ht.Add("0", cost);
            MessageTemplateManager.ShowMessage(902123, ht, delegate(int result) {
                if (result == 0)
                {
                    LoadingSpinner.Show();
                    BuyTimesRequest.SendRequest();
                }
            });
            Johny.HashtablePool.Release(ht);
        }
Ejemplo n.º 3
0
 public void OnRefresh(EB.Sparx.Response res)
 {
     LoadingSpinner.Hide();
     if (res.sucessful)
     {
         //界面刷新由datalookup
         if (m_RefreshCostId == "hc")
         {
             FusionTelemetry.PostBuy(((int)FusionTelemetry.UseHC.hc_resetstore).ToString(), 1, refreshBlueCostCache);
         }
         ShowRefreshPrice();
         StartCoroutine(RefreshFxPlay());
     }
     else if (res.fatal)
     {
         SparxHub.Instance.FatalError(res.localizedError);
     }
     else
     {
         MessageTemplateManager.ShowMessage(901018, null, delegate(int result)
         {
             if (result == 0)
             {
                 m_RefreshRequest.SendRequest();
                 LoadingSpinner.Show();
             }
         });
     }
     isRefresh = false;
 }
Ejemplo n.º 4
0
        public void Open(int characterId, bool blockUI, System.Action <eResponseCode, Hashtable> callback)
        {
            var request = endPoint.Post("/character/open");

            request.AddData("characterId", characterId);

            if (blockUI)
            {
                LoadingSpinner.Show();
            }
            endPoint.Service(request, delegate(Response result)
            {
                if (blockUI)
                {
                    LoadingSpinner.Hide();
                }

                if (result.sucessful)
                {
                    callback(eResponseCode.Success, result.hashtable);
                    return;
                }

                callback(CheckError(result.error.ToString()), null);
            });
        }
Ejemplo n.º 5
0
        private void onlineStateChanged(ValueChangedEvent <APIState> state) => Schedule(() =>
        {
            switch (state.NewValue)
            {
            case APIState.Offline:
                PopContentOut(Content);
                placeholder.ScaleTo(0.8f).Then().ScaleTo(1, 3 * transform_duration, Easing.OutQuint);
                placeholder.FadeInFromZero(2 * transform_duration, Easing.OutQuint);
                LoadingSpinner.Hide();
                break;

            case APIState.Online:
                PopContentIn(Content);
                placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
                LoadingSpinner.Hide();
                break;

            case APIState.Failing:
            case APIState.Connecting:
                PopContentOut(Content);
                LoadingSpinner.Show();
                placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
                break;
            }
        });
Ejemplo n.º 6
0
        public TestSceneLoadingSpinner()
        {
            LoadingSpinner loading = new LoadingSpinner(true, true);

            loading.Show();
            Add(loading);
        }
Ejemplo n.º 7
0
        public virtual void APIStateChanged(IAPIProvider api, APIState state)
        {
            switch (state)
            {
            case APIState.Offline:
                PopContentOut(Content);
                placeholder.ScaleTo(0.8f).Then().ScaleTo(1, 3 * transform_duration, Easing.OutQuint);
                placeholder.FadeInFromZero(2 * transform_duration, Easing.OutQuint);
                LoadingSpinner.Hide();
                break;

            case APIState.Online:
                PopContentIn(Content);
                placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
                LoadingSpinner.Hide();
                break;

            case APIState.Failing:
            case APIState.Connecting:
                PopContentOut(Content);
                LoadingSpinner.Show();
                placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
                break;
            }
        }
Ejemplo n.º 8
0
        private IEnumerator WaitUpdataMap(System.Action callback = null, bool isCleanMove = true)
        {
            LoadingSpinner.Show();
            isWaitForUpdataMap = true;
            if (isCleanMove && moveActionList != null)
            {
                moveActionList.Clear();
            }
            bool iswait = false;

            while (LTInstanceMapModel.Instance.RequestDirQueue.Count > 0 || LTInstanceMapModel.Instance.DealDirQueue.Count > 0)
            {
                iswait = true;
                yield return(null);
            }
            while (!isNotRequest)
            {
                iswait = true;
                yield return(null);
            }

            if (iswait)//如果等待过就多等下
            {
                yield return(null);
            }

            isWaitForUpdataMap = false;
            if (callback != null)
            {
                callback();
            }
            LoadingSpinner.Hide();
            yield break;
        }
Ejemplo n.º 9
0
 public void OnUse()
 {
     mUseRequest.parameters[0].parameter = curItemInfo.InventoryId.Replace("inventory.", "");
     mUseRequest.parameters[1].parameter = mCurNum.ToString();
     LoadingSpinner.Show();
     mUseRequest.SendRequest();
     dataLookup.ClearShowCache();
 }
Ejemplo n.º 10
0
 public void OnUse()
 {
     mUseRequest.parameters[0].parameter = EB.Dot.String("inventory_id", BagItemData, null);
     mUseRequest.parameters[1].parameter = EB.Dot.Integer("num", BagItemData, 0).ToString();
     LoadingSpinner.Show();
     mUseRequest.SendRequest();
     dataLookup.ClearShowCache();
 }
Ejemplo n.º 11
0
 protected void FetchDataRemote()
 {
     if (m_UIServerRequest != null)
     {
         LoadingSpinner.Show();
         m_UIServerRequest.SendRequest();
     }
 }
Ejemplo n.º 12
0
        private void currentChannelChanged(ValueChangedEvent <Channel> e)
        {
            if (e.NewValue == null)
            {
                textbox.Current.Disabled = true;
                currentChannelContainer.Clear(false);
                ChannelSelectionOverlay.Show();
                return;
            }

            if (e.NewValue is ChannelSelectorTabItem.ChannelSelectorTabChannel)
            {
                return;
            }

            textbox.Current.Disabled = e.NewValue.ReadOnly;

            if (ChannelTabControl.Current.Value != e.NewValue)
            {
                Scheduler.Add(() => ChannelTabControl.Current.Value = e.NewValue);
            }

            var loaded = loadedChannels.Find(d => d.Channel == e.NewValue);

            if (loaded == null)
            {
                currentChannelContainer.FadeOut(500, Easing.OutQuint);
                loading.Show();

                loaded = new DrawableChannel(e.NewValue);
                loadedChannels.Add(loaded);
                LoadComponentAsync(loaded, l =>
                {
                    if (currentChannel.Value != e.NewValue)
                    {
                        return;
                    }

                    loading.Hide();

                    currentChannelContainer.Clear(false);
                    currentChannelContainer.Add(loaded);
                    currentChannelContainer.FadeIn(500, Easing.OutQuint);
                });
            }
            else
            {
                currentChannelContainer.Clear(false);
                currentChannelContainer.Add(loaded);
            }

            // mark channel as read when channel switched
            if (e.NewValue.Messages.Any())
            {
                channelManager.MarkChannelAsRead(e.NewValue);
            }
        }
Ejemplo n.º 13
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            load1.Show();
            load2.Show();

            text.Loop(b => b.ScaleTo(1.25f, 0, Easing.None).ScaleTo(1.0f, 1000f, Easing.OutQuint).Then());
        }
Ejemplo n.º 14
0
    public int BlockService(Request request, Action <Hashtable> dataHandler)
    {
        LoadingSpinner.Show();

        return(endPoint.Service(request, delegate(Response response)
        {
            LoadingSpinner.Hide();
            ProcessResult(response, dataHandler);
        }));
    }
Ejemplo n.º 15
0
        private int BlockService(EB.Sparx.Request request, System.Action <Hashtable> dataHandler)
        {
            LoadingSpinner.Show();

            return(endPoint.Service(request, delegate(EB.Sparx.Response response)
            {
                ProcessResult(response, dataHandler);
                LoadingSpinner.Hide();
            }));
        }
Ejemplo n.º 16
0
        public ProgressRoundedButton()
        {
            base.Action = () =>
            {
                loading.Show();
                Enabled.Value = false;

                Action?.Invoke();
            };
        }
Ejemplo n.º 17
0
        private int BlockService(EB.Sparx.Request request, Func <EB.Sparx.Response, bool> responseFunc)
        {
            LoadingSpinner.Show();

            return(endPoint.Service(request, delegate(EB.Sparx.Response response)
            {
                LoadingSpinner.Hide();
                if (responseFunc != null && !responseFunc(response)) //如果没有处理完成
                {
                    ProcessError(response);
                }
            }));
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 刷新时间
        /// </summary>
        /// <param name="time"></param>
        /// <returns></returns>
        IEnumerator ReflashGiftTime(int nextflashtime, LTChargeManager.ECycleTimeType type)
        {
            controller.GObjects["ReflashPanel"].CustomSetActive(true);
            while (true)
            {
                int timestamp = nextflashtime - EB.Time.ToPosixTime(Hotfix_LT.Data.ZoneTimeDiff.GetServerTime()) + 60;
                int day       = timestamp / 86400;
                int hour      = timestamp / 3600 % 24;
                int min       = timestamp / 60 % 60;
                if (timestamp < 60)
                {
                    LoadingSpinner.Show();
                    LTChargeManager.Instance.InitReflashTime();
                    switch (type)
                    {
                    case LTChargeManager.ECycleTimeType.eDay:
                        nextflashtime = LTChargeManager.Instance.DayGiftNextReflashTime;
                        break;

                    case LTChargeManager.ECycleTimeType.eWeek:
                        nextflashtime = LTChargeManager.Instance.WeekGiftNextReflashTime;
                        break;

                    case LTChargeManager.ECycleTimeType.eMonth:
                        nextflashtime = LTChargeManager.Instance.MonthGiftNextReflashTime;
                        break;

                    case LTChargeManager.ECycleTimeType.eYear:
                        break;

                    default:
                        break;
                    }

                    Hub.Instance.GetManager <WalletManager>().Connect();
                    yield return(new WaitForSeconds(0.2f));

                    ShowUI(curChargeType);
                    ReflashFreeGiftRP();
                    LoadingSpinner.Hide();
                    controller.UiLabels["ReflashTime"].text = string.Format(EB.Localizer.GetString("ID_CHARGE_GIFTREFLASH_TIME"), day, hour, min);
                }
                else
                {
                    controller.UiLabels["ReflashTime"].text = string.Format(EB.Localizer.GetString("ID_CHARGE_GIFTREFLASH_TIME"), day, hour, min);
                }
                yield return(new WaitForSeconds(1.0f));
            }
        }
Ejemplo n.º 19
0
        private void load(OverlayColourProvider colourProvider)
        {
            coverGradient.Colour = ColourInfo.GradientVertical(colourProvider.Background6.Opacity(0.3f), colourProvider.Background6.Opacity(0.8f));
            onlineStatusPill.BackgroundColour = colourProvider.Background6;

            State.BindValueChanged(_ => updateDownloadButtons());

            BeatmapSet.BindValueChanged(setInfo =>
            {
                Picker.BeatmapSet = RulesetSelector.BeatmapSet = author.BeatmapSet = beatmapAvailability.BeatmapSet = Details.BeatmapSet = setInfo.NewValue;
                cover.BeatmapSet  = setInfo.NewValue;

                if (setInfo.NewValue == null)
                {
                    onlineStatusPill.FadeTo(0.5f, 500, Easing.OutQuint);
                    fadeContent.Hide();

                    loading.Show();

                    downloadButtonsContainer.FadeOut(transition_duration);
                    favouriteButton.FadeOut(transition_duration);
                }
                else
                {
                    fadeContent.FadeIn(500, Easing.OutQuint);

                    loading.Hide();

                    // Make BeatmapInfo overlay shows unicoded title and artist
                    // Actually the API responce are provided those values but the class implements cant see them

                    // Use LocalisedString to insert the unicode title and artist strings
                    title.Text = new LocalisedString((
                                                         setInfo.NewValue.Metadata.TitleUnicode, // TitleUnicode text from API responce
                                                         setInfo.NewValue.Metadata.Title ?? string.Empty));
                    artist.Text = new LocalisedString((
                                                          setInfo.NewValue.Metadata.ArtistUnicode, // ArtistUnicode text from API responce
                                                          setInfo.NewValue.Metadata.Artist ?? string.Empty));

                    onlineStatusPill.FadeIn(500, Easing.OutQuint);
                    onlineStatusPill.Status = setInfo.NewValue.OnlineInfo.Status;

                    downloadButtonsContainer.FadeIn(transition_duration);
                    favouriteButton.FadeIn(transition_duration);

                    updateDownloadButtons();
                }
            }, true);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// 购买
        /// </summary>
        public void BuyClick(StoreItemData target)
        {
            if (target.sell_out)
            {
                return;
            }
            int isCanBuyMessageId = 0;

            if (!GameItemUtil.GetItemIsCanBuy(target.id, target.type, out isCanBuyMessageId))
            {
                MessageTemplateManager.ShowMessage(isCanBuyMessageId);
                return;
            }

            if (BalanceResourceUtil.GetResValue(target.cost_id) < target.cost)
            {
                if (target.cost_id.Equals("hc"))
                {
                    BalanceResourceUtil.HcLessMessage();
                    return;
                }
                else if (target.cost_id.Equals("gold"))
                {
                    MessageTemplateManager.ShowMessage(901031, null, delegate(int result)
                    {
                        if (result == 0)
                        {
                            InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);
                            GlobalMenuManager.Instance.Open("LTResourceShopUI");
                        }
                    });
                    return;
                }
                else
                {
                    var ht = Johny.HashtablePool.Claim();
                    ht.Add("0", BalanceResourceUtil.GetResName(target.cost_id));
                    MessageTemplateManager.ShowMessage(902022, ht, null);
                    Johny.HashtablePool.Release(ht);
                    return;
                }
            }
            m_buytarget = target;
            m_BuyRequest.parameters[0].parameter = target.store_type;
            m_BuyRequest.parameters[1].parameter = target.buy_id.ToString();
            m_BuyRequest.parameters[2].parameter = m_buytarget.cost.ToString();
            m_BuyRequest.SendRequest();
            LoadingSpinner.Show();
        }
Ejemplo n.º 21
0
        public TestSceneLoadingSpinner()
            : base(2, 2)
        {
            LoadingSpinner loading;

            Cell(0).AddRange(new Drawable[]
            {
                new Box
                {
                    Colour           = Colour4.Black,
                    RelativeSizeAxes = Axes.Both
                },
                loading = new LoadingSpinner()
            });

            loading.Show();

            Cell(1).AddRange(new Drawable[]
            {
                new Box
                {
                    Colour           = Colour4.White,
                    RelativeSizeAxes = Axes.Both
                },
                loading = new LoadingSpinner(true)
            });

            loading.Show();

            Cell(2).AddRange(new Drawable[]
            {
                new Box
                {
                    Colour           = Colour4.Gray,
                    RelativeSizeAxes = Axes.Both
                },
                loading = new LoadingSpinner()
            });

            loading.Show();

            Cell(3).AddRange(new Drawable[]
            {
                loading = new LoadingSpinner()
            });

            Scheduler.AddDelayed(() => loading.ToggleVisibility(), 200, true);
        }
Ejemplo n.º 22
0
        private void load(OverlayColourProvider colourProvider)
        {
            coverGradient.Colour = ColourInfo.GradientVertical(colourProvider.Background6.Opacity(0.3f), colourProvider.Background6.Opacity(0.8f));

            BeatmapSet.BindValueChanged(setInfo =>
            {
                Picker.BeatmapSet = rulesetSelector.BeatmapSet = author.BeatmapSet = beatmapAvailability.BeatmapSet = Details.BeatmapSet = setInfo.NewValue;
                cover.OnlineInfo  = setInfo.NewValue;

                downloadTracker?.RemoveAndDisposeImmediately();

                if (setInfo.NewValue == null)
                {
                    onlineStatusPill.FadeTo(0.5f, 500, Easing.OutQuint);
                    fadeContent.Hide();

                    loading.Show();

                    downloadButtonsContainer.FadeOut(transition_duration);
                    favouriteButton.FadeOut(transition_duration);
                }
                else
                {
                    downloadTracker = new BeatmapDownloadTracker(setInfo.NewValue);
                    downloadTracker.State.BindValueChanged(_ => updateDownloadButtons());
                    AddInternal(downloadTracker);

                    fadeContent.FadeIn(500, Easing.OutQuint);

                    loading.Hide();

                    title.Text  = new RomanisableString(setInfo.NewValue.TitleUnicode, setInfo.NewValue.Title);
                    artist.Text = new RomanisableString(setInfo.NewValue.ArtistUnicode, setInfo.NewValue.Artist);

                    explicitContent.Alpha = setInfo.NewValue.HasExplicitContent ? 1 : 0;
                    spotlight.Alpha       = setInfo.NewValue.FeaturedInSpotlight ? 1 : 0;
                    featuredArtist.Alpha  = setInfo.NewValue.TrackId != null ? 1 : 0;

                    onlineStatusPill.FadeIn(500, Easing.OutQuint);

                    downloadButtonsContainer.FadeIn(transition_duration);
                    favouriteButton.FadeIn(transition_duration);

                    updateDownloadButtons();
                }
            }, true);
        }
Ejemplo n.º 23
0
        public void OnSureBtnClick()
        {
            if (string.IsNullOrEmpty(InputLabel.value))
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_INPUT_EMPTY")); //MenuManager.Warning("ID_INPUT_EMPTY");
                return;
            }

            if (InputLabel.value.IndexOf(" ") >= 0)
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_INPUT_CONTAINS_SPACE")); //MenuManager.Warning("ID_INPUT_CONTAINS_SPACE");
                return;
            }

            if (InputLabel.value.IndexOf("\n") >= 0)
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_INPUT_CONTAINS_NEWLINE")); //MenuManager.Warning("ID_INPUT_CONTAINS_NEWLINE");
                return;
            }

            if (InputLabel.value.Equals(LTGameSettingController.GetPlayerName()))
            {
                MessageTemplateManager.ShowMessage(901023);
                return;
            }

            if (isHadRename && BalanceResourceUtil.GetUserDiamond() < (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("changeNameCost"))
            {
                BalanceResourceUtil.HcLessMessage();
                return;
            }

            if (!isRandomName && (!EB.ProfanityFilter.Test(InputLabel.value) || !IsNormalName(InputLabel.value)))
            {
                MessageDialog.Show(EB.Localizer.GetString("ID_MESSAGE_TITLE_STR"),
                                   EB.Localizer.GetString("ID_NAME_ILLEGEL"),
                                   EB.Localizer.GetString("ID_MESSAGE_BUTTON_STR"), null, false, true, true, null, NGUIText.Alignment.Center);
                return;
            }

            LoadingSpinner.Show();
            var req = controller.transform.GetComponent <UIServerRequest>();

            req.parameters[0].parameter = InputLabel.value;
            req.SendRequest();
        }
Ejemplo n.º 24
0
        private void updateState()
        {
            switch (state.Value)
            {
            case DownloadState.Downloading:
            case DownloadState.Importing:
                Action      = null;
                TooltipText = string.Empty;
                spinner.Show();
                Icon.Hide();
                break;

            case DownloadState.LocallyAvailable:
                Action      = null;
                TooltipText = string.Empty;
                this.FadeOut(BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
                break;

            case DownloadState.NotDownloaded:
                if (beatmapSet.Availability.DownloadDisabled)
                {
                    Enabled.Value = false;
                    TooltipText   = BeatmapsetsStrings.AvailabilityDisabled;
                    return;
                }

                Action = () => beatmaps.Download(beatmapSet, preferNoVideo.Value);
                this.FadeIn(BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
                spinner.Hide();
                Icon.Show();

                if (!beatmapSet.HasVideo)
                {
                    TooltipText = BeatmapsetsStrings.PanelDownloadAll;
                }
                else
                {
                    TooltipText = preferNoVideo.Value ? BeatmapsetsStrings.PanelDownloadNoVideo : BeatmapsetsStrings.PanelDownloadVideo;
                }
                break;

            default:
                throw new InvalidOperationException($"Unknown {nameof(DownloadState)} specified.");
            }
        }
Ejemplo n.º 25
0
        private void load(OverlayColourProvider colourProvider)
        {
            coverGradient.Colour = ColourInfo.GradientVertical(colourProvider.Background6.Opacity(0.3f), colourProvider.Background6.Opacity(0.8f));
            onlineStatusPill.BackgroundColour = colourProvider.Background6;

            State.BindValueChanged(_ => updateDownloadButtons());

            BeatmapSet.BindValueChanged(setInfo =>
            {
                Picker.BeatmapSet = rulesetSelector.BeatmapSet = author.BeatmapSet = beatmapAvailability.BeatmapSet = Details.BeatmapSet = setInfo.NewValue;
                cover.BeatmapSet  = setInfo.NewValue;

                if (setInfo.NewValue == null)
                {
                    onlineStatusPill.FadeTo(0.5f, 500, Easing.OutQuint);
                    fadeContent.Hide();

                    loading.Show();

                    downloadButtonsContainer.FadeOut(transition_duration);
                    favouriteButton.FadeOut(transition_duration);
                }
                else
                {
                    fadeContent.FadeIn(500, Easing.OutQuint);

                    loading.Hide();

                    title.Text  = new RomanisableString(setInfo.NewValue.Metadata.TitleUnicode, setInfo.NewValue.Metadata.Title);
                    artist.Text = new RomanisableString(setInfo.NewValue.Metadata.ArtistUnicode, setInfo.NewValue.Metadata.Artist);

                    explicitContentPill.Alpha = setInfo.NewValue.OnlineInfo.HasExplicitContent ? 1 : 0;

                    onlineStatusPill.FadeIn(500, Easing.OutQuint);
                    onlineStatusPill.Status = setInfo.NewValue.OnlineInfo.Status;

                    downloadButtonsContainer.FadeIn(transition_duration);
                    favouriteButton.FadeIn(transition_duration);

                    updateDownloadButtons();
                }
            }, true);
        }
Ejemplo n.º 26
0
        public void BuySlots(int characterId, System.Action <eResponseCode, int, int> callback)
        {
            CharacterRecord currentRecord = CharacterManager.Instance.CurrentCharacter;

            if (characterId != currentRecord.Id)
            {
                EB.Debug.LogError("Cannot buy item slots on a character you are not currently playing");
                return;
            }

            var request = endPoint.Post("/equipment/buySlots");

            request.AddData("characterId", characterId);

            LoadingSpinner.Show();
            endPoint.Service(request, delegate(Response response) {
                LoadingSpinner.Hide();
                if (response.sucessful)
                {
                    int maxItems     = EB.Dot.Integer("maxItems", response.hashtable, currentRecord.EquipmentRecord.maxItems);
                    int hardCurrency = EB.Dot.Integer("hardCurrency", response.hashtable, ProfileManager.Instance.HardCurrency);

                    currentRecord.EquipmentRecord.maxItems = maxItems;
                    ProfileManager.Instance.HardCurrency   = hardCurrency;

                    DebugSystem.Log("Item slots: " + maxItems);
                    DebugSystem.Log("Hard currency: " + hardCurrency);

                    if (callback != null)
                    {
                        callback(eResponseCode.Success, maxItems, hardCurrency);
                    }
                }
                else
                {
                    if (callback != null)
                    {
                        callback(CheckError(response.error.ToString()), 0, 0);
                    }
                }
            });
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 刷新按钮
        /// </summary>
        public void RefreshBtnClick()
        {
            FusionAudio.PostEvent("UI/General/ButtonClick");

            //提示刷新花费
            if (BalanceResourceUtil.GetResValue(m_RefreshCostId) < m_RefreshCost)
            {
                if (m_RefreshCostId.Equals("hc"))
                {
                    BalanceResourceUtil.HcLessMessage();
                    return;
                }
                else
                {
                    var ht = Johny.HashtablePool.Claim();
                    ht.Add("0", BalanceResourceUtil.GetResName(m_RefreshCostId));
                    MessageTemplateManager.ShowMessage(902022, ht, null);
                    Johny.HashtablePool.Release(ht);
                    return;
                }
            }
            if (m_RefreshCostId == "hc")
            {
                refreshBlueCostCache = m_RefreshCost;
            }

            {
                var ht = Johny.HashtablePool.Claim();
                ht.Add("0", m_RefreshCost);
                ht.Add("1", BalanceResourceUtil.GetResName(m_RefreshCostId));
                MessageTemplateManager.ShowMessage(902020, ht, delegate(int result)
                {
                    if (result == 0)
                    {
                        m_RefreshRequest.SendRequest();
                        LoadingSpinner.Show();
                    }
                });
                Johny.HashtablePool.Release(ht);
            }
        }
Ejemplo n.º 28
0
        public void Create(Hashtable properties, Hashtable generalRecord, System.Action <eResponseCode, Hashtable> callback)
        {
            var request = endPoint.Post("/character/create");

            request.AddData("properties", properties);
            request.AddData("generalRecord", generalRecord);

            LoadingSpinner.Show();

            endPoint.Service(request, delegate(Response result)
            {
                LoadingSpinner.Hide();
                if (result.sucessful)
                {
                    callback(eResponseCode.Success, result.hashtable);
                    return;
                }

                callback(CheckError(result.error.ToString()), null);
            });
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 扫荡按钮点击
        /// </summary>
        public void OnBlitzBtnClick()
        {
            int hcnum = 0;//判断钻石是否足够

            DataLookupsCache.Instance.SearchIntByID("res.hc.v", out hcnum);
            if (hcnum < hcCost)
            {
                MessageTemplateManager.ShowMessage(901030, null, delegate(int r)
                {
                    if (r == 0)
                    {
                        InputBlockerManager.Instance.Block(InputBlockReason.FUSION_BLOCK_UI_INTERACTION, 0.5f);
                        GlobalMenuManager.Instance.Open("LTChargeStoreHud", null);
                    }
                });
                return;
            }

            MessageTemplateManager.ShowMessage(902308, null, delegate(int result)
            {
                if (result == 0)
                {
                    //判断券是否足够
                    int num = 0;//判断钻石是否足够
                    DataLookupsCache.Instance.SearchIntByID("res.chall-camp-point.v", out num);
                    if (num < blitzCost)
                    {
                        MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTChallengeInstancePortalCtrl_1451"));
                        return;
                    }
                    showBtn = false;//true;
                    BlitzRequest.parameters[0].parameter = CurSelectLevel.ToString();
                    BlitzRequest.parameters[1].parameter = "0";
                    LoadingSpinner.Show();
                    curHcCount = BalanceResourceUtil.GetUserDiamond();
                    BlitzRequest.SendRequest();
                }
            });
        }
Ejemplo n.º 30
0
 public void OnRequestStoreData(EB.Sparx.Response res)
 {
     LoadingSpinner.Hide();
     if (res.sucessful)
     {
         //界面刷新由datalookup
         //RefreshData();
     }
     else if (res.fatal)
     {
         SparxHub.Instance.FatalError(res.localizedError);
     }
     else
     {
         MessageTemplateManager.ShowMessage(901018, null, delegate(int result)
         {
             if (result == 0)
             {
                 m_GetDataRequest.SendRequest();
                 LoadingSpinner.Show();
             }
         });
     }
 }