예제 #1
0
        public void Complete()
        {
            loading.Hide();
            tick.FadeIn(500, Easing.OutQuint);

            Background.FadeColour(colours.Green, 500, Easing.OutQuint);
            progressBar.FillColour = colours.Green;

            this.TransformBindableTo(progressBar.Current, 1, 500, Easing.OutQuint);
        }
예제 #2
0
        protected override APIRequest FetchScores(Action <IEnumerable <ScoreInfo> > scoresCallback)
        {
            var req = new GetRoomPlaylistScoresRequest(roomId, playlistItem.ID);

            req.Success += r =>
            {
                scoresCallback?.Invoke(r.Scores.Where(s => s.ID != Score?.OnlineScoreID).Select(s => s.CreateScoreInfo(playlistItem)));
                loadingLayer.Hide();
            };

            req.Failure += _ => loadingLayer.Hide();

            return(req);
        }
예제 #3
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;
            }
        }
예제 #4
0
 public override void OnFetchData(EB.Sparx.Response res, int reqInstanceID)
 {
     LoadingSpinner.Hide();
     if (res.sucessful)
     {
         string key       = mTaskType == eTaskType.Normal?"user_prize_data.taskliveness_reward.":"user_prize_data.taskliveness_week_reward.";
         string cachePath = key + m_CurrReceiveChest.StageData.Id;
         DataLookupsCache.Instance.CacheData(cachePath, true);
         //上传友盟获得钻石,任务
         int hcCount = 0;
         List <LTShowItemData> mlist = m_CurrReceiveChest.StageData.Awards;
         for (int i = 0; i < mlist.Count; i++)
         {
             if (mlist[i].id == "hc")
             {
                 hcCount += mlist[i].count;
             }
         }
         FusionTelemetry.PostBonus(hcCount, Umeng.GA.BonusSource.Source2);
         GlobalMenuManager.Instance.Open("LTShowRewardView", m_CurrReceiveChest.StageData.Awards);
     }
     else
     {
         res.CheckAndShowModal();
     }
 }
예제 #5
0
 public override void OnFetchData(EB.Sparx.Response res, int id)
 {
     LoadingSpinner.Hide();
     if (res.sucessful)
     {
         List <Hotfix_LT.Data.TimeLimitActivityStageTemplate> stageTmps = Hotfix_LT.Data.EventTemplateManager.Instance.GetTimeLimitActivityStages(ActivityId);
         if (LTHotfixManager.GetManager <TaskManager>().CurrentIndex < stageTmps.Count - 1)
         {
             LTHotfixManager.GetManager <TaskManager>().CurrentIndex++;
         }
         string cachePath;
         cachePath = "user_prize_data.taskacm_reward." + m_Chest.StageData.Id;
         DataLookupsCache.Instance.CacheData(cachePath, true);
         //上传友盟获得钻石,任务
         int hcCount = 0;
         List <LTShowItemData> mlist = m_Chest.StageData.Awards;
         for (int i = 0; i < mlist.Count; i++)
         {
             if (mlist[i].id == "hc")
             {
                 hcCount += mlist[i].count;
             }
         }
         FusionTelemetry.PostBonus(hcCount, Umeng.GA.BonusSource.Source2);
         GlobalMenuManager.Instance.Open("LTShowRewardView", m_Chest.StageData.Awards);
         UpdateChest();
     }
     else
     {
         res.CheckAndShowModal();
         //SparxHub.Instance.FatalError(res.localizedError);
     }
 }
예제 #6
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;
        }
