Esempio n. 1
0
        private readonly Bindable <IReadOnlyList <Mod> > mods = new Bindable <IReadOnlyList <Mod> >(Array.Empty <Mod>()); // Bound to the game's mods, but is not reset on exiting

        protected SongSelect()
        {
            AddRangeInternal(new Drawable[]
            {
                new ParallaxContainer
                {
                    Masking          = true,
                    ParallaxAmount   = 0.005f,
                    RelativeSizeAxes = Axes.Both,
                    Children         = new[]
                    {
                        new WedgeBackground
                        {
                            RelativeSizeAxes = Axes.Both,
                            Padding          = new MarginPadding {
                                Right = -150
                            },
                            Size = new Vector2(wedged_container_size.X, 1),
                        }
                    }
                },
                new Container
                {
                    Origin           = Anchor.BottomLeft,
                    Anchor           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.Both,
                    Size             = new Vector2(wedged_container_size.X, 1),
                    Padding          = new MarginPadding
                    {
                        Bottom = Footer.HEIGHT,
                        Top    = wedged_container_size.Y + left_area_padding,
                        Left   = left_area_padding,
                        Right  = left_area_padding * 2,
                    },
                    Child = BeatmapDetails = new BeatmapDetailArea
                    {
                        RelativeSizeAxes = Axes.Both,
                        Padding          = new MarginPadding {
                            Top = 10, Right = 5
                        },
                    }
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Masking          = true,
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    Width            = 2, //avoid horizontal masking so the panels don't clip when screen stack is pushed.
                    Child            = new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        Width            = 0.5f,
                        Children         = new Drawable[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Padding          = new MarginPadding
                                {
                                    Top    = FilterControl.HEIGHT,
                                    Bottom = Footer.HEIGHT
                                },
                                Child = Carousel = new BeatmapCarousel
                                {
                                    RelativeSizeAxes   = Axes.Both,
                                    Size               = new Vector2(1 - wedged_container_size.X, 1),
                                    Anchor             = Anchor.CentreRight,
                                    Origin             = Anchor.CentreRight,
                                    SelectionChanged   = updateSelectedBeatmap,
                                    BeatmapSetsChanged = carouselBeatmapsLoaded,
                                },
                            },
                            FilterControl = new FilterControl
                            {
                                RelativeSizeAxes = Axes.X,
                                Height           = FilterControl.HEIGHT,
                                FilterChanged    = c => Carousel.Filter(c),
                                Background       = { Width = 2 },
                                Exit             = () =>
                                {
                                    if (this.IsCurrentScreen())
                                    {
                                        this.Exit();
                                    }
                                },
                            },
                        }
                    },
                },
                beatmapInfoWedge = new BeatmapInfoWedge
                {
                    Size             = wedged_container_size,
                    RelativeSizeAxes = Axes.X,
                    Margin           = new MarginPadding
                    {
                        Top   = left_area_padding,
                        Right = left_area_padding,
                    },
                },
                new ResetScrollContainer(() => Carousel.ScrollToSelected())
                {
                    RelativeSizeAxes = Axes.Y,
                    Width            = 250,
                }
            });

            if (ShowFooter)
            {
                AddRangeInternal(new[]
                {
                    FooterPanels = new Container
                    {
                        Anchor           = Anchor.BottomLeft,
                        Origin           = Anchor.BottomLeft,
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Margin           = new MarginPadding {
                            Bottom = Footer.HEIGHT
                        },
                        Children = new Drawable[]
                        {
                            BeatmapOptions = new BeatmapOptionsOverlay(),
                            ModSelect      = new ModSelectOverlay
                            {
                                RelativeSizeAxes = Axes.X,
                                Origin           = Anchor.BottomCentre,
                                Anchor           = Anchor.BottomCentre,
                            }
                        }
                    },
                    Footer = new Footer()
                });
            }

            BeatmapDetails.Leaderboard.ScoreSelected += s => this.Push(new SoloResults(s));
        }
Esempio n. 2
0
 private void filterChanged(FilterCriteria criteria, bool debounce = true)
 {
     carousel.Filter(criteria, debounce);
 }
Esempio n. 3
0
        protected SongSelect()
        {
            const float carousel_width = 640;
            const float filter_height  = 100;

            AddRange(new Drawable[]
            {
                new ParallaxContainer
                {
                    Padding = new MarginPadding {
                        Top = filter_height
                    },
                    ParallaxAmount   = 0.005f,
                    RelativeSizeAxes = Axes.Both,
                    Children         = new[]
                    {
                        new WedgeBackground
                        {
                            RelativeSizeAxes = Axes.Both,
                            Padding          = new MarginPadding {
                                Right = carousel_width * 0.76f
                            },
                        }
                    }
                },
                LeftContent = new Container
                {
                    Origin           = Anchor.BottomLeft,
                    Anchor           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.Both,
                    Size             = new Vector2(wedged_container_size.X, 1),
                    Padding          = new MarginPadding
                    {
                        Bottom = 50,
                        Top    = wedged_container_size.Y + left_area_padding,
                        Left   = left_area_padding,
                        Right  = left_area_padding * 2,
                    }
                },
                carousel = new BeatmapCarousel
                {
                    RelativeSizeAxes   = Axes.Y,
                    Size               = new Vector2(carousel_width, 1),
                    Anchor             = Anchor.CentreRight,
                    Origin             = Anchor.CentreRight,
                    SelectionChanged   = carouselSelectionChanged,
                    BeatmapSetsChanged = carouselBeatmapsLoaded,
                },
                FilterControl = new FilterControl
                {
                    RelativeSizeAxes = Axes.X,
                    Height           = filter_height,
                    FilterChanged    = c => carousel.Filter(c),
                    Exit             = Exit,
                },
                beatmapInfoWedge = new BeatmapInfoWedge
                {
                    Alpha            = 0,
                    Size             = wedged_container_size,
                    RelativeSizeAxes = Axes.X,
                    Margin           = new MarginPadding
                    {
                        Top   = left_area_padding,
                        Right = left_area_padding,
                    },
                },
                new ResetScrollContainer(() => carousel.ScrollToSelected())
                {
                    RelativeSizeAxes = Axes.Y,
                    Width            = 250,
                }
            });

            if (ShowFooter)
            {
                Add(FooterPanels = new Container
                {
                    Anchor           = Anchor.BottomLeft,
                    Origin           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Margin           = new MarginPadding
                    {
                        Bottom = Footer.HEIGHT,
                    },
                });
                Add(Footer = new Footer
                {
                    OnBack = Exit,
                });

                FooterPanels.Add(BeatmapOptions = new BeatmapOptionsOverlay());
            }
        }