Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Romani to romanization in the lyric editor. #2183

Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private void updateModeWithEditStep()
LyricEditorMode.EditLanguage => throw new NotSupportedException(),
LyricEditorMode.EditRuby => throw new NotSupportedException(),
LyricEditorMode.EditTimeTag => throw new NotSupportedException(),
LyricEditorMode.EditRomaji => throw new NotSupportedException(),
LyricEditorMode.EditRomanisation => throw new NotSupportedException(),
LyricEditorMode.EditNote => throw new NotSupportedException(),
LyricEditorMode.EditSinger => throw new NotSupportedException(),
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public void TestEditTimeTagMode()
[Test]
public void TestEditRomajiMode()
{
switchToMode(LyricEditorMode.EditRomaji);
clickEditStepButtons<RomajiTagEditStep>();
switchToMode(LyricEditorMode.EditRomanisation);
clickEditStepButtons<RomanisationTagEditStep>();
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public LyricEditorModeMenuItem(string text, Bindable<LyricEditorMode> config)
LyricEditorMode.EditLanguage,
LyricEditorMode.EditRuby,
LyricEditorMode.EditTimeTag,
LyricEditorMode.EditRomaji,
LyricEditorMode.EditRomanisation,
LyricEditorMode.EditNote,
LyricEditorMode.EditSinger,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected override void OnSelectionChanged()
{
base.OnSelectionChanged();

// only select one ruby / romaji tag can let user drag to change start and end index.
// only select one ruby tag can let user drag to change start and end index.
SelectionBox.CanScaleX = SelectedItems.Count == 1;

// should clear delta size before change start/end index.
Expand Down Expand Up @@ -97,7 +97,7 @@ public override bool HandleScale(Vector2 scale, Anchor anchor)
{
deltaScaleSize += scale.X;

// this feature only works if only select one ruby / romaji tag.
// this feature only works if only select one ruby tag.
var selectedRubyTag = SelectedItems.FirstOrDefault();
if (selectedRubyTag == null)
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void triggerWritableVersionChanged()
LyricEditorMode.EditLanguage => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.Language)),
LyricEditorMode.EditRuby => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.RubyTags)),
LyricEditorMode.EditTimeTag => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.TimeTags)),
LyricEditorMode.EditRomaji => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.RomajiTags)),
LyricEditorMode.EditRomanisation => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.RomajiTags)),
LyricEditorMode.EditNote => HitObjectWritableUtils.GetCreateOrRemoveNoteLockedBy(lyric),
LyricEditorMode.EditSinger => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.SingerIds)),
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static IEnumerable<Drawable> createItemForEditMode(EditorModeWithEditSte
LyricEditorMode.EditLanguage => Array.Empty<Drawable>(),
LyricEditorMode.EditRuby => Array.Empty<Drawable>(),
LyricEditorMode.EditTimeTag => createItemsForTimeTagEditStep(editorModeWithEditStep.GetEditStep<TimeTagEditStep>()),
LyricEditorMode.EditRomaji => Array.Empty<Drawable>(),
LyricEditorMode.EditRomanisation => Array.Empty<Drawable>(),
LyricEditorMode.EditNote => createItemsForNoteEditStep(editorModeWithEditStep.GetEditStep<NoteEditStep>()),
LyricEditorMode.EditSinger => Array.Empty<Drawable>(),
_ => throw new ArgumentOutOfRangeException(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public partial class IssueNavigator : Component, IIssueNavigator
private IEditTimeTagModeState editTimeTagModeState { get; set; } = null!;

[Resolved]
private IEditRomajiModeState editRomajiModeState { get; set; } = null!;
private IEditRomanisationModeState editRomanisationModeState { get; set; } = null!;

[Resolved]
private IEditNoteModeState noteModeState { get; set; } = null!;
Expand Down Expand Up @@ -88,8 +88,8 @@ public void Navigate(Issue issue)
case CheckLyricTimeTagOnly:
return LyricEditorMode.EditTimeTag;

case CheckLyricTimeTagRomaji:
return LyricEditorMode.EditRomaji;
case CheckLyricRomanisation:
return LyricEditorMode.EditRomanisation;

case CheckNoteReferenceLyric:
case CheckNoteText:
Expand Down Expand Up @@ -121,7 +121,7 @@ public void Navigate(Issue issue)
object[] availableEditModes =
{
editRubyModeState,
editRomajiModeState,
editRomanisationModeState,
editTimeTagModeState,
noteModeState,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public partial class LyricEditor : Container, ILyricEditorState, IKeyBindingHand
[Cached(typeof(IEditTimeTagModeState))]
private readonly EditTimeTagModeState editTimeTagModeState;

[Cached(typeof(IEditRomajiModeState))]
private readonly EditRomajiModeState editRomajiModeState;
[Cached(typeof(IEditRomanisationModeState))]
private readonly EditRomanisationModeState editRomanisationModeState;

[Cached(typeof(IEditNoteModeState))]
private readonly EditNoteModeState editNoteModeState;
Expand Down Expand Up @@ -104,7 +104,7 @@ public LyricEditor()
AddInternal(editLanguageModeState = new EditLanguageModeState());
AddInternal(editRubyModeState = new EditRubyModeState());
AddInternal(editTimeTagModeState = new EditTimeTagModeState());
AddInternal(editRomajiModeState = new EditRomajiModeState());
AddInternal(editRomanisationModeState = new EditRomanisationModeState());
AddInternal(editNoteModeState = new EditNoteModeState());

// Separated feature.
Expand Down Expand Up @@ -159,7 +159,7 @@ public LyricEditor()
initialEditStepChanged<ReferenceLyricEditStep>();
initialEditStepChanged<LanguageEditStep>();
initialEditStepChanged<RubyTagEditStep>();
initialEditStepChanged<RomajiTagEditStep>();
initialEditStepChanged<RomanisationTagEditStep>();
initialEditStepChanged<TimeTagEditStep>();
initialEditStepChanged<NoteEditStep>();

Expand Down Expand Up @@ -208,7 +208,7 @@ private void updateModeWithEditStep()
LyricEditorMode.EditLanguage => editLanguageModeState.BindableEditStep.Value,
LyricEditorMode.EditRuby => editRubyModeState.BindableEditStep.Value,
LyricEditorMode.EditTimeTag => editTimeTagModeState.BindableEditStep.Value,
LyricEditorMode.EditRomaji => editRomajiModeState.BindableEditStep.Value,
LyricEditorMode.EditRomanisation => editRomanisationModeState.BindableEditStep.Value,
LyricEditorMode.EditNote => editNoteModeState.BindableEditStep.Value,
LyricEditorMode.EditSinger => null,
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null),
Expand Down Expand Up @@ -259,7 +259,7 @@ private void initializeSettingsArea()
LyricEditorMode.EditLanguage => new LanguageSettings(),
LyricEditorMode.EditRuby => new RubyTagSettings(),
LyricEditorMode.EditTimeTag => new TimeTagSettings(),
LyricEditorMode.EditRomaji => new RomajiTagSettings(),
LyricEditorMode.EditRomanisation => new RomanisationSettings(),
LyricEditorMode.EditNote => new NoteSettings(),
LyricEditorMode.EditSinger => new SingerSettings(),
_ => null,
Expand Down Expand Up @@ -294,7 +294,7 @@ static LyricEditorLayout getSupportedLayout(LyricEditorMode mode) =>
LyricEditorMode.EditLanguage => LyricEditorLayout.Preview | LyricEditorLayout.Detail,
LyricEditorMode.EditRuby => LyricEditorLayout.Preview | LyricEditorLayout.Detail,
LyricEditorMode.EditTimeTag => LyricEditorLayout.Detail,
LyricEditorMode.EditRomaji => LyricEditorLayout.Preview | LyricEditorLayout.Detail,
LyricEditorMode.EditRomanisation => LyricEditorLayout.Preview | LyricEditorLayout.Detail,
LyricEditorMode.EditNote => LyricEditorLayout.Detail,
LyricEditorMode.EditSinger => LyricEditorLayout.Preview,
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public partial class LyricEditorClipboard : Component, ILyricEditorClipboard
private readonly IBindable<LyricEditorMode> bindableMode = new Bindable<LyricEditorMode>();

// we should save the serialized lyric object into here instead of save into the clipboard for some reason:
// 1. It's hard to know which ruby/romaji or time-tag being copied.
// 1. It's hard to know which ruby/romanisation or time-tag being copied.
// 2. Maybe user did not want to copy the full json content?
private string clipboardContent = string.Empty;

Expand Down Expand Up @@ -192,7 +192,7 @@ private bool performCut()
lyricTimeTagsChangeHandler.RemoveRange(timeTags);
return true;

case LyricEditorMode.EditRomaji:
case LyricEditorMode.EditRomanisation:
return false;

case LyricEditorMode.EditNote:
Expand Down Expand Up @@ -265,7 +265,7 @@ private bool performCopy(Lyric lyric)
copyObjectToClipboard(timeTags);
return true;

case LyricEditorMode.EditRomaji:
case LyricEditorMode.EditRomanisation:
return false;

case LyricEditorMode.EditNote:
Expand Down Expand Up @@ -351,7 +351,7 @@ private bool performPaste(Lyric lyric)
lyricTimeTagsChangeHandler.AddRange(pasteTimeTags);
return true;

case LyricEditorMode.EditRomaji:
case LyricEditorMode.EditRomanisation:
return false;

case LyricEditorMode.EditNote:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private static float getBaseHue(LyricEditorMode mode)
return 333 / 360f; // pink

case LyricEditorMode.EditTimeTag:
case LyricEditorMode.EditRomaji:
case LyricEditorMode.EditRomanisation:
return 45 / 360f; // orange

case LyricEditorMode.EditNote:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public enum LyricEditorMode
EditTimeTag,

/// <summary>
/// Able to edit the romaji from the time-tag.
/// Able to edit the romanisation from the time-tag.
/// </summary>
[Description("Edit romaji")]
EditRomaji,
[Description("Edit Romanisation")]
EditRomanisation,

/// <summary>
/// Enable to create/delete notes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected override IEnumerable<ICheck> CreateChecks(LyricEditorMode type) =>
LyricEditorMode.EditLanguage => new ICheck[] { new CheckLyricLanguage() },
LyricEditorMode.EditRuby => new ICheck[] { new CheckLyricRubyTag() },
LyricEditorMode.EditTimeTag => new ICheck[] { new CheckLyricTimeTagOnly() },
LyricEditorMode.EditRomaji => new ICheck[] { new CheckLyricTimeTagRomaji() },
LyricEditorMode.EditRomanisation => new ICheck[] { new CheckLyricRomanisation() },
LyricEditorMode.EditNote => new ICheck[] { new CheckNoteReferenceLyric(), new CheckNoteText(), new CheckNoteTime() },
LyricEditorMode.EditSinger => Array.Empty<ICheck>(),
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null),
Expand Down Expand Up @@ -196,7 +196,7 @@ protected override IEnumerable<Issue> Check(Lyric lyric)
}
}

