示例#1
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();
        }
示例#2
0
        public Header(Room room)
        {
            RelativeSizeAxes = Axes.X;
            Height           = HEIGHT;

            bindings.Room = room;

            BeatmapTypeInfo     beatmapTypeInfo;
            BeatmapSelectButton beatmapButton;
            UpdateableBeatmapBackgroundSprite background;
            ModDisplay modDisplay;

            Children = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Masking          = true,
                    Children         = new Drawable[]
                    {
                        background = new HeaderBeatmapBackgroundSprite {
                            RelativeSizeAxes = Axes.Both
                        },
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = ColourInfo.GradientVertical(Color4.Black.Opacity(0.4f), Color4.Black.Opacity(0.6f)),
                        },
                    }
                },
                tabStrip = new Box
                {
                    Anchor           = Anchor.BottomLeft,
                    Origin           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.X,
                    Height           = 1,
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Horizontal = SearchableListOverlay.WIDTH_PADDING
                    },
                    Children = new Drawable[]
                    {
                        new FillFlowContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Padding      = new MarginPadding {
                                Top = 20
                            },
                            Direction = FillDirection.Vertical,
                            Children  = new Drawable[]
                            {
                                beatmapTypeInfo = 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(room)
                            {
                                RelativeSizeAxes = Axes.Both,
                                Height           = 1,
                            },
                        },
                        Tabs = new MatchTabControl(room)
                        {
                            Anchor           = Anchor.BottomLeft,
                            Origin           = Anchor.BottomLeft,
                            RelativeSizeAxes = Axes.X
                        },
                    },
                },
            };

            beatmapTypeInfo.Beatmap.BindTo(bindings.CurrentBeatmap);
            beatmapTypeInfo.Ruleset.BindTo(bindings.CurrentRuleset);
            beatmapTypeInfo.Type.BindTo(bindings.Type);
            background.Beatmap.BindTo(bindings.CurrentBeatmap);
            bindings.CurrentMods.BindValueChanged(m => modDisplay.Current.Value = m, true);

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