コード例 #1
0
        public override void Reset()
        {
            base.Reset();

            var overlay = new BeatmapOptionsOverlay();

            Add(overlay);

            AddButton(@"Toggle", overlay.ToggleVisibility);
        }
コード例 #2
0
        public TestCaseBeatmapOptionsOverlay()
        {
            var overlay = new BeatmapOptionsOverlay();

            overlay.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, Color4.Purple, null, Key.Number1);
            overlay.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, Color4.Purple, null, Key.Number2);
            overlay.AddButton(@"Edit", @"Beatmap", FontAwesome.fa_pencil, Color4.Yellow, null, Key.Number3);
            overlay.AddButton(@"Delete", @"Beatmap", FontAwesome.fa_trash, Color4.Pink, null, Key.Number4, float.MaxValue);

            Add(overlay);

            AddStep(@"Toggle", overlay.ToggleVisibility);
        }
コード例 #3
0
        public TestSceneBeatmapOptionsOverlay()
        {
            var overlay = new BeatmapOptionsOverlay();

            overlay.AddButton(@"Remove", @"from unplayed", FontAwesome.Regular.TimesCircle, Color4.Purple, null, Key.Number1);
            overlay.AddButton(@"Clear", @"local scores", FontAwesome.Solid.Eraser, Color4.Purple, null, Key.Number2);
            overlay.AddButton(@"Edit", @"Beatmap", FontAwesome.Solid.PencilAlt, Color4.Yellow, null, Key.Number3);
            overlay.AddButton(@"Delete", @"Beatmap", FontAwesome.Solid.Trash, Color4.Pink, null, Key.Number4, float.MaxValue);

            Add(overlay);

            AddStep(@"Toggle", overlay.ToggleVisibility);
        }
コード例 #4
0
        public TestSceneBeatmapOptionsOverlay()
        {
            var overlay = new BeatmapOptionsOverlay();

            var colours = new OsuColour();

            overlay.AddButton(@"Manage", @"collections", FontAwesome.Solid.Book, colours.Green, null);
            overlay.AddButton(@"Delete", @"all difficulties", FontAwesome.Solid.Trash, colours.Pink, null);
            overlay.AddButton(@"Remove", @"from unplayed", FontAwesome.Regular.TimesCircle, colours.Purple, null);
            overlay.AddButton(@"Clear", @"local scores", FontAwesome.Solid.Eraser, colours.Purple, null);
            overlay.AddButton(@"Edit", @"beatmap", FontAwesome.Solid.PencilAlt, colours.Yellow, null);

            Add(overlay);

            AddStep(@"Toggle", overlay.ToggleVisibility);
        }
コード例 #5
0
        public override void Reset()
        {
            base.Reset();

            var overlay = new BeatmapOptionsOverlay();

            overlay.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, Color4.Purple, null, Key.Number1);
            overlay.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, Color4.Purple, null, Key.Number2);
            overlay.AddButton(@"Edit", @"Beatmap", FontAwesome.fa_pencil, Color4.Yellow, null, Key.Number3);
            overlay.AddButton(@"Delete", @"Beatmap", FontAwesome.fa_trash, Color4.Pink, null, Key.Number4, float.MaxValue);

            //add this view to sereen
            Add(overlay);

            //add a step button
            AddStep(@"Toggle", overlay.ToggleVisibility);
        }
コード例 #6
0
        protected SongSelect()
        {
            const float carousel_width = 640;
            const float filter_height  = 100;

            Add(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
                        },
                    }
                }
            });
            Add(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,
                }
            });
            Add(carousel = new BeatmapCarousel
            {
                RelativeSizeAxes = Axes.Y,
                Size             = new Vector2(carousel_width, 1),
                Anchor           = Anchor.CentreRight,
                Origin           = Anchor.CentreRight,
                SelectionChanged = carouselSelectionChanged,
                BeatmapsChanged  = carouselBeatmapsLoaded,
                DeleteRequested  = promptDelete,
                RestoreRequested = s => { foreach (var b in s.Beatmaps)
                                          {
                                              beatmaps.Restore(b);
                                          }
                },
                EditRequested           = editRequested,
                HideDifficultyRequested = b => beatmaps.Hide(b),
                StartRequested          = () => carouselRaisedStart(),
            });
            Add(FilterControl = new FilterControl
            {
                RelativeSizeAxes = Axes.X,
                Height           = filter_height,
                FilterChanged    = criteria => filterChanged(criteria),
                Exit             = Exit,
            });
            Add(beatmapInfoWedge = new BeatmapInfoWedge
            {
                Alpha            = 0,
                Size             = wedged_container_size,
                RelativeSizeAxes = Axes.X,
                Margin           = new MarginPadding
                {
                    Top   = left_area_padding,
                    Right = left_area_padding,
                },
            });
            Add(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,
                    OnStart = () => carouselRaisedStart(),
                });

                FooterPanels.Add(BeatmapOptions = new BeatmapOptionsOverlay());
            }
        }
コード例 #7
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,
                    }
                },
                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[]
                        {
                            Carousel = new BeatmapCarousel
                            {
                                Masking            = false,
                                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),
                                Background       = { Width = 2 },
                                Exit             = 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)
            {
                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());
            }
        }
