예제 #1
0
 private void load(OverlayColourProvider colourProvider)
 {
     AutoSizeAxes = Axes.Both;
     Anchor       = Anchor.TopRight;
     Origin       = Anchor.TopRight;
     Margin       = new MarginPadding {
         Top = 10
     };
     InternalChild = new FillFlowContainer
     {
         AutoSizeAxes = Axes.Both,
         Direction    = FillDirection.Vertical,
         Anchor       = Anchor.TopRight,
         Origin       = Anchor.TopRight,
         Children     = new Drawable[]
         {
             new OsuSpriteText
             {
                 Anchor = Anchor.TopRight,
                 Origin = Anchor.TopRight,
                 Font   = OsuFont.GetFont(weight: FontWeight.Bold), // using Bold since there is no 800 weight alternative
                 Colour = colourProvider.Light1,
                 Text   = $"{date:dd}"
             },
             new TextFlowContainer(f =>
             {
                 f.Font   = OsuFont.GetFont(size: 11, weight: FontWeight.Regular);
                 f.Colour = colourProvider.Light1;
             })
             {
                 Anchor       = Anchor.TopRight,
                 Origin       = Anchor.TopRight,
                 AutoSizeAxes = Axes.Both,
                 Text         = $"{date:MMM yyyy}"
             }
         }
     };
 }
        private void load(OverlayColourProvider colourProvider)
        {
            iconColour = colourProvider.Foreground1;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = colourProvider.Background4
                },
                new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Direction        = FillDirection.Vertical,
                    Padding          = new MarginPadding {
                        Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10
                    },
                    Spacing  = new Vector2(0, 10),
                    Children = new Drawable[]
                    {
                        topLinkContainer = new LinkFlowContainer(text => text.Font = text.Font.With(size: 12))
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                        },
                        bottomLinkContainer = new LinkFlowContainer(text => text.Font = text.Font.With(size: 12))
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                        }
                    }
                }
            };

            User.BindValueChanged(user => updateDisplay(user.NewValue));
        }
예제 #3
0
 private void load(OverlayColourProvider colourProvider)
 {
     AutoSizeAxes = Axes.Both;
     Masking      = true;
     Children     = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = colourProvider.Background6.Opacity(0.5f)
         },
         new OsuSpriteText
         {
             Text   = date.ToString("d MMM yyyy").ToUpper(),
             Font   = OsuFont.GetFont(size: 10, weight: FontWeight.SemiBold),
             Margin = new MarginPadding
             {
                 Horizontal = 20,
                 Vertical   = 5
             }
         }
     };
 }
예제 #4
0
 private void load(OverlayColourProvider colourProvider)
 {
     AutoSizeAxes = Axes.Both;
     Masking      = true;
     Children     = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = colourProvider.Background6
         },
         counter = new OsuSpriteText
         {
             Anchor = Anchor.Centre,
             Origin = Anchor.Centre,
             Margin = new MarginPadding {
                 Horizontal = 10, Bottom = 1
             },
             Font   = OsuFont.GetFont(size: 11.2f, weight: FontWeight.Bold),
             Colour = colourProvider.Foreground1
         }
     };
 }
예제 #5
0
        private void load(OsuColour colours, OverlayColourProvider colourProvider)
        {
            Background.Colour = colourProvider.Background5;

            Children = new Drawable[]
            {
                trackTimer = new OsuSpriteText
                {
                    Anchor  = Anchor.CentreLeft,
                    Origin  = Anchor.CentreLeft,
                    Spacing = new Vector2(-2, 0),
                    Font    = OsuFont.Torus.With(size: 36, fixedWidth: true, weight: FontWeight.Light),
                    Y       = -10,
                },
                bpm = new OsuSpriteText
                {
                    Colour   = colours.Orange1,
                    Anchor   = Anchor.CentreLeft,
                    Font     = OsuFont.Torus.With(size: 18, weight: FontWeight.SemiBold),
                    Position = new Vector2(2, 5),
                }
            };
        }
예제 #6
0
        private void load(OverlayColourProvider colourProvider)
        {
            Child = new HomePanel
            {
                Child = text = new OsuSpriteText
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Margin = new MarginPadding {
                        Vertical = 20
                    },
                    Text = CommonStrings.ButtonsSeeMore
                }
            };

            IdleColour  = colourProvider.Light1;
            HoverColour = Color4.White;

            Action = () =>
            {
                overlay?.ShowFrontPage();
            };
        }
