Пример #1
0
        private void load(SongSelect songSelect)
        {
            if (songSelect != null)
            {
                startRequested = b => songSelect.FinaliseSelection(b);
                editRequested  = songSelect.Edit;
            }

            Children = new Drawable[]
Пример #2
0
        private void load(BeatmapManager manager, SongSelect songSelect)
        {
            Header.Height = height;

            if (songSelect != null)
            {
                startRequested = b => songSelect.FinaliseSelection(b);
                if (songSelect.AllowEditing)
                {
                    editRequested = songSelect.Edit;
                }
            }

            if (manager != null)
            {
                hideRequested = manager.Hide;
            }

            Header.Children = new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                },
                triangles = new Triangles
                {
                    TriangleScale    = 2,
                    RelativeSizeAxes = Axes.Both,
                    ColourLight      = Color4Extensions.FromHex(@"3a7285"),
                    ColourDark       = Color4Extensions.FromHex(@"123744")
                },
                new FillFlowContainer
                {
                    Padding      = new MarginPadding(5),
                    Direction    = FillDirection.Horizontal,
                    AutoSizeAxes = Axes.Both,
                    Anchor       = Anchor.CentreLeft,
                    Origin       = Anchor.CentreLeft,
                    Children     = new Drawable[]
                    {
                        new DifficultyIcon(beatmapInfo, shouldShowTooltip: false)
                        {
                            Scale = new Vector2(1.8f),
                        },
                        new FillFlowContainer
                        {
                            Padding = new MarginPadding {
                                Left = 5
                            },
                            Direction    = FillDirection.Vertical,
                            AutoSizeAxes = Axes.Both,
                            Children     = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    Direction    = FillDirection.Horizontal,
                                    Spacing      = new Vector2(4, 0),
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new[]
                                    {
                                        new OsuSpriteText
                                        {
                                            Text   = beatmapInfo.Version,
                                            Font   = OsuFont.GetFont(size: 20),
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Text   = "mapped by",
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Text   = $"{(beatmapInfo.Metadata ?? beatmapInfo.BeatmapSet.Metadata).Author.Username}",
                                            Font   = OsuFont.GetFont(italics: true),
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft
                                        },
                                    }
                                },
                                new FillFlowContainer
                                {
                                    Direction    = FillDirection.Horizontal,
                                    Spacing      = new Vector2(4, 0),
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new Drawable[]
                                    {
                                        new TopLocalRank(beatmapInfo)
                                        {
                                            Scale = new Vector2(0.8f),
                                            Size  = new Vector2(40, 20)
                                        },
                                        starCounter = new StarCounter
                                        {
                                            Scale = new Vector2(0.8f),
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            };
        }
Пример #3
0
        private void load(SongSelect songSelect, BeatmapManager manager, BeatmapSetOverlay beatmapOverlay)
        {
            this.beatmapOverlay = beatmapOverlay;

            if (songSelect != null)
            {
                startRequested = b => songSelect.FinaliseSelection(b);
                editRequested  = songSelect.Edit;
            }

            if (manager != null)
            {
                hideRequested = manager.Hide;
            }

            Children = new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                },
                triangles = new Triangles
                {
                    TriangleScale    = 2,
                    RelativeSizeAxes = Axes.Both,
                    ColourLight      = OsuColour.FromHex(@"3a7285"),
                    ColourDark       = OsuColour.FromHex(@"123744")
                },
                new FillFlowContainer
                {
                    Padding      = new MarginPadding(5),
                    Direction    = FillDirection.Horizontal,
                    AutoSizeAxes = Axes.Both,
                    Anchor       = Anchor.CentreLeft,
                    Origin       = Anchor.CentreLeft,
                    Children     = new Drawable[]
                    {
                        new DifficultyIcon(beatmap)
                        {
                            Scale = new Vector2(1.8f),
                        },
                        new FillFlowContainer
                        {
                            Padding = new MarginPadding {
                                Left = 5
                            },
                            Direction    = FillDirection.Vertical,
                            AutoSizeAxes = Axes.Both,
                            Children     = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    Direction    = FillDirection.Horizontal,
                                    Spacing      = new Vector2(4, 0),
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new[]
                                    {
                                        new OsuSpriteText
                                        {
                                            Font     = @"Exo2.0-Medium",
                                            Text     = beatmap.Version,
                                            TextSize = 20,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Font     = @"Exo2.0-Medium",
                                            Text     = "mapped by",
                                            TextSize = 16,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Font     = @"Exo2.0-MediumItalic",
                                            Text     = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author.Username}",
                                            TextSize = 16,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                    }
                                },
                                starCounter = new StarCounter
                                {
                                    CountStars = (float)beatmap.StarDifficulty,
                                    Scale      = new Vector2(0.8f),
                                }
                            }
                        }
                    }
                }
            };
        }