예제 #7
0
        public void OnRequestResponse(EB.Sparx.Response res)
        {
            LoadingSpinner.Hide();
            if (res.sucessful)
            {
                var user = EB.Dot.Object("user", res.hashtable, null);
                if (user == null)
                {
                    Debug.LogError("Missing user object on set name!!!");
                }
                else
                {
                    LoginManager.Instance.LocalUser.Update(user);
                }

                MessageTemplateManager.ShowMessage(902045);
                DataLookupsCache.Instance.CacheData("name", InputLabel.value);
                string name = null;
                if (DataLookupsCache.Instance.SearchDataByID <string>(string.Format("mainlands.pl.{0}.un", LoginManager.Instance.LocalUserId), out name) && !string.IsNullOrEmpty(name))
                {
                    DataLookupsCache.Instance.CacheData(string.Format("mainlands.pl.{0}.un", LoginManager.Instance.LocalUserId), InputLabel.value);
                }

                if (isHadRename)
                {
                    FusionTelemetry.PostBuy(((int)FusionTelemetry.UseHC.hc_playername).ToString(), 1, (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("changeNameCost"));
                }
                controller.Close();
            }
            else
            {
                res.CheckAndShowModal();
            }
        }
예제 #8
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();
        }
예제 #9
0
 private void ProcessResult(EB.Sparx.Response response, System.Action <Hashtable> dataHandler)
 {
     if (!string.IsNullOrEmpty(response.error))
     {
         if (response.error.Equals("timeout"))
         {
             MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTDrawCardAPI_3009"));
             dataHandler(null);
         }
         else
         {
             UIStack.Instance.ShowLoadingScreen(delegate
             {
                 LoadingSpinner.Hide();
                 LTHotfixManager.GetManager <SceneManager>().RequestPlayState();
             }, false, true);
         }
         return;
     }
     dataHandler = dataHandler ?? new System.Action <Hashtable>(DefaultDataHandler);
     if (ProcessResponse(response))
     {
         dataHandler(response.hashtable);
     }
     else
     {
         dataHandler(null);
     }
 }
예제 #10
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;
            }
        });
예제 #11
0
 public override void OnFetchData(Response res, int reqInstanceID)
 {
     LoadingSpinner.Hide();
     if (res.sucessful)
     {
         ShowAward(res.hashtable);
         DataLookupsCache.Instance.CacheData(res.hashtable);
         if (res.hashtable.ContainsKey("heroStats"))
         {
             LTPartnerDataManager.Instance.InitPartnerData();
         }
         mTotalNum = mTotalNum - mCurNum;
         mCurNum   = 1;
         Show();
         if (mTotalNum <= 0)
         {
             UIInventoryBagLogic.Instance.FirstItem = null;
             UIInventoryBagLogic.Instance.RefeshBag(ShowBagContent.Instance.CurType);
             controller.Close();
         }
         else
         {
             UIInventoryBagLogic.Instance.RefeshBag(ShowBagContent.Instance.CurType);
         }
     }
     else if (res.fatal)
     {
         Hub.Instance.FatalError(res.localizedError);
     }
 }
예제 #12
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;
 }
예제 #13
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);
            });
        }
예제 #14
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);
            }
        }
예제 #15
0
    public int BlockService(Request request, Action <Hashtable> dataHandler)
    {
        LoadingSpinner.Show();

        return(endPoint.Service(request, delegate(Response response)
        {
            LoadingSpinner.Hide();
            ProcessResult(response, dataHandler);
        }));
    }
예제 #16
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();
            }));
        }
예제 #17
0
 public void OnResponse(EB.Sparx.Response res)
 {
     LoadingSpinner.Hide();
     if (res.sucessful)
     {
         ShowAward(res.hashtable);
     }
     else if (res.fatal)
     {
         SparxHub.Instance.FatalError(res.localizedError);
     }
 }
예제 #18
0
 public void Update()
 {
     if (_hasStarted && hasOverTime)
     {
         timer += Time.deltaTime;
         if (timer > overTimer)
         {
             EB.Debug.LogError("UILoadingSpinner is TimeOut.Hide!");
             LoadingSpinner.Hide();
             timer = 0;
         }
     }
 }
예제 #19
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);
                }
            }));
        }
