Пример #1
0
        private void load(OsuColour colours)
        {
            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.FromHex(@"343138"),
                },
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    RowDimensions    = new[]
                    {
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(GridSizeMode.Distributed),
                    },
                    Content = new[]
                    {
                        new Drawable[]
                        {
                            new FillFlowContainer
                            {
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y,
                                Direction        = FillDirection.Vertical,
                                Children         = new Drawable[]
                                {
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        Height           = 200,
                                        Masking          = true,
                                        Children         = new Drawable[]
                                        {
                                            new MultiplayerBackgroundSprite {
                                                RelativeSizeAxes = Axes.Both
                                            },
                                            new Box
                                            {
                                                RelativeSizeAxes = Axes.Both,
                                                Colour           = ColourInfo.GradientVertical(Color4.Black.Opacity(0.5f), Color4.Black.Opacity(0)),
                                            },
                                            new Container
                                            {
                                                RelativeSizeAxes = Axes.Both,
                                                Padding          = new MarginPadding(20),
                                                Children         = new Drawable[]
                                                {
                                                    participantCount = new ParticipantCountDisplay
                                                    {
                                                        Anchor = Anchor.TopRight,
                                                        Origin = Anchor.TopRight,
                                                    },
                                                    name = new OsuSpriteText
                                                    {
                                                        Anchor  = Anchor.BottomLeft,
                                                        Origin  = Anchor.BottomLeft,
                                                        Font    = OsuFont.GetFont(size: 30),
                                                        Current = RoomName
                                                    },
                                                },
                                            },
                                        },
                                    },
                                    new StatusColouredContainer(transition_duration)
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        Height           = 5,
                                        Child            = new Box {
                                            RelativeSizeAxes = Axes.Both
                                        }
                                    },
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Children         = new Drawable[]
                                        {
                                            new Box
                                            {
                                                RelativeSizeAxes = Axes.Both,
                                                Colour           = OsuColour.FromHex(@"28242d"),
                                            },
                                            new FillFlowContainer
                                            {
                                                RelativeSizeAxes = Axes.X,
                                                AutoSizeAxes     = Axes.Y,
                                                Direction        = FillDirection.Vertical,
                                                LayoutDuration   = transition_duration,
                                                Padding          = contentPadding,
                                                Spacing          = new Vector2(0f, 5f),
                                                Children         = new Drawable[]
                                                {
                                                    new StatusColouredContainer(transition_duration)
                                                    {
                                                        AutoSizeAxes = Axes.Both,
                                                        Child        = new StatusText
                                                        {
                                                            Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 14),
                                                        }
                                                    },
                                                    beatmapTypeInfo = new BeatmapTypeInfo(),
                                                },
                                            },
                                        },
                                    },
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Padding          = contentPadding,
                                        Children         = new Drawable[]
                                        {
                                            participantInfo = new ParticipantInfo(),
                                        },
                                    },
                                },
                            },
                        },
                        new Drawable[]
                        {
                            new MatchParticipants
                            {
                                RelativeSizeAxes = Axes.Both,
                            }
                        }
                    }
                }
            };

            Status.BindValueChanged(_ => updateStatus(), true);
            RoomID.BindValueChanged(_ => updateStatus(), true);
        }
Пример #2
0
        public Info()
        {
            RelativeSizeAxes = Axes.X;
            Height           = HEIGHT;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.FromHex(@"28242d"),
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Horizontal = SearchableListOverlay.WIDTH_PADDING
                    },
                    Children = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.Y,
                            AutoSizeAxes     = Axes.X,
                            Padding          = new MarginPadding {
                                Vertical = 20
                            },
                            Children = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Vertical,
                                    Children     = new Drawable[]
                                    {
                                        name = new OsuSpriteText
                                        {
                                            TextSize = 30,
                                        },
                                        availabilityStatus = new OsuSpriteText
                                        {
                                            TextSize = 14,
                                        },
                                    },
                                },
                                beatmapTypeInfo = new BeatmapTypeInfo
                                {
                                    Anchor = Anchor.BottomLeft,
                                    Origin = Anchor.BottomLeft,
                                },
                            },
                        },
                        readyButton = new ReadyButton
                        {
                            Anchor           = Anchor.TopRight,
                            Origin           = Anchor.TopRight,
                            RelativeSizeAxes = Axes.Y,
                            Size             = new Vector2(200, 1),
                            Padding          = new MarginPadding {
                                Vertical = 10
                            },
                        },
                    },
                },
            };
        }