Пример #1
0
        /// <summary>
        /// </summary>
        private void CreateRightSideButtons()
        {
            const int padding = 50;

            ButtonPlayTest = new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_play_sign), "Test Play", padding, Alignment.MidRight)
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                Size      = new ScalableVector2(18, 18),
                X         = -ButtonPlayPauseTrack.X,
            };

            ButtonPlayTest.Clicked += (o, e) =>
            {
                var game   = GameBase.Game as QuaverGame;
                var screen = game?.CurrentScreen as EditorScreen;

                // ReSharper disable once SwitchStatementMissingSomeCases
                screen?.GoPlayTest();
            };

            ButtonBeatSnap = new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_align_justify), "Change Beat Snap", padding, Alignment.MidRight)
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                Size      = new ScalableVector2(18, 18),
                X         = ButtonPlayTest.X - ButtonPlayTest.Width - 20
            };

            ButtonBeatSnap.Clicked += (o, e) =>
            {
                var game   = GameBase.Game as QuaverGame;
                var screen = game?.CurrentScreen as EditorScreen;

                // ReSharper disable once SwitchStatementMissingSomeCases
                screen?.ChangeBeatSnap(Direction.Forward);
            };

            ButtonScrollDirection = new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_exchange_arrows), "Change Scroll Direction",
                                                            padding, Alignment.MidRight)
            {
                Parent    = this,
                Alignment = Alignment.MidRight,
                Size      = new ScalableVector2(18, 18),
                X         = ButtonBeatSnap.X - ButtonBeatSnap.Width - 20
            };

            ButtonScrollDirection.Clicked += (o, e) =>
            {
                var game    = GameBase.Game as QuaverGame;
                var screen  = game?.CurrentScreen as EditorScreen;
                var ruleset = screen?.Ruleset as EditorRulesetKeys;
                //cruleset?.ToggleScrollDirection();
                NotificationManager.Show(NotificationLevel.Warning, "Not implemented yet");
            };
        }
Пример #2
0
        /// <summary>
        /// </summary>
        private void CreateLeftSideButtons()
        {
            const int padding = 50;

            // Pause/Play
            ButtonPlayPauseTrack = new EditorControlButton(FontAwesome.Get(AudioEngine.Track.IsPlaying
                ? FontAwesomeIcon.fa_pause_symbol : FontAwesomeIcon.fa_play_button), "Play/Pause Track", padding)
            {
                Parent    = this,
                Alignment = Alignment.MidLeft,
                Size      = new ScalableVector2(18, 18),
                X         = 20
            };

            ButtonPlayPauseTrack.Clicked += (o, e) =>
            {
                var game   = GameBase.Game as QuaverGame;
                var screen = game?.CurrentScreen as EditorScreen;
                screen?.PlayPauseTrack();
            };

            // Stop
            ButtonStopTrack = new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_square_shape_shadow), "Stop Track", padding)
            {
                Parent    = this,
                Alignment = Alignment.MidLeft,
                Size      = new ScalableVector2(18, 18),
                X         = ButtonPlayPauseTrack.X + ButtonPlayPauseTrack.Width + 15
            };

            ButtonStopTrack.Clicked += (o, e) => EditorScreen.StopTrack();

            // Restart
            ButtonRestartTrack = new EditorControlButton(FontAwesome.Get(FontAwesomeIcon.fa_refresh_page_option), "Restart Track", padding)
            {
                Parent    = this,
                Alignment = Alignment.MidLeft,
                Size      = new ScalableVector2(18, 18),
                X         = ButtonStopTrack.X + ButtonStopTrack.Width + 15
            };

            ButtonRestartTrack.Clicked += (o, e) =>
            {
                var game   = GameBase.Game as QuaverGame;
                var screen = game?.CurrentScreen as EditorScreen;
                screen?.RestartTrack();
            };
        }