From 7e8fd49ce884e1a3257f9a1ccedd1f39f263f011 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Sun, 10 Mar 2024 22:59:09 +0800 Subject: [PATCH] Romaji -> Romanisation in the LyricFontInfo. --- .../KaraokeSkinElementConverterTest.cs | 4 +-- .../Resources/special-skin/default.json | 2 +- .../Resources/Skin/Default/default.json | 2 +- .../Lyrics/PreviewKaraokeSpriteText.cs | 2 +- .../Edit/Beatmaps/Lyrics/LyricEditorSkin.cs | 4 +-- .../Screens/Skin/Config/IntervalSection.cs | 4 +-- .../Screens/Skin/Config/RubyRomajiSection.cs | 8 ++--- .../Skinning/Elements/LyricFontInfo.cs | 32 +++++++++---------- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/KaraokeSkinElementConverterTest.cs b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/KaraokeSkinElementConverterTest.cs index df769615f..446f086f7 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/KaraokeSkinElementConverterTest.cs +++ b/osu.Game.Rulesets.Karaoke.Tests/IO/Serialization/Converters/KaraokeSkinElementConverterTest.cs @@ -28,7 +28,7 @@ public void TestLyricConfigSerializer() var lyricConfig = LyricFontInfo.CreateDefault(); const string expected = - "{\"$type\":0,\"name\":\"Default\",\"smart_horizon\":2,\"lyrics_interval\":4,\"ruby_interval\":2,\"romaji_interval\":2,\"ruby_alignment\":2,\"romaji_alignment\":2,\"ruby_margin\":4,\"romaji_margin\":4,\"main_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\",\"size\":48.0},\"ruby_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\"},\"romaji_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\"}}"; + "{\"$type\":0,\"name\":\"Default\",\"smart_horizon\":2,\"lyrics_interval\":4,\"ruby_interval\":2,\"romanisation_interval\":2,\"ruby_alignment\":2,\"romanisation_alignment\":2,\"ruby_margin\":4,\"romanisation_margin\":4,\"main_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\",\"size\":48.0},\"ruby_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\"},\"romanisation_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\"}}"; string actual = JsonConvert.SerializeObject(lyricConfig, CreateSettings()); Assert.AreEqual(expected, actual); } @@ -37,7 +37,7 @@ public void TestLyricConfigSerializer() public void TestLyricConfigDeserialize() { const string json = - "{\"$type\":0,\"name\":\"Default\",\"smart_horizon\":2,\"lyrics_interval\":4,\"ruby_interval\":2,\"romaji_interval\":2,\"ruby_alignment\":2,\"romaji_alignment\":2,\"ruby_margin\":4,\"romaji_margin\":4,\"main_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\",\"size\":48.0},\"ruby_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\"},\"romaji_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\"}}"; + "{\"$type\":0,\"name\":\"Default\",\"smart_horizon\":2,\"lyrics_interval\":4,\"ruby_interval\":2,\"romanisation_interval\":2,\"ruby_alignment\":2,\"romanisation_alignment\":2,\"ruby_margin\":4,\"romanisation_margin\":4,\"main_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\",\"size\":48.0},\"ruby_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\"},\"romanisation_text_font\":{\"family\":\"Torus\",\"weight\":\"Bold\"}}"; var expected = LyricFontInfo.CreateDefault(); var actual = (LyricFontInfo)JsonConvert.DeserializeObject(json, CreateSettings())!; diff --git a/osu.Game.Rulesets.Karaoke.Tests/Resources/special-skin/default.json b/osu.Game.Rulesets.Karaoke.Tests/Resources/special-skin/default.json index c044b36b1..1d5e56a87 100644 --- a/osu.Game.Rulesets.Karaoke.Tests/Resources/special-skin/default.json +++ b/osu.Game.Rulesets.Karaoke.Tests/Resources/special-skin/default.json @@ -15,7 +15,7 @@ "family": "Torus", "weight": "Bold" }, - "romaji_text_font": { + "romanisation_text_font": { "family": "Torus", "weight": "Bold" } diff --git a/osu.Game.Rulesets.Karaoke/Resources/Skin/Default/default.json b/osu.Game.Rulesets.Karaoke/Resources/Skin/Default/default.json index c044b36b1..1d5e56a87 100644 --- a/osu.Game.Rulesets.Karaoke/Resources/Skin/Default/default.json +++ b/osu.Game.Rulesets.Karaoke/Resources/Skin/Default/default.json @@ -15,7 +15,7 @@ "family": "Torus", "weight": "Bold" }, - "romaji_text_font": { + "romanisation_text_font": { "family": "Torus", "weight": "Bold" } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Components/Lyrics/PreviewKaraokeSpriteText.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Components/Lyrics/PreviewKaraokeSpriteText.cs index c1864d6c4..17d038955 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Components/Lyrics/PreviewKaraokeSpriteText.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/Components/Lyrics/PreviewKaraokeSpriteText.cs @@ -225,7 +225,7 @@ private void load(ISkinSource skin, ShaderManager? shaderManager) // Apply text font info var lyricFont = newConfig.MainTextFont; var rubyFont = newConfig.RubyTextFont; - var romajiFont = newConfig.RomajiTextFont; + var romajiFont = newConfig.RomanisationTextFont; Font = getFont(lyricFont.Size); RubyFont = getFont(rubyFont.Size); diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditorSkin.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditorSkin.cs index fe3419ec0..2bc3b1074 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditorSkin.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/Beatmaps/Lyrics/LyricEditorSkin.cs @@ -85,8 +85,8 @@ public float FontSize = multipleSize(LyricFontInfo.MainTextFont, changePercentage); LyricFontInfo.RubyTextFont = multipleSize(LyricFontInfo.RubyTextFont, changePercentage); - LyricFontInfo.RomajiTextFont - = multipleSize(LyricFontInfo.RomajiTextFont, changePercentage); + LyricFontInfo.RomanisationTextFont + = multipleSize(LyricFontInfo.RomanisationTextFont, changePercentage); // todo: change size might not working now. // DefaultElement[ElementType.LyricConfig].TriggerChange(); diff --git a/osu.Game.Rulesets.Karaoke/Screens/Skin/Config/IntervalSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Skin/Config/IntervalSection.cs index ac6b7dc20..fe45ea69c 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Skin/Config/IntervalSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Skin/Config/IntervalSection.cs @@ -67,7 +67,7 @@ private void load(LyricFontInfoManager lyricFontInfoManager) var lyricFontInfo = e.NewValue; applyCurrent(lyricIntervalSliderBar.Current, lyricFontInfo.LyricsInterval); applyCurrent(rubyIntervalSliderBar.Current, lyricFontInfo.RubyInterval); - applyCurrent(romajiIntervalSliderBar.Current, lyricFontInfo.RomajiInterval); + applyCurrent(romajiIntervalSliderBar.Current, lyricFontInfo.RomanisationInterval); static void applyCurrent(Bindable bindable, T value) => bindable.Value = bindable.Default = value; @@ -75,6 +75,6 @@ static void applyCurrent(Bindable bindable, T value) lyricIntervalSliderBar.Current.BindValueChanged(x => lyricFontInfoManager.ApplyCurrentLyricFontInfoChange(l => l.LyricsInterval = x.NewValue)); rubyIntervalSliderBar.Current.BindValueChanged(x => lyricFontInfoManager.ApplyCurrentLyricFontInfoChange(l => l.RubyInterval = x.NewValue)); - romajiIntervalSliderBar.Current.BindValueChanged(x => lyricFontInfoManager.ApplyCurrentLyricFontInfoChange(l => l.RomajiInterval = x.NewValue)); + romajiIntervalSliderBar.Current.BindValueChanged(x => lyricFontInfoManager.ApplyCurrentLyricFontInfoChange(l => l.RomanisationInterval = x.NewValue)); } } diff --git a/osu.Game.Rulesets.Karaoke/Screens/Skin/Config/RubyRomajiSection.cs b/osu.Game.Rulesets.Karaoke/Screens/Skin/Config/RubyRomajiSection.cs index f2c240642..39682fff5 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Skin/Config/RubyRomajiSection.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Skin/Config/RubyRomajiSection.cs @@ -68,17 +68,17 @@ private void load(LyricFontInfoManager lyricFontInfoManager) { var lyricFontInfo = e.NewValue; applyCurrent(rubyAlignmentDropdown.Current, lyricFontInfo.RubyAlignment); - applyCurrent(romajiAlignmentDropdown.Current, lyricFontInfo.RomajiAlignment); + applyCurrent(romajiAlignmentDropdown.Current, lyricFontInfo.RomanisationAlignment); applyCurrent(rubyMarginSliderBar.Current, lyricFontInfo.RubyMargin); - applyCurrent(romajiMarginSliderBar.Current, lyricFontInfo.RomajiMargin); + applyCurrent(romajiMarginSliderBar.Current, lyricFontInfo.RomanisationMargin); static void applyCurrent(Bindable bindable, T value) => bindable.Value = bindable.Default = value; }, true); rubyAlignmentDropdown.Current.BindValueChanged(x => lyricFontInfoManager.ApplyCurrentLyricFontInfoChange(l => l.RubyAlignment = x.NewValue)); - romajiAlignmentDropdown.Current.BindValueChanged(x => lyricFontInfoManager.ApplyCurrentLyricFontInfoChange(l => l.RomajiAlignment = x.NewValue)); + romajiAlignmentDropdown.Current.BindValueChanged(x => lyricFontInfoManager.ApplyCurrentLyricFontInfoChange(l => l.RomanisationAlignment = x.NewValue)); rubyMarginSliderBar.Current.BindValueChanged(x => lyricFontInfoManager.ApplyCurrentLyricFontInfoChange(l => l.RubyMargin = x.NewValue)); - romajiMarginSliderBar.Current.BindValueChanged(x => lyricFontInfoManager.ApplyCurrentLyricFontInfoChange(l => l.RomajiMargin = x.NewValue)); + romajiMarginSliderBar.Current.BindValueChanged(x => lyricFontInfoManager.ApplyCurrentLyricFontInfoChange(l => l.RomanisationMargin = x.NewValue)); } } diff --git a/osu.Game.Rulesets.Karaoke/Skinning/Elements/LyricFontInfo.cs b/osu.Game.Rulesets.Karaoke/Skinning/Elements/LyricFontInfo.cs index 9ae4676ef..d1ca46863 100644 --- a/osu.Game.Rulesets.Karaoke/Skinning/Elements/LyricFontInfo.cs +++ b/osu.Game.Rulesets.Karaoke/Skinning/Elements/LyricFontInfo.cs @@ -19,14 +19,14 @@ public class LyricFontInfo : IKaraokeSkinElement SmartHorizon = KaraokeTextSmartHorizon.Multi, LyricsInterval = 4, RubyInterval = 2, - RomajiInterval = 2, + RomanisationInterval = 2, RubyAlignment = LyricTextAlignment.EqualSpace, - RomajiAlignment = LyricTextAlignment.EqualSpace, + RomanisationAlignment = LyricTextAlignment.EqualSpace, RubyMargin = 4, - RomajiMargin = 4, + RomanisationMargin = 4, MainTextFont = new FontUsage("Torus", 48, "Bold"), RubyTextFont = new FontUsage("Torus", 20, "Bold"), - RomajiTextFont = new FontUsage("Torus", 20, "Bold"), + RomanisationTextFont = new FontUsage("Torus", 20, "Bold"), }; public int ID { get; set; } @@ -49,9 +49,9 @@ public class LyricFontInfo : IKaraokeSkinElement public int RubyInterval { get; set; } /// - /// Interval between lyric romaji + /// Interval between lyric romanisation /// - public int RomajiInterval { get; set; } + public int RomanisationInterval { get; set; } /// /// Ruby position alignment @@ -61,7 +61,7 @@ public class LyricFontInfo : IKaraokeSkinElement /// /// Ruby position alignment /// - public LyricTextAlignment RomajiAlignment { get; set; } = LyricTextAlignment.Auto; + public LyricTextAlignment RomanisationAlignment { get; set; } = LyricTextAlignment.Auto; /// /// Interval between lyric text and ruby @@ -69,9 +69,9 @@ public class LyricFontInfo : IKaraokeSkinElement public int RubyMargin { get; set; } /// - /// (Additional) Interval between lyric text and romaji + /// (Additional) Interval between lyric text and romanisation. /// - public int RomajiMargin { get; set; } + public int RomanisationMargin { get; set; } /// /// Main text font @@ -84,9 +84,9 @@ public class LyricFontInfo : IKaraokeSkinElement public FontUsage RubyTextFont { get; set; } = new("Torus", 20, "Bold"); /// - /// Romaji text font + /// Romanisation text font /// - public FontUsage RomajiTextFont { get; set; } = new("Torus", 20, "Bold"); + public FontUsage RomanisationTextFont { get; set; } = new("Torus", 20, "Bold"); public void ApplyTo(Drawable d) { @@ -98,7 +98,7 @@ public void ApplyTo(Drawable d) // Apply text font info l.Font = getFont(KaraokeRulesetSetting.MainFont, MainTextFont); l.RubyFont = getFont(KaraokeRulesetSetting.RubyFont, RubyTextFont); - l.RomajiFont = getFont(KaraokeRulesetSetting.RomanisationFont, RomajiTextFont); + l.RomajiFont = getFont(KaraokeRulesetSetting.RomanisationFont, RomanisationTextFont); // Layout to text l.KaraokeTextSmartHorizon = SmartHorizon; @@ -109,10 +109,10 @@ public void ApplyTo(Drawable d) l.RubyAlignment = RubyAlignment; l.RubyMargin = RubyMargin; - // Romaji - l.RomajiSpacing = new Vector2(RomajiInterval, l.RomajiSpacing.Y); - l.RomajiAlignment = RomajiAlignment; - l.RomajiMargin = RomajiMargin; + // Romanisation + l.RomajiSpacing = new Vector2(RomanisationInterval, l.RomajiSpacing.Y); + l.RomajiAlignment = RomanisationAlignment; + l.RomajiMargin = RomanisationMargin; }); // Apply translate font.