Beispiel #1
0
        public MainMenu()
        {
            background = new BackgroundScreenDefault();

            Children = new Drawable[]
            {
                new ParallaxContainer
                {
                    ParallaxAmount = 0.01f,
                    Children       = new Drawable[]
                    {
                        buttons = new ButtonSystem
                        {
                            OnChart  = delegate { Push(new ChartListing()); },
                            OnDirect = delegate { Push(new OnlineListing()); },
                            OnEdit   = delegate { Push(new Editor()); },
                            OnSolo   = delegate { Push(consumeSongSelect()); },
                            OnMulti  = delegate { Push(new Lobby()); },
                            OnExit   = delegate { Exit(); },
                        }
                    }
                },
                sideFlashes = new MenuSideFlashes(),
            };
        }
Beispiel #2
0
        public MainMenu()
        {
            background = new BackgroundScreenDefault();

            Children = new Drawable[]
            {
                new ExitConfirmOverlay
                {
                    Action = Exit,
                },
                new ParallaxContainer
                {
                    ParallaxAmount = 0.01f,
                    Children       = new Drawable[]
                    {
                        buttons = new ButtonSystem
                        {
                            OnChart  = delegate { Push(new ChartListing()); },
                            OnDirect = delegate { Push(new OnlineListing()); },
                            OnEdit   = delegate { Push(new Editor()); },
                            OnSolo   = onSolo,
                            OnMulti  = delegate { Push(new Multiplayer()); },
                            OnExit   = Exit,
                        }
                    }
                },
                sideFlashes = new MenuSideFlashes(),
            };
        }
Beispiel #3
0
        private void load(OsuGame game = null)
        {
            if (host.CanExit)
            {
                AddInternal(new ExitConfirmOverlay {
                    Action = this.Exit
                });
            }

            AddRangeInternal(new Drawable[]
            {
                new ParallaxContainer
                {
                    ParallaxAmount = 0.01f,
                    Children       = new Drawable[]
                    {
                        buttons = new ButtonSystem
                        {
                            OnChart  = delegate { this.Push(new ChartListing()); },
                            OnDirect = delegate { this.Push(new OnlineListing()); },
                            OnEdit   = delegate { this.Push(new Editor()); },
                            OnSolo   = onSolo,
                            OnMulti  = delegate { this.Push(new Multiplayer()); },
                            OnExit   = this.Exit,
                        }
                    }
                },
                sideFlashes = new MenuSideFlashes(),
            });

            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;
                }
            };

            if (game != null)
            {
                buttons.OnSettings = game.ToggleSettings;
                buttons.OnDirect   = game.ToggleDirect;
            }

            LoadComponentAsync(background = new BackgroundScreenDefault());
            preloadSongSelect();
        }
Beispiel #4
0
        private void load()
        {
            AddRangeInternal(new Drawable[]
            {
                new BeatmapLevelListing {
                    RelativeSizeAxes = Axes.Both
                },
            });

            LoadComponentAsync(background = new BackgroundScreenDefault());
        }
Beispiel #5
0
        public MainMenu()
        {
            background = new BackgroundScreenDefault();

            Children = new Drawable[]
            {
                new ExitConfirmOverlay
                {
                    Action = Exit,
                },
                new ParallaxContainer
                {
                    ParallaxAmount = 0.01f,
                    Children       = new Drawable[]
                    {
                        buttons = new ButtonSystem
                        {
                            OnChart  = delegate { Push(new ChartListing()); },
                            OnDirect = delegate { Push(new OnlineListing()); },
                            OnEdit   = delegate { Push(new Editor()); },
                            OnSolo   = onSolo,
                            OnMulti  = delegate { Push(new Multiplayer()); },
                            OnExit   = Exit,
                        }
                    }
                },
                sideFlashes = new MenuSideFlashes(),
            };

            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;
                }
            };
        }
Beispiel #6
0
 protected override BackgroundScreen CreateBackground() => background = new BackgroundScreenDefault(false)
 {
     Alpha = 0,
 };
Beispiel #7
0
 public TrianglesIntroSequence(OsuLogo logo, BackgroundScreenDefault background)
 {
     this.logo       = logo;
     this.background = background;
 }
Beispiel #8
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();
        }
Beispiel #9
0
        private void load(DirectOverlay direct, SettingsOverlay settings, 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 Drawable[]
            {
                new ParallaxContainer
                {
                    ParallaxAmount = 0.01f,
                    Children       = new Drawable[]
                    {
                        buttons = new ButtonSystem
                        {
                            OnChart = delegate { this.Push(new ChartListing()); },
                            OnEdit  = delegate { this.Push(new Editor()); },
                            OnSolo  = onSolo,
                            OnMulti = delegate { this.Push(new Multiplayer()); },
                            OnExit  = confirmAndExit,
                        }
                    }
                },
                sideFlashes = new MenuSideFlashes(),
            });

            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.OnDirect   = () => direct?.ToggleVisibility();

            LoadComponentAsync(background = new BackgroundScreenDefault());
            preloadSongSelect();
        }
Beispiel #10
0
 public void SetUpSteps()
 {
     AddStep("create background stack", () => Child         = stack = new BackgroundScreenStack());
     AddStep("push default screen", () => stack.Push(screen = new BackgroundScreenDefault(false)));
     AddUntilStep("wait for screen to load", () => screen.IsCurrentScreen());
 }