mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 02:02:53 +08:00
Remove FadeTime customisation
Also adjusts fade transitions to feel better, especially in fast forward scenarios.
This commit is contained in:
parent
f9c969788a
commit
158737e001
@ -44,7 +44,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
Key key = (Key)((int)Key.A + RNG.Next(26));
|
||||
kc.Add(new KeyCounterKeyboard(key));
|
||||
});
|
||||
AddSliderStep("Fade time", 0, 200, 50, v => kc.FadeTime = v);
|
||||
|
||||
Key testKey = ((KeyCounterKeyboard)kc.Children.First()).Key;
|
||||
double time1 = 0;
|
||||
|
@ -231,7 +231,6 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected virtual KeyCounterDisplay CreateKeyCounter() => new KeyCounterDisplay
|
||||
{
|
||||
FadeTime = 50,
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
Margin = new MarginPadding(10),
|
||||
|
@ -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
|
||||
public Color4 KeyDownTextColor { get; set; } = Color4.DarkGray;
|
||||
public Color4 KeyUpTextColor { get; set; } = Color4.White;
|
||||
public int FadeTime { get; set; }
|
||||
public double FadeTime { get; set; }
|
||||
|
||||
protected KeyCounter(string name)
|
||||
{
|
||||
@ -130,17 +130,17 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private void updateGlowSprite(bool show)
|
||||
{
|
||||
double remainingFadeTime = FadeTime * (1 - glowSprite.Alpha);
|
||||
|
||||
if (show)
|
||||
{
|
||||
glowSprite.FadeIn(remainingFadeTime);
|
||||
textLayer.FadeColour(KeyDownTextColor, remainingFadeTime);
|
||||
double remainingFadeTime = FadeTime * (1 - glowSprite.Alpha);
|
||||
glowSprite.FadeIn(remainingFadeTime, Easing.OutQuint);
|
||||
textLayer.FadeColour(KeyDownTextColor, remainingFadeTime, Easing.OutQuint);
|
||||
}
|
||||
else
|
||||
{
|
||||
glowSprite.FadeOut(remainingFadeTime);
|
||||
textLayer.FadeColour(KeyUpTextColor, remainingFadeTime);
|
||||
double remainingFadeTime = 8 * FadeTime * glowSprite.Alpha;
|
||||
glowSprite.FadeOut(remainingFadeTime, Easing.OutQuint);
|
||||
textLayer.FadeColour(KeyUpTextColor, remainingFadeTime, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ namespace osu.Game.Screens.Play
|
||||
public class KeyCounterDisplay : FillFlowContainer<KeyCounter>
|
||||
{
|
||||
private const int duration = 100;
|
||||
private const double key_fade_time = 80;
|
||||
|
||||
public readonly Bindable<bool> Visible = new Bindable<bool>(true);
|
||||
private readonly Bindable<bool> configVisibility = new Bindable<bool>();
|
||||
@ -33,17 +34,11 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
base.Add(key);
|
||||
key.IsCounting = IsCounting;
|
||||
key.FadeTime = FadeTime;
|
||||
key.FadeTime = key_fade_time;
|
||||
key.KeyDownTextColor = KeyDownTextColor;
|
||||
key.KeyUpTextColor = KeyUpTextColor;
|
||||
}
|
||||
|
||||
public void ResetCount()
|
||||
{
|
||||
foreach (var counter in Children)
|
||||
counter.ResetCount();
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
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;
|
||||
|
||||
public Color4 KeyDownTextColor
|
||||
|
Loading…
Reference in New Issue
Block a user