mirror of
https://github.com/ppy/osu
synced 2025-01-05 05:39:49 +00:00
Update ScreenEntry
colour usage to update correctly on language change
This commit is contained in:
parent
d218e7d935
commit
e4e8390a8a
@ -5,7 +5,6 @@ using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Utils;
|
||||
@ -135,7 +134,16 @@ namespace osu.Game.Overlays.AccountCreation
|
||||
characterCheckText = passwordDescription.AddText("8 characters long");
|
||||
passwordDescription.AddText(". Choose something long but also something you will remember, like a line from your favourite song.");
|
||||
|
||||
passwordTextBox.Current.ValueChanged += password => { characterCheckText.Drawables.ForEach(s => s.Colour = password.NewValue.Length == 0 ? Color4.White : Interpolation.ValueAt(password.NewValue.Length, Color4.OrangeRed, Color4.YellowGreen, 0, 8, Easing.In)); };
|
||||
passwordTextBox.Current.BindValueChanged(_ => updateCharacterCheckTextColour(), true);
|
||||
characterCheckText.DrawablePartsRecreated += _ => updateCharacterCheckTextColour();
|
||||
}
|
||||
|
||||
private void updateCharacterCheckTextColour()
|
||||
{
|
||||
string password = passwordTextBox.Text;
|
||||
|
||||
foreach (var d in characterCheckText.Drawables)
|
||||
d.Colour = password.Length == 0 ? Color4.White : Interpolation.ValueAt(password.Length, Color4.OrangeRed, Color4.YellowGreen, 0, 8, Easing.In);
|
||||
}
|
||||
|
||||
public override void OnEntering(IScreen last)
|
||||
|
Loading…
Reference in New Issue
Block a user