示例#1
0
        private void load(OsuColour colour, LocalisationEngine locale, BeatmapSetOverlay beatmapSetOverlay)
        {
            coloredBackground.Colour = underscoreLine.Colour = colour.Gray4;

            Stats.Add(new OsuSpriteText
            {
                Text     = $"accuracy: {Score.Accuracy:P2}",
                Anchor   = Anchor.TopRight,
                Origin   = Anchor.TopRight,
                Colour   = colour.GrayA,
                TextSize = 11,
                Font     = "Exo2.0-RegularItalic",
                Depth    = -1,
            });

            metadata.Add(new MetadataContainer(Score.Beatmap.Metadata.Title, Score.Beatmap.Metadata.Artist)
            {
                AutoSizeAxes = Axes.Both,
                Action       = () =>
                {
                    if (Score.Beatmap.OnlineBeatmapSetID.HasValue)
                    {
                        beatmapSetOverlay?.ShowBeatmapSet(Score.Beatmap.OnlineBeatmapSetID.Value);
                    }
                },
                Child = new FillFlowContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Children     = new Drawable[]
                    {
                        new OsuSpriteText
                        {
                            Current = locale.GetUnicodePreference(
                                $"{Score.Beatmap.Metadata.TitleUnicode ?? Score.Beatmap.Metadata.Title} [{Score.Beatmap.Version}] ",
                                $"{Score.Beatmap.Metadata.Title ?? Score.Beatmap.Metadata.TitleUnicode} [{Score.Beatmap.Version}] "
                                ),
                            TextSize = 15,
                            Font     = "Exo2.0-SemiBoldItalic",
                        },
                        new OsuSpriteText
                        {
                            Current  = locale.GetUnicodePreference(Score.Beatmap.Metadata.ArtistUnicode, Score.Beatmap.Metadata.Artist),
                            TextSize = 12,
                            Padding  = new MarginPadding {
                                Top = 3
                            },
                            Font = "Exo2.0-RegularItalic",
                        },
                    },
                },
            });

            foreach (Mod mod in Score.Mods)
            {
                modsContainer.Add(new ModIcon(mod)
                {
                    Scale = new Vector2(0.5f)
                });
            }
        }
示例#2
0
        private void load(LocalisationEngine locale, BeatmapSetOverlay beatmapSetOverlay)
        {
            Action = () =>
            {
                if (beatmap.OnlineBeatmapSetID.HasValue)
                {
                    beatmapSetOverlay?.ShowBeatmapSet(beatmap.OnlineBeatmapSetID.Value);
                }
            };

            Child = new FillFlowContainer
            {
                AutoSizeAxes = Axes.Both,
                Children     = new Drawable[]
                {
                    new OsuSpriteText
                    {
                        Current = locale.GetUnicodePreference(
                            $"{beatmap.Metadata.TitleUnicode ?? beatmap.Metadata.Title} [{beatmap.Version}] ",
                            $"{beatmap.Metadata.Title ?? beatmap.Metadata.TitleUnicode} [{beatmap.Version}] "
                            ),
                        TextSize = 15,
                        Font     = "Exo2.0-SemiBoldItalic",
                    },
                    new OsuSpriteText
                    {
                        Current  = locale.GetUnicodePreference(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist),
                        TextSize = 12,
                        Padding  = new MarginPadding {
                            Top = 3
                        },
                        Font = "Exo2.0-RegularItalic",
                    },
                },
            };
        }
