Remove FadeTime customisation

Also adjusts fade transitions to feel better, especially in fast forward scenarios.
This commit is contained in:
Dean Herbert 2019-09-12 14:27:29 +09:00
parent f9c969788a
commit 158737e001
4 changed files with 9 additions and 32 deletions

View File

@ -44,7 +44,6 @@ namespace osu.Game.Tests.Visual.Gameplay
Key key = (Key)((int)Key.A + RNG.Next(26)); Key key = (Key)((int)Key.A + RNG.Next(26));
kc.Add(new KeyCounterKeyboard(key)); kc.Add(new KeyCounterKeyboard(key));
}); });
AddSliderStep("Fade time", 0, 200, 50, v => kc.FadeTime = v);
Key testKey = ((KeyCounterKeyboard)kc.Children.First()).Key; Key testKey = ((KeyCounterKeyboard)kc.Children.First()).Key;
double time1 = 0; double time1 = 0;

View File

@ -231,7 +231,6 @@ namespace osu.Game.Screens.Play
protected virtual KeyCounterDisplay CreateKeyCounter() => new KeyCounterDisplay protected virtual KeyCounterDisplay CreateKeyCounter() => new KeyCounterDisplay
{ {
FadeTime = 50,
Anchor = Anchor.BottomRight, Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight, Origin = Anchor.BottomRight,
Margin = new MarginPadding(10), Margin = new MarginPadding(10),

View File

@ -65,7 +65,7 @@ namespace osu.Game.Screens.Play
//further: change default values here and in KeyCounterCollection if needed, instead of passing them in every constructor //further: change default values here and in KeyCounterCollection if needed, instead of passing them in every constructor
public Color4 KeyDownTextColor { get; set; } = Color4.DarkGray; public Color4 KeyDownTextColor { get; set; } = Color4.DarkGray;
public Color4 KeyUpTextColor { get; set; } = Color4.White; public Color4 KeyUpTextColor { get; set; } = Color4.White;
public int FadeTime { get; set; } public double FadeTime { get; set; }
protected KeyCounter(string name) protected KeyCounter(string name)
{ {
@ -130,17 +130,17 @@ namespace osu.Game.Screens.Play
private void updateGlowSprite(bool show) private void updateGlowSprite(bool show)
{ {
double remainingFadeTime = FadeTime * (1 - glowSprite.Alpha);
if (show) if (show)
{ {
glowSprite.FadeIn(remainingFadeTime); double remainingFadeTime = FadeTime * (1 - glowSprite.Alpha);
textLayer.FadeColour(KeyDownTextColor, remainingFadeTime); glowSprite.FadeIn(remainingFadeTime, Easing.OutQuint);
textLayer.FadeColour(KeyDownTextColor, remainingFadeTime, Easing.OutQuint);
} }
else else
{ {
glowSprite.FadeOut(remainingFadeTime); double remainingFadeTime = 8 * FadeTime * glowSprite.Alpha;
textLayer.FadeColour(KeyUpTextColor, remainingFadeTime); glowSprite.FadeOut(remainingFadeTime, Easing.OutQuint);
textLayer.FadeColour(KeyUpTextColor, remainingFadeTime, Easing.OutQuint);
} }
} }

View File

@ -17,6 +17,7 @@ namespace osu.Game.Screens.Play
public class KeyCounterDisplay : FillFlowContainer<KeyCounter> public class KeyCounterDisplay : FillFlowContainer<KeyCounter>
{ {
private const int duration = 100; private const int duration = 100;
private const double key_fade_time = 80;
public readonly Bindable<bool> Visible = new Bindable<bool>(true); public readonly Bindable<bool> Visible = new Bindable<bool>(true);
private readonly Bindable<bool> configVisibility = new Bindable<bool>(); private readonly Bindable<bool> configVisibility = new Bindable<bool>();
@ -33,17 +34,11 @@ namespace osu.Game.Screens.Play
base.Add(key); base.Add(key);
key.IsCounting = IsCounting; key.IsCounting = IsCounting;
key.FadeTime = FadeTime; key.FadeTime = key_fade_time;
key.KeyDownTextColor = KeyDownTextColor; key.KeyDownTextColor = KeyDownTextColor;
key.KeyUpTextColor = KeyUpTextColor; key.KeyUpTextColor = KeyUpTextColor;
} }
public void ResetCount()
{
foreach (var counter in Children)
counter.ResetCount();
}
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) private void load(OsuConfigManager config)
{ {
@ -68,22 +63,6 @@ namespace osu.Game.Screens.Play
} }
} }
private int fadeTime;
public int FadeTime
{
get => fadeTime;
set
{
if (value != fadeTime)
{
fadeTime = value;
foreach (var child in Children)
child.FadeTime = value;
}
}
}
private Color4 keyDownTextColor = Color4.DarkGray; private Color4 keyDownTextColor = Color4.DarkGray;
public Color4 KeyDownTextColor public Color4 KeyDownTextColor