Rename FontColour to TextColour

This commit is contained in:
Daniel Cios 2024-09-20 16:50:17 +02:00
parent ec575e9de4
commit 73b6744a97
5 changed files with 11 additions and 11 deletions

View File

@ -70,14 +70,14 @@ public static class SkinnableComponentStrings
public static LocalisableString ColourDescription => new TranslatableString(getKey(@"colour_description"), @"The colour of the component.");
/// <summary>
/// "Font colour"
/// "Text colour"
/// </summary>
public static LocalisableString FontColour => new TranslatableString(getKey(@"font_colour"), @"Font colour");
public static LocalisableString TextColour => new TranslatableString(getKey(@"text_colour"), @"Text colour");
/// <summary>
/// "The colour of the font."
/// "The colour of the text."
/// </summary>
public static LocalisableString FontColourDescription => new TranslatableString(getKey(@"font_colour_description"), @"The colour of the font.");
public static LocalisableString TextColourDescription => new TranslatableString(getKey(@"text_colour_description"), @"The colour of the text.");
private static string getKey(string key) => $@"{prefix}:{key}";
}

View File

@ -124,7 +124,7 @@ private void updateLabel()
protected override void SetFont(FontUsage font) => text.Font = font.With(size: 40);
protected override void SetFontColour(Colour4 fontColour) => text.Colour = fontColour;
protected override void SetTextColour(Colour4 textColour) => text.Colour = textColour;
}
// WARNING: DO NOT ADD ANY VALUES TO THIS ENUM ANYWHERE ELSE THAN AT THE END.

View File

@ -54,6 +54,6 @@ private void load()
protected override void SetFont(FontUsage font) => text.Font = font.With(size: 40);
protected override void SetFontColour(Colour4 fontColour) => text.Colour = fontColour;
protected override void SetTextColour(Colour4 textColour) => text.Colour = textColour;
}
}

View File

@ -37,6 +37,6 @@ public TextElement()
protected override void SetFont(FontUsage font) => text.Font = font.With(size: 40);
protected override void SetFontColour(Colour4 fontColour) => text.Colour = fontColour;
protected override void SetTextColour(Colour4 textColour) => text.Colour = textColour;
}
}

View File

@ -21,15 +21,15 @@ public abstract partial class FontAdjustableSkinComponent : Container, ISerialis
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.Font), nameof(SkinnableComponentStrings.FontDescription))]
public Bindable<Typeface> Font { get; } = new Bindable<Typeface>(Typeface.Torus);
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.FontColour), nameof(SkinnableComponentStrings.FontColourDescription))]
public BindableColour4 FontColour { get; } = new BindableColour4(Colour4.White);
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.TextColour), nameof(SkinnableComponentStrings.TextColourDescription))]
public BindableColour4 TextColour { get; } = new BindableColour4(Colour4.White);
/// <summary>
/// Implement to apply the user font selection to one or more components.
/// </summary>
protected abstract void SetFont(FontUsage font);
protected abstract void SetFontColour(Colour4 fontColour);
protected abstract void SetTextColour(Colour4 textColour);
protected override void LoadComplete()
{
@ -44,7 +44,7 @@ protected override void LoadComplete()
SetFont(f);
}, true);
FontColour.BindValueChanged(e => SetFontColour(e.NewValue), true);
TextColour.BindValueChanged(e => SetTextColour(e.NewValue), true);
}
}
}