예제 #7
0
        private void load(OverlayColourProvider colours)
        {
            RelativeSizeAxes = Axes.Both;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    Colour           = colours.Background4,
                    RelativeSizeAxes = Axes.Both,
                },
                new OsuScrollContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = new FillFlowContainer
                    {
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Direction        = FillDirection.Vertical,
                        Children         = CreateSections()
                    },
                }
            };
        }
예제 #8
0
 private void load(OverlayColourProvider colourProvider, [CanBeNull] KaraokeHitObjectComposer composer)
 {
     InternalChildren = new Drawable[]
     {
         background = new Box
         {
             RelativeSizeAxes = Axes.Both,
             Alpha            = 0.3f,
             Colour           = colourProvider.Background1,
         },
         new GridContainer
         {
             RelativeSizeAxes = Axes.Both,
             ColumnDimensions = new[]
             {
                 new Dimension(GridSizeMode.Absolute, SingerInfoSize),
                 new Dimension(GridSizeMode.Absolute, 5),
                 new Dimension(),
             },
             Content = new[]
             {
                 new[]
                 {
                     CreateSingerInfo(singer).With(x => { x.RelativeSizeAxes = Axes.Both; }),
                     new Box
                     {
                         Name             = "Separator",
                         RelativeSizeAxes = Axes.Both,
                         Colour           = colourProvider.Dark1,
                     },
                     CreateTimeLinePart(composer)
                 }
             }
         }
     };
 }
예제 #9
0
 private void load(OverlayColourProvider colourProvider)
 {
     AutoSizeAxes = Axes.Both;
     CornerRadius = 4;
     Masking      = true;
     Children     = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = colourProvider.Background6,
         },
         parentTextComponent.CreateSpriteText().With(t =>
         {
             t.Colour  = colourProvider.Light1;
             t.Text    = Text;
             t.Padding = new MarginPadding
             {
                 Vertical   = 1,
                 Horizontal = 4,
             };
         }),
     };
 }
예제 #10
0
        private void load(OverlayColourProvider colourProvider)
        {
            // todo: get result from here

            if (true)
            {
                Children = new Drawable[]
                {
                    new ChangelogBuildWithNavigation(build)
                    {
                        SelectBuild = SelectBuild
                    },
                    new Box
                    {
                        RelativeSizeAxes = Axes.X,
                        Height           = 2,
                        Colour           = colourProvider.Background6,
                        Margin           = new MarginPadding {
                            Top = 30
                        },
                    },
                };
            }
        }
예제 #11
0
 private void load(OverlayColourProvider colourProvider)
 {
     InternalChild = new FillFlowContainer
     {
         RelativeSizeAxes = Axes.X,
         AutoSizeAxes     = Axes.Y,
         Direction        = FillDirection.Vertical,
         Spacing          = new Vector2(2),
         Children         = new Drawable[]
         {
             new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 16, weight: FontWeight.SemiBold))
             {
                 Text             = text,
                 RelativeSizeAxes = Axes.X,
                 AutoSizeAxes     = Axes.Y,
             },
             new Circle
             {
                 Colour = colourProvider.Highlight1,
                 Size   = new Vector2(28, 2),
             }
         }
     };
 }
예제 #12
0
 private void load(OverlayColourProvider colourProvider)
 {
     IdleColour  = colourProvider.Background4;
     HoverColour = colourProvider.Background3;
 }
예제 #13
0
 private void load(OverlayColourProvider colourProvider)
 {
     sortControlBackground.Colour = colourProvider.Background5;
 }
