public void CreateNew()
                {
                    var user = new SeedingBeatmap();

                    round.Beatmaps.Add(user);
                    flow.Add(new SeedingBeatmapRow(round, user));
                }
Exemple #2
0
                public BeatmapScoreRow(SeedingBeatmap beatmap)
                {
                    RelativeSizeAxes = Axes.X;
                    AutoSizeAxes     = Axes.Y;

                    InternalChildren = new Drawable[]
                    {
                        new FillFlowContainer
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Direction        = FillDirection.Horizontal,
                            Spacing          = new Vector2(5),
                            Children         = new Drawable[]
                            {
                                new TournamentSpriteText {
                                    Text = beatmap.BeatmapInfo.Metadata.Title, Colour = TournamentGame.TEXT_COLOUR,
                                },
                                new TournamentSpriteText {
                                    Text = "by", Colour = TournamentGame.TEXT_COLOUR, Font = OsuFont.Torus.With(weight: FontWeight.Regular)
                                },
                                new TournamentSpriteText {
                                    Text = beatmap.BeatmapInfo.Metadata.Artist, Colour = TournamentGame.TEXT_COLOUR, Font = OsuFont.Torus.With(weight: FontWeight.Regular)
                                },
                            }
                        },
                        new FillFlowContainer
                        {
                            AutoSizeAxes = Axes.Y,
                            Anchor       = Anchor.TopRight,
                            Origin       = Anchor.TopRight,
                            Direction    = FillDirection.Horizontal,
                            Spacing      = new Vector2(40),
                            Children     = new Drawable[]
                            {
                                new TournamentSpriteText {
                                    Text = beatmap.Score.ToString("#,0"), Colour = TournamentGame.TEXT_COLOUR, Width = 80
                                },
                                new TournamentSpriteText {
                                    Text = "#" + beatmap.Seed.Value.ToString("#,0"), Colour = TournamentGame.TEXT_COLOUR, Font = OsuFont.Torus.With(weight: FontWeight.Regular)
                                },
                            }
                        },
                    };
                }
                    public SeedingBeatmapRow(SeedingResult result, SeedingBeatmap beatmap)
                    {
                        this.result = result;
                        Model       = beatmap;

                        Margin = new MarginPadding(10);

                        RelativeSizeAxes = Axes.X;
                        AutoSizeAxes     = Axes.Y;

                        Masking      = true;
                        CornerRadius = 5;

                        InternalChildren = new Drawable[]
                        {
                            new Box
                            {
                                Colour           = OsuColour.Gray(0.2f),
                                RelativeSizeAxes = Axes.Both,
                            },
                            new FillFlowContainer
                            {
                                Margin  = new MarginPadding(5),
                                Padding = new MarginPadding {
                                    Right = 160
                                },
                                Spacing      = new Vector2(5),
                                Direction    = FillDirection.Horizontal,
                                AutoSizeAxes = Axes.Both,
                                Children     = new Drawable[]
                                {
                                    new SettingsNumberBox
                                    {
                                        LabelText        = "Beatmap ID",
                                        RelativeSizeAxes = Axes.None,
                                        Width            = 200,
                                        Bindable         = beatmapId,
                                    },
                                    new SettingsSlider <int>
                                    {
                                        LabelText        = "Seed",
                                        RelativeSizeAxes = Axes.None,
                                        Width            = 200,
                                        Bindable         = beatmap.Seed
                                    },
                                    new SettingsTextBox
                                    {
                                        LabelText        = "Score",
                                        RelativeSizeAxes = Axes.None,
                                        Width            = 200,
                                        Bindable         = score,
                                    },
                                    drawableContainer = new Container
                                    {
                                        Size = new Vector2(100, 70),
                                    },
                                }
                            },
                            new DangerousSettingsButton
                            {
                                Anchor           = Anchor.CentreRight,
                                Origin           = Anchor.CentreRight,
                                RelativeSizeAxes = Axes.None,
                                Width            = 150,
                                Text             = "Delete Beatmap",
                                Action           = () =>
                                {
                                    Expire();
                                    result.Beatmaps.Remove(beatmap);
                                },
                            }
                        };
                    }