Ejemplo n.º 1
0
        /// <summary>
        ///     Creates the container to scroll for different mapsets.
        /// </summary>
        private void CreateMapsetScrollContainer()
        {
            MapsetScrollContainer = new MapsetScrollContainer(this)
            {
                Parent    = Container,
                Alignment = Alignment.TopRight,
                Y         = Header.Height + 2
            };

            MapsetScrollContainer.X = MapsetScrollContainer.Width;
            MapsetScrollContainer.MoveToX(-18, Easing.OutBounce, 1200);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Creates the container to scroll for different mapsets.
        /// </summary>
        private void CreateMapsetScrollContainer()
        {
            MapsetScrollContainer = new MapsetScrollContainer(this)
            {
                Parent    = Container,
                Alignment = Alignment.TopRight,
                Y         = Navbar.Line.Y + 2,
            };

            MapsetScrollContainer.X = MapsetScrollContainer.Width;
            MapsetScrollContainer.MoveToX(-28, Easing.OutBounce, 1200);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Called when the screen is exiting
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnScreenExiting(object sender, ScreenExitingEventArgs e)
        {
            if (Screen is SelectScreen screen && !screen.IsExitingToGameplay)
            {
                return;
            }

            MapsetScrollContainer.MoveToX(MapsetScrollContainer.Width, Easing.OutQuint, 400);
            DifficultyScrollContainer.MoveToX(DifficultyScrollContainer.Width, Easing.OutQuint, 400);
            SearchContainer.MoveToX(SearchContainer.Width, Easing.OutQuint, 400);
            Banner.MoveToX(-Banner.Width, Easing.OutQuint, 400);
            LeaderboardSelector.MoveToX(-LeaderboardSelector.Width, Easing.OutQuint, 400);
            Leaderboard.MoveToX(-Leaderboard.Width, Easing.OutQuint, 400);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///    If we've already got a working AudioTrack for the selected map, then fade it in.
        ///     Otherwise load it up at its preview.
        /// </summary>
        private static void LoadOrFadeAudioTrack()
        {
            if (AudioEngine.Track != null)
            {
                if (AudioEngine.Track.IsStopped || AudioEngine.Track.IsDisposed || AudioEngine.Track.IsPaused ||
                    MapManager.GetAudioPath(AudioEngine.Map) != MapManager.GetAudioPath(MapManager.Selected.Value))
                {
                    MapsetScrollContainer.LoadNewAudioTrackIfNecessary();
                }
                else
                {
                    AudioEngine.Track.Fade(ConfigManager.VolumeMusic.Value, 500);
                }

                return;
            }

            MapsetScrollContainer.LoadNewAudioTrackIfNecessary();
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Switches the UI to the specified ScrollContainer.
        /// </summary>
        /// <param name="container"></param>
        public void SwitchToContainer(SelectContainerStatus container)
        {
            if (container == ActiveContainer)
            {
                return;
            }

            const int time    = 400;
            const int targetX = -18;

            MapsetScrollContainer.ClearAnimations();
            DifficultyScrollContainer.ClearAnimations();

            switch (container)
            {
            case SelectContainerStatus.Mapsets:
                MapsetScrollContainer.Parent = Container;

                MapsetScrollContainer.MoveToX(targetX, Easing.OutQuint, time);
                DifficultyScrollContainer.MoveToX(DifficultyScrollContainer.Width, Easing.OutQuint, time);
                break;

            case SelectContainerStatus.Difficulty:
                DifficultyScrollContainer.Parent = Container;

                DifficultyScrollContainer.Visible = true;
                DifficultyScrollContainer.ContentContainer.Visible = true;

                MapsetScrollContainer.MoveToX(MapsetScrollContainer.Width, Easing.OutQuint, time);
                DifficultyScrollContainer.MoveToX(targetX, Easing.OutQuint, time);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(container), container, null);
            }

            ActiveContainer        = container;
            SearchContainer.Parent = Container;
            Banner.Parent          = Container;
            Footer.Parent          = Container;
            Logger.Debug($"Switched to Select Container: {ActiveContainer}", LogType.Runtime, false);
        }