示例#3
0
 /// <summary>
 /// Show a beatmap set as an overlay.
 /// </summary>
 /// <param name="setId">The set to display.</param>
 public void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId);
        private void load(RulesetStore rulesets)
        {
            var mania = rulesets.GetRuleset(3);
            var taiko = rulesets.GetRuleset(1);

            AddStep(@"show first", () =>
            {
                overlay.ShowBeatmapSet(new BeatmapSetInfo
                {
                    Metadata = new BeatmapMetadata
                    {
                        Title  = @"Lachryma <Re:Queen’M>",
                        Artist = @"Kaneko Chiharu",
                        Source = @"SOUND VOLTEX III GRAVITY WARS",
                        Tags   = @"sdvx grace the 5th kac original song contest konami bemani",
                        Author = new User
                        {
                            Username = @"Fresh Chicken",
                            Id       = 3984370,
                        },
                    },
                    OnlineInfo = new BeatmapSetOnlineInfo
                    {
                        Preview        = @"https://b.ppy.sh/preview/415886.mp3",
                        PlayCount      = 681380,
                        FavouriteCount = 356,
                        Submitted      = new DateTime(2016, 2, 10),
                        Ranked         = new DateTime(2016, 6, 19),
                        BPM            = 236,
                        HasVideo       = true,
                        Covers         = new BeatmapSetOnlineCovers
                        {
                            Cover = @"https://assets.ppy.sh/beatmaps/415886/covers/cover.jpg?1465651778",
                        },
                    },
                    Beatmaps = new List <BeatmapInfo>
                    {
                        new BeatmapInfo
                        {
                            StarDifficulty = 1.36,
                            Version        = @"BASIC",
                            Ruleset        = mania,
                            BaseDifficulty = new BeatmapDifficulty
                            {
                                CircleSize        = 4,
                                DrainRate         = 6.5f,
                                OverallDifficulty = 6.5f,
                                ApproachRate      = 5,
                            },
                            OnlineInfo = new BeatmapOnlineInfo
                            {
                                Length      = 115000,
                                CircleCount = 265,
                                SliderCount = 71,
                                PlayCount   = 47906,
                                PassCount   = 19899,
                            },
                            Metrics = new BeatmapMetrics
                            {
                                Ratings = Enumerable.Range(0, 11),
                                Fails   = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
                                Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
                            },
                        },
                        new BeatmapInfo
                        {
                            StarDifficulty = 2.22,
                            Version        = @"NOVICE",
                            Ruleset        = mania,
                            BaseDifficulty = new BeatmapDifficulty
                            {
                                CircleSize        = 4,
                                DrainRate         = 7,
                                OverallDifficulty = 7,
                                ApproachRate      = 5,
                            },
                            OnlineInfo = new BeatmapOnlineInfo
                            {
                                Length      = 118000,
                                CircleCount = 592,
                                SliderCount = 62,
                                PlayCount   = 162021,
                                PassCount   = 72116,
                            },
                            Metrics = new BeatmapMetrics
                            {
                                Ratings = Enumerable.Range(0, 11),
                                Fails   = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
                                Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
                            },
                        },
                        new BeatmapInfo
                        {
                            StarDifficulty = 3.49,
                            Version        = @"ADVANCED",
                            Ruleset        = mania,
                            BaseDifficulty = new BeatmapDifficulty
                            {
                                CircleSize        = 4,
                                DrainRate         = 7.5f,
                                OverallDifficulty = 7.5f,
                                ApproachRate      = 5,
                            },
                            OnlineInfo = new BeatmapOnlineInfo
                            {
                                Length      = 118000,
                                CircleCount = 1042,
                                SliderCount = 79,
                                PlayCount   = 225178,
                                PassCount   = 73001,
                            },
                            Metrics = new BeatmapMetrics
                            {
                                Ratings = Enumerable.Range(0, 11),
                                Fails   = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
                                Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
                            },
                        },
                        new BeatmapInfo
                        {
                            StarDifficulty = 4.24,
                            Version        = @"EXHAUST",
                            Ruleset        = mania,
                            BaseDifficulty = new BeatmapDifficulty
                            {
                                CircleSize        = 4,
                                DrainRate         = 8,
                                OverallDifficulty = 8,
                                ApproachRate      = 5,
                            },
                            OnlineInfo = new BeatmapOnlineInfo
                            {
                                Length      = 118000,
                                CircleCount = 1352,
                                SliderCount = 69,
                                PlayCount   = 131545,
                                PassCount   = 42703,
                            },
                            Metrics = new BeatmapMetrics
                            {
                                Ratings = Enumerable.Range(0, 11),
                                Fails   = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
                                Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
                            },
                        },
                        new BeatmapInfo
                        {
                            StarDifficulty = 5.26,
                            Version        = @"GRAVITY",
                            Ruleset        = mania,
                            BaseDifficulty = new BeatmapDifficulty
                            {
                                CircleSize        = 4,
                                DrainRate         = 8.5f,
                                OverallDifficulty = 8.5f,
                                ApproachRate      = 5,
                            },
                            OnlineInfo = new BeatmapOnlineInfo
                            {
                                Length      = 118000,
                                CircleCount = 1730,
                                SliderCount = 115,
                                PlayCount   = 117673,
                                PassCount   = 24241,
                            },
                            Metrics = new BeatmapMetrics
                            {
                                Ratings = Enumerable.Range(0, 11),
                                Fails   = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
                                Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
                            },
                        },
                    },
                });
            });

            AddStep(@"show second", () =>
            {
                overlay.ShowBeatmapSet(new BeatmapSetInfo
                {
                    Metadata = new BeatmapMetadata
                    {
                        Title  = @"Soumatou Labyrinth",
                        Artist = @"Yunomi with Momobako&miko",
                        Tags   = @"mmbk.com yuzu__rinrin charlotte",
                        Author = new User
                        {
                            Username = @"komasy",
                            Id       = 1980256,
                        },
                    },
                    OnlineInfo = new BeatmapSetOnlineInfo
                    {
                        Preview        = @"https://b.ppy.sh/preview/625493.mp3",
                        PlayCount      = 22996,
                        FavouriteCount = 58,
                        Submitted      = new DateTime(2016, 6, 11),
                        Ranked         = new DateTime(2016, 7, 12),
                        BPM            = 160,
                        HasVideo       = false,
                        Covers         = new BeatmapSetOnlineCovers
                        {
                            Cover = @"https://assets.ppy.sh/beatmaps/625493/covers/cover.jpg?1499167472",
                        },
                    },
                    Beatmaps = new List <BeatmapInfo>
                    {
                        new BeatmapInfo
                        {
                            StarDifficulty = 1.40,
                            Version        = @"yzrin's Kantan",
                            Ruleset        = taiko,
                            BaseDifficulty = new BeatmapDifficulty
                            {
                                CircleSize        = 2,
                                DrainRate         = 7,
                                OverallDifficulty = 3,
                                ApproachRate      = 10,
                            },
                            OnlineInfo = new BeatmapOnlineInfo
                            {
                                Length      = 193000,
                                CircleCount = 262,
                                SliderCount = 0,
                                PlayCount   = 3952,
                                PassCount   = 1373,
                            },
                            Metrics = new BeatmapMetrics
                            {
                                Ratings = Enumerable.Range(0, 11),
                                Fails   = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
                                Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
                            },
                        },
                        new BeatmapInfo
                        {
                            StarDifficulty = 2.23,
                            Version        = @"Futsuu",
                            Ruleset        = taiko,
                            BaseDifficulty = new BeatmapDifficulty
                            {
                                CircleSize        = 2,
                                DrainRate         = 6,
                                OverallDifficulty = 4,
                                ApproachRate      = 10,
                            },
                            OnlineInfo = new BeatmapOnlineInfo
                            {
                                Length      = 193000,
                                CircleCount = 464,
                                SliderCount = 0,
                                PlayCount   = 4833,
                                PassCount   = 920,
                            },
                            Metrics = new BeatmapMetrics
                            {
                                Ratings = Enumerable.Range(0, 11),
                                Fails   = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
                                Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
                            },
                        },
                        new BeatmapInfo
                        {
                            StarDifficulty = 3.19,
                            Version        = @"Muzukashii",
                            Ruleset        = taiko,
                            BaseDifficulty = new BeatmapDifficulty
                            {
                                CircleSize        = 2,
                                DrainRate         = 6,
                                OverallDifficulty = 5,
                                ApproachRate      = 10,
                            },
                            OnlineInfo = new BeatmapOnlineInfo
                            {
                                Length      = 193000,
                                CircleCount = 712,
                                SliderCount = 0,
                                PlayCount   = 4405,
                                PassCount   = 854,
                            },
                            Metrics = new BeatmapMetrics
                            {
                                Ratings = Enumerable.Range(0, 11),
                                Fails   = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
                                Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
                            },
                        },
                        new BeatmapInfo
                        {
                            StarDifficulty = 3.97,
                            Version        = @"Charlotte's Oni",
                            Ruleset        = taiko,
                            BaseDifficulty = new BeatmapDifficulty
                            {
                                CircleSize        = 5,
                                DrainRate         = 6,
                                OverallDifficulty = 5.5f,
                                ApproachRate      = 10,
                            },
                            OnlineInfo = new BeatmapOnlineInfo
                            {
                                Length      = 193000,
                                CircleCount = 943,
                                SliderCount = 0,
                                PlayCount   = 3950,
                                PassCount   = 693,
                            },
                            Metrics = new BeatmapMetrics
                            {
                                Ratings = Enumerable.Range(0, 11),
                                Fails   = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
                                Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
                            },
                        },
                        new BeatmapInfo
                        {
                            StarDifficulty = 5.08,
                            Version        = @"Labyrinth Oni",
                            Ruleset        = taiko,
                            BaseDifficulty = new BeatmapDifficulty
                            {
                                CircleSize        = 5,
                                DrainRate         = 5,
                                OverallDifficulty = 6,
                                ApproachRate      = 10,
                            },
                            OnlineInfo = new BeatmapOnlineInfo
                            {
                                Length      = 193000,
                                CircleCount = 1068,
                                SliderCount = 0,
                                PlayCount   = 5856,
                                PassCount   = 1207,
                            },
                            Metrics = new BeatmapMetrics
                            {
                                Ratings = Enumerable.Range(0, 11),
                                Fails   = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
                                Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
                            },
                        },
                    },
                });
            });

            AddStep(@"hide", overlay.Hide);
            AddStep(@"show without reload", overlay.Show);
        }
