Beispiel #1
0
        private void load(OsuColour colours, LocalisationEngine localisation)
        {
            hoverColour  = colours.Yellow;
            artistColour = colours.Gray9;

            var metadata = BeatmapSetInfo.Metadata;

            FilterTerms = metadata.SearchableTerms;

            Children = new Drawable[]
            {
                handle = new PlaylistItemHandle
                {
                    Colour = colours.Gray5
                },
                text = new OsuTextFlowContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Padding          = new MarginPadding {
                        Left = 20
                    },
                    ContentIndent = 10f,
                },
            };

            titleBind  = localisation.GetUnicodePreference(metadata.TitleUnicode, metadata.Title);
            artistBind = localisation.GetUnicodePreference(metadata.ArtistUnicode, metadata.Artist);

            artistBind.ValueChanged += newText => recreateText();
            artistBind.TriggerChange();
        }
Beispiel #2
0
        private void load(OsuColour colours, LocalisationEngine localisation)
        {
            hoverColour  = colours.Yellow;
            artistColour = colours.Gray9;

            var metadata = BeatmapSetInfo.Metadata;

            FilterTerms = metadata.SearchableTerms;

            Children = new Drawable[]
            {
                handle = new TextAwesome
                {
                    Anchor   = Anchor.TopLeft,
                    Origin   = Anchor.TopLeft,
                    TextSize = 12,
                    Colour   = colours.Gray5,
                    Icon     = FontAwesome.fa_bars,
                    Alpha    = 0f,
                    Margin   = new MarginPadding {
                        Left = 5
                    },
                    Padding = new MarginPadding {
                        Top = 2
                    },
                },
                text = new Paragraph
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Padding          = new MarginPadding {
                        Left = 20
                    },
                    ContentIndent = 10f,
                },
            };

            titleBind  = localisation.GetUnicodePreference(metadata.TitleUnicode, metadata.Title);
            artistBind = localisation.GetUnicodePreference(metadata.ArtistUnicode, metadata.Artist);

            artistBind.ValueChanged += newText => recreateText();
            artistBind.TriggerChange();
        }
Beispiel #3
0
            private void load(LocalisationEngine localisation)
            {
                var beatmapInfo = working.BeatmapInfo;
                var metadata    = beatmapInfo.Metadata ?? working.BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();

                PixelSnapping         = true;
                CacheDrawnFrameBuffer = true;
                RelativeSizeAxes      = Axes.Both;

                titleBinding  = localisation.GetUnicodePreference(metadata.TitleUnicode, metadata.Title);
                artistBinding = localisation.GetUnicodePreference(metadata.ArtistUnicode, metadata.Artist);

                Children = new Drawable[]
                {
                    // We will create the white-to-black gradient by modulating transparency and having
                    // a black backdrop. This results in an sRGB-space gradient and not linear space,
                    // transitioning from white to black more perceptually uniformly.
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = Color4.Black,
                    },
                    // We use a container, such that we can set the colour gradient to go across the
                    // vertices of the masked container instead of the vertices of the (larger) sprite.
                    new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = ColourInfo.GradientVertical(Color4.White, Color4.White.Opacity(0.3f)),
                        Children         = new[]
                        {
                            // Zoomed-in and cropped beatmap background
                            new BeatmapBackgroundSprite(working)
                            {
                                RelativeSizeAxes = Axes.Both,
                                Anchor           = Anchor.Centre,
                                Origin           = Anchor.Centre,
                                FillMode         = FillMode.Fill,
                            },
                        },
                    },
                    new DifficultyColourBar(beatmapInfo)
                    {
                        RelativeSizeAxes = Axes.Y,
                        Width            = 20,
                    },
                    new FillFlowContainer
                    {
                        Name      = "Top-aligned metadata",
                        Anchor    = Anchor.TopLeft,
                        Origin    = Anchor.TopLeft,
                        Direction = FillDirection.Vertical,
                        Margin    = new MarginPadding {
                            Top = 10, Left = 25, Right = 10, Bottom = 20
                        },
                        AutoSizeAxes = Axes.Both,
                        Children     = new Drawable[]
                        {
                            VersionLabel = new OsuSpriteText
                            {
                                Font     = @"Exo2.0-MediumItalic",
                                Text     = beatmapInfo.Version,
                                TextSize = 24,
                            },
                        }
                    },
                    new FillFlowContainer
                    {
                        Name      = "Centre-aligned metadata",
                        Anchor    = Anchor.CentreLeft,
                        Origin    = Anchor.TopLeft,
                        Y         = -22,
                        Direction = FillDirection.Vertical,
                        Margin    = new MarginPadding {
                            Top = 15, Left = 25, Right = 10, Bottom = 20
                        },
                        AutoSizeAxes = Axes.Both,
                        Children     = new Drawable[]
                        {
                            TitleLabel = new OsuSpriteText
                            {
                                Font     = @"Exo2.0-MediumItalic",
                                TextSize = 28,
                            },
                            ArtistLabel = new OsuSpriteText
                            {
                                Font     = @"Exo2.0-MediumItalic",
                                TextSize = 17,
                            },
                            MapperContainer = new FillFlowContainer
                            {
                                Margin = new MarginPadding {
                                    Top = 10
                                },
                                Direction    = FillDirection.Horizontal,
                                AutoSizeAxes = Axes.Both,
                                Children     = getMapper(metadata)
                            },
                            InfoLabelContainer = new FillFlowContainer
                            {
                                Margin = new MarginPadding {
                                    Top = 20
                                },
                                Spacing      = new Vector2(20, 0),
                                AutoSizeAxes = Axes.Both,
                                Children     = getInfoLabels()
                            }
                        }
                    }
                };
                artistBinding.ValueChanged += value => setMetadata(metadata.Source);
                artistBinding.TriggerChange();
            }