Skip to content

Commit

Permalink
Merge pull request #2189 from andy840119/remove-romaji-text-in-import…
Browse files Browse the repository at this point in the history
…-lyric-screen

Remove romaji text in import lyric screen.
  • Loading branch information
andy840119 authored Mar 11, 2024
2 parents 3d73c5b + ad1b9a3 commit d2edb5d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ protected override NavigationTextContainer CreateTextContainer()

protected override NavigationState GetState(Lyric[] lyrics)
{
// technically, all non-english lyric should have romaji.
if (lyrics.All(hasRomaji))
// technically, all non-english lyric should have romanisation.
if (lyrics.All(hasRomanisation))
return NavigationState.Done;

// not all (japanese) lyric contains ruby, so it's ok with that.
if (lyrics.Any(hasRuby) || lyrics.Any(hasRomaji))
if (lyrics.Any(hasRuby) || lyrics.Any(hasRomanisation))
return NavigationState.Working;

return NavigationState.Initial;

static bool hasRuby(Lyric lyric)
=> lyric.RubyTags.Any();

static bool hasRomaji(Lyric lyric)
=> lyric.RubyTags.Any();
static bool hasRomanisation(Lyric lyric)
=> lyric.TimeTags.Any(x => !string.IsNullOrEmpty(x.RomanisedSyllable));
}

protected override LocalisableString GetNavigationText(NavigationState value) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected override void LoadComplete()
{
base.LoadComplete();

// todo: we should better way to switch between time-tag mode or romaji mode.
// todo: we should better way to switch between time-tag mode or romanisation mode.
// or even create new step for it.
if (lyricPropertyAutoGenerateChangeHandler.CanGenerate(AutoGenerateType.AutoGenerateRomanisation))
{
Expand Down Expand Up @@ -92,7 +92,7 @@ internal void AskForAutoGenerateRomanisation()
{
SwitchLyricEditorMode(LyricEditorMode.EditRomanisation);

DialogOverlay.Push(new UseAutoGenerateRomajiPopupDialog(ok =>
DialogOverlay.Push(new UseAutoGenerateRomanisationPopupDialog(ok =>
{
if (!ok)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Import.Lyrics.GenerateTimeTag;

public partial class UseAutoGenerateRomajiPopupDialog : PopupDialog
public partial class UseAutoGenerateRomanisationPopupDialog : PopupDialog
{
public UseAutoGenerateRomajiPopupDialog(Action<bool> okAction)
public UseAutoGenerateRomanisationPopupDialog(Action<bool> okAction)
{
Icon = FontAwesome.Solid.Globe;
HeaderText = "Auto generate romaji";
BodyText = "Would you like to use romaji generator to auto generate each lyric's romaji?";
HeaderText = "Auto generate romanisation";
BodyText = "Would you like to use generator to auto generate each lyric's romanisation?";
Buttons = new PopupDialogButton[]
{
new PopupDialogOkButton
Expand Down

0 comments on commit d2edb5d

Please sign in to comment.