예제 #14
0
        private void load(OsuColour colours, OverlayColourProvider colourProvider)
        {
            foreach (var categoryEntries in Build.ChangelogEntries.GroupBy(b => b.Category).OrderBy(c => c.Key))
            {
                ChangelogEntries.Add(new OsuSpriteText
                {
                    Text   = categoryEntries.Key,
                    Font   = OsuFont.GetFont(weight: FontWeight.Bold, size: 18),
                    Margin = new MarginPadding {
                        Top = 35, Bottom = 15
                    },
                });

                var fontLarge  = OsuFont.GetFont(size: 16);
                var fontMedium = OsuFont.GetFont(size: 12);

                foreach (var entry in categoryEntries)
                {
                    var entryColour = entry.Major ? colours.YellowLight : Color4.White;

                    LinkFlowContainer title;

                    var titleContainer = new Container
                    {
                        AutoSizeAxes     = Axes.Y,
                        RelativeSizeAxes = Axes.X,
                        Margin           = new MarginPadding {
                            Vertical = 5
                        },
                        Children = new Drawable[]
                        {
                            new SpriteIcon
                            {
                                Anchor = Anchor.CentreLeft,
                                Origin = Anchor.CentreRight,
                                Size   = new Vector2(10),
                                Icon   = entry.Type == ChangelogEntryType.Fix ? FontAwesome.Solid.Check : FontAwesome.Solid.Plus,
                                Colour = entryColour.Opacity(0.5f),
                                Margin = new MarginPadding {
                                    Right = 5
                                },
                            },
                            title = new LinkFlowContainer
                            {
                                Direction        = FillDirection.Full,
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y,
                            }
                        }
                    };

                    title.AddText(entry.Title, t =>
                    {
                        t.Font   = fontLarge;
                        t.Colour = entryColour;
                    });

                    if (!string.IsNullOrEmpty(entry.Repository))
                    {
                        title.AddText(" (", t =>
                        {
                            t.Font   = fontLarge;
                            t.Colour = entryColour;
                        });
                        title.AddLink($"{entry.Repository.Replace("ppy/", "")}#{entry.GithubPullRequestId}", entry.GithubUrl,
                                      creationParameters: t =>
                        {
                            t.Font   = fontLarge;
                            t.Colour = entryColour;
                        });
                        title.AddText(")", t =>
                        {
                            t.Font   = fontLarge;
                            t.Colour = entryColour;
                        });
                    }

                    title.AddText("by ", t =>
                    {
                        t.Font    = fontMedium.With(italics: true);
                        t.Colour  = entryColour;
                        t.Padding = new MarginPadding {
                            Left = 10
                        };
                    });

                    if (entry.GithubUser.UserId != null)
                    {
                        title.AddUserLink(new User
                        {
                            Username = entry.GithubUser.OsuUsername,
                            Id       = entry.GithubUser.UserId.Value
                        }, t =>
                        {
                            t.Font   = fontMedium.With(italics: true);
                            t.Colour = entryColour;
                        });
                    }
                    else if (entry.GithubUser.GithubUrl != null)
                    {
                        title.AddLink(entry.GithubUser.DisplayName, entry.GithubUser.GithubUrl, t =>
                        {
                            t.Font   = fontMedium.With(italics: true);
                            t.Colour = entryColour;
                        });
                    }
                    else
                    {
                        title.AddText(entry.GithubUser.DisplayName, t =>
                        {
                            t.Font   = fontMedium.With(italics: true);
                            t.Colour = entryColour;
                        });
                    }

                    ChangelogEntries.Add(titleContainer);

                    if (!string.IsNullOrEmpty(entry.MessageHtml))
                    {
                        var message = new TextFlowContainer
                        {
                            AutoSizeAxes     = Axes.Y,
                            RelativeSizeAxes = Axes.X,
                        };

                        // todo: use markdown parsing once API returns markdown
                        message.AddText(WebUtility.HtmlDecode(Regex.Replace(entry.MessageHtml, @"<(.|\n)*?>", string.Empty)), t =>
                        {
                            t.Font   = fontMedium;
                            t.Colour = colourProvider.Foreground1;
                        });

                        ChangelogEntries.Add(message);
                    }
                }
            }
        }
예제 #15
0
 private void load(OverlayColourProvider colourProvider)
 {
     text.Colour      = colourProvider.Foreground1;
     separator.Colour = colourProvider.Background3;
 }
예제 #16
0
파일: ScoreTable.cs 프로젝트: Malox10/osu
 private void load(OverlayColourProvider colourProvider)
 {
     Colour = colourProvider.Foreground1;
 }
