예제 #1
0
            public DivisorText(BindableBeatDivisor beatDivisor)
            {
                this.beatDivisor.BindTo(beatDivisor);

                Anchor = Anchor.Centre;
                Origin = Anchor.Centre;
            }
예제 #2
0
            public TickSliderBar(BindableBeatDivisor beatDivisor, params int[] divisors)
            {
                CurrentNumber.BindTo(this.beatDivisor = beatDivisor);
                availableDivisors = divisors;

                Padding = new MarginPadding {
                    Horizontal = 5
                };
            }
예제 #3
0
 public BeatDivisorControl(BindableBeatDivisor beatDivisor)
 {
     this.beatDivisor.BindTo(beatDivisor);
 }
예제 #4
0
        private void load([CanBeNull] BindableBeatDivisor beatDivisor)
        {
            if (beatDivisor != null)
            {
                this.beatDivisor.BindTo(beatDivisor);
            }

            ScrollableTimeline timeline;

            Children = new Drawable[]
            {
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Content          = new[]
                    {
                        new Drawable[]
                        {
                            new Container
                            {
                                Name             = "Timeline",
                                RelativeSizeAxes = Axes.Both,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Colour           = Color4.Black.Opacity(0.5f)
                                    },
                                    new Container
                                    {
                                        Name             = "Timeline content",
                                        RelativeSizeAxes = Axes.Both,
                                        Padding          = new MarginPadding {
                                            Horizontal = horizontal_margins, Vertical = vertical_margins
                                        },
                                        Child = new GridContainer
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Content          = new[]
                                            {
                                                new Drawable[]
                                                {
                                                    new Container
                                                    {
                                                        RelativeSizeAxes = Axes.Both,
                                                        Padding          = new MarginPadding {
                                                            Right = 5
                                                        },
                                                        Child = timeline = new ScrollableTimeline {
                                                            RelativeSizeAxes = Axes.Both
                                                        }
                                                    },
                                                    new BeatDivisorControl(beatDivisor)
                                                    {
                                                        RelativeSizeAxes = Axes.Both
                                                    }
                                                },
                                            },
                                            ColumnDimensions = new[]
                                            {
                                                new Dimension(),
                                                new Dimension(GridSizeMode.Absolute, 90),
                                            }
                                        },
                                    }
                                }
                            }
                        },
                        new Drawable[]
                        {
                            composerContainer = new Container
                            {
                                Name             = "Composer content",
                                RelativeSizeAxes = Axes.Both,
                                Padding          = new MarginPadding {
                                    Horizontal = horizontal_margins, Vertical = vertical_margins
                                },
                            }
                        }
                    },
                    RowDimensions = new[] { new Dimension(GridSizeMode.Absolute, 110) }
                },
            };

            timeline.Beatmap.BindTo(Beatmap);

            var ruleset = Beatmap.Value.BeatmapInfo.Ruleset?.CreateInstance();

            if (ruleset == null)
            {
                Logger.Log("Beatmap doesn't have a ruleset assigned.");
                // ExitRequested?.Invoke();
                return;
            }

            var composer = ruleset.CreateHitObjectComposer();

            if (composer == null)
            {
                Logger.Log($"Ruleset {ruleset.Description} doesn't support hitobject composition.");
                // ExitRequested?.Invoke();
                return;
            }

            composerContainer.Child = composer;
        }