-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1474 from andy840119/implement-reference-lyric-se…
…ction Implement reference lyric section and auto-generate feature.
- Loading branch information
Showing
10 changed files
with
199 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
osu.Game.Rulesets.Karaoke/Edit/Configs/Generator/ReferenceLyric/GenericSection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...esets.Karaoke/Edit/Configs/Generator/ReferenceLyric/ReferenceLyricDetectorConfigDialog.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
}; | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...sets.Karaoke/Edit/Configs/Generator/ReferenceLyric/ReferenceLyricDetectorConfigPopover.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
}; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
osu.Game.Rulesets.Karaoke/Edit/Generator/ReferenceLyric/ReferenceLyricDetectorConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Game.Rulesets.Karaoke.Edit.Checks.Configs; | ||
using osu.Game.Rulesets.Karaoke.Edit.Generator.Types; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Generator.ReferenceLyric | ||
{ | ||
|
20 changes: 20 additions & 0 deletions
20
osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Reference/ReferenceExtend.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Reference | ||
{ | ||
public class ReferenceExtend : EditExtend | ||
{ | ||
public override ExtendDirection Direction => ExtendDirection.Right; | ||
|
||
public override float ExtendWidth => 300; | ||
|
||
public ReferenceExtend() | ||
{ | ||
Children = new[] | ||
{ | ||
new ReferenceLyricAutoGenerateSection(), | ||
}; | ||
} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
osu.Game.Rulesets.Karaoke/Edit/Lyrics/Extends/Reference/ReferenceLyricAutoGenerateSection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// 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.Graphics.UserInterface; | ||
using osu.Framework.Localisation; | ||
using osu.Game.Rulesets.Karaoke.Edit.Components.Containers; | ||
using osu.Game.Rulesets.Karaoke.Edit.Configs.Generator.ReferenceLyric; | ||
using osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Components; | ||
|
||
namespace osu.Game.Rulesets.Karaoke.Edit.Lyrics.Extends.Reference | ||
{ | ||
public class ReferenceLyricAutoGenerateSection : Section | ||
{ | ||
protected override LocalisableString Title => "Auto generate"; | ||
|
||
public ReferenceLyricAutoGenerateSection() | ||
{ | ||
Children = new[] | ||
{ | ||
new ReferenceLyricAutoGenerateSubsection() | ||
}; | ||
} | ||
|
||
private class ReferenceLyricAutoGenerateSubsection : AutoGenerateSubsection | ||
{ | ||
public ReferenceLyricAutoGenerateSubsection() | ||
: base(LyricAutoGenerateProperty.DetectReferenceLyric) | ||
{ | ||
} | ||
|
||
protected override InvalidLyricAlertTextContainer CreateInvalidLyricAlertTextContainer() | ||
=> new InvalidLyricLanguageAlertTextContainer(); | ||
|
||
protected override ConfigButton CreateConfigButton() | ||
=> new ReferenceLyricAutoGenerateConfigButton(); | ||
|
||
protected class InvalidLyricLanguageAlertTextContainer : InvalidLyricAlertTextContainer | ||
{ | ||
private const string language_mode = "LANGUAGE_MODE"; | ||
|
||
public InvalidLyricLanguageAlertTextContainer() | ||
{ | ||
SwitchToEditorMode(language_mode, "edit language mode", LyricEditorMode.Language); | ||
Text = $"Seems some lyric missing language, go to [{language_mode}] to fill the language."; | ||
} | ||
} | ||
|
||
protected class ReferenceLyricAutoGenerateConfigButton : ConfigButton | ||
{ | ||
public override Popover GetPopover() | ||
=> new ReferenceLyricDetectorConfigPopover(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters