Skip to content

Commit

Permalink
Implement the config popover and dialog for the reference lyric mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Jul 25, 2022
1 parent b2bb285 commit 894c576
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Rulesets.Karaoke.Edit.Generator.ReferenceLyric;

namespace osu.Game.Rulesets.Karaoke.Edit.Configs.Generator.ReferenceLyric
{
public class GenericSection : GeneratorConfigSection<ReferenceLyricDetectorConfig>
{
private readonly LabelledSwitchButton ignorePrefixAndPostfixSymbol;

protected override string Title => "Generic";

public GenericSection(Bindable<ReferenceLyricDetectorConfig> current)
: base(current)
{
Children = new Drawable[]
{
ignorePrefixAndPostfixSymbol = new LabelledSwitchButton
{
Label = "Ruby as Katakana",
Description = "Ruby as Katakana.",
},
};

RegisterConfig(ignorePrefixAndPostfixSymbol.Current, nameof(ReferenceLyricDetectorConfig.IgnorePrefixAndPostfixSymbol));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable

using osu.Framework.Bindables;
using osu.Game.Overlays;
using osu.Game.Rulesets.Karaoke.Configuration;
using osu.Game.Rulesets.Karaoke.Edit.Generator.ReferenceLyric;

namespace osu.Game.Rulesets.Karaoke.Edit.Configs.Generator.ReferenceLyric
{
public class ReferenceLyricGeneratorConfigDialog : GeneratorConfigDialog<ReferenceLyricDetectorConfig>
{
protected override KaraokeRulesetEditGeneratorSetting Config => KaraokeRulesetEditGeneratorSetting.NoteGeneratorConfig;

protected override OverlayColourScheme OverlayColourScheme => OverlayColourScheme.Green;

protected override string Title => "Reference lyric config";

protected override string Description => "Change config for reference lyric detector.";

protected override GeneratorConfigSection[] CreateConfigSection(Bindable<ReferenceLyricDetectorConfig> current)
{
return new GeneratorConfigSection[]
{
new GenericSection(current),
};
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable

using osu.Framework.Bindables;
using osu.Game.Rulesets.Karaoke.Configuration;
using osu.Game.Rulesets.Karaoke.Edit.Generator.ReferenceLyric;

namespace osu.Game.Rulesets.Karaoke.Edit.Configs.Generator.ReferenceLyric
{
public class ReferenceLyricDetectorConfigPopover : GeneratorConfigPopover<ReferenceLyricDetectorConfig>
{
protected override KaraokeRulesetEditGeneratorSetting Config => KaraokeRulesetEditGeneratorSetting.ReferenceLyricDetectorConfig;

protected override GeneratorConfigSection[] CreateConfigSection(Bindable<ReferenceLyricDetectorConfig> current)
{
return new GeneratorConfigSection[]
{
new GenericSection(current),
};
}
}
}

0 comments on commit 894c576

Please sign in to comment.