Пример #1
0
        private void load()
        {
            Container gameTypeContainer;

            InternalChild = new FillFlowContainer
            {
                AutoSizeAxes   = Axes.Both,
                Direction      = FillDirection.Horizontal,
                Spacing        = new Vector2(5f, 0f),
                LayoutDuration = 100,
                Children       = new[]
                {
                    drawableRuleset = new Container
                    {
                        AutoSizeAxes = Axes.Both,
                    },
                    gameTypeContainer = new Container
                    {
                        AutoSizeAxes = Axes.Both,
                    },
                },
            };

            CurrentItem.BindValueChanged(item => updateBeatmap(item.NewValue), true);

            Type.BindValueChanged(type => gameTypeContainer.Child = new DrawableGameType(type.NewValue)
            {
                Size = new Vector2(height)
            }, true);
        }
Пример #2
0
        private void load()
        {
            UpdateableBeatmapBackgroundSprite sprite;

            InternalChild = sprite = CreateBackgroundSprite();

            CurrentItem.BindValueChanged(item => sprite.Beatmap.Value = item.NewValue?.Beatmap, true);
        }
Пример #3
0
        private void load()
        {
            LinkFlowContainer beatmapAuthor;

            InternalChild = new FillFlowContainer
            {
                AutoSizeAxes   = Axes.Both,
                Direction      = FillDirection.Horizontal,
                LayoutDuration = 100,
                Spacing        = new Vector2(5, 0),
                Children       = new Drawable[]
                {
                    new ModeTypeInfo(),
                    new Container
                    {
                        AutoSizeAxes = Axes.X,
                        Height       = 30,
                        Margin       = new MarginPadding {
                            Left = 5
                        },
                        Children = new Drawable[]
                        {
                            new BeatmapTitle(),
                            beatmapAuthor = new LinkFlowContainer(s => s.Font = s.Font.With(size: 14))
                            {
                                Anchor       = Anchor.BottomLeft,
                                Origin       = Anchor.BottomLeft,
                                AutoSizeAxes = Axes.Both
                            },
                        },
                    },
                }
            };

            CurrentItem.BindValueChanged(item =>
            {
                beatmapAuthor.Clear();

                var beatmap = item.NewValue?.Beatmap;

                if (beatmap != null)
                {
                    beatmapAuthor.AddText("制作者 ", s => s.Colour = OsuColour.Gray(0.8f));
                    beatmapAuthor.AddUserLink(beatmap.Metadata.Author);
                }
            }, true);
        }
Пример #4
0
        private void load()
        {
            LinkFlowContainer beatmapAuthor;

            InternalChild = new FillFlowContainer
            {
                AutoSizeAxes   = Axes.Both,
                Direction      = FillDirection.Horizontal,
                LayoutDuration = 100,
                Spacing        = new Vector2(5, 0),
                Children       = new Drawable[]
                {
                    new ModeTypeInfo(),
                    new Container
                    {
                        AutoSizeAxes = Axes.X,
                        Height       = 30,
                        Margin       = new MarginPadding {
                            Left = 5
                        },
                        Children = new Drawable[]
                        {
                            new BeatmapTitle(),
                            beatmapAuthor = new LinkFlowContainer(s => s.TextSize = 14)
                            {
                                Anchor       = Anchor.BottomLeft,
                                Origin       = Anchor.BottomLeft,
                                AutoSizeAxes = Axes.Both
                            },
                        },
                    },
                }
            };

            CurrentItem.BindValueChanged(item =>
            {
                beatmapAuthor.Clear();

                var beatmap = item?.Beatmap;

                if (beatmap != null)
                {
                    beatmapAuthor.AddText("mapped by ", s => s.Colour = OsuColour.Gray(0.8f));
                    beatmapAuthor.AddLink(beatmap.Metadata.Author.Username, null, LinkAction.OpenUserProfile, beatmap.Metadata.Author.Id.ToString(), "View Profile");
                }
            }, true);
        }
Пример #5
0
 private void load()
 {
     CurrentItem.BindValueChanged(_ => updateText(), true);
 }
Пример #6
0
 private void load()
 {
     CurrentItem.BindValueChanged(item => loadNewPanel(item.NewValue?.Beatmap), true);
 }
Пример #7
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);
        }
Пример #8
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            CurrentItem.BindValueChanged(currentItemChanged, true);
        }
Пример #9
0
        private void load(OsuColour colours)
        {
            BeatmapSelectButton beatmapButton;
            ModDisplay          modDisplay;

            InternalChildren = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Masking          = true,
                    Children         = new Drawable[]
                    {
                        new HeaderBackgroundSprite {
                            RelativeSizeAxes = Axes.Both
                        },
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = ColourInfo.GradientVertical(Color4.Black.Opacity(0.7f), Color4.Black.Opacity(0.8f)),
                        },
                        beatmapPanel = new MatchBeatmapPanel
                        {
                            Anchor = Anchor.CentreRight,
                            Origin = Anchor.CentreRight,
                            Margin = new MarginPadding {
                                Right = 100
                            },
                        }
                    }
                },
                new Box
                {
                    Anchor           = Anchor.BottomLeft,
                    Origin           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.X,
                    Height           = 1,
                    Colour           = colours.Yellow
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Horizontal = SearchableListOverlay.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING
                    },
                    Children = new Drawable[]
                    {
                        new FillFlowContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Padding      = new MarginPadding {
                                Top = 20
                            },
                            Direction = FillDirection.Vertical,
                            Children  = new Drawable[]
                            {
                                new BeatmapTypeInfo(),
                                modDisplay = new ModDisplay
                                {
                                    Scale = new Vector2(0.75f),
                                    DisplayUnrankedText = false
                                },
                            }
                        },
                        new Container
                        {
                            Anchor           = Anchor.TopRight,
                            Origin           = Anchor.TopRight,
                            RelativeSizeAxes = Axes.Y,
                            Width            = 200,
                            Padding          = new MarginPadding {
                                Vertical = 10
                            },
                            Child = beatmapButton = new BeatmapSelectButton
                            {
                                RelativeSizeAxes = Axes.Both,
                                Height           = 1,
                            },
                        },
                        Tabs = new MatchTabControl
                        {
                            Anchor           = Anchor.BottomLeft,
                            Origin           = Anchor.BottomLeft,
                            RelativeSizeAxes = Axes.X
                        },
                    },
                },
            };

            CurrentItem.BindValueChanged(item => modDisplay.Current.Value = item.NewValue?.RequiredMods?.ToArray() ?? Array.Empty <Mod>(), true);

            beatmapButton.Action = () => RequestBeatmapSelection?.Invoke();
        }