mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:07:38 +08:00
Change WarningText
to accept LocalisableString
Can't work just yet, but best to have the flow in place to maintain 100% localisation on classes which were already localised.
This commit is contained in:
parent
488dd3ea52
commit
af9f910a12
@ -61,12 +61,17 @@ namespace osu.Game.Overlays.Settings
|
||||
/// Text to be displayed at the bottom of this <see cref="SettingsItem{T}"/>.
|
||||
/// Generally used to recommend the user change their setting as the current one is considered sub-optimal.
|
||||
/// </summary>
|
||||
public string WarningText
|
||||
public LocalisableString? WarningText
|
||||
{
|
||||
set
|
||||
{
|
||||
bool hasValue = string.IsNullOrWhiteSpace(value.ToString());
|
||||
|
||||
if (warningText == null)
|
||||
{
|
||||
if (!hasValue)
|
||||
return;
|
||||
|
||||
// construct lazily for cases where the label is not needed (may be provided by the Control).
|
||||
FlowContent.Add(warningText = new OsuTextFlowContainer
|
||||
{
|
||||
@ -77,8 +82,8 @@ namespace osu.Game.Overlays.Settings
|
||||
});
|
||||
}
|
||||
|
||||
warningText.Alpha = string.IsNullOrWhiteSpace(value) ? 0 : 1;
|
||||
warningText.Text = value;
|
||||
warningText.Alpha = hasValue ? 0 : 1;
|
||||
warningText.Text = value.ToString(); // TODO: Add localisation support after https://github.com/ppy/osu-framework/pull/4603 is merged.
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user