Example #1
0
        private Background createBackground()
        {
            Background newBackground;

            if (user.Value?.IsSupporter ?? false)
            {
                switch (mode.Value)
                {
                case BackgroundSource.Beatmap:
                    newBackground = new BeatmapBackground(beatmap.Value, backgroundName);
                    break;

                default:
                    newBackground = new SkinnedBackground(skin.Value, backgroundName);
                    break;
                }
            }
            else
            {
                newBackground = new Background(backgroundName);
            }

            newBackground.Depth = currentDisplay;

            return(newBackground);
        }
Example #2
0
        public void TestBeatmapDoesntReloadOnNoChange()
        {
            BeatmapBackground last = null;

            setSourceMode(BackgroundSource.Beatmap);
            setSupporter(true);

            AddUntilStep("wait for beatmap background to be loaded", () => (last = getCurrentBackground() as BeatmapBackground) != null);
            AddAssert("next doesn't load new background", () => screen.Next() == false);

            // doesn't really need to be checked but might as well.
            AddWaitStep("wait a bit", 5);
            AddUntilStep("ensure same background instance", () => last == getCurrentBackground());
        }
Example #3
0
        private Background createBackground()
        {
            Background newBackground;
            string     backgroundName;

            switch (introSequence.Value)
            {
            case IntroSequence.Welcome:
                backgroundName = "Intro/Welcome/menu-background";
                break;

            default:
                backgroundName = $@"Menu/menu-background-{currentDisplay % background_count + 1}";
                break;
            }

            if (user.Value?.IsSupporter ?? false)
            {
                switch (mode.Value)
                {
                case BackgroundSource.Beatmap:
                    newBackground = new BeatmapBackground(beatmap.Value, backgroundName);
                    break;

                default:
                    newBackground = new SkinnedBackground(skin.Value, backgroundName);
                    break;
                }
            }
            else
            {
                newBackground = new Background(backgroundName);
            }

            newBackground.Depth = currentDisplay;

            return(newBackground);
        }