示例#5
0
        private void load(OsuColour colour, LocalisationEngine locale, BeatmapSetOverlay beatmapSetOverlay)
        {
            stats.Add(new OsuSpriteText
            {
                Text     = $"{Math.Round(score.PP ?? 0)}pp",
                Anchor   = Anchor.TopRight,
                Origin   = Anchor.TopRight,
                TextSize = 18,
                Font     = "Exo2.0-BoldItalic",
            });

            if (weight.HasValue)
            {
                stats.Add(new OsuSpriteText
                {
                    Text     = $"weighted: {Math.Round(score.PP * weight ?? 0)}pp ({weight.Value.ToString("0%", CultureInfo.CurrentCulture)})",
                    Anchor   = Anchor.TopRight,
                    Origin   = Anchor.TopRight,
                    Colour   = colour.GrayA,
                    TextSize = 11,
                    Font     = "Exo2.0-RegularItalic",
                });
            }

            stats.Add(new OsuSpriteText
            {
                Text     = "accuracy: " + score.Accuracy.ToString("0.00%"),
                Anchor   = Anchor.TopRight,
                Origin   = Anchor.TopRight,
                Colour   = colour.GrayA,
                TextSize = 11,
                Font     = "Exo2.0-RegularItalic",
            });

            metadata.Add(new OsuHoverContainer
            {
                AutoSizeAxes = Axes.Both,
                Action       = () =>
                {
                    if (score.Beatmap.OnlineBeatmapSetID.HasValue)
                    {
                        beatmapSetOverlay.ShowBeatmapSet(score.Beatmap.OnlineBeatmapSetID.Value);
                    }
                },
                Child = new FillFlowContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Children     = new Drawable[]
                    {
                        new OsuSpriteText
                        {
                            Current = locale.GetUnicodePreference(
                                $"{score.Beatmap.Metadata.TitleUnicode ?? score.Beatmap.Metadata.Title} [{score.Beatmap.Version}] ",
                                $"{score.Beatmap.Metadata.Title ?? score.Beatmap.Metadata.TitleUnicode} [{score.Beatmap.Version}] "
                                ),
                            TextSize = 15,
                            Font     = "Exo2.0-SemiBoldItalic",
                        },
                        new OsuSpriteText
                        {
                            Current  = locale.GetUnicodePreference(score.Beatmap.Metadata.ArtistUnicode, score.Beatmap.Metadata.Artist),
                            TextSize = 12,
                            Padding  = new MarginPadding {
                                Top = 3
                            },
                            Font = "Exo2.0-RegularItalic",
                        },
                    },
                },
            });

            foreach (Mod mod in score.Mods)
            {
                modContainer.Add(new ModIcon(mod)
                {
                    AutoSizeAxes = Axes.Both,
                    Scale        = new Vector2(0.5f),
                });
            }
        }
示例#6
0
 public void TestLoading()
 {
     AddStep(@"show loading", () => overlay.ShowBeatmapSet(null));
 }