예제 #17
0
        private void load(OsuColour colour, TextureStore textures, OverlayColourProvider colourProvider)
        {
            SupporterPromoLinkFlowContainer supportLinkText;

            InternalChildren = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Masking          = true,
                    CornerRadius     = 6,
                    EdgeEffect       = new EdgeEffectParameters
                    {
                        Type   = EdgeEffectType.Shadow,
                        Colour = Color4.Black.Opacity(0.25f),
                        Offset = new Vector2(0, 1),
                        Radius = 3,
                    },
                    Children = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = colourProvider.Background5,
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = 200,
                            Padding          = new MarginPadding {
                                Horizontal = 75
                            },
                            Children = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Direction        = FillDirection.Vertical,
                                    Anchor           = Anchor.CentreLeft,
                                    Origin           = Anchor.CentreLeft,
                                    Padding          = new MarginPadding {
                                        Right = 50 + image_container_width
                                    },
                                    Children = new Drawable[]
                                    {
                                        new OsuSpriteText
                                        {
                                            Text   = ChangelogStrings.SupportHeading,
                                            Font   = OsuFont.GetFont(size: 20, weight: FontWeight.Light),
                                            Margin = new MarginPadding {
                                                Bottom = 20
                                            },
                                        },
                                        supportLinkText = new SupporterPromoLinkFlowContainer(t =>
                                        {
                                            t.Font   = t.Font.With(size: 14);
                                            t.Colour = colour.PinkLighter;
                                        })
                                        {
                                            RelativeSizeAxes = Axes.X,
                                            AutoSizeAxes     = Axes.Y,
                                        },
                                        new OsuTextFlowContainer(t =>
                                        {
                                            t.Font   = t.Font.With(size: 12);
                                            t.Colour = colour.PinkLighter;
                                        })
                                        {
                                            Text   = ChangelogStrings.SupportText2,
                                            Margin = new MarginPadding {
                                                Top = 10
                                            },
                                            RelativeSizeAxes = Axes.X,
                                            AutoSizeAxes     = Axes.Y,
                                        }
                                    },
                                },
                                new Container
                                {
                                    RelativeSizeAxes = Axes.Y,
                                    Width            = image_container_width,
                                    Anchor           = Anchor.CentreRight,
                                    Origin           = Anchor.CentreRight,
                                    Children         = new Drawable[]
                                    {
                                        new Sprite
                                        {
                                            Anchor = Anchor.Centre,
                                            Origin = Anchor.Centre,
                                            Margin = new MarginPadding {
                                                Bottom = 28
                                            },
                                            RelativeSizeAxes = Axes.Both,
                                            FillMode         = FillMode.Fill,
                                            Texture          = textures.Get(@"Online/supporter-pippi"),
                                        },
                                        new Container
                                        {
                                            Anchor = Anchor.TopCentre,
                                            Origin = Anchor.TopCentre,
                                            Size   = new Vector2(heart_size),
                                            Margin = new MarginPadding {
                                                Top = 70
                                            },
                                            Masking    = true,
                                            EdgeEffect = new EdgeEffectParameters
                                            {
                                                Type      = EdgeEffectType.Shadow,
                                                Colour    = colour.Pink,
                                                Radius    = 10,
                                                Roundness = heart_size / 2,
                                            },
                                            Child = new Sprite
                                            {
                                                Size    = new Vector2(heart_size),
                                                Texture = textures.Get(@"Online/supporter-heart"),
                                            },
                                        },
                                    }
                                }
                            }
                        },
                    }
                },
            };

            supportLinkText.AddText("Support further development of osu! and ");
            supportLinkText.AddLink("become an osu!supporter", @"https://osu.ppy.sh/home/support", t => t.Font = t.Font.With(weight: FontWeight.Bold));
            supportLinkText.AddText(" today!");
        }