public class CheckLyricTimeTagRomaji : CheckLyricTimeTag
public class CheckLyricRomanisation : CheckLyricTimeTag
{
protected override IEnumerable<Issue> Check(Lyric lyric)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private void initializeBadge(EditorModeWithEditStep editorMode)
case LyricEditorMode.EditTimeTag:
return createTimeTagModeSubInfo(editorMode.GetEditStep<TimeTagEditStep>(), Lyric);

case LyricEditorMode.EditRomaji:
case LyricEditorMode.EditRomanisation:
return new LanguageInfo(Lyric);

case LyricEditorMode.EditNote:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected LabelledObjectFieldSwitchButton(T item)
// apply current value from the field in the item.
Current.Value = GetFieldValue(item);

// should change preview text box if selected ruby/romaji changed.
// should change preview text box if selected boolean property changed.
Component.OnCommit += (sender, edited) =>
{
if (!edited)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected LabelledObjectFieldTextBox(T item)
// apply current value from the field in the item.
Current.Value = GetFieldValue(item);

// should change preview text box if selected ruby/romaji changed.
// should change preview text box if selected string property changed.
OnCommit += (sender, newText) =>
{
if (!newText)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.Components.Markdown;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Components.Markdown;

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.Romaji;
namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.Romanisation;

public partial class RomajiAutoGenerateSection : AutoGenerateSection
public partial class RomanisationAutoGenerateSection : AutoGenerateSection
{
protected override AutoGenerateSubsection CreateAutoGenerateSubsection()
=> new RomajiTagAutoGenerateSubsection();
=> new RomanisationAutoGenerateSubsection();

private partial class RomajiTagAutoGenerateSubsection : LyricEditorAutoGenerateSubsection
private partial class RomanisationAutoGenerateSubsection : LyricEditorAutoGenerateSubsection
{
private const string language_mode = "LANGUAGE_MODE";
private const string time_tag_mode = "TIME_TAG_MODE";

public RomajiTagAutoGenerateSubsection()
public RomanisationAutoGenerateSubsection()
: base(AutoGenerateType.AutoGenerateTimeTagRomaji)
{
}
Expand Down Expand Up @@ -51,9 +51,9 @@ protected override DescriptionFormat CreateInvalidDescriptionFormat()
};

protected override ConfigButton CreateConfigButton()
=> new RomajiTagAutoGenerateConfigButton();
=> new RomanisationAutoGenerateConfigButton();

protected partial class RomajiTagAutoGenerateConfigButton : MultiConfigButton
protected partial class RomanisationAutoGenerateConfigButton : MultiConfigButton
{
protected override IEnumerable<KaraokeRulesetEditGeneratorSetting> AvailableSettings => new[]
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// 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.Screens.Edit.Beatmaps.Lyrics.Settings.Romaji;
namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.Romanisation;

public enum RomajiEditPropertyMode
public enum RomanisationEditPropertyMode
{
Text,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.States.Modes;

namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.Romaji;
namespace osu.Game.Rulesets.Karaoke.Screens.Edit.Beatmaps.Lyrics.Settings.Romanisation;

public partial class RomajiEditPropertyModeSection : EditorSection
public partial class RomanisationEditPropertyModeSection : EditorSection
{
protected override LocalisableString Title => "Edit property";

[BackgroundDependencyLoader]
private void load(IEditRomajiModeState editRomajiModeState)
private void load(IEditRomanisationModeState editRomanisationModeState)
{
Children = new Drawable[]
{
new LabelledEnumDropdown<RomajiEditPropertyMode>
new LabelledEnumDropdown<RomanisationEditPropertyMode>
{
Label = "Edit property",
Description = "Batch edit text or other romaji-related properties from time-tag",
Current = editRomajiModeState.BindableRomajiEditPropertyMode,
Description = "Batch edit text or other romanisation-related properties from time-tag",
Current = editRomanisationModeState.BindableRomanisationEditPropertyMode,
},
};
}
Expand Down
Loading