1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 19:22:56 +08:00

Add localisation and improve visuals of placeholder text

This commit is contained in:
Dean Herbert 2022-05-03 14:28:58 +09:00
parent 4fb66a812f
commit 4a56297c1c

View File

@ -11,8 +11,8 @@ using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Mods; using osu.Game.Overlays.Mods;
using osu.Game.Resources.Localisation.Web;
using osuTK; using osuTK;
using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
@ -132,14 +132,29 @@ namespace osu.Game.Graphics.UserInterface
{ {
BackgroundFocused = colourProvider.Background4; BackgroundFocused = colourProvider.Background4;
BackgroundUnfocused = colourProvider.Background4; BackgroundUnfocused = colourProvider.Background4;
Placeholder.Colour = Color4.White;
PlaceholderText = @"Search"; Placeholder.Font = OsuFont.GetFont(size: CalculatedTextSize, weight: FontWeight.SemiBold);
PlaceholderText = CommonStrings.InputSearch;
} }
protected override SpriteText CreatePlaceholder() => new OsuSpriteText protected override SpriteText CreatePlaceholder() => new SearchPlaceholder();
internal class SearchPlaceholder : SpriteText
{ {
Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold) public override void Show()
}; {
this
.MoveToY(0, 250, Easing.OutQuint)
.FadeIn(250, Easing.OutQuint);
}
public override void Hide()
{
this
.MoveToY(3, 250, Easing.OutQuint)
.FadeOut(250, Easing.OutQuint);
}
}
protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer protected override Drawable GetDrawableCharacter(char c) => new FallingDownContainer
{ {