예제 #20
0
        public void OnCombatEventArrayReceived(object payload)
        {
            if (LTCombatEventReceiver.Instance != null)
            {
                LTCombatEventReceiver.Instance.OnCombatEventListReceived(payload);
            }

            UIStack.Instance.HideLoadingScreen();
            Hashtable data = payload as Hashtable;

            if (data == null)
            {
                EB.Debug.LogError("Combat message error");
                return;
            }

            ClearPingTime();
            LoadingSpinner.Hide();

            int  eid   = EB.Dot.Integer("combat.eid", data, 0);
            bool reset = EB.Dot.Bool("combat.reset", data, false);

            if (reset)
            {
                int subEid = EB.Dot.Integer("combat.subEid", data, 0);
                Combat.CombatSyncData.Instance.AddQueue(new Combat.CombatResumeEvent(eid, subEid));
                Combat.CombatSyncData.Instance.Parse(data, true);
                return;
            }

            if (eid == 0)
            {
                Combat.CombatSyncData.Instance.Parse(data, true);
                return;//直接处理
            }

            if (Combat.CombatSyncData.Instance.PendingEvents.ContainsKey(eid))
            {
                Combat.CombatSyncData.Instance.PendingEvents[eid] = data;
                EB.Debug.LogWarning(string.Format(" eid {0} repetition!!! ", eid));
            }
            else
            {
                Combat.CombatSyncData.Instance.PendingEvents.Add(eid, data);
            }

            ILRTimerManager.instance.RemoveTimerSafely(ref _WaitForCombatReady_Sequence);
            _WaitForCombatReady_Sequence = ILRTimerManager.instance.AddTimer(1, 0, Update_WaitForCombatReady);
        }
예제 #21
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));
            }
        }
예제 #22
0
파일: Header.cs 프로젝트: appleneko2001/osu
        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);
        }
예제 #23
0
        public override void OnFetchData(EB.Sparx.Response res, int reqInstanceID)
        {
            LoadingSpinner.Hide();

            if (res.sucessful)
            {
                UIInventoryBagLogic.Instance.FirstItem = null;
                ShowAward(res.hashtable);
                DataLookupsCache.Instance.CacheData(res.hashtable);
                UIInventoryBagLogic.Instance.RefeshBag(CurType);
            }
            else if (res.fatal)
            {
                SparxHub.Instance.FatalError(res.localizedError);
            }
        }
예제 #24
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);
        }
예제 #25
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.");
            }
        }
예제 #26
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);
        }
예제 #27
0
 public void OnGetReward(EB.Sparx.Response result)
 {
     LoadingSpinner.Hide();
     if (result.sucessful)
     {
         DataLookupsCache.Instance.CacheData("user_prize_data.level_reward." + m_CurrentGotItemData.id, true);
         ShowGotRewardItems();
     }
     else if (result.fatal)
     {
         SparxHub.Instance.FatalError(result.localizedError);
     }
     else
     {
         MessageDialog.Show(EB.Localizer.GetString("ID_MESSAGE_TITLE_STR"), result.localizedError, EB.Localizer.GetString("ID_MESSAGE_BUTTON_STR"), null, false, true, true, delegate(int ret)
         {
         }, NGUIText.Alignment.Center);
     }
 }
예제 #28
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);
                    }
                }
            });
        }
예제 #29
0
 public override void OnFetchData(EB.Sparx.Response result, int reqInstanceID)
 {
     LoadingSpinner.Hide();
     if (result.sucessful && result.hashtable != null)
     {
         ArrayList array = Hotfix_LT.EBCore.Dot.Array(m_PageDataPath, result.hashtable, null);
         if (array != null)
         {
             UpdateUI(array);
         }
     }
     else if (result.fatal)
     {
         SparxHub.Instance.FatalError(result.localizedError);
     }
     else
     {
         EB.Debug.LogError("Fetch Data Error");
     }
 }
예제 #30
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);
            });
        }