예제 #18
0
 private void load(OverlayColourProvider colourProvider)
 {
     AddRangeInternal(new Drawable[]
     {
         new UpdateableBeatmapSetCover(BeatmapSetCoverType.List)
         {
             RelativeSizeAxes = Axes.Y,
             Width            = cover_width,
             BeatmapSet       = beatmap.BeatmapSet,
         },
         new Container
         {
             RelativeSizeAxes = Axes.Both,
             Padding          = new MarginPadding {
                 Left = cover_width - corner_radius
             },
             Children = new Drawable[]
             {
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Masking          = true,
                     CornerRadius     = corner_radius,
                     Children         = new Drawable[]
                     {
                         new MostPlayedBeatmapContainer
                         {
                             Child = new Container
                             {
                                 RelativeSizeAxes = Axes.Both,
                                 Padding          = new MarginPadding(10),
                                 Children         = new Drawable[]
                                 {
                                     new FillFlowContainer
                                     {
                                         Anchor       = Anchor.CentreLeft,
                                         Origin       = Anchor.CentreLeft,
                                         AutoSizeAxes = Axes.Both,
                                         Direction    = FillDirection.Vertical,
                                         Children     = new Drawable[]
                                         {
                                             new MostPlayedBeatmapMetadataContainer(beatmap),
                                             new LinkFlowContainer(t =>
                                             {
                                                 t.Font   = OsuFont.GetFont(size: 12, weight: FontWeight.Regular);
                                                 t.Colour = colourProvider.Foreground1;
                                             })
                                             {
                                                 AutoSizeAxes = Axes.Both,
                                                 Direction    = FillDirection.Horizontal,
                                             }.With(d =>
                                             {
                                                 d.AddText("mapped by ");
                                                 d.AddUserLink(beatmap.Metadata.Author);
                                             }),
                                         }
                                     },
                                     new PlayCountText(playCount)
                                     {
                                         Anchor = Anchor.CentreRight,
                                         Origin = Anchor.CentreRight
                                     },
                                 }
                             },
                         }
                     }
                 }
             }
         }
     });
 }
예제 #19
0
 private void load([CanBeNull] OverlayColourProvider overlayColourProvider, OsuColour osuColour)
 {
     Background.Colour = overlayColourProvider?.Dark6 ?? osuColour.GreySeaFoamDarker;
 }
        private void load(OverlayColourProvider colourProvider)
        {
            Height = 150;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = colourProvider.Background5,
                },
                new FillFlowContainer
                {
                    Direction = FillDirection.Horizontal,
                    Margin    = new MarginPadding {
                        Left = UserProfileOverlay.CONTENT_X_MARGIN
                    },
                    Height       = avatar_size,
                    AutoSizeAxes = Axes.X,
                    Anchor       = Anchor.CentreLeft,
                    Origin       = Anchor.CentreLeft,
                    Children     = new Drawable[]
                    {
                        avatar = new UpdateableAvatar
                        {
                            Size            = new Vector2(avatar_size),
                            Masking         = true,
                            CornerRadius    = avatar_size * 0.25f,
                            OpenOnClick     = { Value = false },
                            ShowGuestOnNull = false,
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.Y,
                            AutoSizeAxes     = Axes.X,
                            Padding          = new MarginPadding {
                                Left = 10
                            },
                            Children = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Vertical,
                                    Children     = new Drawable[]
                                    {
                                        new FillFlowContainer
                                        {
                                            AutoSizeAxes = Axes.Both,
                                            Direction    = FillDirection.Horizontal,
                                            Children     = new Drawable[]
                                            {
                                                usernameText = new OsuSpriteText
                                                {
                                                    Font = OsuFont.GetFont(size: 24, weight: FontWeight.Regular)
                                                },
                                                openUserExternally = new ExternalLinkButton
                                                {
                                                    Margin = new MarginPadding {
                                                        Left = 5
                                                    },
                                                    Anchor = Anchor.CentreLeft,
                                                    Origin = Anchor.CentreLeft,
                                                },
                                            }
                                        },
                                        titleText = new OsuSpriteText
                                        {
                                            Font = OsuFont.GetFont(size: 18, weight: FontWeight.Regular)
                                        },
                                    }
                                },
                                new FillFlowContainer
                                {
                                    Origin       = Anchor.BottomLeft,
                                    Anchor       = Anchor.BottomLeft,
                                    Direction    = FillDirection.Vertical,
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new Drawable[]
                                    {
                                        supporterTag = new SupporterIcon
                                        {
                                            Height = 20,
                                            Margin = new MarginPadding {
                                                Top = 5
                                            }
                                        },
                                        new Box
                                        {
                                            RelativeSizeAxes = Axes.X,
                                            Height           = 1.5f,
                                            Margin           = new MarginPadding {
                                                Top = 10
                                            },
                                            Colour = colourProvider.Light1,
                                        },
                                        new FillFlowContainer
                                        {
                                            AutoSizeAxes = Axes.Both,
                                            Margin       = new MarginPadding {
                                                Top = 5
                                            },
                                            Direction = FillDirection.Horizontal,
                                            Children  = new Drawable[]
                                            {
                                                userFlag = new UpdateableFlag
                                                {
                                                    Size = new Vector2(30, 20),
                                                    ShowPlaceholderOnNull = false,
                                                },
                                                userCountryText = new OsuSpriteText
                                                {
                                                    Font   = OsuFont.GetFont(size: 17.5f, weight: FontWeight.Regular),
                                                    Margin = new MarginPadding {
                                                        Left = 10
                                                    },
                                                    Origin = Anchor.CentreLeft,
                                                    Anchor = Anchor.CentreLeft,
                                                    Colour = colourProvider.Light1,
                                                }
                                            }
                                        },
                                    }
                                }
                            }
                        }
                    }
                },
                userStats = new FillFlowContainer
                {
                    Anchor       = Anchor.TopRight,
                    Origin       = Anchor.TopRight,
                    AutoSizeAxes = Axes.Y,
                    Width        = 300,
                    Margin       = new MarginPadding {
                        Right = UserProfileOverlay.CONTENT_X_MARGIN
                    },
                    Padding = new MarginPadding {
                        Vertical = 15
                    },
                    Spacing = new Vector2(0, 2)
                }
            };

            User.BindValueChanged(user => updateUser(user.NewValue));
        }
