mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 22:22:54 +08:00
Use LocalisableString
s where possible to leverage localisable text flow
This commit is contained in:
parent
ad98ab0a26
commit
11de924704
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
@ -19,7 +20,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// </summary>
|
||||
protected virtual bool PlaySoundsOnUserChange => true;
|
||||
|
||||
public string LabelText
|
||||
public LocalisableString LabelText
|
||||
{
|
||||
set
|
||||
{
|
||||
|
@ -8,6 +8,7 @@ using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
@ -156,18 +157,18 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
||||
descriptionText.Colour = osuColour.Yellow;
|
||||
}
|
||||
|
||||
public string Label
|
||||
public LocalisableString Label
|
||||
{
|
||||
set => labelText.Text = value;
|
||||
}
|
||||
|
||||
public string Description
|
||||
public LocalisableString Description
|
||||
{
|
||||
set
|
||||
{
|
||||
descriptionText.Text = value;
|
||||
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
if (value == default)
|
||||
descriptionText.Show();
|
||||
else
|
||||
descriptionText.Hide();
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
@ -12,7 +13,7 @@ namespace osu.Game.Online.Placeholders
|
||||
{
|
||||
public Action Action;
|
||||
|
||||
public ClickablePlaceholder(string actionMessage, IconUsage icon)
|
||||
public ClickablePlaceholder(LocalisableString actionMessage, IconUsage icon)
|
||||
{
|
||||
OsuTextFlowContainer textFlow;
|
||||
|
||||
|
@ -3,14 +3,15 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Localisation;
|
||||
|
||||
namespace osu.Game.Online.Placeholders
|
||||
{
|
||||
public class MessagePlaceholder : Placeholder
|
||||
{
|
||||
private readonly string message;
|
||||
private readonly LocalisableString message;
|
||||
|
||||
public MessagePlaceholder(string message)
|
||||
public MessagePlaceholder(LocalisableString message)
|
||||
{
|
||||
AddIcon(FontAwesome.Solid.ExclamationCircle, cp =>
|
||||
{
|
||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Effects;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics.Backgrounds;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osuTK;
|
||||
@ -42,9 +43,9 @@ namespace osu.Game.Overlays.Dialog
|
||||
set => icon.Icon = value;
|
||||
}
|
||||
|
||||
private string headerText;
|
||||
private LocalisableString headerText;
|
||||
|
||||
public string HeaderText
|
||||
public LocalisableString HeaderText
|
||||
{
|
||||
get => headerText;
|
||||
set
|
||||
@ -57,9 +58,9 @@ namespace osu.Game.Overlays.Dialog
|
||||
}
|
||||
}
|
||||
|
||||
private string bodyText;
|
||||
private LocalisableString bodyText;
|
||||
|
||||
public string BodyText
|
||||
public LocalisableString BodyText
|
||||
{
|
||||
get => bodyText;
|
||||
set
|
||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
@ -22,7 +23,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
{
|
||||
private const float loading_spinner_size = 22;
|
||||
|
||||
public string Text
|
||||
public LocalisableString Text
|
||||
{
|
||||
set => Schedule(() => textDrawable.Text = value);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osuTK;
|
||||
@ -15,9 +16,9 @@ namespace osu.Game.Overlays.Notifications
|
||||
{
|
||||
public class SimpleNotification : Notification
|
||||
{
|
||||
private string text = string.Empty;
|
||||
private LocalisableString text;
|
||||
|
||||
public string Text
|
||||
public LocalisableString Text
|
||||
{
|
||||
get => text;
|
||||
set
|
||||
|
@ -6,6 +6,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics.UserInterfaceV2;
|
||||
using osu.Game.Overlays.Settings;
|
||||
|
||||
@ -16,7 +17,7 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
{
|
||||
private readonly SettingsSlider<T> slider;
|
||||
|
||||
public SliderWithTextBoxInput(string labelText)
|
||||
public SliderWithTextBoxInput(LocalisableString labelText)
|
||||
{
|
||||
LabelledTextBox textbox;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user