示例#1
0
        public void SetUpSteps()
        {
            AddStep("setup overlay", () =>
            {
                Child = overlay = new BeatmapListingOverlay {
                    State = { Value = Visibility.Visible }
                };
                setsForResponse.Clear();
            });

            AddStep("initialize dummy", () =>
            {
                var api = (DummyAPIAccess)API;

                api.HandleRequest = req =>
                {
                    if (!(req is SearchBeatmapSetsRequest searchBeatmapSetsRequest))
                    {
                        return(false);
                    }

                    searchBeatmapSetsRequest.TriggerSuccess(new SearchBeatmapSetsResponse
                    {
                        BeatmapSets = setsForResponse,
                    });

                    return(true);
                };
示例#2
0
        private void load()
        {
            Child = overlay = new BeatmapListingOverlay {
                State = { Value = Visibility.Visible }
            };

            ((DummyAPIAccess)API).HandleRequest = req =>
            {
                if (!(req is SearchBeatmapSetsRequest searchBeatmapSetsRequest))
                {
                    return(false);
                }

                searchBeatmapSetsRequest.TriggerSuccess(new SearchBeatmapSetsResponse
                {
                    BeatmapSets = setsForResponse,
                });

                return(true);
            };

            AddStep("initialize dummy", () =>
            {
                // non-supporter user
                ((DummyAPIAccess)API).LocalUser.Value = new User
                {
                    Username = "******",
                    Id       = API.LocalUser.Value.Id + 1,
                };
            });
        }
        private void load()
        {
            Child = overlay = new BeatmapListingOverlay {
                State = { Value = Visibility.Visible }
            };

            ((DummyAPIAccess)API).HandleRequest = req =>
            {
                if (req is SearchBeatmapSetsRequest searchBeatmapSetsRequest)
                {
                    searchBeatmapSetsRequest.TriggerSuccess(new SearchBeatmapSetsResponse
                    {
                        BeatmapSets = setsForResponse,
                    });
                }
            };
        }
示例#4
0
 public TestSceneBeatmapListingOverlay()
 {
     Add(overlay = new BeatmapListingOverlay());
 }
示例#5
0
        private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings, RankingsOverlay rankings, OsuConfigManager config, SessionStatics statics)
        {
            holdDelay      = config.GetBindable <float>(OsuSetting.UIHoldActivationDelay);
            loginDisplayed = statics.GetBindable <bool>(Static.LoginOverlayDisplayed);

            if (host.CanExit)
            {
                AddInternal(exitConfirmOverlay = new ExitConfirmOverlay
                {
                    Action = () =>
                    {
                        if (holdDelay.Value > 0)
                        {
                            confirmAndExit();
                        }
                        else
                        {
                            this.Exit();
                        }
                    }
                });
            }

            AddRangeInternal(new[]
            {
                buttonsContainer = new ParallaxContainer
                {
                    ParallaxAmount = 0.01f,
                    Children       = new Drawable[]
                    {
                        buttons = new ButtonSystem
                        {
                            OnEdit  = delegate { this.Push(new Editor()); },
                            OnSolo  = onSolo,
                            OnMulti = delegate { this.Push(new Multiplayer()); },
                            OnExit  = confirmAndExit,
                        }
                    }
                },
                sideFlashes = new MenuSideFlashes(),
                songTicker  = new SongTicker
                {
                    Anchor = Anchor.TopRight,
                    Origin = Anchor.TopRight,
                    Margin = new MarginPadding {
                        Right = 15, Top = 5
                    }
                },
                exitConfirmOverlay?.CreateProxy() ?? Drawable.Empty()
            });

            buttons.StateChanged += state =>
            {
                switch (state)
                {
                case ButtonSystemState.Initial:
                case ButtonSystemState.Exit:
                    Background.FadeColour(Color4.White, 500, Easing.OutSine);
                    break;

                default:
                    Background.FadeColour(OsuColour.Gray(0.8f), 500, Easing.OutSine);
                    break;
                }
            };

            buttons.OnSettings       = () => settings?.ToggleVisibility();
            buttons.OnBeatmapListing = () => beatmapListing?.ToggleVisibility();
            buttons.OnChart          = () => rankings?.ShowSpotlights();

            LoadComponentAsync(background = new BackgroundScreenDefault());
            preloadSongSelect();
        }
 private void load(BeatmapListingOverlay beatmapListing)
 {
     StateContainer = beatmapListing;
 }