private void load(OsuGameBase osuGame)
        {
            osuGame.Beatmap.Value = new TestWorkingBeatmap(new OsuRuleset().RulesetInfo);

            SummaryTimeline summaryTimeline;

            Add(summaryTimeline = new SummaryTimeline
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Size   = new Vector2(500, 50)
            });

            summaryTimeline.Beatmap.BindTo(osuGame.Beatmap);
        }
        public TestCaseEditorSummaryTimeline()
        {
            random = new Random(1337);

            SummaryTimeline summaryTimeline;

            Add(summaryTimeline = new SummaryTimeline
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Size   = new Vector2(500, 50)
            });

            summaryTimeline.Beatmap.BindTo(beatmap);

            AddStep("New beatmap", newBeatmap);

            newBeatmap();
        }
Beispiel #3
0
        private void load()
        {
            beatmap.Value = new TestWorkingBeatmap(new OsuRuleset().RulesetInfo);

            var clock = new DecoupleableInterpolatingFramedClock {
                IsCoupled = false
            };

            dependencies.CacheAs <IAdjustableClock>(clock);
            dependencies.CacheAs <IFrameBasedClock>(clock);

            SummaryTimeline summaryTimeline;

            Add(summaryTimeline = new SummaryTimeline
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Size   = new Vector2(500, 50)
            });

            summaryTimeline.Beatmap.BindTo(beatmap);
        }
Beispiel #4
0
        public Editor()
        {
            EditorMenuBar   menuBar;
            SummaryTimeline timeline;

            Children = new[]
            {
                new Container
                {
                    Name             = "Screen container",
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Top = 40, Bottom = 60
                    },
                    Child = screenContainer = new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Masking          = true
                    }
                },
                new Container
                {
                    Name             = "Top bar",
                    RelativeSizeAxes = Axes.X,
                    Height           = 40,
                    Child            = menuBar = new EditorMenuBar
                    {
                        Anchor           = Anchor.CentreLeft,
                        Origin           = Anchor.CentreLeft,
                        RelativeSizeAxes = Axes.Both,
                        Items            = new[]
                        {
                            new MenuItem("File")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("Exit", MenuItemType.Standard, Exit)
                                }
                            }
                        }
                    }
                },
                new Container
                {
                    Name             = "Bottom bar",
                    Anchor           = Anchor.BottomLeft,
                    Origin           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.X,
                    Height           = 60,
                    Children         = new Drawable[]
                    {
                        bottomBackground = new Box {
                            RelativeSizeAxes = Axes.Both
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Padding          = new MarginPadding {
                                Top = 5, Bottom = 5, Left = 10, Right = 10
                            },
                            Child = new FillFlowContainer
                            {
                                Name             = "Bottom bar",
                                RelativeSizeAxes = Axes.Both,
                                Direction        = FillDirection.Horizontal,
                                Spacing          = new Vector2(10, 0),
                                Children         = new[]
                                {
                                    timeline = new SummaryTimeline
                                    {
                                        Anchor           = Anchor.Centre,
                                        Origin           = Anchor.Centre,
                                        RelativeSizeAxes = Axes.Both,
                                        Width            = 0.65f
                                    }
                                }
                            }
                        }
                    }
                },
            };

            timeline.Beatmap.BindTo(Beatmap);
            menuBar.Mode.ValueChanged += onModeChanged;
        }
