Exemplo n.º 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(),
            };
        }
Exemplo n.º 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(),
            };
        }
Exemplo n.º 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();
        }
Exemplo n.º 4
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;
                }
            };
        }
Exemplo n.º 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();
        }
Exemplo n.º 6
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();
        }