Пример #1
0
        private void load()
        {
            ReadyButton       readyButton;
            ViewBeatmapButton viewBeatmapButton;
            HostInfo          hostInfo;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.FromHex(@"28242d"),
                },
                new Container
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Padding          = new MarginPadding {
                        Horizontal = SearchableListOverlay.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING
                    },
                    Children = new Drawable[]
                    {
                        new FillFlowContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Direction    = FillDirection.Vertical,
                            Spacing      = new Vector2(0, 10),
                            Padding      = new MarginPadding {
                                Vertical = 20
                            },
                            Children = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Vertical,
                                    Children     = new Drawable[]
                                    {
                                        new OsuSpriteText
                                        {
                                            Font    = OsuFont.GetFont(size: 30),
                                            Current = RoomName
                                        },
                                        new RoomStatusInfo(),
                                    }
                                },
                                hostInfo = new HostInfo(),
                            },
                        },
                        new FillFlowContainer
                        {
                            Anchor       = Anchor.CentreRight,
                            Origin       = Anchor.CentreRight,
                            AutoSizeAxes = Axes.X,
                            Height       = 70,
                            Spacing      = new Vector2(10, 0),
                            Direction    = FillDirection.Horizontal,
                            Children     = new Drawable[]
                            {
                                viewBeatmapButton = new ViewBeatmapButton(),
                                readyButton       = new ReadyButton
                                {
                                    Action = () => OnStart?.Invoke()
                                }
                            }
                        }
                    },
                },
            };

            CurrentItem.BindValueChanged(item =>
            {
                viewBeatmapButton.Beatmap.Value = item.NewValue?.Beatmap;
                readyButton.Beatmap.Value       = item.NewValue?.Beatmap;
            }, true);

            hostInfo.Host.BindTo(Host);
        }
Пример #2
0
        public Info(Room room)
        {
            RelativeSizeAxes = Axes.X;
            AutoSizeAxes     = Axes.Y;

            ReadyButton       readyButton;
            ViewBeatmapButton viewBeatmapButton;
            HostInfo          hostInfo;
            RoomStatusInfo    statusInfo;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.FromHex(@"28242d"),
                },
                new Container
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Padding          = new MarginPadding {
                        Horizontal = SearchableListOverlay.WIDTH_PADDING
                    },
                    Children = new Drawable[]
                    {
                        new FillFlowContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Direction    = FillDirection.Vertical,
                            Spacing      = new Vector2(0, 10),
                            Padding      = new MarginPadding {
                                Vertical = 20
                            },
                            Children = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Vertical,
                                    Children     = new Drawable[]
                                    {
                                        new OsuSpriteText
                                        {
                                            TextSize = 30,
                                            Current  = bindings.Name
                                        },
                                        new RoomStatusInfo(room),
                                    }
                                },
                                hostInfo = new HostInfo(),
                            },
                        },
                        new FillFlowContainer
                        {
                            Anchor       = Anchor.CentreRight,
                            Origin       = Anchor.CentreRight,
                            AutoSizeAxes = Axes.X,
                            Height       = 70,
                            Spacing      = new Vector2(10, 0),
                            Direction    = FillDirection.Horizontal,
                            Children     = new Drawable[]
                            {
                                viewBeatmapButton = new ViewBeatmapButton(),
                                readyButton       = new ReadyButton(room)
                                {
                                    Action = () => OnStart?.Invoke()
                                }
                            }
                        }
                    },
                },
            };

            viewBeatmapButton.Beatmap.BindTo(bindings.CurrentBeatmap);
            readyButton.Beatmap.BindTo(bindings.CurrentBeatmap);
            hostInfo.Host.BindTo(bindings.Host);

            bindings.Room = room;
        }