Exemple #1
0
        private void updateState(ValueChangedEvent <DownloadState> state)
        {
            switch (state.NewValue)
            {
            case DownloadState.NotDownloaded:
                background.FadeColour(colours.Gray4, 500, Easing.InOutExpo);
                icon.MoveToX(0, 500, Easing.InOutExpo);
                checkmark.ScaleTo(Vector2.Zero, 500, Easing.InOutExpo);
                break;

            case DownloadState.Downloading:
                background.FadeColour(colours.Blue, 500, Easing.InOutExpo);
                icon.MoveToX(0, 500, Easing.InOutExpo);
                checkmark.ScaleTo(Vector2.Zero, 500, Easing.InOutExpo);
                break;

            case DownloadState.Downloaded:
                background.FadeColour(colours.Yellow, 500, Easing.InOutExpo);
                break;

            case DownloadState.LocallyAvailable:
                background.FadeColour(colours.Green, 500, Easing.InOutExpo);
                icon.MoveToX(-8, 500, Easing.InOutExpo);
                checkmark.ScaleTo(new Vector2(13), 500, Easing.InOutExpo);
                break;
            }
        }
Exemple #2
0
            protected override void Confirm()
            {
                base.Confirm();

                // temporarily unbind as to not look weird if releasing during confirm animation (can see the unwind of progress).
                Progress.UnbindAll();

                // avoid starting a new confirm call until we finish animating.
                pendingAnimation = true;

                AbortConfirm();

                overlayCircle.ScaleTo(0, 100)
                .Then().FadeOut().ScaleTo(1).FadeIn(500)
                .OnComplete(a =>
                {
                    icon.ScaleTo(1, 100);
                    circularProgress.FadeOut(100).OnComplete(_ =>
                    {
                        bind();

                        circularProgress.FadeIn();
                        pendingAnimation = false;
                    });
                });
            }
Exemple #3
0
        protected override bool OnHover(InputState state)
        {
            if (State != ButtonState.Expanded)
            {
                return(true);
            }

            sampleHover?.Play();

            box.ScaleTo(new Vector2(1.5f, 1), 500, Easing.OutElastic);

            double duration = TimeUntilNextBeat;

            icon.ClearTransforms();
            icon.RotateTo(rightward ? -10 : 10, duration, Easing.InOutSine);
            icon.ScaleTo(new Vector2(1, 0.9f), duration, Easing.Out);
            return(true);
        }
Exemple #4
0
        private void updateState(BeatmapSetDownloader.DownloadStatus state)
        {
            switch (state)
            {
            case BeatmapSetDownloader.DownloadStatus.NotDownloaded:
                background.FadeColour(colours.Gray4, 500, Easing.InOutExpo);
                icon.MoveToX(0, 500, Easing.InOutExpo);
                checkmark.ScaleTo(Vector2.Zero, 500, Easing.InOutExpo);
                break;

            case BeatmapSetDownloader.DownloadStatus.Downloading:
                background.FadeColour(colours.Blue, 500, Easing.InOutExpo);
                icon.MoveToX(0, 500, Easing.InOutExpo);
                checkmark.ScaleTo(Vector2.Zero, 500, Easing.InOutExpo);
                break;

            case BeatmapSetDownloader.DownloadStatus.Downloaded:
                background.FadeColour(colours.Green, 500, Easing.InOutExpo);
                icon.MoveToX(-8, 500, Easing.InOutExpo);
                checkmark.ScaleTo(new Vector2(13), 500, Easing.InOutExpo);
                break;
            }
        }
Exemple #5
0
            protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
            {
                base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes);

                var beatLength = timingPoint.BeatLength;

                float amplitudeAdjust = Math.Min(1, 0.4f + amplitudes.Maximum);

                if (beatIndex < 0)
                {
                    return;
                }

                icon.ScaleTo(1 - 0.1f * amplitudeAdjust, beat_in_time, Easing.Out)
                .Then()
                .ScaleTo(1, beatLength * 2, Easing.OutQuint);
            }
Exemple #6
0
        /// <summary>
        /// Set the current selected rom card as the one at the given index.
        /// </summary>
        private void setSelection(int idx)
        {
            selection.Value += idx;

            if (idx == 1)
            {
                selectionRight
                .ScaleTo(1.5f, 150, Easing.OutQuint)
                .Then(0)
                .ScaleTo(1, 150, Easing.OutQuint);
            }
            else
            {
                selectionLeft
                .ScaleTo(1.5f, 150, Easing.OutQuint)
                .Then(0)
                .ScaleTo(1, 150, Easing.OutQuint);
            }
        }
Exemple #7
0
 protected override bool OnMouseDown(MouseDownEvent e)
 {
     icon.ScaleTo(0.8f, 4000, Easing.OutQuint);
     return(base.OnMouseDown(e));
 }
 protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
 {
     icon.ScaleTo(0.9f, 1000, Easing.Out);
     return(base.OnMouseDown(state, args));
 }