예제 #21
0
 private void load(OverlayColourProvider colourProvider)
 {
     background.Colour = idleColour = colourProvider.Background4;
     hoverColour       = colourProvider.Background3;
 }
예제 #22
0
 private void load(OverlayColourProvider colourProvider)
 {
     lineBackground.Colour = colourProvider.Highlight1;
 }
예제 #23
0
        private void load(OverlayColourProvider colours)
        {
            ButtonsContainer = new Container
            {
                Anchor           = Anchor.CentreRight,
                Origin           = Anchor.CentreRight,
                RelativeSizeAxes = Axes.Y,
                AutoSizeAxes     = Axes.X
            };

            InternalChildren = new[]
            {
                // This resolves internal 1px gaps due to applying the (parenting) corner radius and masking across multiple filling background sprites.
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = colours.Background5,
                },
                CreateBackground().With(d =>
                {
                    d.RelativeSizeAxes = Axes.Both;
                }),
                wrapper = new DelayedLoadWrapper(() =>
                                                 new Container
                {
                    Name             = @"Room content",
                    RelativeSizeAxes = Axes.Both,
                    // This negative padding resolves 1px gaps between this background and the background above.
                    Padding = new MarginPadding {
                        Left = 20, Vertical = -0.5f
                    },
                    Child = new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Masking          = true,
                        CornerRadius     = CORNER_RADIUS,
                        Children         = new Drawable[]
                        {
                            new GridContainer
                            {
                                RelativeSizeAxes = Axes.Both,
                                ColumnDimensions = new[]
                                {
                                    new Dimension(GridSizeMode.Relative, 0.2f)
                                },
                                Content = new[]
                                {
                                    new Drawable[]
                                    {
                                        new Box
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Colour           = colours.Background5,
                                        },
                                        new Box
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Colour           = ColourInfo.GradientHorizontal(colours.Background5, colours.Background5.Opacity(0.3f))
                                        },
                                    }
                                }
                            },
                            new Container
                            {
                                Name             = @"Left details",
                                RelativeSizeAxes = Axes.Both,
                                Padding          = new MarginPadding
                                {
                                    Left     = 20,
                                    Vertical = 5
                                },
                                Children = new Drawable[]
                                {
                                    new FillFlowContainer
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Direction        = FillDirection.Vertical,
                                        Children         = new Drawable[]
                                        {
                                            new FillFlowContainer
                                            {
                                                AutoSizeAxes = Axes.Both,
                                                Direction    = FillDirection.Horizontal,
                                                Spacing      = new Vector2(5),
                                                Children     = new Drawable[]
                                                {
                                                    new RoomStatusPill
                                                    {
                                                        Anchor = Anchor.CentreLeft,
                                                        Origin = Anchor.CentreLeft
                                                    },
                                                    specialCategoryPill = new RoomSpecialCategoryPill
                                                    {
                                                        Anchor = Anchor.CentreLeft,
                                                        Origin = Anchor.CentreLeft
                                                    },
                                                    endDateInfo = new EndDateInfo
                                                    {
                                                        Anchor = Anchor.CentreLeft,
                                                        Origin = Anchor.CentreLeft,
                                                    },
                                                }
                                            },
                                            new FillFlowContainer
                                            {
                                                RelativeSizeAxes = Axes.X,
                                                AutoSizeAxes     = Axes.Y,
                                                Padding          = new MarginPadding {
                                                    Top = 3
                                                },
                                                Direction = FillDirection.Vertical,
                                                Children  = new Drawable[]
                                                {
                                                    new RoomNameText(),
                                                    new RoomStatusText()
                                                }
                                            }
                                        },
                                    },
                                    new FillFlowContainer
                                    {
                                        Anchor             = Anchor.BottomLeft,
                                        Origin             = Anchor.BottomLeft,
                                        AutoSizeAxes       = Axes.Both,
                                        Direction          = FillDirection.Horizontal,
                                        Spacing            = new Vector2(5),
                                        ChildrenEnumerable = CreateBottomDetails()
                                    }
                                }
                            },
                            new FillFlowContainer
                            {
                                Name             = "Right content",
                                Anchor           = Anchor.CentreRight,
                                Origin           = Anchor.CentreRight,
                                AutoSizeAxes     = Axes.X,
                                RelativeSizeAxes = Axes.Y,
                                Spacing          = new Vector2(5),
                                Padding          = new MarginPadding
                                {
                                    Right    = 10,
                                    Vertical = 20,
                                },
                                Children = new Drawable[]
                                {
                                    ButtonsContainer,
                                    drawableRoomParticipantsList = new DrawableRoomParticipantsList
                                    {
                                        Anchor          = Anchor.CentreRight,
                                        Origin          = Anchor.CentreRight,
                                        NumberOfCircles = NumberOfAvatars
                                    }
                                }
                            },
                            passwordIcon = new PasswordProtectedIcon {
                                Alpha = 0
                            }
                        },
                    },
                }, 0)
                {
                    RelativeSizeAxes = Axes.Both,
                }
            };
        }