コード例 #8
0
ファイル: SongSelect.cs プロジェクト: EvolvedAwesome/osu
        protected SongSelect()
        {
            const float carousel_width = 640;
            const float filter_height  = 100;

            beatmapGroups = new List <BeatmapGroup>();
            Add(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
                        },
                    }
                }
            });
            Add(carousel = new CarouselContainer
            {
                RelativeSizeAxes = Axes.Y,
                Size             = new Vector2(carousel_width, 1),
                Anchor           = Anchor.CentreRight,
                Origin           = Anchor.CentreRight,
            });
            Add(filter = new FilterControl
            {
                RelativeSizeAxes = Axes.X,
                Height           = filter_height,
                FilterChanged    = () => filterChanged(),
                Exit             = Exit,
            });
            Add(beatmapInfoWedge = new BeatmapInfoWedge
            {
                Alpha            = 0,
                Size             = wedged_container_size,
                RelativeSizeAxes = Axes.X,
                Margin           = new MarginPadding
                {
                    Top   = 20,
                    Right = 20,
                },
                X = -50,
            });

            if (ShowFooter)
            {
                Add(BeatmapOptions = new BeatmapOptionsOverlay
                {
                    Margin = new MarginPadding
                    {
                        Bottom = 50,
                    },
                });
                Add(Footer = new Footer
                {
                    OnBack  = Exit,
                    OnStart = raiseSelect,
                });
            }
        }
コード例 #9
0
        private void load(BeatmapDatabase beatmaps, AudioManager audio, DialogOverlay dialog, Framework.Game game,
                          OsuGame osu, OsuColour colours)
        {
            const float carousel_width = 640;
            const float filter_height  = 100;

            beatmapGroups = new List <BeatmapGroup>();
            Children      = 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
                            },
                        },
                    }
                },
                carousel = new CarouselContainer
                {
                    RelativeSizeAxes = Axes.Y,
                    Size             = new Vector2(carousel_width, 1),
                    Anchor           = Anchor.CentreRight,
                    Origin           = Anchor.CentreRight,
                },
                filter = new FilterControl
                {
                    RelativeSizeAxes = Axes.X,
                    Height           = filter_height,
                    FilterChanged    = () => filterChanged(),
                    Exit             = Exit,
                },
                beatmapInfoWedge = new BeatmapInfoWedge
                {
                    Alpha            = 0,
                    Size             = wedged_container_size,
                    RelativeSizeAxes = Axes.X,
                    Margin           = new MarginPadding
                    {
                        Top   = 20,
                        Right = 20,
                    },
                },
                beatmapOptions = new BeatmapOptionsOverlay
                {
                    OnRemoveFromUnplayed = null,
                    OnClearLocalScores   = null,
                    OnEdit   = null,
                    OnDelete = promptDelete,
                    Margin   = new MarginPadding
                    {
                        Bottom = 50,
                    },
                },
                modSelect = new ModSelectOverlay
                {
                    RelativeSizeAxes = Axes.X,
                    Origin           = Anchor.BottomCentre,
                    Anchor           = Anchor.BottomCentre,
                    Margin           = new MarginPadding
                    {
                        Bottom = 50,
                    },
                },
                footer = new Footer
                {
                    OnBack  = Exit,
                    OnStart = () =>
                    {
                        if (player != null || Beatmap == null)
                        {
                            return;
                        }

                        (player = new PlayerLoader(new Player
                        {
                            BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap,
                            PreferredPlayMode = playMode.Value
                        })).LoadAsync(Game, l => Push(player));
                    }
                },
            };

            footer.AddButton(@"mods", colours.Yellow, modSelect.ToggleVisibility);
            footer.AddButton(@"random", colours.Green, carousel.SelectRandom);
            footer.AddButton(@"options", colours.Blue, beatmapOptions.ToggleVisibility);

            if (osu != null)
            {
                playMode.BindTo(osu.PlayMode);
            }
            playMode.ValueChanged += playMode_ValueChanged;

            if (database == null)
            {
                database = beatmaps;
            }

            database.BeatmapSetAdded   += onBeatmapSetAdded;
            database.BeatmapSetRemoved += onBeatmapSetRemoved;

            trackManager  = audio.Track;
            dialogOverlay = dialog;

            sampleChangeDifficulty = audio.Sample.Get(@"SongSelect/select-difficulty");
            sampleChangeBeatmap    = audio.Sample.Get(@"SongSelect/select-expand");

            initialAddSetsTask = new CancellationTokenSource();

            Task.Factory.StartNew(() => addBeatmapSets(game, initialAddSetsTask.Token), initialAddSetsTask.Token);
        }
コード例 #10
0
ファイル: SongSelect.cs プロジェクト: slanterns-fork/osu
        protected SongSelect()
        {
            const float carousel_width = 640;
            const float filter_height  = 100;

            Add(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
                        },
                    }
                }
            });
            Add(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,
                }
            });
            Add(carousel = new BeatmapCarousel
            {
                RelativeSizeAxes = Axes.Y,
                Size             = new Vector2(carousel_width, 1),
                Anchor           = Anchor.CentreRight,
                Origin           = Anchor.CentreRight,
                SelectionChanged = selectionChanged,
                StartRequested   = raiseSelect
            });
            Add(FilterControl = new FilterControl
            {
                RelativeSizeAxes = Axes.X,
                Height           = filter_height,
                FilterChanged    = criteria => filterChanged(criteria),
                Exit             = Exit,
            });
            Add(beatmapInfoWedge = new BeatmapInfoWedge
            {
                Alpha            = 0,
                Size             = wedged_container_size,
                RelativeSizeAxes = Axes.X,
                Margin           = new MarginPadding
                {
                    Top   = left_area_padding,
                    Right = left_area_padding,
                },
                X = -50,
            });

            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,
                    OnStart = raiseSelect,
                });

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