Beispiel #5
0
        public Editor()
        {
            Add(new Container
            {
                RelativeSizeAxes = Axes.X,
                Height           = 40,
                Children         = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = OsuColour.FromHex("111")
                    },
                    new EditorMenuBar
                    {
                        Anchor = Anchor.CentreLeft,
                        Origin = Anchor.CentreLeft,
                        X      = 100,
                        Items  = new[]
                        {
                            new EditorMenuBarItem("File")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("Clear all notes"),
                                    new EditorMenuItem("Open difficulty..."),
                                    new EditorMenuItem("Save"),
                                    new EditorMenuItem("Create new difficulty..."),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Revert to saved"),
                                    new EditorMenuItem("Revert to saved (full"),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Test beatmap"),
                                    new EditorMenuItem("Open AiMod"),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Upload Beatmap..."),
                                    new EditorMenuItem("Export package"),
                                    new EditorMenuItem("Export map package"),
                                    new EditorMenuItem("Import from..."),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Open song folder"),
                                    new EditorMenuItem("Open .osu in Notepad"),
                                    new EditorMenuItem("Open .osb in Notepad"),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Exit", MenuItemType.Standard, Exit)
                                }
                            },
                            new EditorMenuBarItem("Edit")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("Undo"),
                                    new EditorMenuItem("Redo"),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Cut"),
                                    new EditorMenuItem("Copy"),
                                    new EditorMenuItem("Paste"),
                                    new EditorMenuItem("Delete"),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Select all"),
                                    new EditorMenuItem("Clone"),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Reverse selection"),
                                    new EditorMenuItem("Flip horizontally"),
                                    new EditorMenuItem("Flip vertically"),
                                    new EditorMenuItem("Rotate 90deg clockwise"),
                                    new EditorMenuItem("Rotate 90deg anticlockwise"),
                                    new EditorMenuItem("Rotate by..."),
                                    new EditorMenuItem("Scale by..."),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Reset selected objects' samples"),
                                    new EditorMenuItem("Reset all samples", MenuItemType.Destructive),
                                    new EditorMenuItem("Reset combo colours", MenuItemType.Destructive),
                                    new EditorMenuItem("Reset breaks", MenuItemType.Destructive),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Nudge backward"),
                                    new EditorMenuItem("Nudge forward")
                                }
                            },
                            new EditorMenuBarItem("View")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("Compose"),
                                    new EditorMenuItem("Design"),
                                    new EditorMenuItem("Timing"),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Song setup..."),
                                    new EditorMenuItem("Timing setup..."),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Volume"),
                                    new EditorMenuItem("Grid level"),
                                    new EditorMenuItem("Show video"),
                                    new EditorMenuItem("Show sample name"),
                                    new EditorMenuItem("Snaking sliders"),
                                    new EditorMenuItem("Hit animations"),
                                    new EditorMenuItem("Follow points"),
                                    new EditorMenuItem("Stacking")
                                }
                            },
                            new EditorMenuBarItem("Compose")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("Snap divisor"),
                                    new EditorMenuItem("Audio rate"),
                                    new EditorMenuItem("Grid snapping"),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Create polygon cricles..."),
                                    new EditorMenuItem("Convert slider to stream"),
                                    new EditorMenuItem("Enable live mapping mode"),
                                    new EditorMenuItem("Sample import")
                                }
                            },
                            new EditorMenuBarItem("Design")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("Move all elements in time...")
                                }
                            },
                            new EditorMenuBarItem("Timing")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("Time signature"),
                                    new EditorMenuItem("Metronome clicks"),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Add timing section"),
                                    new EditorMenuItem("Add inheriting section"),
                                    new EditorMenuItem("Reset current section"),
                                    new EditorMenuItem("Delete timing section"),
                                    new EditorMenuItem("Resnap current section"),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Timing setup..."),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Resnap all notes", MenuItemType.Destructive),
                                    new EditorMenuItem("Move all notes in time...", MenuItemType.Destructive),
                                    new EditorMenuItem("Recalculate slider lengths", MenuItemType.Destructive),
                                    new EditorMenuItem("Delete all timing sections", MenuItemType.Destructive),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Set current position as preview point")
                                }
                            },
                            new EditorMenuBarItem("Web")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("This Beatmap's information page"),
                                    new EditorMenuItem("This Beatmap's thread"),
                                    new EditorMenuItem("Quick reply")
                                }
                            },
                            new EditorMenuBarItem("Help")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("Show in-game help"),
                                    new EditorMenuItem("View FAQ")
                                }
                            }
                        }
                    }
                }
            });

            SummaryTimeline summaryTimeline;

            Add(new Container
            {
                Anchor           = Anchor.BottomLeft,
                Origin           = Anchor.BottomLeft,
                RelativeSizeAxes = Axes.X,
                Height           = 60,
                Children         = new Drawable[]
                {
                    bottomBackground = new Box {
                        RelativeSizeAxes = Axes.Both
                    },
                    new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Padding          = new MarginPadding {
                            Top = 5, Bottom = 5, Left = 10, Right = 10
                        },
                        Child = new FillFlowContainer
                        {
                            Name             = "Bottom bar",
                            RelativeSizeAxes = Axes.Both,
                            Direction        = FillDirection.Horizontal,
                            Spacing          = new Vector2(10, 0),
                            Children         = new[]
                            {
                                summaryTimeline = new SummaryTimeline
                                {
                                    Anchor           = Anchor.Centre,
                                    Origin           = Anchor.Centre,
                                    RelativeSizeAxes = Axes.Both,
                                    Width            = 0.65f
                                }
                            }
                        }
                    }
                }
            });

            summaryTimeline.Beatmap.BindTo(Beatmap);
        }