예제 #24
0
 private void load(OverlayColourProvider colourProvider)
 {
     background.Colour = colourProvider.Background5;
 }
예제 #25
0
 private void load(OverlayColourProvider colourProvider)
 {
     IdleColour  = isCurrent ? Color4.White : colourProvider.Light2;
     HoverColour = isCurrent ? Color4.White : colourProvider.Light1;
     Action      = () => { }; // Avoid button being disabled since there's no proper action assigned.
 }
예제 #26
0
        private void load(OverlayColourProvider colourProvider, GameHost host)
        {
            if (post.Slug != null)
            {
                TooltipText = "view in browser";
                Action      = () => host.OpenUrlExternally("https://osu.ppy.sh/home/news/" + post.Slug);
            }

            NewsPostBackground bg;

            AddRange(new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both
                },
                new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Direction        = FillDirection.Vertical,
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = 160,
                            Masking          = true,
                            CornerRadius     = 6,
                            Children         = new Drawable[]
                            {
                                new DelayedLoadWrapper(bg = new NewsPostBackground(post.FirstImage)
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    FillMode         = FillMode.Fill,
                                    Anchor           = Anchor.Centre,
                                    Origin           = Anchor.Centre,
                                    Alpha            = 0
                                })
                                {
                                    RelativeSizeAxes = Axes.Both
                                },
                                new DateContainer(post.PublishedAt)
                                {
                                    Anchor = Anchor.TopRight,
                                    Origin = Anchor.TopRight,
                                    Margin = new MarginPadding
                                    {
                                        Top   = 10,
                                        Right = 15
                                    }
                                }
                            }
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Padding          = new MarginPadding
                            {
                                Horizontal = 15,
                                Vertical   = 10
                            },
                            Child = main = new TextFlowContainer
                            {
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y
                            }
                        }
                    }
                }
            });

            IdleColour  = colourProvider.Background4;
            HoverColour = colourProvider.Background3;

            bg.OnLoadComplete += d => d.FadeIn(250, Easing.In);

            main.AddParagraph(post.Title, t => t.Font   = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold));
            main.AddParagraph(post.Preview, t => t.Font = OsuFont.GetFont(size: 12)); // Should use sans-serif font
            main.AddParagraph("by ", t => t.Font        = OsuFont.GetFont(size: 12));
            main.AddText(post.Author, t => t.Font       = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold));
        }
