Skip to content

Commit

Permalink
Romaji -> Romanisation in the LyricFontInfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Mar 10, 2024
1 parent 389b385 commit c5a6ea1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ 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<T>(Bindable<T> bindable, T value)
=> bindable.Value = bindable.Default = value;
}, true);

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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(Bindable<T> 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));
}
}
32 changes: 16 additions & 16 deletions osu.Game.Rulesets.Karaoke/Skinning/Elements/LyricFontInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -49,9 +49,9 @@ public class LyricFontInfo : IKaraokeSkinElement
public int RubyInterval { get; set; }

/// <summary>
/// Interval between lyric romaji
/// Interval between lyric romanisation
/// </summary>
public int RomajiInterval { get; set; }
public int RomanisationInterval { get; set; }

/// <summary>
/// Ruby position alignment
Expand All @@ -61,17 +61,17 @@ public class LyricFontInfo : IKaraokeSkinElement
/// <summary>
/// Ruby position alignment
/// </summary>
public LyricTextAlignment RomajiAlignment { get; set; } = LyricTextAlignment.Auto;
public LyricTextAlignment RomanisationAlignment { get; set; } = LyricTextAlignment.Auto;

/// <summary>
/// Interval between lyric text and ruby
/// </summary>
public int RubyMargin { get; set; }

/// <summary>
/// (Additional) Interval between lyric text and romaji
/// (Additional) Interval between lyric text and romanisation.
/// </summary>
public int RomajiMargin { get; set; }
public int RomanisationMargin { get; set; }

/// <summary>
/// Main text font
Expand All @@ -84,9 +84,9 @@ public class LyricFontInfo : IKaraokeSkinElement
public FontUsage RubyTextFont { get; set; } = new("Torus", 20, "Bold");

/// <summary>
/// Romaji text font
/// Romanisation text font
/// </summary>
public FontUsage RomajiTextFont { get; set; } = new("Torus", 20, "Bold");
public FontUsage RomanisationTextFont { get; set; } = new("Torus", 20, "Bold");

public void ApplyTo(Drawable d)
{
Expand All @@ -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;
Expand All @@ -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.
Expand Down

0 comments on commit c5a6ea1

Please sign in to comment.