Skip to content

Commit

Permalink
Create new section for generate the page.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Dec 24, 2022
1 parent 6078ddf commit 907f7a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Pages;

public enum PageEditorEditMode
{
Generate,

Edit,

Verify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ protected override OverlayColourScheme CreateColourScheme()
protected override Selection CreateSelection(PageEditorEditMode mode) =>
mode switch
{
PageEditorEditMode.Generate => new Selection(),
PageEditorEditMode.Edit => new Selection(),
PageEditorEditMode.Verify => new PageEditorVerifySelection(),
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null)
Expand All @@ -41,23 +42,26 @@ protected override Selection CreateSelection(PageEditorEditMode mode) =>
protected override LocalisableString GetSelectionText(PageEditorEditMode mode) =>
mode switch
{
PageEditorEditMode.Edit => "Generate",
PageEditorEditMode.Generate => "Generate",
PageEditorEditMode.Edit => "Edit",
PageEditorEditMode.Verify => "Verify",
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null)
};

protected override Color4 GetSelectionColour(OsuColour colours, PageEditorEditMode mode, bool active) =>
mode switch
{
PageEditorEditMode.Edit => active ? colours.Blue : colours.BlueDarker,
PageEditorEditMode.Generate => active ? colours.Blue : colours.BlueDarker,
PageEditorEditMode.Edit => active ? colours.Red : colours.RedDarker,
PageEditorEditMode.Verify => active ? colours.Yellow : colours.YellowDarker,
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null)
};

protected override DescriptionFormat GetSelectionDescription(PageEditorEditMode mode) =>
mode switch
{
PageEditorEditMode.Edit => "Edit the page.",
PageEditorEditMode.Generate => "Generate the pages by lyric.",
PageEditorEditMode.Edit => "Batch edit page in here.",
PageEditorEditMode.Verify => "Check if have any page issues.",
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ private void load(OverlayColourProvider colourProvider, IPageStateProvider pageS

protected override IReadOnlyList<Drawable> CreateSections() => bindableMode.Value switch
{
PageEditorEditMode.Generate => new Drawable[]
{
new PageEditorEditModeSection(),
new PageAutoGenerateSection(),
},
PageEditorEditMode.Edit => new Drawable[]
{
new PageEditorEditModeSection(),
Expand Down

0 comments on commit 907f7a5

Please sign in to comment.