예제 #27
0
 private void load([CanBeNull] OverlayColourProvider colourProvider, OsuColour colours)
 {
     Background.Colour = Arrow.Colour = colourProvider?.Background4 ?? colours.GreySeaFoamDarker;
 }
예제 #28
0
        protected ShearedOverlayContainer(OverlayColourScheme colourScheme)
        {
            RelativeSizeAxes = Axes.Both;

            ColourProvider = new OverlayColourProvider(colourScheme);
        }
예제 #29
0
 private void load(OverlayColourProvider colourProvider)
 {
     AccentColour = colourProvider.Highlight1;
     LineColour   = colourProvider.Background1;
 }
예제 #30
0
        private void load(OverlayColourProvider colourProvider, TextureStore textures)
        {
            Container <Drawable> hiddenDetailContainer;
            Container <Drawable> expandedDetailContainer;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = colourProvider.Background4
                },
                new FillFlowContainer
                {
                    AutoSizeAxes     = Axes.X,
                    RelativeSizeAxes = Axes.Y,
                    Direction        = FillDirection.Horizontal,
                    Padding          = new MarginPadding {
                        Vertical = 10
                    },
                    Margin = new MarginPadding {
                        Left = UserProfileOverlay.CONTENT_X_MARGIN
                    },
                    Spacing  = new Vector2(10, 0),
                    Children = new Drawable[]
                    {
                        new AddFriendButton
                        {
                            RelativeSizeAxes = Axes.Y,
                            User             = { BindTarget = User }
                        },
                        new MessageUserButton
                        {
                            User = { BindTarget = User }
                        },
                    }
                },
                new Container
                {
                    Anchor           = Anchor.CentreRight,
                    Origin           = Anchor.CentreRight,
                    RelativeSizeAxes = Axes.Y,
                    Padding          = new MarginPadding {
                        Vertical = 10
                    },
                    Width = UserProfileOverlay.CONTENT_X_MARGIN,
                    Child = new ExpandDetailsButton
                    {
                        RelativeSizeAxes = Axes.Y,
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        DetailsVisible   = { BindTarget = DetailsVisible }
                    },
                },
                new Container
                {
                    Anchor       = Anchor.CentreRight,
                    Origin       = Anchor.CentreRight,
                    AutoSizeAxes = Axes.Both,
                    Margin       = new MarginPadding {
                        Right = UserProfileOverlay.CONTENT_X_MARGIN
                    },
                    Children = new Drawable[]
                    {
                        new LevelBadge
                        {
                            Anchor = Anchor.CentreRight,
                            Origin = Anchor.CentreRight,
                            Size   = new Vector2(40),
                            User   = { BindTarget = User }
                        },
                        expandedDetailContainer = new Container
                        {
                            Anchor = Anchor.CentreRight,
                            Origin = Anchor.CentreRight,
                            Width  = 200,
                            Height = 6,
                            Margin = new MarginPadding {
                                Right = 50
                            },
                            Child = new LevelProgressBar
                            {
                                RelativeSizeAxes = Axes.Both,
                                User             = { BindTarget = User }
                            }
                        },
                        hiddenDetailContainer = new FillFlowContainer
                        {
                            Direction    = FillDirection.Horizontal,
                            Anchor       = Anchor.CentreRight,
                            Origin       = Anchor.CentreRight,
                            Width        = 200,
                            AutoSizeAxes = Axes.Y,
                            Alpha        = 0,
                            Spacing      = new Vector2(10, 0),
                            Margin       = new MarginPadding {
                                Right = 50
                            },
                            Children = new[]
                            {
                                hiddenDetailGlobal = new OverlinedInfoContainer
                                {
                                    Title      = "Global Ranking",
                                    LineColour = colourProvider.Highlight1
                                },
                                hiddenDetailCountry = new OverlinedInfoContainer
                                {
                                    Title      = "Country Ranking",
                                    LineColour = colourProvider.Highlight1
                                },
                            }
                        }
                    }
                }
            };

            DetailsVisible.BindValueChanged(visible =>
            {
                hiddenDetailContainer.FadeTo(visible.NewValue ? 0 : 1, 200, Easing.OutQuint);
                expandedDetailContainer.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
            });

            User.BindValueChanged(user => updateDisplay(user.NewValue));
        }