Beispiel #1
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;
                }
            };
        }