Beispiel #6
0
        public Editor()
        {
            EditorMenuBar     menuBar;
            TimeInfoContainer timeInfo;
            SummaryTimeline   timeline;
            PlaybackControl   playback;

            Children = new[]
            {
                new Container
                {
                    Name             = "Screen container",
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Top = 40, Bottom = 60
                    },
                    Child = screenContainer = new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Masking          = true
                    }
                },
                new Container
                {
                    Name             = "Top bar",
                    RelativeSizeAxes = Axes.X,
                    Height           = 40,
                    Child            = menuBar = new EditorMenuBar
                    {
                        Anchor           = Anchor.CentreLeft,
                        Origin           = Anchor.CentreLeft,
                        RelativeSizeAxes = Axes.Both,
                        Items            = new[]
                        {
                            new MenuItem("File")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("Export", MenuItemType.Standard, exportBeatmap),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Exit", MenuItemType.Standard, Exit)
                                }
                            }
                        }
                    }
                },
                new Container
                {
                    Name             = "Bottom bar",
                    Anchor           = Anchor.BottomLeft,
                    Origin           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.X,
                    Height           = 60,
                    Children         = new Drawable[]
                    {
                        bottomBackground = new Box {
                            RelativeSizeAxes = Axes.Both
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Padding          = new MarginPadding {
                                Vertical = 5, Horizontal = 10
                            },
                            Child = new GridContainer
                            {
                                RelativeSizeAxes = Axes.Both,
                                ColumnDimensions = new[]
                                {
                                    new Dimension(GridSizeMode.Absolute, 220),
                                    new Dimension(),
                                    new Dimension(GridSizeMode.Absolute, 220)
                                },
                                Content = new[]
                                {
                                    new Drawable[]
                                    {
                                        new Container
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Padding          = new MarginPadding {
                                                Right = 10
                                            },
                                            Child = timeInfo = new TimeInfoContainer {
                                                RelativeSizeAxes = Axes.Both
                                            },
                                        },
                                        timeline = new SummaryTimeline
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                        },
                                        new Container
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Padding          = new MarginPadding {
                                                Left = 10
                                            },
                                            Child = playback = new PlaybackControl {
                                                RelativeSizeAxes = Axes.Both
                                            },
                                        }
                                    },
                                }
                            },
                        }
                    }
                },
            };

            timeInfo.Beatmap.BindTo(Beatmap);
            timeline.Beatmap.BindTo(Beatmap);
            playback.Beatmap.BindTo(Beatmap);
            menuBar.Mode.ValueChanged += onModeChanged;
        }
Beispiel #7
0
        private void load(OsuColour colours)
        {
            // TODO: should probably be done at a RulesetContainer level to share logic with Player.
            var sourceClock = (IAdjustableClock)Beatmap.Value.Track ?? new StopwatchClock();

            clock = new EditorClock(Beatmap, beatDivisor)
            {
                IsCoupled = false
            };
            clock.ChangeSource(sourceClock);

            dependencies.CacheAs <IFrameBasedClock>(clock);
            dependencies.CacheAs <IAdjustableClock>(clock);
            dependencies.Cache(beatDivisor);

            EditorMenuBar     menuBar;
            TimeInfoContainer timeInfo;
            SummaryTimeline   timeline;
            PlaybackControl   playback;

            Children = new[]
            {
                new Container
                {
                    Name             = "Screen container",
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Top = 40, Bottom = 60
                    },
                    Child = screenContainer = new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Masking          = true
                    }
                },
                new Container
                {
                    Name             = "Top bar",
                    RelativeSizeAxes = Axes.X,
                    Height           = 40,
                    Child            = menuBar = new EditorMenuBar
                    {
                        Anchor           = Anchor.CentreLeft,
                        Origin           = Anchor.CentreLeft,
                        RelativeSizeAxes = Axes.Both,
                        Items            = new[]
                        {
                            new MenuItem("File")
                            {
                                Items = new[]
                                {
                                    new EditorMenuItem("Export", MenuItemType.Standard, exportBeatmap),
                                    new EditorMenuItemSpacer(),
                                    new EditorMenuItem("Exit", MenuItemType.Standard, Exit)
                                }
                            }
                        }
                    }
                },
                new Container
                {
                    Name             = "Bottom bar",
                    Anchor           = Anchor.BottomLeft,
                    Origin           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.X,
                    Height           = 60,
                    Children         = new Drawable[]
                    {
                        bottomBackground = new Box {
                            RelativeSizeAxes = Axes.Both
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Padding          = new MarginPadding {
                                Vertical = 5, Horizontal = 10
                            },
                            Child = new GridContainer
                            {
                                RelativeSizeAxes = Axes.Both,
                                ColumnDimensions = new[]
                                {
                                    new Dimension(GridSizeMode.Absolute, 220),
                                    new Dimension(),
                                    new Dimension(GridSizeMode.Absolute, 220)
                                },
                                Content = new[]
                                {
                                    new Drawable[]
                                    {
                                        new Container
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Padding          = new MarginPadding {
                                                Right = 10
                                            },
                                            Child = timeInfo = new TimeInfoContainer {
                                                RelativeSizeAxes = Axes.Both
                                            },
                                        },
                                        timeline = new SummaryTimeline
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                        },
                                        new Container
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Padding          = new MarginPadding {
                                                Left = 10
                                            },
                                            Child = playback = new PlaybackControl {
                                                RelativeSizeAxes = Axes.Both
                                            },
                                        }
                                    },
                                }
                            },
                        }
                    }
                },
            };

            timeInfo.Beatmap.BindTo(Beatmap);
            timeline.Beatmap.BindTo(Beatmap);
            playback.Beatmap.BindTo(Beatmap);
            menuBar.Mode.ValueChanged += onModeChanged;

            bottomBackground.Colour = colours.Gray2;
        }